ARPDAS_QNX6 1.0
Functions | Variables
sc104.c File Reference
#include <stdio.h>
#include <string.h>
#include <sys/neutrino.h>
#include <hw/inout.h>
#include <errno.h>
#include "subbusd_int.h"
#include "nortlib.h"
#include "sc104.h"
#include "nl_assert.h"
Include dependency graph for sc104.c:

Go to the source code of this file.

Functions

int read_ack (unsigned short addr, unsigned short *data)
unsigned short sbrb (unsigned short addr)
int write_ack (unsigned short addr, unsigned short data)
int set_cmdenbl (int val)
int set_cmdstrobe (int value)
unsigned short read_switches (void)
int set_failure (unsigned short value)
unsigned short read_failure (void)
int tick_sic (void)
int disarm_sic (void)
static void ErrorReply (int rcvid, int rv)
void incoming_sbreq (int rcvid, subbusd_req_t *req)
void init_subbus (dispatch_t *dpp)
void shutdown_subbus (void)

Variables

unsigned short subbus_version = SUBBUS_VERSION
unsigned short subbus_features = SUBBUS_FEATURES
unsigned short subbus_subfunction = LIBRARY_SUB

Function Documentation

int disarm_sic ( void  )

If system controller is associated with a watchdog timer that can reboot the system, this command disables that timer.

Definition at line 117 of file sc104.c.

References SBC_DISARM, SBRT_NONE, SC_DISARM, and send_to_subbusd().

Here is the call graph for this function:

static void ErrorReply ( int  rcvid,
int  rv 
) [static]

Definition at line 122 of file sc104.c.

References nl_assert, subbusd_rep_hdr_t::ret_type, SBRT_NONE, and subbusd_rep_hdr_t::status.

Referenced by incoming_sbreq().

Here is the caller graph for this function:

void incoming_sbreq ( int  rcvid,
subbusd_req_t req 
)
void init_subbus ( dispatch_t *  dpp)

Definition at line 238 of file sc104.c.

References expint_init(), nl_error, SC_SB_CONFIG, SC_SB_HIGHCTRL, SC_SB_LOWCTRL, SC_SB_RESET, and service_expint().

Here is the call graph for this function:

int read_ack ( unsigned short  addr,
unsigned short *  data 
)
Returns:
non-zero if hardware read acknowledge was observed.

Definition at line 19 of file sc104.c.

References subbusd_rep_t::data, subbusd_req_data1::data, nl_error, SBC_READACK, SBRT_US, SBS_ACK, SBS_NOACK, SC_SB_LOWA, SC_SB_LOWB, SC_SB_LOWC, send_to_subbusd(), subbusd_rep_t::value, and WAIT_COUNT.

Here is the call graph for this function:

unsigned short read_failure ( void  )

The value reported represents the current state of the indicator lights. As noted in read_switches(), the least significant bit is associated the the main "fail light" located in the cockpit. This light can be lit via set_failure() or the system controller's two minute timeout circuit. In either case, read_failure() will report the actual state of the light.

Returns:
The binary-encoded value of the indicator light settings.

Definition at line 104 of file sc104.c.

References read_special(), SBC_READFAIL, and SC_LAMP.

Here is the call graph for this function:

unsigned short read_switches ( void  )

Reads the positions of a dedicated set of system mode switches, usually located on a control panel on the instrument.

Returns:
The binary-encoded switch positions, or zero on error.

Definition at line 85 of file sc104.c.

References read_special(), SBC_READSW, and SC_SWITCHES.

Here is the call graph for this function:

unsigned short sbrb ( unsigned short  addr)

Definition at line 32 of file sc104.c.

References read_ack(), and read_subbus().

Here is the call graph for this function:

int set_cmdenbl ( int  val)

don't need to serialize access to cmdenbl, since it's I/O port mapped.

Definition at line 56 of file sc104.c.

References SBC_SETCMDENBL, SC_CMDENBL, and send_CSF().

Here is the call graph for this function:

int set_cmdstrobe ( int  value)

Function to set cmdstrobe value.

Parameters:
valnon-zero value asserts cmdstrobe.
Returns:
non-zero no success, zero if operation is not supported.

Function did not exist at all before version 3.10, so programs intending to use this function should verify that the resident library version is at least 3.10. The feature word can also be checked for support, and that is consistent back to previous versions.

Definition at line 72 of file sc104.c.

References SBC_SETCMDSTRB, SC_SB_LOWC, SC_SB_LOWCTRL, and send_CSF().

Here is the call graph for this function:

int set_failure ( unsigned short  value)

Sets the value of a dedicated set of indicator lights, usually located on a control panel on the instrument and/or in the cockpit of the aircraft. For each bit of the input argument, a non-zero value indicates the associated light should be on.

By convention, the least significant bit is associated with the main "fail light" located in the cockpit on aircraft instruments, indicating that the instrument is not acquiring data.. This light (and the associated bit value on readback) will also be set by the system controller's two minute timeout circuit.

See also:
read_failure()
Parameters:
valueBinary-encoded light settings.

Definition at line 93 of file sc104.c.

References SBC_SETFAIL, SC_LAMP, and send_CSF().

Here is the call graph for this function:

void shutdown_subbus ( void  )

Definition at line 260 of file sc104.c.

References nl_error.

int tick_sic ( void  )

Historically, tick_sic() has been associated with two timers. The first is a 2-second timeout that can reboot the system. The second is a 2-minute timeout that lights the main fail light indicating that the instrument is not acquiring data.

It is unclear whether the new syscon_usb will support the reboot timer or rely on a motherboard-specific watchdog timer.

Definition at line 112 of file sc104.c.

References SBC_TICK, SBRT_NONE, SC_TICK, and send_to_subbusd().

Here is the call graph for this function:

int write_ack ( unsigned short  addr,
unsigned short  data 
)
Returns:
non-zero value if the hardware acknowledge is observed. Historically, the value recorded the number of iterations in the software loop waiting for the microsecond timeout.

Definition at line 42 of file sc104.c.

References subbusd_req_data0::address, subbusd_req_data0::data, nl_error, SBC_WRITEACK, SBRT_NONE, SBS_ACK, SBS_NOACK, SC_SB_LOWA, SC_SB_LOWB, SC_SB_LOWC, send_to_subbusd(), and WAIT_COUNT.

Here is the call graph for this function:


Variable Documentation

unsigned short subbus_features = SUBBUS_FEATURES

Definition at line 15 of file sc104.c.

unsigned short subbus_subfunction = LIBRARY_SUB

Definition at line 16 of file sc104.c.

unsigned short subbus_version = SUBBUS_VERSION

Definition at line 14 of file sc104.c.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines