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


Interface   Data Structures   File List   Data Fields   Globals  

CO1553_util.h File Reference

Common 1553 utility library. More...


Defines

1553 Status Word Definitions


#define CO1553_SW_TERMINAL_FLAG   0x0001
#define CO1553_SW_DYNAMIC_BUS_ACCEPTANCE   0x0002
#define CO1553_SW_SUBSYSTEM_FLAG   0x0004
#define CO1553_SW_BUSY   0x0008
#define CO1553_SW_BROADCAST_COMMAND_RECEIVED   0x0010
#define CO1553_SW_SERVICE_REQUEST   0x0100
#define CO1553_SW_INSTRUMENTATION   0x0200
#define CO1553_SW_MESSAGE_ERROR   0x0400
Mode Code Definitions


#define CO1553_MC_DYNAMIC_BUS_CONTROL   0
#define CO1553_MC_SYNCHRONIZE_WITHOUT   1
#define CO1553_MC_TRANSMIT_STATUS_WORD   2
#define CO1553_MC_INITIATE_SELF_TEST   3
#define CO1553_MC_TRANSMITTER_SHUTDOWN   4
#define CO1553_MC_OVERRIDE_SHUTDOWN   5
#define CO1553_MC_INHIBIT_TERMINAL_FLAG_BIT   6
#define CO1553_MC_OVERRIDE_INHIBIT   7
#define CO1553_MC_RESET_REMOTE_TERMINAL   8
#define CO1553_MC_TRANSMIT_VECTOR_WORD   16
#define CO1553_MC_SYNCHRONIZE_WITH   17
#define CO1553_MC_TRANSMIT_LAST_COMMAND   18
#define CO1553_MC_TRANSMIT_BIT_WORD   19
#define CO1553_MC_SELECTED_TRANSMITTER_SHUTDOWN   20
#define CO1553_MC_OVERRIDE_SELECTED_SHUTDOWN   21
1553 Size Definitions


#define CO1553_MSG_SIZE   64
#define CO1553_MSG_WORDS   (CO1553_MSG_SIZE / sizeof(unsigned short))

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

Common 1553 utility library.

Author:
D.L. Wood
The functions in this library perform utility operations common to all 1553 platforms independent of the hardware implementation.

Define Documentation

#define CO1553_MC_DYNAMIC_BUS_CONTROL   0

Dynamic bus control mode code.

#define CO1553_MC_INHIBIT_TERMINAL_FLAG_BIT   6

Inhibit terminal flag mode code.

#define CO1553_MC_INITIATE_SELF_TEST   3

Initiate self test mode code.

#define CO1553_MC_OVERRIDE_INHIBIT   7

Inhibit terminal flag override mode code.

#define CO1553_MC_OVERRIDE_SELECTED_SHUTDOWN   21

Selected transmitter shutdown override mode code.

#define CO1553_MC_OVERRIDE_SHUTDOWN   5

Transmitter shutdown override mode code.

#define CO1553_MC_RESET_REMOTE_TERMINAL   8

Reset RT mode code.

#define CO1553_MC_SELECTED_TRANSMITTER_SHUTDOWN   20

Selected transmitter shutdown mode code.

#define CO1553_MC_SYNCHRONIZE_WITH   17

Synchronize with data word mode code.

#define CO1553_MC_SYNCHRONIZE_WITHOUT   1

Synchronize without data word mode code.

#define CO1553_MC_TRANSMIT_BIT_WORD   19

Transmit self test status word.

#define CO1553_MC_TRANSMIT_LAST_COMMAND   18

Transmit last command word mode code.

#define CO1553_MC_TRANSMIT_STATUS_WORD   2

Transmit last status word mode code.

#define CO1553_MC_TRANSMIT_VECTOR_WORD   16

Transmit vector word mode code.

#define CO1553_MC_TRANSMITTER_SHUTDOWN   4

Transmitter shutdown mode code.

#define CO1553_MSG_SIZE   64

#define CO1553_MSG_WORDS   (CO1553_MSG_SIZE / sizeof(unsigned short))

The number of 16-bit words in a full 1553 data message.

Referenced by CO1553_bcCmdRxMsg(), CO1553_bcCmdTxMsg(), CO1553_bcTelemMsg(), VSBC_bcConfigure(), and VSBC_bcHandleSyncCmd().

#define CO1553_SW_BROADCAST_COMMAND_RECEIVED   0x0010

Indicates the RT received a valid broadcast message.

#define CO1553_SW_BUSY   0x0008

The RT is busy and must stop processing bus commands.

#define CO1553_SW_DYNAMIC_BUS_ACCEPTANCE   0x0002

Indicates the RT is ready to become BC.

#define CO1553_SW_INSTRUMENTATION   0x0200

Should be set to 0.

#define CO1553_SW_MESSAGE_ERROR   0x0400

The RT detected an error in a bus message.

#define CO1553_SW_SERVICE_REQUEST   0x0100

Indicates the RT is ready for message transactions.

#define CO1553_SW_SUBSYSTEM_FLAG   0x0004

Generic status flag for the RT.

#define CO1553_SW_TERMINAL_FLAG   0x0001

Indicates an RT failure.


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.

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.

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

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.

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

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.

Parameters:
cmdWord The 1553 command word.
Return values:
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.

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

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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.


Generated on Tue Sep 27 14:35:36 2011 by  doxygen 1.5.8