Software Library API naibrd 1.62
See all documentation at naii.docs.com
Bus Controller Specific Functions

Functions

NAIBRDFUNC nai_status_t NAIAPI naibrd_SUM1553_BC_SetCmdBlockPtr (int32_t cardIndex, int32_t module, int32_t channel, uint32_t blockIndex)
 Sets the Command Block Pointer Register (Core Register 8) to the location to start the command blocks associated with the "blockIndex" passed in. The Bus Controller command blocks are eight-word, contiguous blocks of memory that contains opcodes for controlling the core as well as 1553 command words and associated data locations in memory. After execution begins, this register is automatically updated with the address of the next block.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SUM1553_BC_GetCmdBlockPtr (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *outblockIndex)
 Retrieves the "blockIndex" value associated with the address read from the Command Block Pointer Register (Core Register 8). The Bus Controller command blocks are eight-word, contiguous blocks of memory that contains opcodes for controlling the core as well as 1553 command words and associated data locations in memory. After execution begins, this register is automatically updated with the address of the next block.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SUM1553_BC_LoadCmdBlock (int32_t cardIndex, int32_t module, int32_t channel, uint32_t blockIndex, uint16_t ctrl, uint16_t cmd1, uint16_t cmd2, uint16_t datablock, uint16_t branchblock, uint32_t timerus)
 Loads the BC Command Block. Each command block contains eight-words.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SUM1553_BC_ReadCmdBlock (int32_t cardIndex, int32_t module, int32_t channel, uint32_t blockIndex, uint16_t *outctrl, uint16_t *outcmd1, uint16_t *outcmd2, uint16_t *outdatablock, uint16_t *outstatus1, uint16_t *outstatus2, uint16_t *outbranchblock, uint32_t *outtimerus)
 Retrieves the BC Command Block. Each command block contains eight-words.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SUM1553_BC_ClearBAME (int32_t cardIndex, int32_t module, int32_t channel, uint32_t blockIndex)
 Clears the Command Block's Control Word Block Access Message Error (bit 0) bit. This bit is set when a protocol message error occurred in the RT response. The host or subsystem should reset this bit when writing the control word into memory.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SUM1553_BC_SetCmdBlockDataPtr (int32_t cardIndex, int32_t module, int32_t channel, uint32_t blockIndex, uint16_t datablock)
 Sets the Command Block's Data Pointer (Word 4). The Data Pointer specifies the first location in memory where data associated with the command word(s) is to be stored or fetched from.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SUM1553_BC_ReadCmdBlockDataPtr (int32_t cardIndex, int32_t module, int32_t channel, uint32_t blockIndex, uint16_t *outdatablock)
 Retrieves the Command Block's Data Pointer (Word 4). The Data Pointer specifies the first location in memory where data associated with the command word(s) is to be stored or fetched from.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SUM1553_BC_LoadDataBlock (int32_t cardIndex, int32_t module, int32_t channel, uint32_t blockIndex, const uint16_t datablock[32])
 Loads the BC Data Block. Each data block contains 32-words.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SUM1553_BC_ReadDataBlock (int32_t cardIndex, int32_t module, int32_t channel, uint32_t blockIndex, uint16_t outdatablock[32])
 Retrieves the BC Data Block. Each data block contains 32-words.
 

Detailed Description


Function Documentation

◆ naibrd_SUM1553_BC_ClearBAME()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SUM1553_BC_ClearBAME ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t blockIndex )

Clears the Command Block's Control Word Block Access Message Error (bit 0) bit. This bit is set when a protocol message error occurred in the RT response. The host or subsystem should reset this bit when writing the control word into memory.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
channel: (Input) Channel Number of the channel to access (1 - [max channels for module]).
blockIndex: (Input) BC Command Block Index.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid card parameter is specified.
  • NAI_ERROR_NOT_OPEN when handle to board is invalid.
  • NAI_ERROR_INVALID_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_SUM1553_BC_GetCmdBlockPtr()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SUM1553_BC_GetCmdBlockPtr ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t * outblockIndex )

