Software Library API naibrd 2.24.0
See all documentation at naii.docs.com

Functions

NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_RtDataBlkGetSize (naibrd_1553_rt_dataBlockType_t dataBlockType, uint16_t *p_outsizeOfAllocatedDeviceMemory, uint16_t *p_outactualSizeOfDataBlock)
 Gets the size of a data block type.
 
NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_RtDataBlkCreate (int16_t device, int16_t dataBlockId, naibrd_1553_rt_dataBlockType_t dataBlockType, const uint16_t *p_buffer, uint16_t writeCount)
 Creates a RT data block to be used.
 
NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_RtDataBlkGetAddr (int16_t device, int16_t dataBlockId, uint16_t *p_outdeviceMemoryAddress)
 Gets the memory address of the specified RT data block.
 
NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_RtDataBlkDelete (int16_t device, int16_t dataBlockId)
 Deletes a data block represented by the given block id.
 
NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_RtDataBlkWrite (int16_t device, int16_t dataBlockId, const uint16_t *p_buffer, uint16_t writeCount, uint16_t offset)
 Writes data to a user-specified data block.
 
NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_RtDataBlkRead (int16_t device, int16_t dataBlockId, uint16_t *p_outbuffer, uint16_t readCount, uint16_t offset)
 Reads data from a user-specified data block.
 
NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_RtDataBlkMapToSA (int16_t device, int16_t dataBlockId, naibrd_1553_rt_subaddress_t subaddress, naibrd_1553_rt_messageTypes_t messageTypes, naibrd_1553_rt_irqOptions_t irqOptions, uint16_t isSubaddressLegalizationRequested)
 Maps an existing data block to a subaddress.
 
NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_RtDataBlkUnmapFromSA (int16_t device, int16_t dataBlockId, naibrd_1553_rt_subaddress_t subaddress, naibrd_1553_rt_messageTypes_t messageTypes)
 Unmaps a data block from a subaddress.
 
NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_RtTxDataBlkSwap (int16_t device, int16_t dataBlockId, naibrd_1553_rt_subaddress_t subaddress)
 This function swaps the data block that is currently mapped to a given Tx subaddress with the data block given by dataBlockId. This function is especially useful for multiple buffering of Tx messages for a RT to BC or RT to RT commands.
 
NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_RtModeCodeReadDataValue (int16_t device, naibrd_1553_rt_dataContainingModeCode_t dataContainingModeCode, uint16_t *p_outdata)
 Reads data from the Mode Code Data Locations Table.
 
NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_RtModeCodeWriteDataValue (int16_t device, naibrd_1553_rt_dataContainingModeCode_t dataContainingModeCode, uint16_t data)
 Writes data to the Mode Code Data Locations Table.
 

Detailed Description

Function Documentation

◆ naibrd_1553_RtDataBlkCreate()

NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_RtDataBlkCreate ( int16_t device,
int16_t dataBlockId,
naibrd_1553_rt_dataBlockType_t dataBlockType,
const uint16_t * p_buffer,
uint16_t writeCount )

Creates a RT data block to be used.

Parameters
device: (Input) Logical Device Number (0-31).
dataBlockId: (Input) Unique value representing the block id for future use and removal (Must be greater than 0).
dataBlockType: (Input) Type of data block to be allocated.
* 1 - 32
* This value defines the number of words for Single Buffer Mode
*
* NAIBRD_1553_RT_DATABLOCK_DOUBLE        (DDC: ACE_RT_DBLK_DOUBLE)
* Double buffered message datablock 64 words long
*
* NAIBRD_1553_RT_DATABLOCK_CIRCULAR_128  (DDC: ACE_RT_DBLK_C_128)
* Circular buffer 128 words long
*
* NAIBRD_1553_RT_DATABLOCK_CIRCULAR_256  (DDC: ACE_RT_DBLK_C_256)
* Circular buffer 256 words long
*
* NAIBRD_1553_RT_DATABLOCK_CIRCULAR_512  (DDC: ACE_RT_DBLK_C_512)
* Circular buffer 512 words long
*
* NAIBRD_1553_RT_DATABLOCK_CIRCULAR_1024  (DDC: ACE_RT_DBLK_C_1024)
* Circular buffer 1024 words long
*
* NAIBRD_1553_RT_DATABLOCK_CIRCULAR_2048  (DDC: ACE_RT_DBLK_C_2048)
* Circular buffer 2048 words long
*
* NAIBRD_1553_RT_DATABLOCK_CIRCULAR_4096  (DDC: ACE_RT_DBLK_C_4096)
* Circular buffer 4096 words long
*
* NAIBRD_1553_RT_DATABLOCK_CIRCULAR_8192  (DDC: ACE_RT_DBLK_C_8192)
* Circular buffer 8192 words long
* 
p_buffer: (Input) Address of a buffer containing info to be copied to the created data block.
writeCount: (Input) Number of words to be copied from the p_buffer into the created data block. NOTE: Length of p_buffer must be at least as large as writeCount
Returns
  • NAI_SUCCESS when the device has been initialized successfully
  • NAIBRD_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAIBRD_1553_RC_INVALID_MODE when device mode is not set to RT or RT/MT
  • NAIBRD_1553_RC_INVALID_STATE when device is in invalid state
  • NAIBRD_1553_RC_INVALID_PARAMETER when dataBlockId and/or dataBlockType values are invalid, or when writeCount is greater than size of allocated memory
  • NAIBRD_1553_RC_RT_DATA_BLOCK_EXISTS when the specified data block already exists
  • NAIBRD_1553_RC_ALLOCATION_FAIL when memory allocation failed for this data block

