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

Constituent: co1553_rt     Tag: sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

CO1553_rt_telem.c File Reference

Function definitions for 1553 CCSDS telemetry packet buffers, queues, and state machines. More...

#include "stdlib.h"
#include "string.h"
#include "CTDB/CO1553_rt.h"
#include "CTDB/CO1553_util.h"
#include "CCSDS/CCSDS_pkt.h"
#include "PBS/LI.h"
#include "PBS/FPA.h"
#include "PBS/L.h"
#include "PBS/RW.h"
#include "PBS/MBA.h"
#include "MSG/MSG_pubdefs.h"

Include dependency graph for CO1553_rt_telem.c:

Include dependency graph

Telemtry Interface Functions

unsigned int CO1553_rtTelemSizeof (void)
 Get the size of a telemetry interface descriptor.

unsigned int CO1553_rtTelemInit (CO1553_RT_Telem *telem, unsigned int msgCount, unsigned int queueSizeHigh, unsigned int queueSizeLow, unsigned int telemPktSize, unsigned int hkpPktSize, CO1553_RT_Hkp_Handler *hkpHandler, void *hkpArg)
 Initialize a telemetry interface descriptor.

unsigned int CO1553_rtTelemExit (CO1553_RT_Telem *telem)
 Destroy a telemetry interface descriptor.

unsigned int CO1553_rtTelemMsg (CO1553_RT_Telem *telem, unsigned int *devPtr, CO1553_RT_Mem_Copy *copyFunc, unsigned int wordSize, CO1553_RT_Diag *diag, RW_ctl *lock)
 Process a 1553 message transmit for the telemetry interface.

unsigned int CO1553_rtTelemPktSend (CO1553_RT_Telem *telem, void *pkt, CO1553_RT_Pkt_Free *freeHandler, void *freeArg, CO1553_RT_Priority priority, const TOC *timeout)
 Send a CCSDS telmetry packet to the 1553 telemtry interface.

unsigned int CO1553_rtTelemHkpSet (CO1553_RT_Telem *telem, CO1553_RT_Hkp_Handler *hkpHandler, void *hkpArg)
 Change the HKP application callback.

unsigned int CO1553_rtTelemHkpGet (CO1553_RT_Telem *telem, CO1553_RT_Hkp_Handler **hkpHandler, void **hkpArg)
 Get current HKP application callback information.


Defines

#define MEM_ALLOC(_size)   MBA_alloc((_size))
#define MEM_FREE(_mem)   MBA_free((_mem))

Functions

unsigned int CO1553_rtTelemHkpProc (CO1553_RT_Telem *telem, void *pktPtr, int *hkpSize, CO1553_RT_Diag *diag, RW_ctl *lock)

Detailed Description

Function definitions for 1553 CCSDS telemetry packet buffers, queues, and state machines.

Author:
D.L. Wood

The functions are for use by a remote terminal 1553 controller device driver.


Define Documentation

#define MEM_ALLOC _size   )     MBA_alloc((_size))
 

Helper macro to call user defined memory allocator.

Parameters:
_size The size in bytes of memory to allocate.
Returns:
A pointer to the memory, or NULL on error.

#define MEM_FREE _mem   )     MBA_free((_mem))
 

Helper macro to call user defined memory allocator.

Parameters:
_mem A pointer to the memory to free.


Function Documentation

unsigned int CO1553_rtTelemExit CO1553_RT_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_rtTelemHkpGet CO1553_RT_Telem telem,
CO1553_RT_Hkp_Handler **  hkpHandler,
void **  hkpArg
 

Get current HKP application callback information.

Retrieves the HKP application callback function and arguments current values.

Parameters:
telem A telemetry interface descriptor.
hkpHandler Stores the pointer to the application HKP function.
hkpArg Stores user argument for hkpHandler.
Returns:
A CTDB MSG code.

unsigned int CO1553_rtTelemHkpProc CO1553_RT_Telem telem,
void *  pktPtr,
int *  hkpSize,
CO1553_RT_Diag diag,
RW_ctl *  lock
[static]
 

Attempts to insert a real-time houskeeping packet at the head of the telemetry packet block. Calls the user handler to insert packet. Verifies packet header contents once complete.