Retrieves the "blockIndex" value associated with the address read from the Command Block Pointer Register (Core Register 8). The Bus Controller command blocks are eight-word, contiguous blocks of memory that contains opcodes for controlling the core as well as 1553 command words and associated data locations in memory. After execution begins, this register is automatically updated with the address of the next block.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
channel: (Input) Channel Number of the channel to access (1 - [max channels for module]).
outblockIndex: (Output) BC Command Block Index.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid card parameter is specified.
  • NAI_ERROR_NOT_OPEN when handle to board is invalid.
  • NAI_ERROR_INVALID_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_SUM1553_BC_LoadCmdBlock()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SUM1553_BC_LoadCmdBlock ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t blockIndex,
uint16_t ctrl,
uint16_t cmd1,
uint16_t cmd2,
uint16_t datablock,
uint16_t branchblock,
uint32_t timerus )

Loads the BC Command Block. Each command block contains eight-words.

The eight-word command block contain the following:
- Control Word (Word 1) - contains the opcode, number of retries, bus definition, RT-RT instructions, condition
  codes, and the block access message error (BAME) necessary to complete a single 1553 command.
  The Control Word format:
     - Opcode (bits 15:12) - specifies the opcode to be used for the command block being processed. Refer to the
                             Bus Controller Command Block Control Word definitions in naibrd_sum1553.h.
     - Retry Number (bits 11:10) - specifies the number of times the core will retry each command block, providing that
                             the opcode allows for retrying. If the Control register Ping-Pong Enable bit (Core Register 0
                             bit 2) is enabled, the core will alternate between Bus A and Bus B on message retries. If this
                             is disabled, the core will retry only on the programmed bus as defined in the Control
                             Word's Channel A/B bit (bit 9).
     - Channel A/B (bit 9) - specifies the primary bus for 1553 transmissions. 1 selects Bus A, 0 selects Bus B.
     - RT-to-RT Transfer (bit 8) - if set to 1 indicates that the current command block involves an RT-to-RT transfer and therefore
                             Command Word 2 should be transmitted. The core will store all data associated with an RT-to-RT
                             transfer.
     - Condition 7 (bit 7) - set if there is an error in the RT response or if there is no response after the message time-out
                             period has expired.
     - Condition 6 (bit 6) - set if the RT Status Word response has the Message Error bit set (bit 9 in 1553A mode).
     - Condition 5 (bit 5) - set if the RT Status Word response has the Busy bit set (bit 16 in 1553A mode).
     - Condition 4 (bit 4) - set if the RT Status Word response has the Terminal Flag bit set (bit 19 in 1553A mode).
     - Condition 3 (bit 3) - set if the RT Status Word response has the Subsystem Fail bit set (bit 17 in 1553A mode).
     - Condition 2 (bit 2) - set if the RT Status Word response has the Instrumentation bit set (bit 10 in 1553A mode).
     - Condition 1 (bit 1) - set if the RT Status Word response has the Service Request bit set (bit 11 in 1553A mode).
     - Block Access Message Error (bit 0) - set when a protocol message error occurred in the RT response. The host or subsystem
                             should reset this bit when writing the control word into memory.

- Command Word 1 (Word 2) / Command Word 2 (Word 3) - For most 1553 messages, only the first command word is needed. During RT-to-RT
  transfers, the first command word is the receive command and the second is the transmit command.
  The command word consists of the following:
     - RT Address (bits 15:11)
     - Transmit/Receive (bit 10) - set to 1 to indicate Transmit message (RTBC), 0 to indicate Receive message (BCRT).
     - Subaddress/Mode (bits 9:5)
     - Word Count/Mode Code (bits 4:0)

- Data Pointer (Word 4) - specifies the first location in memory where data associated with the command word(s) is to be stored or
  fetched from.

- Status Word 1 (Word 5) / Status Word 2 (Word 6) - 1553 Status after a 1553 command. For an RT-to-RT transfer, the status word
  from the transmitting RT will be stored in Word 5, while the status word for the receiving RT will be stored in word 6.

- Branch Address (Word 7) - specifies the starting address of the command block that is the destination of a branch opcode.

