GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> CTDB / V5-5-5 > ctdb_unit_test / mv2304
#include <CTDB/CTDB_msg.h>
#include <PBS/TOC.h>
#include <PBS/FPA.h>
#include <PBS/LI.h>
#include <MSG/MSG_pubdefs.h>
Classes | |
struct | _CO1553_BC_Pkt_Desc |
struct | _CO1553_BC_Telem |
struct | _CO1553_BC_Cmd_Rx |
struct | _CO1553_BC_Cmd_Tx |
Typedefs | |
typedef void | CO1553_BC_Pkt_Free (void *pkt, void *arg) |
typedef void | CO1553_BC_Mem_Copy (void *dest, void *src, unsigned int numWords) |
typedef struct _CO1553_BC_Pkt_Desc | CO1553_BC_Pkt_Desc |
typedef struct _CO1553_BC_Telem | CO1553_BC_Telem |
typedef struct _CO1553_BC_Cmd_Rx | CO1553_BC_Cmd_Rx |
typedef struct _CO1553_BC_Cmd_Tx | CO1553_BC_Cmd_Tx |
Functions | |
Telemetry Interface Functions | |
unsigned int | CO1553_bcTelemSizeof (void) |
Get the size of a telemetry interface descriptor. | |
unsigned int | CO1553_bcTelemInit (CO1553_BC_Telem *telem, unsigned int msgCount, unsigned int queueSize, unsigned int pktSize) |
Initialize a telemetry interface descriptor. | |
unsigned | CO1553_bcTelemExit (CO1553_BC_Telem *telem) |
Destroy a telemetry interface descriptor. | |
unsigned int | CO1553_bcTelemMsg (CO1553_BC_Telem *telem, unsigned short **devPtr, CO1553_BC_Mem_Copy *copyFunc) |
Process a 1553 message receive for the telemetry interface. | |
unsigned int | CO1553_bcTelemPktRecv (CO1553_BC_Telem *telem, void **pkt, const TOC *timeout) |
Receive a CCSDS telemetry packet from the 1553 telemetry interface. | |
unsigned int | CO1553_bcTelemPktFree (CO1553_BC_Telem *telem, void *pkt) |
Free a CCSDS telemetry packet buffer. | |
Command Receive Interface Functions | |
unsigned int | CO1553_bcCmdRxSizeof (void) |
unsigned int | CO1553_bcCmdRxInit (CO1553_BC_Cmd_Rx *cmd, unsigned int queueSize, unsigned int pktSize) |
Initialize an command receive interface descriptor. | |
unsigned int | CO1553_bcCmdRxExit (CO1553_BC_Cmd_Rx *cmd) |
Destroy an command receive interface descriptor. | |
unsigned int | CO1553_bcCmdRxMsg (CO1553_BC_Cmd_Rx *cmd, unsigned short *devPtr, CO1553_BC_Mem_Copy *copyFunc) |
Process a 1553 message transmit for the command receive interface. | |
unsigned int | CO1553_bcCmdRxPktSend (CO1553_BC_Cmd_Rx *cmd, void *pkt, CO1553_BC_Pkt_Free *freeHandler, void *freeArg, const TOC *timeout) |
Send a CCSDS command packet to the 1553 command receive interface. | |
Command Transmit Interface Functions | |
unsigned int | CO1553_bcCmdTxSizeof (void) |
unsigned int | CO1553_bcCmdTxInit (CO1553_BC_Cmd_Tx *cmd, unsigned int queueSize, unsigned int pktSize) |
Initialize an command transmit interface descriptor. | |
unsigned int | CO1553_bcCmdTxExit (CO1553_BC_Cmd_Tx *cmd) |
Destroy an command transmit interface descriptor. | |
unsigned int | CO1553_bcCmdTxMsg (CO1553_BC_Cmd_Tx *cmd, unsigned short *devPtr, CO1553_BC_Mem_Copy *copyFunc) |
Process a 1553 message transmit for the command transmit interface. | |
unsigned int | CO1553_bcCmdTxPktRecv (CO1553_BC_Cmd_Tx *cmd, void **pkt, const TOC *timeout) |
Receive a CCSDS command packet from the 1553 command transmit interface. | |
unsigned int | CO1553_bcCmdTxPktFree (CO1553_BC_Cmd_Tx *cmd, void *pkt) |
Free a CCSDS command transmit packet buffer. |
This library contains functions for processing CCSDS packets as messages on the 1553 bus. Each subaddress can have one outstanding packet for either transmission or reception. For each subaddress, a packet queue, packet buffer, and packet state machine are maintained. The packet queues hold pending outgoing command packets for receive subaddresses and pending incomming telmetry packets for transmit subaddresses. The packet buffer holds the current packet for a subaddress while its fragments are being sent or received. The packet state machines implement the policy for fragmenting telemtry packets and re-assebling command packets. The packets are fragmented as a series of 1553 data messages.
The recognized subaddress types are shown below,
Subaddress | Direction | Description |
Command Receive (CmdRx) | Receive (BC->RT) | Telecommand input |
Command Transmit(CmdTx) | Transmit (RT->BC) | Telecommand output |
Telemetry (Telem) | Transmit (RT->BC) | Low rate telemetry
|
The functions in this library are meant to be called by a 1553 device controller driver. Each subaddress state machine needs to be notified when the frame sync message occurs and when a data transfer message for that subaddress occurs. The controller driver provides pointers to device memory that the packet state machines use to copy 1553 messages in and out of the packet buffers.
A command receive interface descriptor. The command interface functions will take a pointer to an instance of this structure as a parameter.
A command transmit interface descriptor. The command interface functions will take a pointer to an instance of this structure as a parameter.
A device independent message copy function. For efficiency, the packet state machines try to move packet fragments directly in and out of the 1553 device shared memory message buffers. This function is provided by the controller driver to access the device shared memory.
void CO1553_BC_Mem_Copy(void *dest, void *src, unsigned int numWords)
dest | The destination address of the copy. | |
src | The source address of the copy. | |
numWords | The number of 16-bit words to copy. |
The typedef for _CO1553_BC_Pkt_Desc.
The definition of a packet buffer memory free callback function. These callbacks are employeed when users are sending packets on a transmit queue. The packet memory is borrowed while the packet is on the queue. When the packet contents have been transmitted, the free handler is called with a user supplied argument.
void CO1553_BC_Pkt_Free(void *pkt, void *arg)
pkt | A pointer to the packet buffer to release. | |
arg | The user defined argument. |
A telemtry interface descriptor. The telemtery interface functions will take a pointer to an instance of this structure as a parameter.
unsigned int CO1553_bcCmdRxSizeof | ( | void | ) |
Get the size of a command receive interface descriptor.
Referenced by co1553_bc_test_cmd_rx(), co1553_bc_test_param(), and co1553_bc_test_sizeof().
unsigned int CO1553_bcCmdTxSizeof | ( | void | ) |
Get the size of a command transmit interface descriptor.
Referenced by co1553_bc_test_cmd_tx(), co1553_bc_test_param(), and co1553_bc_test_sizeof().