GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> CTDB / V5-5-5 > vsbc_bc_pmc1553 / mv2304
#include <CTDB/CO1553_util.h>
#include <CO1553_util_private.h>
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. |
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.
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. |
References CO1553_CW_M_RT_ADDR, CO1553_CW_M_SUB_ADDR, CO1553_CW_M_TR_BIT, CO1553_CW_M_WORD_CNT, CO1553_CW_S_RT_ADDR, CO1553_CW_S_SUB_ADDR, and CO1553_CW_S_WORD_CNT.
Referenced by VSBC_bcConfigure().
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.
cmdWord | The 1553 command word. |
References CO1553_CW_M_RT_ADDR, and CO1553_CW_S_RT_ADDR.
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.
cmdWord | The 1553 command word. |
References CO1553_CW_M_SUB_ADDR, and CO1553_CW_S_SUB_ADDR.
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.
cmdWord | The 1553 command word. |
0 | The command is a receive command. | |
1 | The command is a transmit command. |
References CO1553_CW_M_TR_BIT.
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.
cmdWord | The 1553 command word. |
References CO1553_CW_M_SUB_ADDR, CO1553_CW_M_WORD_CNT, CO1553_CW_S_SUB_ADDR, and CO1553_CW_S_WORD_CNT.
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.
cmdWord | The 1553 command word. | |
rtAddr | The new RT address value to assign. |
References CO1553_CW_M_RT_ADDR, and CO1553_CW_S_RT_ADDR.
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.
cmdWord | The 1553 command word. | |
subAddr | The new sub-address value to assign. |
References CO1553_CW_M_SUB_ADDR, and CO1553_CW_S_SUB_ADDR.
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.
cmdWord | The 1553 command word. | |
txFlag | The TX flag value: 0 = receive, 1 = transmit. |
References CO1553_CW_M_TR_BIT.
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.
cmdWord | The 1553 command word. | |
wordCount | The new word count or mode code value to assign. |
References CO1553_CW_M_SUB_ADDR, CO1553_CW_M_WORD_CNT, CO1553_CW_S_SUB_ADDR, and CO1553_CW_S_WORD_CNT.