AR429 Recv Summary
Edit this on GitLab
AR429 Recv Summary Sample Application (SSK 2.x)
Overview
The AR429 Recv Summary sample application demonstrates how to configure ARINC 429 receive channels and use the Rx summary register to detect when new messages arrive, using the NAI Software Support Kit (SSK 2.x). Unlike the fault-oriented summary samples for other module types, this sample uses the summary register to monitor receive data availability across multiple channels simultaneously.
The application configures channels 1, 2, 5, 6, 7, and 8 for FIFO receive mode, then either polls the Rx summary real-time register or uses interrupts on the Rx summary latched register to detect when any channel has new ARINC messages in its receive FIFO. When a summary bit is set, the sample reads out and displays all pending messages from the corresponding channel’s FIFO buffer.
This sample supports ARINC 429 module types: AR1 and AR2. It serves as a practical reference for building an ARINC 429 multi-channel receiver that uses the summary register for efficient message detection.
|
Note
|
This pattern is new to SSK 2.x and has no SSK 1.x counterpart. |
Prerequisites
Before running this sample, make sure you have:
-
An NAI board with an ARINC 429 module installed (AR1 or AR2).
-
An external ARINC 429 transmitter connected to one or more of the configured receive channels.
-
SSK 2.x installed on your development host.
-
The sample applications built. Refer to the SSK 2.x Software Development Guide for platform-specific build instructions.
How to Run
Launch the ar429_recv_summary executable from your build output directory. On startup the application looks for a configuration file (default_ARRecv_Summary.txt). On the first run, this file will not exist — the application will present an interactive board menu where you configure a board connection, card index, and module slot. You can save this configuration so that subsequent runs skip the menu and connect automatically. Once connected, the application prompts you for the ARINC data rate (high or low speed) and whether to use interrupt-driven or polling-based message detection, then begins monitoring for received messages.
Board Connection and Module Selection
|
Note
|
This startup sequence is common to all NAI sample applications. The board connection and module selection code shown here is not specific to ARINC 429. |
The main() function follows a standard SSK 2.x startup flow:
-
Call
naiapp_RunBoardMenu()to load a saved configuration file (if one exists) or present the interactive board menu. The configuration file (default_ARRecv_Summary.txt) is not included with the SSK — it is created when the user saves their connection settings from the board menu. On the first run, the menu will always appear. -
Query the user for a card index with
naiapp_query_CardIndex(). -
Query for a module slot with
naiapp_query_ModuleNumber(). -
Retrieve the module ID with
naibrd_GetModuleName()so downstream code can adapt to the specific ARINC 429 variant installed.
#if defined (NAIBSP_CONFIG_SOFTWARE_OS_VXWORKS)
int32_t ar429_recv_summary(void)
#else
int32_t main(void)
#endif
{
int32_t cardIndex;
int32_t moduleCnt;
int32_t module;
bool_t stop = NAI_FALSE;
uint32_t moduleID;
int8_t inputBuffer[80];
int32_t inputResponseCnt;
if (naiapp_RunBoardMenu(CONFIG_FILE) == (bool_t)NAI_TRUE)
{
while (stop != NAI_TRUE)
{
stop = naiapp_query_CardIndex(naiapp_GetBoardCnt(), DEF_AR_CARD_INDEX, &cardIndex);
if (stop != NAI_TRUE)
{
check_status(naibrd_GetModuleCount(cardIndex, &moduleCnt));
stop = naiapp_query_ModuleNumber(moduleCnt, DEF_AR_MODULE, &module);
if (stop != NAI_TRUE)
{
check_status(naibrd_GetModuleName(cardIndex, module, &moduleID));
if ((moduleID != 0))
{
AR_Receive_Summary_run(cardIndex, module, moduleID);
}
}
}
}
}
naiapp_access_CloseAllOpenCards();
return 0;
}
Program Structure
Entry Point
After board and module selection, AR_Receive_Summary_run() queries the user for the ARINC data rate and whether to use interrupts or polling, then configures all six receive channels and enters the message monitoring loop.
Channel Configuration
The sample configures channels 1, 2, 5, 6, 7, and 8 with the following settings for each channel:
int32_t arChannels[6] = {1, 2, 5, 6, 7, 8};
for (i = 0; i < 6; i++)
{
check_status(naibrd_AR_SetBaudRate(cardIndex, module, arChannels[i], datarate));
check_status(naibrd_AR_SetRxFifoThreshold(cardIndex, module, arChannels[i], 128));
check_status(naibrd_AR_SetParityBitUsage(cardIndex, module, arChannels[i], NAIBRD_AR_PAR_ODD));
check_status(naibrd_AR_SetRxStoreOnErrorEnable(cardIndex, module, arChannels[i], NAI_TRUE));
check_status(naibrd_AR_SetRxTimeStampEn(cardIndex, module, arChannels[i], bTimestampEnabled));
check_status(naibrd_AR_SetReceiveMode(cardIndex, module, arChannels[i], NAIBRD_AR_RX_FIFO_MODE));
check_status(naibrd_AR_ClearRxFifo(cardIndex, module, arChannels[i]));
check_status(naibrd_AR_SetRxEnable(cardIndex, module, arChannels[i], NAI_TRUE));
}
-
naibrd_AR_SetBaudRate()— sets the transmission speed (high 100 kHz or low 12.5 kHz). -
naibrd_AR_SetRxFifoThreshold()— sets the FIFO almost-full threshold to 128 messages (max 255). -
naibrd_AR_SetParityBitUsage()— configures ARINC bit 32 as odd parity with parity checking enabled. -
naibrd_AR_SetRxStoreOnErrorEnable()— stores all received messages regardless of error status. -
naibrd_AR_SetRxTimeStampEn()— enables timestamping on received messages. -
naibrd_AR_SetReceiveMode()— sets the channel to FIFO receive mode. -
naibrd_AR_ClearRxFifo()— clears the receive FIFO to start with an empty buffer. -
naibrd_AR_SetRxEnable()— enables the receiver on the channel.
Polling Mode
In polling mode, the sample reads the Rx summary real-time register to detect which channels have new messages:
check_status(naibrd_AR_GetChanMappedStatusRaw(cardIndex, module,
NAIBRD_AR_STATUS_SUMMARY_RX_AVAIL_REALTIME, ®Value));
if (regValue > 0)
{
for (chan = 1; chan <= maxChannels; chan++)
{
if ((regValue & (1u << (chan - 1))) > 0u)
{
FetchNewMessagesFromRxFIFO(cardIndex, module, chan);
}
}
}
-
NAIBRD_AR_STATUS_SUMMARY_RX_AVAIL_REALTIME— the real-time (non-latched) summary register. Each bit corresponds to a channel and reads1when the channel’s Rx FIFO contains at least one unread message. -
The sample checks each bit in the register to determine which channels have data, then reads out the messages from those channels.
The polling loop runs for a user-specified duration (default 5 seconds), checking the summary register every 10 ms.
Interrupt Mode
In interrupt mode, the sample configures interrupts on the Rx summary latched register. When an interrupt fires, the callback sets a flag that the main loop checks:
/* Per-channel interrupt configuration */
check_status(naibrd_AR_SetChanMappedInterruptTriggerType(cardIndex, module, arChannels[i],
NAIBRD_AR_STATUS_SUMMARY_RX_AVAIL_LATCHED, NAIBRD_INT_TRIGGER_TYPE_LEVEL));
check_status(naibrd_AR_SetChanMappedInterruptEnable(cardIndex, module, arChannels[i],
NAIBRD_AR_STATUS_SUMMARY_RX_AVAIL_LATCHED, NAI_TRUE));
/* Module-level interrupt configuration */
check_status(naibrd_ConnectISR(cardIndex, SampleCallBack));
check_status(naibrd_AR_SetChanMappedInterruptSteering(cardIndex, module,
NAIBRD_AR_STATUS_SUMMARY_RX_AVAIL_LATCHED, NAIBRD_INT_STEERING_ONBOARD_ARM));
check_status(naibrd_AR_SetChanMappedInterruptVector(cardIndex, module,
NAIBRD_AR_STATUS_SUMMARY_RX_AVAIL_LATCHED, INTERRUPT_VECTOR));
check_status(naibrd_AR_ClearChanMappedStatusRaw(cardIndex, module,
NAIBRD_AR_STATUS_SUMMARY_RX_AVAIL_LATCHED, 0xFFFFFFFFu));
-
NAIBRD_AR_STATUS_SUMMARY_RX_AVAIL_LATCHED— the latched summary register for Rx data availability. Unlike the real-time register, the latched register holds its state until explicitly cleared. -
NAIBRD_INT_TRIGGER_TYPE_LEVEL— level triggering is used here (rather than edge) because the interrupt should fire as long as data is available, not just on transitions. -
After reading the FIFO, the latched status is cleared to allow the next interrupt.
Reading Messages from the FIFO
When a channel has data, the sample reads the FIFO count and then fetches all available messages:
check_status(naibrd_AR_GetRxFifoCnt(cardIndex, module, channel, &nNumWordsRecv));
if (nNumWordsRecv > 0)
{
check_status(naibrd_AR_ReadRxFifo(cardIndex, module, channel, bTimestampEnabled,
nNumWordsRecv, RecvStatusWd, RecvData, RecvTimeStamp, &nNumWordsRecv));
}
-
naibrd_AR_GetRxFifoCnt()— returns the number of messages currently in the Rx FIFO. -
naibrd_AR_ReadRxFifo()— reads out the specified number of messages, returning status words, data words, and timestamps for each.
Interrupt Callback
The sample callback sets a flag when an interrupt with the expected vector is received:
static void SampleCallBack(uint32_t vector)
{
NAIBSP_UNREFERENCED_PARAMETER(vector);
#if defined (NAIBSP_CONFIG_SOFTWARE_OS_VXWORKS)
logMsg("Interrupt Received!!! Vector:0x%x\n Clear Status to receive new interrupt!!!\r\n",
vector, 0, 0, 0, 0, 0);
if ((vector & 0xFF) == INTERRUPT_VECTOR)
{
irqFlag = NAI_TRUE;
}
#endif
}
|
Note
|
On VxWorks, the callback uses logMsg() because printf() is not safe in interrupt context. The irqFlag global variable is set to signal the main loop that new data is available.
|
For background on interrupt concepts — including edge vs. level triggering, interrupt vector numbering, steering architecture, and latency measurement — see the Interrupts API Guide.
Troubleshooting Reference
This table summarizes common errors and symptoms. Consult your module’s manual (AR1 Manual) for hardware-specific diagnostic procedures.
| Error / Symptom | Possible Causes | Suggested Resolution |
|---|---|---|
No board found or connection timeout |
Board not powered, incorrect or missing configuration file, network issue |
Verify hardware is powered and connected. If |
Module not detected at selected slot |
No module installed at the specified slot, incorrect module number entered |
Verify hardware configuration and module slot assignment |
No messages received during test duration |
No external transmitter connected, wrong data rate selected, transmitter not sending on configured channels |
Verify external ARINC 429 transmitter is connected and sending on channels 1, 2, 5, 6, 7, or 8. Confirm the data rate matches between transmitter and receiver. |
Summary register always reads zero |
Receiver not enabled, FIFO not in correct mode, no data being transmitted |
Verify |
Interrupt does not fire |
Missing one or more interrupt configuration steps, steering not set correctly |
Verify all interrupt configuration calls completed successfully. Check that steering is set to |
Parity errors in received data |
Transmitter using different parity settings |
Match the parity configuration between transmitter and receiver. The sample defaults to odd parity. |
FIFO overflow |
Messages arriving faster than they are being read |
Increase the polling frequency or use interrupt mode. Consider adjusting the FIFO threshold. |
Full Source
The complete source for this sample is provided below for reference. The sections above explain each part in detail.
Full Source — ar429_recv_summary.c (SSK 2.x)
/* nailib include files */
#include "nai_libs/nailib/include/naitypes.h"
#include "nai_libs/nailib/include/nailib.h"
#include "nai_libs/nailib/include/nailib_utils.h"
/* naibrd include files */
#include "nai_libs/naibrd/include/naibrd.h"
/* naiif include files */
#include "nai_libs/naiif/include/naiif_stdio.h"
/* Common Sample Program include files */
#include "nai_sample_apps/naiapp_common/include/naiapp_boardaccess_menu.h"
#include "nai_sample_apps/naiapp_common/include/naiapp_boardaccess_query.h"
#include "nai_sample_apps/naiapp_common/include/naiapp_boardaccess_access.h"
#include "nai_sample_apps/naiapp_common/include/naiapp_boardaccess_display.h"
#include "nai_sample_apps/naiapp_common/include/naiapp_boardaccess_utils.h"
/* AD Sample App include files */
#include "nai_sample_apps/naiapp_src/board_modules/ar429/ar429_common_utils/ar429_common_utils.h"
#if defined (NAIBSP_CONFIG_SOFTWARE_OS_VXWORKS)
#include "logLib.h"
#endif
static const int8_t *CONFIG_FILE = (const int8_t *)"default_ARRecv_Summary.txt";
static bool_t AR_Receive_Summary_run(int32_t cardIndex, int32_t module, uint32_t moduleID);
static bool_t RxAndDisplayFIFOMsgs(int32_t cardIndex, int32_t module, uint32_t moduleID, bool_t useInterrupt);
static void FetchNewMessagesFromRxFIFO(int32_t cardIndex, int32_t module, int32_t channel);
static void SampleCallBack(uint32_t vector);
/* Default channel selection */
#define DEF_AR_CARD_INDEX 0
#define DEF_AR_MODULE 1
#define AR_RECV_CHANNELS {1, 2, 5, 6, 7, 8}
/* Default channel configuration settings */
#define DEF_AR_DATA_RATE NAIBRD_AR_SPEED_LOW
#define DEF_AR_TIMESTAMP_ENABLED NAI_TRUE
#define DEF_USE_INTERRUPTS NAI_FALSE
#define INTERRUPT_VECTOR 0xA0
/* Global Variables */
static bool_t bTimestampEnabled = NAI_TRUE;
static bool_t irqFlag = NAI_FALSE;
/*****************************************************************************/
/**
* <summary>
* The purpose of ar429_recv_summary is to illustrate the methods to call in
* the naibrd library to configure channels 1, 2, 5, 6, 7 and 8 for message receive
* operation and poll the Rx summary register (or utilize interrupts) to
* ascertain which channels contain new ARINC message(s) in their respective
* Rx FIFO buffer. The summary register is bit-mapped by channel (bit index
* zero is channel 1) and mirrors the "Rx Data Available" bit in the Channel
* Status registers. If unread messages are present in the FIFO of a particular
* channel, the corresponding bit will be set to '1' in the Rx summary register.
*
* The following system configuration routines from the nai_sys_cfg.c file are
* called to assist with the configuration setup for this program prior to
* calling the naibrd ARINC routines.
* - ConfigDevice
* - DisplayDeviceCfg
* - GetBoardSNModCfg
* - CheckModule
* </summary>
*/
/*****************************************************************************/
#if defined (NAIBSP_CONFIG_SOFTWARE_OS_VXWORKS)
int32_t ar429_recv_summary(void)
#else
int32_t main(void)
#endif
{
int32_t cardIndex;
int32_t moduleCnt;
int32_t module;
bool_t stop = NAI_FALSE;
uint32_t moduleID;
int8_t inputBuffer[80];
int32_t inputResponseCnt;
if (naiapp_RunBoardMenu(CONFIG_FILE) == (bool_t)NAI_TRUE)
{
while (stop != NAI_TRUE)
{
/* Select Card Index */
stop = naiapp_query_CardIndex(naiapp_GetBoardCnt(), DEF_AR_CARD_INDEX, &cardIndex);
if (stop != NAI_TRUE)
{
check_status(naibrd_GetModuleCount(cardIndex, &moduleCnt));
/* Select Module */
stop = naiapp_query_ModuleNumber(moduleCnt, DEF_AR_MODULE, &module);
if (stop != NAI_TRUE)
{
check_status(naibrd_GetModuleName(cardIndex, module, &moduleID));
if ((moduleID != 0))
{
AR_Receive_Summary_run(cardIndex, module, moduleID);
naiif_printf("\r\nType Q to quit or Enter to continue:\r\n");
stop = naiapp_query_ForQuitResponse(sizeof(inputBuffer), NAI_QUIT_CHAR, inputBuffer, &inputResponseCnt);
}
}
}
}
}
naiif_printf("\r\nType the Enter key to exit the program: ");
naiapp_query_ForQuitResponse(sizeof(inputBuffer), NAI_QUIT_CHAR, inputBuffer, &inputResponseCnt);
naiapp_access_CloseAllOpenCards();
return 0;
}
/*****************************************************************************/
/**
* <summary>
* AR_Receive_Summary_run queries the user for the card and module to configure
* the ARINC receiver as well as the data rate (high (100kHz) or low (12.5
* kHz)). The receiving ARINC channel is configured for FIFO receive mode.
* </summary>
*/
/*****************************************************************************/
static bool_t AR_Receive_Summary_run(int32_t cardIndex, int32_t module, uint32_t moduleID)
{
bool_t bQuit = NAI_FALSE;
naibrd_ar_datarate_t datarate;
int32_t arChannels[6] = AR_RECV_CHANNELS;
int32_t i;
bool_t useInterrupts;
/* Get Data Rate */
bQuit = GetARINCDataRate( DEF_AR_DATA_RATE, &datarate );
if (!bQuit)
{
/* Use Interrupts or Poll */
bQuit = GetInterruptOrPoll( DEF_USE_INTERRUPTS, &useInterrupts );
if (!bQuit)
{
for (i = 0; i < 6; i++)
{
/* Set the transmission speed */
check_status( naibrd_AR_SetBaudRate( cardIndex, module, arChannels[i], datarate ) );
/* Set the Rx Fifo Threshold to 128 (max is 255). If the number of messages in the Rx FIFO rises above 128, the Rx FIFO Almost Full Status will be set */
check_status( naibrd_AR_SetRxFifoThreshold( cardIndex, module, arChannels[i], 128 ) );
/* Set the Parity Bit Usage to treat ARINC bit 32 as an odd parity bit and perform parity checking */
check_status( naibrd_AR_SetParityBitUsage( cardIndex, module, arChannels[i], NAIBRD_AR_PAR_ODD ) );
/* Set Store On Error to "Enable". In other words, store all received messages regardless of whether or not the message was flagged with an error. */
check_status( naibrd_AR_SetRxStoreOnErrorEnable( cardIndex, module, arChannels[i], NAI_TRUE ) );
/* Set Timestamp Enable */
check_status( naibrd_AR_SetRxTimeStampEn( cardIndex, module, arChannels[i], bTimestampEnabled ) );
/* Enable FIFO Receive Mode */
check_status( naibrd_AR_SetReceiveMode( cardIndex, module, arChannels[i], NAIBRD_AR_RX_FIFO_MODE ) );
/* Clear Rx FIFO to start with an empty buffer */
check_status( naibrd_AR_ClearRxFifo( cardIndex, module, arChannels[i] ) );
/* Enable Receiver */
check_status( naibrd_AR_SetRxEnable( cardIndex, module, arChannels[i], NAI_TRUE ) );
/* If using interrupts, configure channel-specific settings */
if (useInterrupts)
{
check_status(naibrd_AR_SetChanMappedInterruptTriggerType(cardIndex, module, arChannels[i], NAIBRD_AR_STATUS_SUMMARY_RX_AVAIL_LATCHED,
NAIBRD_INT_TRIGGER_TYPE_LEVEL));
check_status(naibrd_AR_SetChanMappedInterruptEnable(cardIndex, module, arChannels[i], NAIBRD_AR_STATUS_SUMMARY_RX_AVAIL_LATCHED, NAI_TRUE));
}
}
/* If using interrupts, configure and enable interrupts on the summary status register */
if (useInterrupts)
{
/* Specify callback function for interrupt type */
check_status(naibrd_ConnectISR(cardIndex, SampleCallBack)); /* Invoked once per card, not per interrupt type */
/* Set interrupt steering (VME, Onboard_ARM, PCIE or CPCI) */
check_status(naibrd_AR_SetChanMappedInterruptSteering(cardIndex, module, NAIBRD_AR_STATUS_SUMMARY_RX_AVAIL_LATCHED,
NAIBRD_INT_STEERING_ONBOARD_ARM));
/* Set the interrupt vector */
check_status(naibrd_AR_SetChanMappedInterruptVector(cardIndex, module, NAIBRD_AR_STATUS_SUMMARY_RX_AVAIL_LATCHED, INTERRUPT_VECTOR));
/* Clear summary latched status register to ensure that interrupts can be received */
check_status(naibrd_AR_ClearChanMappedStatusRaw(cardIndex, module, NAIBRD_AR_STATUS_SUMMARY_RX_AVAIL_LATCHED, 0xFFFFFFFFu));
}
/* Poll the Summary Register and Display Data Received in the Rx FIFO */
bQuit = RxAndDisplayFIFOMsgs( cardIndex, module, moduleID, useInterrupts );
}
}
return bQuit;
}
static bool_t RxAndDisplayFIFOMsgs(int32_t cardIndex, int32_t module, uint32_t moduleID, bool_t useInterrupt)
{
bool_t bQuit = NAI_FALSE;
bool_t bContinue = NAI_TRUE;
int32_t chan;
uint32_t regValue;
int32_t duration;
int32_t timeout;
int32_t maxChannels;
int8_t inputBuffer[80];
int32_t inputResponseCnt;
bContinue = NAI_TRUE;
/* Get count of all channels on the AR module */
maxChannels = naibrd_AR_GetChannelCount(moduleID);
while (bContinue)
{
naiif_printf( "\r\nType duration (in seconds) for ARINC receive messages test or %c to quit (default: 5) : ", NAI_QUIT_CHAR );
bQuit = naiapp_query_ForQuitResponse( sizeof(inputBuffer), NAI_QUIT_CHAR, inputBuffer, &inputResponseCnt );
if (!bQuit)
{
duration = 0;
timeout = 5;
if ( inputResponseCnt > 0 )
timeout = (int32_t)atol( (const char*)inputBuffer );
timeout *= 100;
/* Read new messages */
while ( duration < timeout )
{
/****************************************/
/*************** INTERRUPT **************/
/****************************************/
if (useInterrupt)
{
if (irqFlag)
{
irqFlag = NAI_FALSE;
/* Read the Summary Latched Status Register */
check_status(naibrd_AR_GetChanMappedStatusRaw(cardIndex, module, NAIBRD_AR_STATUS_SUMMARY_RX_AVAIL_LATCHED, ®Value));
/* If any bits in summary register are '1' indicating new data available, read out the received messages on the corresponding channels */
if (regValue > 0)
{
for (chan = 1; chan <= maxChannels; chan++)
{
if ((regValue & (1u << (chan - 1))) > 0u)
{
naiif_printf("\r\n***************************************\r\n");
naiif_printf("Summary latched register read: 0x%08X\r\n", regValue);
naiif_printf("Channel %d New Message detected\r\n", chan);
FetchNewMessagesFromRxFIFO(cardIndex, module, chan);
naiif_printf("***************************************\r\n");
}
}
}
/* Clear the Summary Latched Status Register once all new messages are read out */
check_status(naibrd_AR_ClearChanMappedStatusRaw(cardIndex, module, NAIBRD_AR_STATUS_SUMMARY_RX_AVAIL_LATCHED, regValue));
}
}
/****************************************/
/**************** POLLING ***************/
/****************************************/
else
{
/* Read the Summary Real-Time Status Register */
check_status( naibrd_AR_GetChanMappedStatusRaw(cardIndex, module, NAIBRD_AR_STATUS_SUMMARY_RX_AVAIL_REALTIME, ®Value));
/* If any bits in summary register are '1' indicating new data available, read out the received messages on the corresponding channels */
if (regValue > 0)
{
for (chan = 1; chan <= maxChannels; chan++)
{
if ((regValue & (1u << (chan - 1))) > 0u)
{
naiif_printf("\r\n***************************************\r\n");
naiif_printf("Summary real-time register read: 0x%08X\r\n", regValue);
naiif_printf("Channel %d New Message detected\r\n", chan);
FetchNewMessagesFromRxFIFO(cardIndex, module, chan);
naiif_printf("***************************************\r\n");
}
}
}
}
duration++;
naiif_msDelay(10);
}
}
else
bContinue = NAI_FALSE;
}
return bQuit;
}
static void FetchNewMessagesFromRxFIFO(int32_t cardIndex, int32_t module, int32_t channel)
{
int32_t nNumWordsRecv;
uint32_t RecvStatusWd[NAIBRD_AR_MAX_FIFO_COUNT];
uint32_t RecvData[NAIBRD_AR_MAX_FIFO_COUNT];
uint32_t RecvTimeStamp[NAIBRD_AR_MAX_FIFO_COUNT];
int32_t i;
/* Get count of received ARINC messages in Rx FIFO */
check_status( naibrd_AR_GetRxFifoCnt( cardIndex, module, channel, &nNumWordsRecv ) );
/* If Rx count is greater than 0, read out as many messages from the Rx FIFO */
if ( nNumWordsRecv > 0 )
{
naiif_printf( "Reading back %d words on channel %d ...\r\n", nNumWordsRecv, channel );
check_status( naibrd_AR_ReadRxFifo( cardIndex, module, channel, bTimestampEnabled, nNumWordsRecv, RecvStatusWd, RecvData, RecvTimeStamp, &nNumWordsRecv ) ); /* read back data */
for ( i = 0; i < nNumWordsRecv; i++ )
{
naiif_printf( "Status: 0x%08X ", RecvStatusWd[i] );
naiif_printf( "Data: 0x%08X ", RecvData[i] );
if (bTimestampEnabled)
{
naiif_printf( "TimeStamp: 0x%08X\r\n", RecvTimeStamp[i] );
}
}
}
}
static void SampleCallBack(uint32_t vector)
{
NAIBSP_UNREFERENCED_PARAMETER(vector);
#if defined (NAIBSP_CONFIG_SOFTWARE_OS_VXWORKS)
logMsg("Interrupt Received!!! Vector:0x%x\n Clear Status to receive new interrupt!!!\r\n",vector,0,0,0,0,0);
if ((vector & 0xFF) == INTERRUPT_VECTOR)
{
irqFlag = NAI_TRUE;
}
else
{
logMsg("Unknown Vector Received!!!r\n",0,0,0,0,0,0);
}
#endif
}