GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > CTDB / V5-5-3

Constituent: co1553_bc     Tag: rad750


Interface   Data Structures   File List   Data Fields   Globals  

CO1553_bc.h File Reference

1553 Bus Controller Driver CCSDS Packet Interface Library. More...

#include "CTDB/CTDB_msg.h"
#include "PBS/TOC.h"
#include "PBS/FPA.h"
#include "PBS/LI.h"
#include "MSG/MSG_pubdefs.h"

Include dependency graph for CO1553_bc.h:

This graph shows which files directly or indirectly include this file:


Data Structures

struct  _CO1553_BC_Pkt_Desc
struct  _CO1553_BC_Telem
struct  _CO1553_BC_Cmd_Rx
struct  _CO1553_BC_Cmd_Tx

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.

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 _CO1553_BC_Pkt_Desc CO1553_BC_Pkt_Desc
typedef _CO1553_BC_Telem CO1553_BC_Telem
typedef _CO1553_BC_Cmd_Rx CO1553_BC_Cmd_Rx
typedef _CO1553_BC_Cmd_Tx CO1553_BC_Cmd_Tx

Detailed Description

1553 Bus Controller Driver CCSDS Packet Interface Library.

Author:
D.L. Wood
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.


Typedef Documentation

CO1553_BC_Cmd_Rx
 

A command receive interface descriptor. The command interface functions will take a pointer to an instance of this structure as a parameter.

CO1553_BC_Cmd_Tx
 

A command transmit interface descriptor. The command interface functions will take a pointer to an instance of this structure as a parameter.

CO1553_BC_Mem_Copy
 

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)

Parameters:
dest The destination address of the copy.
src The source address of the copy.
numWords The number of 16-bit words to copy.

CO1553_BC_Pkt_Desc
 

The typedef for _CO1553_BC_Pkt_Desc.

CO1553_BC_Pkt_Free
 

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)

Parameters:
pkt A pointer to the packet buffer to release.
arg The user defined argument.

CO1553_BC_Telem
 

A telemtry interface descriptor. The telemtery interface functions will take a pointer to an instance of this structure as a parameter.


Function Documentation

unsigned int CO1553_bcCmdRxExit CO1553_BC_Cmd_Rx cmd  ) 
 

Destroy an command receive interface descriptor.

Release resources from a 1553 CCSDS command receive interface.

Parameters:
cmd An command receive interface descriptor.
Returns:
A CTDB MSG code.

unsigned int CO1553_bcCmdRxInit CO1553_BC_Cmd_Rx cmd,
unsigned int  queueSize,
unsigned int  pktSize
 

Initialize an command receive interface descriptor.

Initializes a 1553 CCSDS command receive packet interface for a bus controller. The command receive packet output queue is created.

Parameters:
cmd An command receive interface descriptor.
queueSize The maximum number of command packets to allow on the CCSDS output queue.
pktSize The maximum size in bytes, including header, of a telecommand packet on this subaddress interface.
Returns:
A CTDB MSG code.

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.

Announces the beginning of a new 1553 frame to the 1553 command receive packet interface. This function is called by a 1553 controller driver when the next bus frame has a telecommand receive transfer slot availble on the 1553 bus.

The packet output queue is seached for new packets ready for transmission. If a new command packet is available on the queue, a 1553 command message containing the packet is copied to the device.

Parameters:
cmd An command interface descriptor.
devPtr A pointer to the 1553 device memory where the first 1553 command message should be copied to.
copyFunc A device specific memory copy function for accessing 1553 device memory.
Returns:
A CTDB MSG code.

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.

Places a CCSDS command receive packet on the bus controller command output queue. The command receive subaddress interface will remove packets from this queue and send them as fast as 1553 command receive message bandwidth allows.

The packet buffer memory remains allocated as long as the packet is on the output queue. After the packet has been transmitted, a user supplied callback freeHandler will be called to release the packet memory.

Parameters:
cmd An command receive interface descriptor.
pkt A pointer to the CCSDS packet header of the packet to send.
freeHandler The packet buffer memory free callback.
freeArg The argument passed to the freeHandler callback.
timeout The number of system clock ticks to wait for a packet on the queue.
Returns:
A CTDB MSG code.

unsigned int CO1553_bcCmdRxSizeof void   ) 
 

Returns:
The size of the telecommand receive packet interface descriptor.

unsigned int CO1553_bcCmdTxExit CO1553_BC_Cmd_Tx cmd  ) 
 

Destroy an command transmit interface descriptor.

Release resources from a 1553 CCSDS telecommand transmit interface.

Parameters:
cmd An command transmit interface descriptor.
Returns:
A CTDB MSG code.

unsigned int CO1553_bcCmdTxInit CO1553_BC_Cmd_Tx cmd,
unsigned int  queueSize,
unsigned int  pktSize
 

Initialize an command transmit interface descriptor.