- Timer Value (Word 8) - specifies either the minor frame timer (opcode: NAI_SUM1553_OPCODE_LOAD_MINOR_FRAME_TIMER) or the
  message-to-message timer (opcode: NAI_SUM1553_OPCODE_SKIP). The minor frame time is driven from an internal 15.625 KHz clock
  and the message-to-message timer is clocked by the core 20MHz clock input.
Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
channel: (Input) Channel Number of the channel to access (1 - [max channels for module]).
blockIndex: (Input) BC Command Block Index.
ctrl: (Input) Control Word.
cmd1: (Input) Command Word 1.
cmd2: (Input) Command Word 2.
datablock: (Input) Data Block Index. This will be converted to core memory address.
branchblock: (Input) Branch Block Index. This will be converted to core memory address.
timerus: (Input) Timer in microsecond. This will be converted to the timer value to based on the timer type.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid card parameter is specified.
  • NAI_ERROR_NOT_OPEN when handle to board is invalid.
  • NAI_ERROR_INVALID_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_SUM1553_BC_LoadDataBlock()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SUM1553_BC_LoadDataBlock ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t blockIndex,
const uint16_t datablock[32] )

Loads the BC Data Block. Each data block contains 32-words.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
channel: (Input) Channel Number of the channel to access (1 - [max channels for module]).
blockIndex: (Input) BC Command Block Index.
datablock: (Input) Data Words.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid card parameter is specified.
  • NAI_ERROR_NOT_OPEN when handle to board is invalid.
  • NAI_ERROR_INVALID_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_SUM1553_BC_ReadCmdBlock()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SUM1553_BC_ReadCmdBlock ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t blockIndex,
uint16_t * outctrl,
uint16_t * outcmd1,
uint16_t * outcmd2,
uint16_t * outdatablock,
uint16_t * outstatus1,
uint16_t * outstatus2,
uint16_t * outbranchblock,
uint32_t * outtimerus )

Retrieves the BC Command Block. Each command block contains eight-words.

The eight-word command block contain the following:
- Control Word (Word 1) - contains the opcode, number of retries, bus definition, RT-RT instructions, condition
  codes, and the block access message error (BAME) necessary to complete a single 1553 command.
  The Control Word format:
     - Opcode (bits 15:12) - specifies the opcode to be used for the command block being processed. Refer to the
                             Bus Controller Command Block Control Word definitions in naibrd_sum1553.h.
     - Retry Number (bits 11:10) - specifies the number of times the core will retry each command block, providing that
                             the opcode allows for retrying. If the Control register Ping-Pong Enable bit (Core Register 0
                             bit 2) is enabled, the core will alternate between Bus A and Bus B on message retries. If this
                             is disabled, the core will retry only on the programmed bus as defined in the Control
                             Word's Channel A/B bit (bit 9).
     - Channel A/B (bit 9) - specifies the primary bus for 1553 transmissions. 1 selects Bus A, 0 selects Bus B.
     - RT-to-RT Transfer (bit 8) - if set to 1 indicates that the current command block involves an RT-to-RT transfer and therefore
                             Command Word 2 should be transmitted. The core will store all data associated with an RT-to-RT
                             transfer.
     - Condition 7 (bit 7) - set if there is an error in the RT response or if there is no response after the message time-out
                             period has expired.
     - Condition 6 (bit 6) - set if the RT Status Word response has the Message Error bit set (bit 9 in 1553A mode).
     - Condition 5 (bit 5) - set if the RT Status Word response has the Busy bit set (bit 16 in 1553A mode).
     - Condition 4 (bit 4) - set if the RT Status Word response has the Terminal Flag bit set (bit 19 in 1553A mode).
     - Condition 3 (bit 3) - set if the RT Status Word response has the Subsystem Fail bit set (bit 17 in 1553A mode).
     - Condition 2 (bit 2) - set if the RT Status Word response has the Instrumentation bit set (bit 10 in 1553A mode).
     - Condition 1 (bit 1) - set if the RT Status Word response has the Service Request bit set (bit 11 in 1553A mode).
     - Block Access Message Error (bit 0) - set when a protocol message error occurred in the RT response. The host or subsystem
                             should reset this bit when writing the control word into memory.

- Command Word 1 (Word 2) / Command Word 2 (Word 3) - For most 1553 messages, only the first command word is needed. During RT-to-RT
  transfers, the first command word is the receive command and the second is the transmit command.
  The command word consists of the following:
     - RT Address (bits 15:11)
     - Transmit/Receive (bit 10) - set to 1 to indicate Transmit message (RTBC), 0 to indicate Receive message (BCRT).
     - Subaddress/Mode (bits 9:5)
     - Word Count/Mode Code (bits 4:0)

