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

Functions

NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_BcDataBlkCreate (int16_t device, int16_t dataBlockId, naibrd_1553_bc_dataBlockSize_t dataBlockSize, const uint16_t *p_buffer, uint16_t writeCount)
 Create a BC data block with a unique identifier given by the dataBlockId input parameter. This data block can be used by a BC message and can be 1-32 words long, single or double buffered.
 
NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_BcDataBlkWrite (int16_t device, int16_t dataBlockId, const uint16_t *p_buffer, uint16_t writeCount, uint16_t offset)
 Write to a BC data block.
 
NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_BcDataBlkRead (int16_t device, int16_t dataBlockId, uint16_t *p_outbuffer, uint16_t readCount, uint16_t offset)
 Read a BC data block. If the function completes successfully, the return value is the actual size of the data block.
 
NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_BcDataBlkDelete (int16_t device, int16_t dataBlockId)
 Delete the data block associated with the dataBlockId identifier.
 

Detailed Description

Function Documentation

◆ naibrd_1553_BcDataBlkCreate()

NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_BcDataBlkCreate ( int16_t device,
int16_t dataBlockId,
naibrd_1553_bc_dataBlockSize_t dataBlockSize,
const uint16_t * p_buffer,
uint16_t writeCount )

Create a BC data block with a unique identifier given by the dataBlockId input parameter. This data block can be used by a BC message and can be 1-32 words long, single or double buffered.

Parameters
device: (Input) Logical Device Number (0-31).
dataBlockId: (Input) Unique block ID.
dataBlockSize: (Input) Value representing the size of the data block (1-32, NAIBRD_1553_BC_DATABLOCK_DOUBLE, NAIBRD_1553_BC_DATABLOCK_SINGLE).
p_buffer: (Input) Pointer to data to be loaded upon block creation.
writeCount: (Input) Number of words to be copied from p_buffer to the data block. NOTE: Length of p_buffer must be at at least as large as writeCount
Returns
  • NAI_SUCCESS when function is completed 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 BC
  • NAIBRD_1553_RC_INVALID_STATE when device is in an invalid state
  • NAIBRD_1553_RC_INVALID_PARAMETER when dataBlockId, wDataBlockSize or bufferSize are invalid or the p_outbuffer is null.
  • NAIBRD_1553_RC_BC_OBJECT_ALREADY_EXISTS when a data block with dataBlockId already exists.
  • NAIBRD_1553_RC_ALLOCATION_FAIL when memory allocation for the data block failed.

◆ naibrd_1553_BcDataBlkDelete()

NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_BcDataBlkDelete ( int16_t device,
int16_t dataBlockId )

Delete the data block associated with the dataBlockId identifier.

Parameters
device: (Input) Logical Device Number (0-31).
dataBlockId: (Input) Unique block ID.
Returns
  • NAI_SUCCESS when function is completed 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 BC
  • NAIBRD_1553_RC_INVALID_STATE when device is in an invalid state
  • NAIBRD_1553_RC_INVALID_PARAMETER when an invalid dataBlockId is specified
  • NAIBRD_1553_RC_UNDEFINED_NODE when the data block identified by dataBlockId is not defined
  • NAIBRD_1553_RC_NOT_SUPPORTED when the data block identified by dataBlockId is still in use by a message

◆ naibrd_1553_BcDataBlkRead()

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

Read a BC data block. If the function completes successfully, the return value is the actual size of the data block.

Parameters
device: (Input) Logical Device Number (0-31).
dataBlockId: (Input) Unique block ID.
p_outbuffer: (Output) Pointer to a buffer that will contain the data read from the data block.
readCount: (Input) Number of words to be read from the data block and copied to the p_outbuffer NOTE: Length of p_outbuffer must be at least as large as readCount.
offset: (Input) Starting word index of the data block to read from.
Returns
  • If function is successful, it returns the size of the data block.
  • NAIBRD_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAIBRD_1553_RC_INVALID_MODE when device mode is not set to BC
  • NAIBRD_1553_RC_INVALID_STATE when device is in an invalid state
  • NAIBRD_1553_RC_INVALID_PARAMETER when an invalid dataBlockId, readCount or offset is specified or the p_outbuffer is null
  • NAIBRD_1553_RC_UNDEFINED_NODE when the data block identified by dataBlockId is not defined

◆ naibrd_1553_BcDataBlkWrite()

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

Write to a BC data block.

Parameters
device: (Input) Logical Device Number (0-31).
dataBlockId: (Input) Unique block ID.
p_buffer: (Input) Pointer to data to be loaded into 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) Starting word index of the data block to write to.
Returns
  • NAI_SUCCESS when function is completed 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 BC
  • NAIBRD_1553_RC_INVALID_STATE when device is in an invalid state
  • NAIBRD_1553_RC_INVALID_PARAMETER when an invalid dataBlockId, bufferSize or offset is specified or the p_buffer is null
  • NAIBRD_1553_RC_UNDEFINED_NODE when the data block identified by dataBlockId is not defined