GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > PBC / V4-12-1
Constituent: pbc_bootshell     Tag: rad750
#include "CCSDS/CCSDS_pkt.h"
#include "CCSDS/CCSDS_msg.h"
#include "CTDB/CTDB_config.h"
#include "CTDB/SUMT_rt_poll.h"
#include "CTDB/CO1553_util.h"
#include "MSG/MSG_macdefs.h"
#include "PBC/PBC_string.h"
#include "PBC/PBC.h"
#include "PBC/PBC_msgs.h"
#include "PBC/PBC_tlmdefs.h"
#include "bootshell.h"
Include dependency graph for bootcomm.c.vx-ppc-siu:
Data Structures | |
struct | _PBC_comm_state |
State of the boot 1553 interface. More... | |
Functions | |
static unsigned int | init_driver (void) |
Initialize the 1553 driver. | |
static void | gather_telem (void) |
Generate telemetry for boot communications. | |
const char * | Pbc_CommType (void) |
Identify communication interface (SIU or EPU). | |
unsigned int | Pbc_CommInit (void) |
Initialize 1553 boot communications. | |
unsigned int | Pbc_CommPoll (const unsigned int buf_bytes, void *buf_p, unsigned int *cmd_bytes) |
Poll the 1553 interface for commands or telemetry. | |
void | Pbc_CommShutdown (void) |
Shutdown 1553 boot communications. | |
Variables | |
static struct _PBC_comm_state | pbc_comm |
Boot instantiation of communication state. | |
static SUMT_RT_Bus_Config | pbc_defaultSumtConfig |
1553 bus remote terminal configuration. |
CVS $Id: bootcomm.c.vx-ppc-siu,v 1.5 2005/05/17 20:38:49 dmay Exp $
This file contains the specifics of the boot communications 1553 interface. PBC runs a command/telemetry interface on the 1553 bus (SIU) or on the LCB (EPU). This file includes the 1553 interface driver.
There are two public interface functions that are provided to handle the communications interface, as well as a handful of utility functions to aid in generating telemetry packets.
The general model is this:
1) At PBC initialization, call Pbc_CommInit(). This initializes and starts the communication interface. It also fills out the boot communications handle, which is used for all subsequent boot communications.
2) During bootshell operation, make periodic calls to Pbc_CommPoll(). This routine polls the underlying interface for a new command and determines if it is time to send a new telemetry packet. No buffering of commands is expected to be done by the hardware interface or driver, so Pbc_CommPoll() must be called often enough to make sure no commands are lost.
Pbc_CommPoll() is responsible for gathering boot telemetry and providing it to the underlying interface. The telemetry sequence number is managed within Pbc_CommPoll().
1553 telemetry model:
The 1553 interface has pre-allocated slots to send telemetry to the spacecraft. The 1553 interface indicates to the boot communications layer when the previous telemetry packet has been transmitted. At that time, the boot communications layer generates a new boot HKP telemetry packet and passes it to the 1553 interface with SUMT_rtPollTelem(). The first telemetry packet is generated at initialization to "prime" the telemetry system.
Command timing:
A new command can come as quickly as once per 20ms on the 1553 interface. To keep up with commands coming from the 1553, the poll routine should be called at least once every 10ms.
|
Generate telemetry for boot communications. Updates the boot housekeeping telemetry and manages the sequence number.
|
|
Initialize the 1553 driver.
|
|
Initialize 1553 boot communications. Configures 1553 communications for use during primary boot. The 1553 driver is initialized and started in a subroutine, though, so it can be retried repeatedly in the polling loop if it fails here.
|
|
Poll the 1553 interface for commands or telemetry. See if there is a command ready on the 1553 interface or if it is time to transmit another telemetry packet. Command receipt is indicated by setting the return parameter cmd_bytes to a non-zero value.
|
|
Shutdown 1553 boot communications. Shuts down boot 1553 communications in preparation for secondary boot.
|
|
Identify communication interface (SIU or EPU). Returns a string that identifies the type of boot communication interface that is in use (SIU or EPU).
|
|
Boot instantiation of communication state. This variable provides the storage for the boot 1553 interface state. |
|
Initial value: { CTDB_CONFIG_RT_ADDR, CTDB_CONFIG_SUBADDR_CMD_RX, CTDB_CONFIG_SUBADDR_CMD_TX, 500, CTDB_CONFIG_SUBADDR_TELEM_FIRST, CTDB_CONFIG_SUBADDR_TELEM_NUM, 500, CTDB_CONFIG_SUBADDR_WRAP, { 0, 0, SUMT_RT_MODE_FLAG_VALID, 0, SUMT_RT_MODE_FLAG_VALID, SUMT_RT_MODE_FLAG_VALID, 0, 0, SUMT_RT_MODE_FLAG_VALID, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } Hard-coded 1553 bus remote terminal configuration. Taken from ctdb_link_test_poll.c in the CTDB package. |