Initializes a 1553 CCSDS command transmit packet interface for a bus controller. The command transmit packet input queue is created.

Parameters:
cmd An command transmit interface descriptor.
queueSize The maximum number of command packets to allow on the CCSDS input queue.
pktSize The maximum size in bytes, including header, of a telecommand packet on this subaddress interface.
Returns:
A CTDB MSG code.

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.

Announces to the 1553 command transmit packet interface the reception of a 1553 command output message. This function is called by a 1553 controller driver when the next 1553 command message in a frame has been received by the 1553 device.

The next 1553 command message is copied from the device memory and is delivered to the command input queue as a CCSDS telecommand packet if the transfer request counter has updated.

Parameters:
cmd A command transmit interface descriptor.
devPtr A pointer to the 1553 device memory where the incomming 1553 message should be copied from.
copyFunc A device specific memory copy function for accessing 1553 device memory.
Returns:
A CTDB MSG code.

unsigned int CO1553_bcCmdTxPktFree CO1553_BC_Cmd_Tx cmd,
void *  pkt
 

Free a CCSDS command transmit packet buffer.

Returns a borrowed CCSDS command packet buffer to the bus controller command transmit interface.

Parameters:
cmd A command transmit interface descriptor.
pkt A pointer to the packet buffer to free.
Returns:
A CTDB MSG code.

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.

Attempts to get the next available command packet from the bus controller command packet input queue. The command packet transmit interface places new packets on this queue as 1553 command output messages arrive on the bus.

The packet buffer memory is loaned to the user. Call CO1553_bcCmdTxPktFree() to return the packet buffer to the remote terminal command interface.

Parameters:
cmd A command transmit interface descriptor.
pkt Upon success, a pointer to the packet buffer is returned here.
timeout The time to wait for a packet on the queue.
Returns:
A CTDB MSG code.

unsigned int CO1553_bcCmdTxSizeof void   ) 
 

Returns:
The size of the telecommand transmit packet interface descriptor.

unsigned CO1553_bcTelemExit CO1553_BC_Telem telem  ) 
 

Destroy a telemetry interface descriptor.

Release resources from a 1553 CCSDS telemetry interface.

Parameters:
telem A telemetry interface descriptor.
Returns:
A CTDB MSG code.

unsigned int CO1553_bcTelemInit CO1553_BC_Telem telem,
unsigned int  msgCount,
unsigned int  queueSize,
unsigned int  pktSize
 

Initialize a telemetry interface descriptor.

Initializes a 1553 CCSDS telemetry packet interface. The telemtry packet buffers and state machine are created. The telemetry packet input queue is created.

Parameters:
telem A telemetry interface descriptor.
msgCount The number of 1553 telemetry messages expected each frame.
queueSize The maximum number of telemetry packets to allow on the CCSDS input queue.
pktSize The maximum size in bytes, including header, of a telecommand packet on this subaddress interface.
Returns:
A CTDB MSG code.

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.

Announces to the 1553 telemetry packet interface the reception of the last 1553 telemety message. This function is called by a 1553 controller driver when the last 1553 telemetry message in a frame has been received by the 1553 device.

The telemetry transfer block (GT_PDU) is scanned for CCSDS telemetry packets. Each discovered packet is placed on the telemetry packet input queue.

Parameters:
telem A telemetry interface descriptor.
devPtr An array of pointers to the 1553 device memory where the 1553 telemetry messages should be copied from.
copyFunc A device specific memory copy function for accessing 1553 device memory.
Returns:
A CTDB MSG code.

unsigned int CO1553_bcTelemPktFree CO1553_BC_Telem telem,
void *  pkt
 

Free a CCSDS telemetry packet buffer.

Returns a borrowed CCSDS telemety packet buffer to the bus controller telemetry interface.

Parameters:
telem A telemetry interface descriptor.
pkt A pointer to the packet buffer to free.
Returns:
A CTDB MSG code.

unsigned int CO1553_bcTelemPktRecv CO1553_BC_Telem telem,
void **  pkt,
const TOC *  timeout
 

Receive a CCSDS telemetry packet from the 1553 telemetry interface.

Attempts to get the next available telemetry packet from the bus controller telemetry input queue. The telemetry packet state machine places new packets on this queue as 1553 messages arrive on the bus.

The packet buffer memory is loaned to the user. Call CO1553_bcTelemPktFree() to return the packet buffer to the bus controller telemetry interface.

Parameters:
telem A telemetry interface descriptor.
pkt Upon success, a pointer to the packet buffer is returned here.
timeout The number of system clock ticks to wait for a packet on the queue.
Returns:
A CTDB MSG code.

unsigned int CO1553_bcTelemSizeof void   ) 
 

Get the size of a telemetry interface descriptor.

Returns:
The size of the telemetry packet interface descriptor.


Generated on Mon Nov 14 22:10:12 2005 by  doxygen 1.4.4