Software Library API naibrd 1.62
See all documentation at naii.docs.com
Standard Operation Functions

Functions

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_TransmitBuffer (int32_t cardIndex, int32_t module, int32_t channel, int32_t width, const void *buffer, uint32_t count, uint32_t *outwritten)
 Writes multiple bytes of data to the transmit FIFO for the specified Serial channel. The actual number of bytes placed in the buffer may be less than the length desired if the FIFO becomes full. NOTE: Gen5 boards should use a 32 bit data buffer (width=4) instead of a 16 bit buffer (width=2) for performance purposes.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_ReceiveBuffer (int32_t cardIndex, int32_t module, int32_t channel, int32_t width, uint16_t outbuffer[], uint32_t length, uint32_t *outreceived)
 Retrieves multiple bytes of data from the receive FIFO for the specified Serial channel. The number of data elements read may be less than the amount requested if the FIFO goes empty during the read. NOTE: For performance purposes, Gen5 boards should use naibrd_SER_ReceiveBuffer32 instead of this API.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_ReceiveBuffer32 (int32_t cardIndex, int32_t module, int32_t channel, uint32_t outbuffer[], uint32_t length, uint32_t *outreceived)
 Retrieves multiple bytes of data from the receive FIFO for the specified Serial channel. The number of data elements read may be less than the amount requested if the FIFO goes empty during the read. NOTE: This API is recommended over naibrd_SER_ReceiveBuffer() for Gen5 boards for performance purposes.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetHDLCPacket (int32_t cardIndex, int32_t module, int32_t channel, uint16_t outbuffer[], uint32_t length, uint32_t *outreceived, int32_t timeoutms)
 Retrieves the buffer data for the specified serial channel associated with one(1) HDLC packet. When an HDLC packet is received OR the maximum count is read, the function returns. Otherwise, it blocks, waiting for data to be read or for the timeout to be reached. NOTE: This function extracts data from the fifo one element at a time, as opposed to naibrd_SER_ReceiveBuffer32() which extracts all of the data at once. For this reason, this API does not perform as efficiently as naibrd_SER_ReceiveBuffer32().
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetHDLCPacket32 (int32_t cardIndex, int32_t module, int32_t channel, uint32_t outbuffer[], uint32_t length, uint32_t *outreceived, int32_t timeoutms)
 Retrieves the buffer data for the specified serial channel associated with one(1) HDLC packet. When an HDLC packet is received OR the maximum count is read, the function returns. Otherwise, it blocks, waiting for data to be read or for the timeout to be reached. NOTE: This function extracts data from the fifo one element at a time, as opposed to naibrd_SER_ReceiveBuffer32() which extracts all of the data at once. For this reason, this API does not perform as efficiently as naibrd_SER_ReceiveBuffer32().
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetTxBufferCnt (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *outcount)
 Retrieves the number of bytes in the Transmit FIFO for the specified Serial channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetRxBufferCnt (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *outcount)
 Retrieves the number of bytes in the Receive FIFO for specified Serial channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetChannelStatusEx (int32_t cardIndex, int32_t module, int32_t channel, nai_ser_status_access_type_t type, nai_ser_status_t *outchannelStatus)
 Retrieves the status for the specified Serial channel with the output specified as follows:
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_ClearChannelStatusEx (int32_t cardIndex, int32_t module, int32_t channel, uint32_t chanStatus)
 Clears the specified latched Channel Status bits from chanStatus.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetChannelStatus (int32_t cardIndex, int32_t module, nai_ser_status_type_t type, nai_ser_status_t *outchannelStatus)
 Retrieves the status for the specified Serial channel with the output specified as follows:
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_ClearChannelStatus (int32_t cardIndex, int32_t module, nai_ser_status_type_t type, uint32_t chanStatus)
 Clears the specified latched Channel Status bits from chanStatus.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetFifoStatus (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *outfifoStatus)
 Retrieves the FIFO status for the specified Serial channel with the output specified as follows:
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_WriteByte (int32_t cardIndex, int32_t module, int32_t channel, uint8_t byteValue)
 Writes a single byte of data to the transmit FIFO of the specified Serial channel. NOTE: This API is not supported by GEN5 architecture and is replaced with naibrd_SER_TransmitBuffer(). Setting the "count" to 1 and "width" to 2 of naibrd_SER_TransmitBuffer() will mimic the naibrd_SER_WriteByte() API. Place the data in a 16 bit buffer "buffer", even when transmitting a single byte.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_ReadByte (int32_t cardIndex, int32_t module, int32_t channel, nai_ser_statusbyte_t *outstatusByte, uint8_t *outbyteValue)
 Retrieves a byte of data from the receive FIFO for the specified Serial channel. NOTE: This API is not supported by GEN5 architecture and is replaced with naibrd_SER_ReceiveBuffer(). Setting the "count" to 1 and "width" to 2 of naibrd_SER_ReceiveBuffer() will mimic the naibrd_SER_ReadByte() API. The resulting 16 bit data [outbuffer] will have the status in the upper byte and the data in the lower byte.
 