◆ naibrd_1553_RtDataBlkDelete()

NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_RtDataBlkDelete ( int16_t device,
int16_t dataBlockId )

Deletes a data block represented by the given block id.

Parameters
device: (Input) Logical Device Number (0-31).
dataBlockId: (Input) Unique value representing the block id for future use and removal (Must be greater than 0).
Returns
  • NAI_SUCCESS when the device has been initialized successfully
  • NAIBRD_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAIBRD_1553_RC_INVALID_MODE when device mode is not set to RT or RT/MT
  • NAIBRD_1553_RC_INVALID_STATE when device is in an invalid state
  • NAIBRD_1553_RC_INVALID_PARAMETER when the value of dataBlockId is invalid
  • NAIBRD_1553_RC_UNDEFINED_NODE when the specified data block with given dataBlockId does not exist

◆ naibrd_1553_RtDataBlkGetAddr()

NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_RtDataBlkGetAddr ( int16_t device,
int16_t dataBlockId,
uint16_t * p_outdeviceMemoryAddress )

Gets the memory address of the specified RT data block.

Parameters
device: (Input) Logical Device Number (0-31).
dataBlockId: (Input) Unique value representing the block id for future use and removal (Must be greater than 0).
p_outdeviceMemoryAddress: (Output) Starting address of the data block in device memory.
Returns
  • NAI_SUCCESS
  • NAIBRD_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAIBRD_1553_RC_INVALID_MODE when device mode is not set to RT or RT/MT
  • NAIBRD_1553_RC_INVALID_STATE when device is in an invalid state
  • NAIBRD_1553_RC_INVALID_PARAMETER when the value of dataBlockId is invalid
  • NAIBRD_1553_RC_UNDEFINED_NODE when the specified data block with given dataBlockId does not exist

◆ naibrd_1553_RtDataBlkGetSize()

NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_RtDataBlkGetSize ( naibrd_1553_rt_dataBlockType_t dataBlockType,
uint16_t * p_outsizeOfAllocatedDeviceMemory,
uint16_t * p_outactualSizeOfDataBlock )

Gets the size of a data block type.

Parameters
dataBlockType: (Input) Type of data block.
* 1 - 32
* This value defines the number of words for Single Buffer Mode
*
* NAIBRD_1553_RT_DATABLOCK_DOUBLE        (DDC: ACE_RT_DBLK_DOUBLE)
* Double buffered message datablock 64 words long
*
* NAIBRD_1553_RT_DATABLOCK_CIRCULAR_128  (DDC: ACE_RT_DBLK_C_128)
* Circular buffer 128 words long
*
* NAIBRD_1553_RT_DATABLOCK_CIRCULAR_256  (DDC: ACE_RT_DBLK_C_256)
* Circular buffer 256 words long
*
* NAIBRD_1553_RT_DATABLOCK_CIRCULAR_512  (DDC: ACE_RT_DBLK_C_512)
* Circular buffer 512 words long
*
* NAIBRD_1553_RT_DATABLOCK_CIRCULAR_1024  (DDC: ACE_RT_DBLK_C_1024)
* Circular buffer 1024 words long
*
* NAIBRD_1553_RT_DATABLOCK_CIRCULAR_2048  (DDC: ACE_RT_DBLK_C_2048)
* Circular buffer 2048 words long
*
* NAIBRD_1553_RT_DATABLOCK_CIRCULAR_4096  (DDC: ACE_RT_DBLK_C_4096)
* Circular buffer 4096 words long
*
* NAIBRD_1553_RT_DATABLOCK_CIRCULAR_8192  (DDC: ACE_RT_DBLK_C_8192)
* Circular buffer 8192 words long
* 
p_outsizeOfAllocatedDeviceMemory: (Output) Size of allocated device memory (in words).
p_outactualSizeOfDataBlock: (Output) Actual size of data block (in words).
Returns
  • NAI_SUCCESS when the device has been initialized successfully
  • NAIBRD_1553_RC_INVALID_PARAMETER when incorrect dataBlockType is specified, or when p_outsizeOfAllocatedDeviceMemory and/or p_outActualSizeOfDataBlock pointers are null

