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_util.c File Reference

Function definitions for 1553 common utility library. More...

#include "CTDB/CO1553_util.h"
#include "CO1553_util_private.h"

Include dependency graph for CO1553_util.c:

Include dependency graph

Functions

unsigned short CO1553_utilCmdCreate (unsigned short rtAddr, unsigned short subAddr, unsigned short wordCount, int txFlag)
 Creates a 1553 command word.

unsigned short CO1553_utilCmdGetRTAddr (unsigned short cmdWord)
 Gets the RT address value from a 1553 command word.

unsigned short CO1553_utilCmdGetSubAddr (unsigned short cmdWord)
 Gets the subaddress value from a 1553 command word.

unsigned short CO1553_utilCmdGetWordCount (unsigned short cmdWord)
 Gets the word count value from a 1553 command word.

int CO1553_utilCmdGetTxFlag (unsigned short cmdWord)
 Gets the Tx flag value from a 1553 command word.

void CO1553_utilCmdSetRTAddr (unsigned short *cmdWord, unsigned short rtAddr)
 Sets the RT address value in a 1553 command word.

void CO1553_utilCmdSetSubAddr (unsigned short *cmdWord, unsigned short subAddr)
 Sets the sub-address value in a 1553 command word.

void CO1553_utilCmdSetWordCount (unsigned short *cmdWord, unsigned short wordCount)
 Sets the word count value in a 1553 command word.

void CO1553_utilCmdSetTxFlag (unsigned short *cmdWord, int txFlag)
 Sets the TX flag value in a 1553 command word.


Detailed Description

Function definitions for 1553 common utility library.

Author:
D.L. Wood

Function Documentation

unsigned short CO1553_utilCmdCreate unsigned short  rtAddr,
unsigned short  subAddr,
unsigned short  wordCount,
int  txFlag
 

Creates a 1553 command word.

Constructs a 1553 bus command word out of components. This function can be used to create both data transfer and mode code commands. The subAddr value should be '0' to indicate a mode code command. If the command is a regular data transfer command, then the wordCount value indicates the number of 16-bit data words in the message. If the command is a mode code command, then the wordCount value is the mode code.

Parameters:
rtAddr The remote terminal address value.
subAddr The subaddress value.
wordCount The word count or mode code value.
txFlag The transmit flag: 0 = RT receive, 1 = RT transmit.
Returns:
The new 1553 command word.

unsigned short CO1553_utilCmdGetRTAddr unsigned short  cmdWord  ) 
 

Gets the RT address value from a 1553 command word.

Extracts the remote terminal address value from a 1553 bus command word.

Parameters:
cmdWord The 1553 command word.
Returns:
The RT address value.

unsigned short CO1553_utilCmdGetSubAddr unsigned short  cmdWord  ) 
 

Gets the subaddress value from a 1553 command word.

Extracts the subaddress value from a 1553 bus command word.

Parameters:
cmdWord The 1553 command word.
Returns:
The subaddress address value.

int CO1553_utilCmdGetTxFlag unsigned short  cmdWord  ) 
 

Gets the Tx flag value from a 1553 command word.

Determines if cmdWord represents a transmit or receive command. Remember that the direction is with respect to the remote terminal: transmit = RT->BC, receive = BC->RT.

Parameters:
cmdWord The 1553 command word.
Return values:
0 The command is a receive command.
1 The command is a transmit command.

unsigned short CO1553_utilCmdGetWordCount unsigned short  cmdWord  ) 
 

Gets the word count value from a 1553 command word.

Extracts either the word count value or the mode code value from a 1553 bus command word. If the embedded subaddress value is '0', then cmdWord is a mode code command and the returned value is the mode code. Otherwise, the returned value is the data word count.

Parameters:
cmdWord The 1553 command word.
Returns:
The word count or mode code value.

void CO1553_utilCmdSetRTAddr unsigned short *  cmdWord,
unsigned short  rtAddr
 

Sets the RT address value in a 1553 command word.

Inserts the remote terminal address value into a 1553 bus command word.

Parameters:
cmdWord The 1553 command word.
rtAddr The new RT address value to assign.

void CO1553_utilCmdSetSubAddr unsigned short *  cmdWord,
unsigned short  subAddr
 

Sets the sub-address value in a 1553 command word.

Inserts the subaddress value into a 1553 bus command word.

Parameters:
cmdWord The 1553 command word.
subAddr The new sub-address value to assign.

void CO1553_utilCmdSetTxFlag unsigned short *  cmdWord,
int  txFlag
 

Sets the TX flag value in a 1553 command word.

Determines if cmdWord represents a transmit or receive command. Remember that the direction is with respect to the remote terminal: transmit = RT->BC, receive = BC->RT.

Parameters:
cmdWord The 1553 command word.
txFlag The TX flag value: 0 = receive, 1 = transmit.

void CO1553_utilCmdSetWordCount unsigned short *  cmdWord,
unsigned short  wordCount
 

Sets the word count value in a 1553 command word.

Inserts either the word count value or the mode code value into a 1553 bus command word. If the embedded subaddress value is '0', then cmdWord is a mode code command and the inserted value is the mode code. Otherwise, the inserted value is the data word count.

Parameters:
cmdWord The 1553 command word.
wordCount The new word count or mode code value to assign.


Generated on Thu May 5 21:54:39 2005 by doxygen 1.3.3