Detailed Description


Function Documentation

◆ naibrd_SER_ClearChannelStatus()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_ClearChannelStatus ( int32_t cardIndex,
int32_t module,
nai_ser_status_type_t type,
uint32_t chanStatus )

Clears the specified latched Channel Status bits from chanStatus.

Note
Only latched statuses can be cleared. Realtime statuses are cleared when their condition no longer exists.
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]).
type: (Input) Status Type: refer to nai_ser_status_type_t definition.
chanStatus: (Input) Mask of Channel Status to clear.
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_SER_ClearChannelStatusEx()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_ClearChannelStatusEx ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t chanStatus )

Clears the specified latched Channel Status bits from chanStatus.

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]).
chanStatus: (Input) Mask of Channel Status to clear.
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_SER_GetChannelStatus()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetChannelStatus ( int32_t cardIndex,
int32_t module,
nai_ser_status_type_t type,
nai_ser_status_t * outchannelStatus )

Retrieves the status for the specified Serial channel with the output specified as follows:

  Parity Error            0x0001
  Rx Buffer Almost Full   0x0002
  CRC Error               0x0004
  Rx Complete (ETX recd)  0x0008
  Rx Data Available       0x0010
  Rx Overrun              0x0020
  High Watermark Reached  0x0040
  Low Watermark Reached   0x0080
  Tx Buffer Almost Empty  0x0100
  Tx Complete             0x0200
  TimeOut Occurred        0x0400
  Break Abort             0x0800
  Sync Char Detected      0x1000
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]).
type: (Input) Status Type: refer to nai_ser_status_type_t definition.
outchannelStatus: (Output) Channel Status.
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_SER_GetChannelStatusEx()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetChannelStatusEx ( int32_t cardIndex,
int32_t module,
int32_t channel,
nai_ser_status_access_type_t type,
nai_ser_status_t * outchannelStatus )

Retrieves the status for the specified Serial channel with the output specified as follows:

  Parity Error            0x0001
  Rx Buffer Almost Full   0x0002
  CRC Error               0x0004
  Rx Complete (ETX recd)  0x0008
  Rx Data Available       0x0010
  Rx Overrun              0x0020
  High Watermark Reached  0x0040
  Low Watermark Reached   0x0080
  Tx Buffer Almost Empty  0x0100
  Tx Complete             0x0200
  TimeOut Occurred        0x0400
  Break Abort             0x0800
  Sync Char Detected      0x1000
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]).
type: (Input) The status access type to read.
outchannelStatus: (Output) Channel Status.
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_SER_GetFifoStatus()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetFifoStatus ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t * outfifoStatus )

Retrieves the FIFO status for the specified Serial channel with the output specified as follows:

  RxFIFO Almost Full     0x0001
  TxFIFO Almost Empty    0x0002
  High Watermark Reached 0x0004
  Low Watermark Reached  0x0008
  Rx Empty               0x0010
  Tx Full                0x0020
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]).
outfifoStatus: (Output) FIFO status.
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_SER_GetHDLCPacket()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetHDLCPacket ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint16_t outbuffer[],
uint32_t length,
uint32_t * outreceived,
int32_t timeoutms )

Retrieves the buffer data for the specified serial channel associated with one(1) HDLC packet. When an HDLC packet is received OR the maximum count is read, the function returns. Otherwise, it blocks, waiting for data to be read or for the timeout to be reached. NOTE: This function extracts data from the fifo one element at a time, as opposed to naibrd_SER_ReceiveBuffer32() which extracts all of the data at once. For this reason, this API does not perform as efficiently as naibrd_SER_ReceiveBuffer32().

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]).
outbuffer: (Output) buffer to store Rx data.
length: (Input) Maximum amount of data expected.
outreceived: (Output) Amount of data successfully copied into 'buffer'.
timeoutms: (Input) maximum time to wait for packet in milliseconds.
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_SER_GetHDLCPacket32()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetHDLCPacket32 ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t outbuffer[],
uint32_t length,
uint32_t * outreceived,
int32_t timeoutms )

