Software Library API naibrd 2.24.0
See all documentation at naii.docs.com
|
Functions | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_AR_SetTxScheduleCmd (int32_t cardIndex, int32_t module, int32_t channel, uint32_t cmdNum, naibrd_ar_sched_cmd_t cmdType, uint16_t parameter) |
Set up a command in the transmit schedule. Use this function to build a transmit message schedule. Make sure that the transmit send mode is set to Schedule Mode with naibrd_AR_SetTransmitSendMode() prior to using this function. The transmit schedule memory allows up to 512 commands (or instructions) for message transmission without host software intervention. The following command types (instructions) are available for constructing a schedule: | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_AR_GetTxScheduleCmd (int32_t cardIndex, int32_t module, int32_t channel, uint32_t cmdNum, uint16_t *p_outcmdWord) |
Reads a command entry (given by the user-specified command number) in the transmit message schedule. The commands in the transmit message schedule are set up using the function naibrd_AR_SetTxScheduleCmd(). The current function is used to read what is currently loaded in the transmit message schedule. After this function executes, the output variable p_outcmdWord will contain a 16-bit value that can be decoded in the following way: | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_AR_WriteMsgMem (int32_t cardIndex, int32_t module, int32_t channel, uint32_t memAddr, uint32_t data) |
Writes 32-bit data to the user specified Transmit Message Memory Address (memAddr) of the specified channel. The Transmit Message Memory is used to store 32-bit ARINC words and Gap Times for utilization by the Transmit Message Scheduler. Please read the description of naibrd_AR_SetTxScheduleCmd() to understand how this function is used in the context of setting up a schedule. The valid range for memAddr is 0 to 1023 (0x3FF) and it addresses a 32-bit word in memory. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_AR_ReadMsgMem (int32_t cardIndex, int32_t module, int32_t channel, uint32_t memAddr, uint32_t *p_outdata) |
Reads 32-bit data from the user specified Transmit Message Memory Address (memAddr) of the specified channel. The Transmit Message Memory is used to store 32-bit ARINC words and Gap Times for utilization by the Transmit Message Scheduler. This function is used to read the contents of the Transmit Message Memory at user-specified locations. The valid range for memAddr is 0 to 1023 (0x3FF) and it addresses a 32-bit word in memory. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_AR_SendAsyncMsg (int32_t cardIndex, int32_t module, int32_t channel, uint32_t msgWord) |
Send an asynchronous ARINC word on the specified channel. This function is used to send an asynchronous message while the channel is transmitting a schedule. Asynchronous messages will only get sent between messages during gap times that are greater than or equal to 40 bit-times. Asynchronous messages will not get sent during Fixed Gap times. Use naibrd_AR_GetEventMappedStatus() to check the Async Data Available bit, which clears once the Async word has transmitted. | |
NAIBRDFUNC nai_status_t NAIAPI naibrd_AR_GetTxScheduleCmd | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
uint32_t | cmdNum, | ||
uint16_t * | p_outcmdWord ) |
Reads a command entry (given by the user-specified command number) in the transmit message schedule. The commands in the transmit message schedule are set up using the function naibrd_AR_SetTxScheduleCmd(). The current function is used to read what is currently loaded in the transmit message schedule. After this function executes, the output variable p_outcmdWord will contain a 16-bit value that can be decoded in the following way:
Bits 12 to 15 - cmdType Bits 0 to 9 - parameter
The following table describes each command type and its parameter (if used).
cmdType | description | parameter | ---------------------------------------------------------------------------------------------------------------------- 0 = NAIBRD_AR_TX_SCHED_STOP Stop Transmitting None (ignored) 1 = NAIBRD_AR_TX_SCHED_MESSAGE Transmit ARINC Message Msg Mem Address (memAddr) containing 32-bit ARINC word 2 = NAIBRD_AR_TX_SCHED_GAP Insert Gap Time Msg Mem Address (memAddr) containing gap time 3 = NAIBRD_AR_TX_SCHED_FIXEDGAP Insert Fixed Gap Time Msg Mem Address (memAddr) containing fixed gap time 4 = NAIBRD_AR_TX_SCHED_PAUSE Pause Transmission None (ignored) 5 = NAIBRD_AR_TX_SCHED_INTERRUPT Generate an Interrupt None (ignored) 6 = NAIBRD_AR_TX_SCHED_JUMP Jump to Command Command Number
For example, 0x1055 would be decoded as command type NAIBRD_AR_TX_SCHED_MESSAGE and parameter 0x55, which indicates that the ARINC word to transmit is located in Msg Memory Address 0x55.
If a value such as 0x00AA, a stop command, is read off, the 0xAA portion of the word is not used in the schedule since a stop command ignores the parameter.
cardIndex | : (Input) Logical Card Index assigned to connect 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]). |
cmdNum | : (Input) Transmit Schedule Command Number (0 to 511). |
p_outcmdWord | : (Output) 16-bit command word. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_AR_ReadMsgMem | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
uint32_t | memAddr, | ||
uint32_t * | p_outdata ) |
Reads 32-bit data from the user specified Transmit Message Memory Address (memAddr) of the specified channel. The Transmit Message Memory is used to store 32-bit ARINC words and Gap Times for utilization by the Transmit Message Scheduler. This function is used to read the contents of the Transmit Message Memory at user-specified locations. The valid range for memAddr is 0 to 1023 (0x3FF) and it addresses a 32-bit word in memory.
cardIndex | : (Input) Logical Card Index assigned to connect 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]). |
memAddr | : (Input) Transmit Message Memory Address (0 to 1023). |
p_outdata | : (Output) 32-bit data word read from memAddr. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_AR_SendAsyncMsg | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
uint32_t | msgWord ) |
Send an asynchronous ARINC word on the specified channel. This function is used to send an asynchronous message while the channel is transmitting a schedule. Asynchronous messages will only get sent between messages during gap times that are greater than or equal to 40 bit-times. Asynchronous messages will not get sent during Fixed Gap times. Use naibrd_AR_GetEventMappedStatus() to check the Async Data Available bit, which clears once the Async word has transmitted.
cardIndex | : (Input) Logical Card Index assigned to connect 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]). |
msgWord | : (Input) 32-bit Async data word. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_AR_SetTxScheduleCmd | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
uint32_t | cmdNum, | ||
naibrd_ar_sched_cmd_t | cmdType, | ||
uint16_t | parameter ) |
Set up a command in the transmit schedule. Use this function to build a transmit message schedule. Make sure that the transmit send mode is set to Schedule Mode with naibrd_AR_SetTransmitSendMode() prior to using this function. The transmit schedule memory allows up to 512 commands (or instructions) for message transmission without host software intervention. The following command types (instructions) are available for constructing a schedule:
cmdType | description | parameter | --------------------------------------------------------------------------------------------------------------- NAIBRD_AR_TX_SCHED_STOP Stop Transmitting None (ignored) NAIBRD_AR_TX_SCHED_MESSAGE Transmit ARINC Message Msg Mem Address (memAddr) containing 32-bit ARINC word NAIBRD_AR_TX_SCHED_GAP Insert Gap Time Msg Mem Address (memAddr) containing gap time NAIBRD_AR_TX_SCHED_FIXEDGAP Insert Fixed Gap Time Msg Mem Address (memAddr) containing fixed gap time NAIBRD_AR_TX_SCHED_PAUSE Pause Transmission None (ignored) NAIBRD_AR_TX_SCHED_INTERRUPT Generate an Interrupt None (ignored) NAIBRD_AR_TX_SCHED_JUMP Jump to Command Command Number
The Transmit ARINC Message command takes a parameter indicating the message memory address (memAddr) that contains the actual 32-bit ARINC word to transmit. The user can write this ARINC word to any memAddr in the Message Memory using the naibrd_AR_WriteMsgMem() function. Then this memAddr should be passed into the current function as a parameter. For example, to set up command number 0 in the schedule to transmit ARINC word 0x12345678, the application can include the following code:
naibrd_AR_WriteMsgMem(cardIndex, module, channel, 5, 0x12345678); --> write 0x12345678 to message memory address 5 naibrd_AR_SetTxScheduleCmd(cardIndex, module, channel, 0, NAIBRD_AR_TX_SCHED_MESSAGE, 5); --> set command number 0 to transmit 32-bit word contained in memory address 5
The Insert Gap Time command takes a parameter indicating the message memory address (memAddr) that contains the message gap time, which is the time interval between messages. The minimum gap time is 4. For example, to set up command number 1 in the schedule for a gap time of 10 bit-times, the application can include the following code:
naibrd_AR_WriteMsgMem(cardIndex, module, channel, 6, 0x0000000A); --> write 0x0000000A to message memory address 6 naibrd_AR_SetTxScheduleCmd(cardIndex, module, channel, 1, NAIBRD_AR_TX_SCHED_GAP, 6); --> set command number 1 for a gap time given by number contained in memory address 6
The Fixed Gap Time command works similar to Insert Gap Time. The difference between Gap Time and Fixed Gap Time is only evident when Asynchronous messages are used. If the user requests an asynchronous message to be sent while a schedule is running, the async message will be sent in the next available Gap Time. If the Gap Time is not long enough (less than 40 bit-times) to accommodate the async message, the async message will not get sent until the next Gap Time that is greater than or equal to 40 bit-times. An async message will not get sent during a Fixed Gap.
The schedule can be started by sending a trigger using naibrd_AR_SetTxSendTrigger(). The transmit schedule will always start at command number zero and run sequentially without host intervention until a Stop or Pause command is encountered. When transmission halts due to a Pause command, the user can send a trigger with naibrd_AR_SetTxSendTrigger() to resume the schedule. The Jump command can be used to jump to any command that is defined in the transmit schedule. It can be useful for looping on a particular set of commands. For example, to set up command number 7 to jump to command number 0 in the schedule, the application can include the following code:
naibrd_AR_SetTxScheduleCmd(cardIndex, module, channel, 7, NAIBRD_AR_TX_SCHED_JUMP, 0); --> set command number 7 for a jump instruction to command 0
IMPORTANT: The user should make sure to construct the schedule with sequential command numbers starting at command number zero. For example, if eight commands are to be used, command numbers 0 to 7 should be used. Never skip command numbers within the schedule since the schedule will run in command number order.
cardIndex | : (Input) Logical Card Index assigned to connect 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]). |
cmdNum | : (Input) Transmit Schedule Command Number (0 to 511). |
cmdType | : (Input) Transmit Schedule Command Type. Select from following: NAIBRD_AR_TX_SCHED_STOP NAIBRD_AR_TX_SCHED_MESSAGE NAIBRD_AR_TX_SCHED_GAP NAIBRD_AR_TX_SCHED_FIXEDGAP NAIBRD_AR_TX_SCHED_PAUSE NAIBRD_AR_TX_SCHED_INTERRUPT NAIBRD_AR_TX_SCHED_JUMP |
parameter | : (Input) Transmit Schedule Command Parameter. If the command does not utilize a parameter, set this value to '0'. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_AR_WriteMsgMem | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
uint32_t | memAddr, | ||
uint32_t | data ) |
Writes 32-bit data to the user specified Transmit Message Memory Address (memAddr) of the specified channel. The Transmit Message Memory is used to store 32-bit ARINC words and Gap Times for utilization by the Transmit Message Scheduler. Please read the description of naibrd_AR_SetTxScheduleCmd() to understand how this function is used in the context of setting up a schedule. The valid range for memAddr is 0 to 1023 (0x3FF) and it addresses a 32-bit word in memory.
cardIndex | : (Input) Logical Card Index assigned to connect 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]). |
memAddr | : (Input) Transmit Message Memory Address (0 to 1023). |
data | : (Input) 32-bit data word. |