Parameters:
telem A telemetry interface descriptor.
pktPtr A buffer where the HKP packet should be placed.
hkpSize If successful, holds number of bytes out of the telemetry packet block occupied by the inserted HKP packet.
diag A pointer to a RT diagnostics structure for update.
lock A RW lock to protect the diag structure updates.
Returns:
A CTDB MSG code.

unsigned int CO1553_rtTelemHkpSet CO1553_RT_Telem telem,
CO1553_RT_Hkp_Handler hkpHandler,
void *  hkpArg
 

Change the HKP application callback.

Changes the HKP application callback function and arguments to new values. The old values, set either in CO1553_rtTelemInit() or in the last call to this function, are replaced.

Parameters:
telem A telemetry interface descriptor.
hkpHandler The synchronous callback to handle insertion of HKP telemety packets into the telemetry blocks.
hkpArg A user argument for hkpHandler.
Returns:
A CTDB MSG code.

unsigned int CO1553_rtTelemInit CO1553_RT_Telem telem,
unsigned int  msgCount,
unsigned int  queueSizeHigh,
unsigned int  queueSizeLow,
unsigned int  telemPktSize,
unsigned int  hkpPktSize,
CO1553_RT_Hkp_Handler hkpHandler,
void *  hkpArg
 

Initialize a telemetry interface descriptor.

Initializes a 1553 CCSDS telemetry packet interface. The telemetry packet output queue is created.

Parameters:
telem A telemetry interface descriptor.
msgCount The number of 1553 telemetry messages expected each frame.
queueSizeHigh The maximum number of telemetry packets to allow on the CCSDS high priority output queue.
queueSizeLow The maximum number of telemetry packets to allow on the CCSDS low priority output queue.
telemPktSize The maximum size in bytes, including header, of a telemetry packet on this subaddress interface (not HKP packet).
hkpPktSize The maximum size in bytes, including header, of a HKP telemetry packet on this subaddress interface.
hkpHandler The synchronous callback to handle insertion of HKP telemety packets into the telemetry blocks.
hkpArg A user argument for hkpHandler.
Returns:
A CTDB MSG code.

unsigned int CO1553_rtTelemMsg CO1553_RT_Telem telem,
unsigned int *  devPtr,
CO1553_RT_Mem_Copy copyFunc,
unsigned int  wordSize,
CO1553_RT_Diag diag,
RW_ctl *  lock
 

Process a 1553 message transmit for the telemetry interface.

Announces to the 1553 telemetry packet interface the transmission of the last 1553 telemety message of a telemetry transfer block (GT_PDU). This function is called by a 1553 controller driver when the previous 1553 telemetry messages in a frame have been sent by the 1553 device.

The CCSDS telemetry packet output queue is checked for any pending data. The function tries to fill a complete telemetry block with packets from the queue for transmission on the next frame.

Parameters:
telem A telemetry interface descriptor.
devPtr An array of pointers to the 1553 device memory where the 1553 telemetry messages should be copied to.
copyFunc A device specific memory copy function for accessing 1553 device memory.
wordSize The size in terms of 16-bit words between successive device locations.
diag A pointer to a RT diagnostics structure for update.
lock A RW lock to protect the diag structure updates.
Returns:
A CTDB MSG code.

Here is the call graph for this function:

unsigned int CO1553_rtTelemPktSend CO1553_RT_Telem telem,
void *  pkt,
CO1553_RT_Pkt_Free freeHandler,
void *  freeArg,
CO1553_RT_Priority  priority,
const TOC *  timeout
 

Send a CCSDS telmetry packet to the 1553 telemtry interface.

Places a CCSDS telemetry packet on the remote terminal telemetry output queue. The telemetry packet state machine will remove packets from this queue and transmit them as fast as 1553 telemetry 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:
telem A telemetry 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.
priority The packet priority level, CO1553_RT_PRIORITY_HIGH or CO1553_RT_PRIORITY_LOW.
timeout The time to wait for space on the queue.
Returns:
A CTDB MSG code.

unsigned int CO1553_rtTelemSizeof void   ) 
 

Get the size of a telemetry interface descriptor.

Returns:
The size of the telemetry packet interface descriptor.


Generated on Thu May 5 22:02:39 2005 by doxygen 1.3.3