Retrieves the buffer data for the specified serial channel associated with one(1) HDLC packet. When an HDLC packet is received OR the maximum count is read, the function returns. Otherwise, it blocks, waiting for data to be read or for the timeout to be reached. NOTE: This function extracts data from the fifo one element at a time, as opposed to naibrd_SER_ReceiveBuffer32() which extracts all of the data at once. For this reason, this API does not perform as efficiently as naibrd_SER_ReceiveBuffer32().

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]).
outbuffer: (Output) buffer to store Rx data.
length: (Input) Maximum amount of data expected.
outreceived: (Output) Amount of data successfully copied into 'buffer'.
timeoutms: (Input) maximum time to wait for packet in milliseconds.
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_SER_GetRxBufferCnt()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetRxBufferCnt ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t * outcount )

Retrieves the number of bytes in the Receive FIFO for specified Serial channel.

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]).
outcount: (Output) Pointer where number of bytes in the receive FIFO is returned.
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_SER_GetTxBufferCnt()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetTxBufferCnt ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t * outcount )

Retrieves the number of bytes in the Transmit FIFO for the specified Serial channel.

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]).
outcount: (Output) Pointer where number of bytes in the transmit FIFO is returned.
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_SER_ReadByte()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_ReadByte ( int32_t cardIndex,
int32_t module,
int32_t channel,
nai_ser_statusbyte_t * outstatusByte,
uint8_t * outbyteValue )

Retrieves a byte of data from the receive FIFO for the specified Serial channel. NOTE: This API is not supported by GEN5 architecture and is replaced with naibrd_SER_ReceiveBuffer(). Setting the "count" to 1 and "width" to 2 of naibrd_SER_ReceiveBuffer() will mimic the naibrd_SER_ReadByte() API. The resulting 16 bit data [outbuffer] will have the status in the upper byte and the data in the lower byte.

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]).
outstatusByte: (Output) Status associated with the byte data.
outbyteValue: (Output) Data byte to read.
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_EMPTY when the fifo is empty.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_SER_ReceiveBuffer()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_ReceiveBuffer ( int32_t cardIndex,
int32_t module,
int32_t channel,
int32_t width,
uint16_t outbuffer[],
uint32_t length,
uint32_t * outreceived )

Retrieves multiple bytes of data from the receive FIFO for the specified Serial channel. The number of data elements read may be less than the amount requested if the FIFO goes empty during the read. NOTE: For performance purposes, Gen5 boards should use naibrd_SER_ReceiveBuffer32 instead of this API.

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]).
width: (Input) The width of the elements in data, in bytes
outbuffer: (Output) Buffer to store Rx data.
length: (Input) Maximum amount of data expected.
outreceived: (Output) Amount of data read from the fifo.
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_EMPTY when the fifo is empty.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_SER_ReceiveBuffer32()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_ReceiveBuffer32 ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t outbuffer[],
uint32_t length,
uint32_t * outreceived )

Retrieves multiple bytes of data from the receive FIFO for the specified Serial channel. The number of data elements read may be less than the amount requested if the FIFO goes empty during the read. NOTE: This API is recommended over naibrd_SER_ReceiveBuffer() for Gen5 boards for performance purposes.

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]).
outbuffer: (Output) Buffer to store Rx data.
length: (Input) Maximum amount of data expected.
outreceived: (Output) Amount of data read from the fifo.
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_EMPTY when the fifo is empty.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.
  • NAI_ERROR_MORE_DATA when there is data remaining in the fifo after the read is complete.

◆ naibrd_SER_TransmitBuffer()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_TransmitBuffer ( int32_t cardIndex,
int32_t module,
int32_t channel,
int32_t width,
const void * buffer,
uint32_t count,
uint32_t * outwritten )

Writes multiple bytes of data to the transmit FIFO for the specified Serial channel. The actual number of bytes placed in the buffer may be less than the length desired if the FIFO becomes full. NOTE: Gen5 boards should use a 32 bit data buffer (width=4) instead of a 16 bit buffer (width=2) for performance purposes.

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]).
width: (Input) Width in bytes of the data being transmitted (2 (16bit) or 4 (32bit) only. 1 (byte) is not supported) .
buffer: (Input) Data buffer to write to the serial Tx buffer.
count: (Input) Amount of data to write.
outwritten: (Output) Amount of data successfully written.
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_FULL when the fifo is full and not all the data can be written to the fifo.
  • NAI_ERROR_INVALID_VALUE when a value for width is not 2 or 4.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_SER_WriteByte()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_WriteByte ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint8_t byteValue )

Writes a single byte of data to the transmit FIFO of the specified Serial channel. NOTE: This API is not supported by GEN5 architecture and is replaced with naibrd_SER_TransmitBuffer(). Setting the "count" to 1 and "width" to 2 of naibrd_SER_TransmitBuffer() will mimic the naibrd_SER_WriteByte() API. Place the data in a 16 bit buffer "buffer", even when transmitting a single byte.

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]).
byteValue: (Input) Data byte to write.
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_FULL when the fifo is full and the data cannot be written to the fifo.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.