ARPDAS_QNX6 1.0
|
#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"
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 |
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().
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().
void incoming_sbreq | ( | int | rcvid, |
subbusd_req_t * | req | ||
) |
The basic sanity of the incoming message has been checked by subbus_io_msg before it gets here, so we can at least assume that the message was big enough to include the specified message type, and that the message type is defined.
Definition at line 137 of file sc104.c.
References subbusd_req_data0::address, subbusd_rep_t::capabilities, subbusd_req_hdr_t::command, subbusd_req_t::d0, subbusd_req_t::d1, subbusd_req_data0::data, subbusd_rep_t::data, subbusd_req_data1::data, subbusd_req_t::data, disarm_sic(), ErrorReply(), subbusd_cap_t::features, subbusd_rep_t::hdr, int_attach(), int_detach(), LIBRARY_SUB, subbusd_cap_t::name, nl_error, read_ack(), read_failure(), read_switches(), subbusd_rep_hdr_t::ret_type, sb_cache_read(), sb_cache_write(), SBC_DISARM, SBC_GETCAPS, SBC_INTATT, SBC_INTDET, SBC_QUIT, SBC_READACK, SBC_READCACHE, SBC_READFAIL, SBC_READSW, SBC_SETCMDENBL, SBC_SETCMDSTRB, SBC_SETFAIL, SBC_TICK, SBC_WRITEACK, SBC_WRITECACHE, subbusd_req_t::sbhdr, SBRT_CAP, SBRT_NONE, SBRT_US, SBS_ACK, SBS_NOACK, SBS_OK, set_cmdenbl(), set_cmdstrobe(), set_failure(), subbusd_rep_hdr_t::status, SUBBUS_FEATURES, SUBBUS_NAME_MAX, subbusd_cap_t::subfunc, tick_sic(), subbusd_rep_t::value, and write_ack().
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().
int read_ack | ( | unsigned short | addr, |
unsigned short * | data | ||
) |
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.
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.
Definition at line 104 of file sc104.c.
References read_special(), SBC_READFAIL, and SC_LAMP.
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.
Definition at line 85 of file sc104.c.
References read_special(), SBC_READSW, and SC_SWITCHES.
unsigned short sbrb | ( | unsigned short | addr | ) |
Definition at line 32 of file sc104.c.
References read_ack(), and read_subbus().
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().
int set_cmdstrobe | ( | int | value | ) |
Function to set cmdstrobe value.
val | non-zero value asserts cmdstrobe. |
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().
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.
value | Binary-encoded light settings. |
Definition at line 93 of file sc104.c.
References SBC_SETFAIL, SC_LAMP, and send_CSF().
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().
int write_ack | ( | unsigned short | addr, |
unsigned short | data | ||
) |
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.
unsigned short subbus_features = SUBBUS_FEATURES |
unsigned short subbus_subfunction = LIBRARY_SUB |
unsigned short subbus_version = SUBBUS_VERSION |