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

Constituent: sumt_bc_sib     Tag: rad750


Interface   Data Structures   File List   Data Fields   Globals  

CO1553_bc_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_bc.h"
#include "CTDB/CO1553_util.h"
#include "CCSDS/CCSDS_pkt.h"
#include "PBS/LI.h"
#include "PBS/FPA.h"
#include "PBS/TOC.h"
#include "PBS/MBA.h"
#include "MSG/MSG_pubdefs.h"

Include dependency graph for CO1553_bc_telem.c:

Include dependency graph

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 int 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.


Defines

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

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 bus controller 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_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.

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 Thu May 5 21:54:38 2005 by doxygen 1.3.3