◆ naibrd_1553_RtDataBlkMapToSA()

NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_RtDataBlkMapToSA ( int16_t device,
int16_t dataBlockId,
naibrd_1553_rt_subaddress_t subaddress,
naibrd_1553_rt_messageTypes_t messageTypes,
naibrd_1553_rt_irqOptions_t irqOptions,
uint16_t isSubaddressLegalizationRequested )

Maps an existing data block to a subaddress.

Parameters
device: (Input) Logical Device Number (0-31).
dataBlockId: (Input) Unique user supplied ID of the previously created data block that will be mapped to an SA. The user provided this ID during the creation of the data block with the naibrd_1553_RtDataBlkCreate() function.
subaddress: (Input) Subaddress to be mapped (0-31).
messageTypes: (Input) Description of the message types that will be mapped by this command. This parameter is generated by OR'ing the following message types together:
* NAIBRD_1553_RT_MESSAGE_TYPE_RX         (DDC: ACE_RT_MSGTYPE_RX)
* NAIBRD_1553_RT_MESSAGE_TYPE_TX         (DDC: ACE_RT_MSGTYPE_TX)
* NAIBRD_1553_RT_MESSAGE_TYPE_BROADCAST  (DDC: ACE_RT_MSGTYPE_BCST)
* NAIBRD_1553_RT_MESSAGE_TYPE_ALL        (DDC: ACE_RT_MSGTYPE_ALL)
* 
irqOptions: (Input) This value can be optionally set to generate interrupts due to circular buffer rollover or an end of message. This value can be either 0 or an OR'ed combination of the following:
* NAIBRD_1553_RT_DATABLOCK_IRQ_CIRC_BUFFER     (DDC: ACE_RT_DBLK_CIRC_IRQ)
* NAIBRD_1553_RT_DATABLOCK_IRQ_END_OF_MESSAGE  (DDC: ACE_RT_DBLK_EOM_IRQ)
* 
isSubaddressLegalizationRequested: (Input) If this value is set to 1, then the subaddress being mapped will also be legalized. If 0, the subaddress will not be legalized.
Returns
  • NAI_SUCCESS when the device has been initialized successfully
  • value greater or equal to 1 indicating the dataBlockId that the user-specified subaddress is already associated with.
  • NAIBRD_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAIBRD_1553_RC_INVALID_MODE when device mode is not set to RT or RT/MT
  • NAIBRD_1553_RC_INVALID_STATE when device is in an invalid state
  • NAIBRD_1553_RC_INVALID_PARAMETER when the value of dataBlockId, subaddress, messageTypes and/or irqOptions are invalid
  • NAIBRD_1553_RC_RT_DATA_BLOCK_EXISTS when the data block specified by dataBlockId already exists
  • NAIBRD_1553_RC_RT_DATA_BLOCK_MAPPED when the data block specified by dataBlockId is already mapped

◆ naibrd_1553_RtDataBlkRead()

NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_RtDataBlkRead ( int16_t device,
int16_t dataBlockId,
uint16_t * p_outbuffer,
uint16_t readCount,
uint16_t offset )

Reads data from a user-specified data block.

Parameters
device: (Input) Logical Device Number (0-31).
dataBlockId: (Input) Unique user supplied ID of the previously created data block that will be mapped to an SA. The user provided this ID during the creation of the data block with the naibrd_1553_RtDataBlkCreate() function.
p_outbuffer: (Input) Buffer that contains the data read from the data block.
readCount: (Input) Number of words to be copied from the data block to p_outbuffer. NOTE: Length of p_outbuffer must be at least as large as readCount
offset: (Input) Offset into data block where the function will start to read the words into p_outbuffer (>= 0).
Returns
  • If successful, this function returns the total number of data words read
  • NAIBRD_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAIBRD_1553_RC_INVALID_MODE when device mode is not set to RT or RT/MT
  • NAIBRD_1553_RC_INVALID_STATE when device is in an invalid state
  • NAIBRD_1553_RC_INVALID_PARAMETER when the value of dataBlockId is invalid
  • NAIBRD_1553_RC_UNDEFINED_NODE when the specified data block with given dataBlockId does not exist