- Data Pointer (Word 4) - specifies the first location in memory where data associated with the command word(s) is to be stored or
  fetched from.

- Status Word 1 (Word 5) / Status Word 2 (Word 6) - 1553 Status after a 1553 command. For an RT-to-RT transfer, the status word
  from the transmitting RT will be stored in Word 5, while the status word for the receiving RT will be stored in word 6.

- Branch Address (Word 7) - specifies the starting address of the command block that is the destination of a branch opcode.

- Timer Value (Word 8) - specifies either the minor frame timer (opcode: NAI_SUM1553_OPCODE_LOAD_MINOR_FRAME_TIMER) or the
  message-to-message timer (opcode: NAI_SUM1553_OPCODE_SKIP). The minor frame time is driven from an internal 15.625 KHz clock
  and the message-to-message timer is clocked by the core 20MHz clock input.
Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
channel: (Input) Channel Number of the channel to access (1 - [max channels for module]).
blockIndex: (Input) BC Command Block Index.
outctrl: (Output) Control Word.
outcmd1: (Output) Command Word 1.
outcmd2: (Output) Command Word 2.
outstatus1: (Output) Status Word 1.
outstatus2: (Output) Status Word 2.
outdatablock: (Output) Data Block Index.
outbranchblock: (Output) Branch Block Index.
outtimerus: (Output) Timer in microsecond.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid card parameter is specified.
  • NAI_ERROR_NOT_OPEN when handle to board is invalid.
  • NAI_ERROR_INVALID_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_SUM1553_BC_ReadCmdBlockDataPtr()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SUM1553_BC_ReadCmdBlockDataPtr ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t blockIndex,
uint16_t * outdatablock )

Retrieves the Command Block's Data Pointer (Word 4). The Data Pointer specifies the first location in memory where data associated with the command word(s) is to be stored or fetched from.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
channel: (Input) Channel Number of the channel to access (1 - [max channels for module]).
blockIndex: (Input) BC Command Block Index.
outdatablock: (Output) Data Block Index. This will be converted to core memory address.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid card parameter is specified.
  • NAI_ERROR_NOT_OPEN when handle to board is invalid.
  • NAI_ERROR_INVALID_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_SUM1553_BC_ReadDataBlock()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SUM1553_BC_ReadDataBlock ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t blockIndex,
uint16_t outdatablock[32] )

Retrieves the BC Data Block. Each data block contains 32-words.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
channel: (Input) Channel Number of the channel to access (1 - [max channels for module]).
blockIndex: (Input) BC Command Block Index.
outdatablock: (Output) Data Words.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid card parameter is specified.
  • NAI_ERROR_NOT_OPEN when handle to board is invalid.
  • NAI_ERROR_INVALID_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_SUM1553_BC_SetCmdBlockDataPtr()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SUM1553_BC_SetCmdBlockDataPtr ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t blockIndex,
uint16_t datablock )

Sets the Command Block's Data Pointer (Word 4). The Data Pointer specifies the first location in memory where data associated with the command word(s) is to be stored or fetched from.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
channel: (Input) Channel Number of the channel to access (1 - [max channels for module]).
blockIndex: (Input) BC Command Block Index.
datablock: (Input) Data Block Index. This will be converted to core memory address.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid card parameter is specified.
  • NAI_ERROR_NOT_OPEN when handle to board is invalid.
  • NAI_ERROR_INVALID_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_SUM1553_BC_SetCmdBlockPtr()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SUM1553_BC_SetCmdBlockPtr ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t blockIndex )

Sets the Command Block Pointer Register (Core Register 8) to the location to start the command blocks associated with the "blockIndex" passed in. The Bus Controller command blocks are eight-word, contiguous blocks of memory that contains opcodes for controlling the core as well as 1553 command words and associated data locations in memory. After execution begins, this register is automatically updated with the address of the next block.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
channel: (Input) Channel Number of the channel to access (1 - [max channels for module]).
blockIndex: (Input) BC Command Block Index.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid card parameter is specified.
  • NAI_ERROR_NOT_OPEN when handle to board is invalid.
  • NAI_ERROR_INVALID_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.