◆ naibrd_1553_RtDataBlkUnmapFromSA()

NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_RtDataBlkUnmapFromSA ( int16_t device,
int16_t dataBlockId,
naibrd_1553_rt_subaddress_t subaddress,
naibrd_1553_rt_messageTypes_t messageTypes )

Unmaps a data block from a subaddress.

Parameters
device: (Input) Logical Device Number (0-31).
dataBlockId: (Input) Unique user supplied ID of the previously created data block.
subaddress: (Input) Subaddress to be unmapped (0-31).
messageTypes: (Input) Description of the message types that will be unmapped by this command. This parameter is generated by OR'ing the following message types together:
* NAIBRD_1553_RT_MESSAGE_TYPE_RX         (DDC: ACE_RT_MSGTYPE_RX)
* NAIBRD_1553_RT_MESSAGE_TYPE_TX         (DDC: ACE_RT_MSGTYPE_TX)
* NAIBRD_1553_RT_MESSAGE_TYPE_BROADCAST  (DDC: ACE_RT_MSGTYPE_BCST)
* NAIBRD_1553_RT_MESSAGE_TYPE_ALL        (DDC: ACE_RT_MSGTYPE_ALL)
* 
Returns
  • NAI_SUCCESS when the device has been initialized successfully
  • NAIBRD_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAIBRD_1553_RC_INVALID_MODE when device mode is not set to RT or RT/MT
  • NAIBRD_1553_RC_INVALID_STATE when device is in an invalid state
  • NAIBRD_1553_RC_INVALID_PARAMETER when the value of dataBlockId, subaddress and/or messageTypes are invalid
  • NAIBRD_1553_RC_UNDEFINED_NODE when the data block specified by dataBlockId does not exist

◆ naibrd_1553_RtDataBlkWrite()

NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_RtDataBlkWrite ( int16_t device,
int16_t dataBlockId,
const uint16_t * p_buffer,
uint16_t writeCount,
uint16_t offset )

Writes data to a user-specified data block.

Parameters
device: (Input) Logical Device Number (0-31).
dataBlockId: (Input) Unique user supplied ID of the previously created data block that will be mapped to an SA. The user provided this ID during the creation of the data block with the naibrd_1553_RtDataBlkCreate() function.
p_buffer: (Input) Buffer that contains the data to be written to the data block.
writeCount: (Input) Number of words to be copied from p_buffer to the data block. NOTE: Length of p_buffer must be at least as large as writeCount
offset: (Input) Offset into data block where the function will start to write the words from p_buffer (>= 0).
Returns
  • NAI_SUCCESS when the device has been initialized successfully
  • NAIBRD_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAIBRD_1553_RC_INVALID_MODE when device mode is not set to RT or RT/MT
  • NAIBRD_1553_RC_INVALID_STATE when device is in an invalid state
  • NAIBRD_1553_RC_INVALID_PARAMETER when the value of dataBlockId is invalid or p_buffer is NULL
  • NAIBRD_1553_RC_UNDEFINED_NODE when the specified data block with given dataBlockId does not exist

◆ naibrd_1553_RtModeCodeReadDataValue()

NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_RtModeCodeReadDataValue ( int16_t device,
naibrd_1553_rt_dataContainingModeCode_t dataContainingModeCode,
uint16_t * p_outdata )

Reads data from the Mode Code Data Locations Table.

Parameters
device: (Input) Logical Device Number (0-31).
dataContainingModeCode: (Input) Specify the data containing mode code:
* NAIBRD_1553_RT_MC_DATA_RX_SYNCHRONIZE                       (DDC: ACE_RT_MCDATA_RX_SYNCHRONIZE)
* NAIBRD_1553_RT_MC_DATA_RX_TRANSMITTER_SHUTDOWN              (DDC: ACE_RT_MCDATA_RX_SEL_T_SHUTDWN)
* NAIBRD_1553_RT_MC_DATA_RX_OVERRIDE_TX_SHUTDOWN              (DDC: ACE_RT_MCDATA_RX_OVR_SEL_T_SHUTDWN)
* NAIBRD_1553_RT_MC_DATA_TX_TRANSMIT_VECTOR_WORD              (DDC: ACE_RT_MCDATA_TX_TRNS_VECTOR)
* NAIBRD_1553_RT_MC_DATA_TX_TRANSMIT_LAST_COMMAND_WORD        (DDC: ACE_RT_MCDATA_TX_TRNS_LAST_CMD)
* NAIBRD_1553_RT_MC_DATA_TX_TRANSMIT_BUILT_IN_TEST_WORD       (DDC: ACE_RT_MCDATA_TX_TRNS_BIT)
* NAIBRD_1553_RT_MC_DATA_BCST_SYNCHRONIZE                     (DDC: ACE_RT_MCDATA_BCST_SYNCHRONIZE)
* NAIBRD_1553_RT_MC_DATA_BCST_SELECTED_TX_SHUTDOWN            (DDC: ACE_RT_MCDATA_BCST_SEL_T_SHUTDWN)
* NAIBRD_1553_RT_MC_DATA_BCST_OVERRIDE_SELECTED_TX_SHUTDOWN   (DDC: ACE_RT_MCDATA_BCST_OVR_SEL_T_SHUTDWN)
* 
p_outdata: (Output) Returned data.
Returns
  • NAI_SUCCESS when the device has been initialized successfully
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_1553_RC_INVALID_MODE when device mode is not set to RT or RT/MT
  • NAI_1553_RC_INVALID_STATE when device is in an invalid state
  • NAI_1553_RC_INVALID_PARAMETER when the value of wDataContainingModeCode is invalid and/or the wpData pointer is null

◆ naibrd_1553_RtModeCodeWriteDataValue()

NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_RtModeCodeWriteDataValue ( int16_t device,
naibrd_1553_rt_dataContainingModeCode_t dataContainingModeCode,
uint16_t data )

Writes data to the Mode Code Data Locations Table.

Parameters
device: (Input) Logical Device Number (0-31).
dataContainingModeCode: (Input) Specify the data containing mode code:
* NAIBRD_1553_RT_MC_DATA_RX_SYNCHRONIZE                       (DDC: ACE_RT_MCDATA_RX_SYNCHRONIZE)
* NAIBRD_1553_RT_MC_DATA_RX_TRANSMITTER_SHUTDOWN              (DDC: ACE_RT_MCDATA_RX_SEL_T_SHUTDWN)
* NAIBRD_1553_RT_MC_DATA_RX_OVERRIDE_TX_SHUTDOWN              (DDC: ACE_RT_MCDATA_RX_OVR_SEL_T_SHUTDWN)
* NAIBRD_1553_RT_MC_DATA_TX_TRANSMIT_VECTOR_WORD              (DDC: ACE_RT_MCDATA_TX_TRNS_VECTOR)
* NAIBRD_1553_RT_MC_DATA_TX_TRANSMIT_LAST_COMMAND_WORD        (DDC: ACE_RT_MCDATA_TX_TRNS_LAST_CMD)
* NAIBRD_1553_RT_MC_DATA_TX_TRANSMIT_BUILT_IN_TEST_WORD       (DDC: ACE_RT_MCDATA_TX_TRNS_BIT)
* NAIBRD_1553_RT_MC_DATA_BCST_SYNCHRONIZE                     (DDC: ACE_RT_MCDATA_BCST_SYNCHRONIZE)
* NAIBRD_1553_RT_MC_DATA_BCST_SELECTED_TX_SHUTDOWN            (DDC: ACE_RT_MCDATA_BCST_SEL_T_SHUTDWN)
* NAIBRD_1553_RT_MC_DATA_BCST_OVERRIDE_SELECTED_TX_SHUTDOWN   (DDC: ACE_RT_MCDATA_BCST_OVR_SEL_T_SHUTDWN)
* 
data: (Input) Data to be written.
Returns
  • NAI_SUCCESS when the device has been initialized successfully
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_1553_RC_INVALID_MODE when device mode is not set to RT or RT/MT
  • NAI_1553_RC_INVALID_STATE when device is in an invalid state
  • NAI_1553_RC_INVALID_PARAMETER when the value of wDataContainingModeCode is invalid

◆ naibrd_1553_RtTxDataBlkSwap()

NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_RtTxDataBlkSwap ( int16_t device,
int16_t dataBlockId,
naibrd_1553_rt_subaddress_t subaddress )

This function swaps the data block that is currently mapped to a given Tx subaddress with the data block given by dataBlockId. This function is especially useful for multiple buffering of Tx messages for a RT to BC or RT to RT commands.

Parameters
device: (Input) Logical Device Number (0-31).
dataBlockId: (Input) Unique user supplied ID of an existing data block that will be mapped to the user-specified subaddress, replacing the currently mapped data block.
subaddress: (Input) Tx Subaddress (0-31) to map.
Returns
  • NAI_SUCCESS
  • NAIBRD_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAIBRD_1553_RC_INVALID_MODE when device mode is not set to RT or RT/MT
  • NAIBRD_1553_RC_INVALID_STATE when device is in an invalid state
  • NAIBRD_1553_RC_INVALID_PARAMETER when the values of dataBlockId and/or subaddress are invalid