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

Functions

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetProtocol (int32_t cardIndex, int32_t module, int32_t channel, nai_ser_protocol_t protocol)
 Sets the protocol for the specified Serial channel specified as follows:
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetProtocol (int32_t cardIndex, int32_t module, int32_t channel, nai_ser_protocol_t *outprotocol)
 Retrieves the protocol for the specified Serial channel specified as follows:
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetInterfaceLevel (int32_t cardIndex, int32_t module, int32_t channel, nai_ser_interface_t level)
 Sets interface level for the specified Serial channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetInterfaceLevel (int32_t cardIndex, int32_t module, int32_t channel, nai_ser_interface_t *outlevel)
 Retrieves interface level for the specified Serial channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetBaudrate (int32_t cardIndex, int32_t module, int32_t channel, uint32_t baudRate)
 Sets the baud rate for the specified Serial channel. Note: For 16-bit Baud Rate configuration registers, this function always sets the value of the high register before the setting value for low register.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetBaudrate (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *outbaudRate)
 Retrieves the baud rate for the specified Serial channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetClockMode (int32_t cardIndex, int32_t module, int32_t channel, uint32_t clockMode)
 Sets the raw clock mode for the specified Serial channel specified as follows:
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetClockMode (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *outclockMode)
 Retrieves the raw clock mode for the specified Serial channel specified as follows:
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetParity (int32_t cardIndex, int32_t module, int32_t channel, nai_ser_parity_t parity)
 Sets the Parity in the Data Configuration for the specified Serial channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetParity (int32_t cardIndex, int32_t module, int32_t channel, nai_ser_parity_t *outparity)
 Retrieves the Parity in the Data Configuration for the specified Serial channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetDataBits (int32_t cardIndex, int32_t module, int32_t channel, uint8_t dataBits)
 Sets the Number of Data Bits in the Data Configuration for the specified Serial channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetDataBits (int32_t cardIndex, int32_t module, int32_t channel, uint8_t *outdataBits)
 Retrieves the Number of Data Bits in the Data Configuration for the specified Serial channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetStopBits (int32_t cardIndex, int32_t module, int32_t channel, uint8_t stopBits)
 Sets the Number of Stop Bits in the Data Configuration for the specified Serial channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetStopBits (int32_t cardIndex, int32_t module, int32_t channel, uint8_t *outstopBits)
 Retrieves the Number of Stop Bits in the Data Configuration for the specified Serial channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetEncoding (int32_t cardIndex, int32_t module, int32_t channel, nai_ser_encoding_t encoding)
 Sets the Encoding in the Data Configuration for the specified Serial channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetEncoding (int32_t cardIndex, int32_t module, int32_t channel, nai_ser_encoding_t *outencoding)
 Retrieves the Encoding in the Data Configuration for the specified Serial channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetPreamble (int32_t cardIndex, int32_t module, int32_t channel, uint32_t preamble)
 Sets the Preamble for the specified Serial channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetPreamble (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *outpreamble)
 Retrieves the Preamble for the specified Serial channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetTxBufferAlmostEmpty (int32_t cardIndex, int32_t module, int32_t channel, uint32_t count)
 Sets the watermark for the Transmit Buffer Almost Empty for the specified Serial channel. The watermark specifies the minimum size, in bytes, for the transmit buffer before the Tx FIFO Almost Empty Status bit D1 in the FIFO status register is flagged. If the Tx Buffer Almost Empty interrupt is enabled, an interrupt will be generated when the status is set.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetTxBufferAlmostEmpty (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *outcount)
 Retrieves the watermark for the Transmit Buffer Almost Empty for the specified Serial channel. The watermark specifies the minimum size, in bytes, for the transmit buffer before the Tx FIFO Almost Empty Status bit D1 in the FIFO status register is flagged. If the Tx Buffer Almost Empty interrupt is enabled, an interrupt will be generated when the status is set.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetRxBufferAlmostFull (int32_t cardIndex, int32_t module, int32_t channel, uint32_t count)
 Sets the watermark associated with the Rx Buffer Almost Full value for the specified Serial channel. This watermark specifies the maximum size, in bytes, of the receive buffer before the RxFIFO Almost-Full Status bit D0 in the FIFO status register is flagged. If the Rx Buffer Almost Full interrupt is enabled, an interrupt will be generated when the status is set.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetRxBufferAlmostFull (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *outcount)
 Retrieves the watermark associated with the Rx Buffer Almost Full value for the specified Serial channel. This watermark specifies the maximum size, in bytes, of the receive buffer before the RxFIFO Almost-Full Status bit D0 in the FIFO status register is flagged. If the Rx Buffer Almost Full interrupt is enabled, an interrupt will be generated when the status is set.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetRxBufferHiWatermark (int32_t cardIndex, int32_t module, int32_t channel, uint32_t count)
 Sets the Receive Buffer High Watermark value for the specified Serial channel. When Rx Buffer size equals the High Watermark value, the High Watermark Reached Status bit D2 in the FIFO status register is flagged and:
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetRxBufferHiWatermark (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *outcount)
 Retrieves the Receive Buffer High Watermark value for the specified Serial channel. When Rx Buffer size equals the High Watermark value, the High Watermark Reached Status bit D2 in the FIFO status register is flagged and:
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetRxBufferLoWatermark (int32_t cardIndex, int32_t module, int32_t channel, uint32_t count)
 Sets the Receive Buffer Low Watermark value for the specified Serial channel. When the Rx Buffer size is less than the Low Watermark value, FIFO Status bit D3 is flagged and;.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetRxBufferLoWatermark (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *outcount)
 Retrieves the Receive Buffer Low Watermark value for the specified Serial channel. When the Rx Buffer size is less than the Low Watermark value, FIFO Status bit D3 is flagged and;.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetTerminationChar (int32_t cardIndex, int32_t module, int32_t channel, uint8_t termChar)
 Sets Termination Character for the specified Serial channel. The termination character used for termination detection. When using the Asynchronous or Bi-Synchronous modes, the receive data stream is monitored for the occurrence of the termination character. If the interrupt mask for SYNC CHAR DETECTED bit is enabled, when this character is detected, an interrupt is generated.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetTerminationChar (int32_t cardIndex, int32_t module, int32_t channel, uint8_t *outtermChar)
 Retrieves Termination Character for the specified Serial channel. The termination character used for termination detection. When using the Asynchronous or Bi-Synchronous modes, the receive data stream is monitored for the occurrence of the termination character. If the interrupt mask for SYNC CHAR DETECTED bit is enabled, when this character is detected, an interrupt is generated.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetXonChar (int32_t cardIndex, int32_t module, int32_t channel, uint8_t xonChar)
 Sets the XON Character for in-band flow control when in Async mode for the specified Serial channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetXonChar (int32_t cardIndex, int32_t module, int32_t channel, uint8_t *outxonChar)
 Retrieves the XON Character for in-band flow control when in Async mode for the specified Serial channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetXoffChar (int32_t cardIndex, int32_t module, int32_t channel, uint8_t xoffChar)
 Sets the XOFF Character for in-band flow control when in Async mode for the specified Serial channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetXoffChar (int32_t cardIndex, int32_t module, int32_t channel, uint8_t *outxoffChar)
 Retrieves the XOFF Character for in-band flow control when in Async mode for the specified Serial channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetRxHdlcAddrsSyncChar (int32_t cardIndex, int32_t module, int32_t channel, uint32_t syncChar)
 Sets the Receive HDLC Address/Sync Character for the specified Serial channel. The handling of this value is mode dependent. If using HDLC mode, this value is compared to the address in received message and if it's equal, the message is stored in the receive buffer. If using Mono/Bi-Synchronous mode, this value is considered the 'Sync Character' and is used for communication synchronization. The receiver searches incoming data for the Sync Character, once found, communication is synchronized and additional data is valid.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetRxHdlcAddrsSyncChar (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *outsyncChar)
 Retrieves the Receive HDLC Address/Sync Character for the specified Serial channel. The handling of this value is mode dependent. If using HDLC mode, this value is compared to the address in received message and if it's equal, the message is stored in the receive buffer. If using Mono/Bi-Synchronous mode, this value is considered the 'Sync Character' and is used for communication synchronization. The receiver searches incoming data for the Sync Character, once found, communication is synchronized and additional data is valid.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetTxHdlcAddrsSyncChar (int32_t cardIndex, int32_t module, int32_t channel, uint32_t syncChar)
 Sets the Transmit HDLC Address/Sync Character for the specified Serial channel. The handling of this value is mode dependent. If using HDLC mode, this value is prepended to the transmit buffer.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetTxHdlcAddrsSyncChar (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *outsyncChar)
 Retrieves the Transmit HDLC Address/Sync Character for the specified Serial channel. The handling of this value is mode dependent. If using HDLC mode, this value is prepended to the transmit buffer.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetTimeout (int32_t cardIndex, int32_t module, int32_t channel, uint32_t timeout)
 Sets the Time Out Value for the specified Serial channel. When there is no receive line activity for the configured period of time, bit D10 in the Interrupt Status register will be set. If the Time Out Occurred interrupt is enabled, an interrupt will be generated when the status is set.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetTimeout (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *outtimeout)
 Retrieves the Time Out Value for the specified Serial channel. When there is no receive line activity for the configured period of time, bit D10 in the Interrupt Status register will be set. If the Time Out Occurred interrupt is enabled, an interrupt will be generated when the status is set.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetRxBufferSize (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *outRxsize)
 Retrieves the size (in bytes) of the Receive FIFO for the specified Serial channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetTxBufferSize (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *outTxsize)
 Retrieves the size (in bytes) of the Transmit FIFO for the specified Serial channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetTimedSerialConfig (int32_t cardIndex, int32_t module, int32_t channel, uint32_t enable, uint32_t gapTime, uint32_t subBytes, uint32_t frameCount)
 Sets the timed configuration for the specified Timed Serial channel. User can enable/disable timed mode, as well as set frame count, byte count and gap time.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetTimedSerialConfig (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *outenable, uint32_t *outgapTime, uint32_t *outsubBytes, uint32_t *outframeCount)
 Retrieves the timed configuration for the specified Timed Serial channel.
 

Detailed Description


Function Documentation

◆ naibrd_SER_GetBaudrate()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetBaudrate ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t * outbaudRate )

Retrieves the baud rate 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]).
outbaudRate: (Output) Baud rate.
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_GetClockMode()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetClockMode ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t * outclockMode )

Retrieves the raw clock mode for the specified Serial channel specified as follows:

  - P8, PC Module -
  0   -  TXINT_RXINT
  1   -  TXEXT_RXEXT
  - P4 Module -
  0   -  TXRXINT_CLKAINT_CLKBINT
  1   -  TXCLKA_RXINT_CLKBINT
  2   -  TXINT_CLKAINT_RXCLKB
  3   -  TXCLKA_RXCLKA
  4   -  TXCLKB_RXCLKB
  5   -  TXCLKA_RXCLKB
  - PD Module -
  0x10   -  CLOCK_GATE_RTS
  0x20   -  CLOCK_GATE_CTS
  0x40   -  CLOCK_TX_INVERTED
  0x80   -  CLOCK_RX_INVERTED
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]).
outclockMode: (Output) Clock Mode.
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_GetDataBits()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetDataBits ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint8_t * outdataBits )

Retrieves the Number of Data Bits in the Data Configuration 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]).
outdataBits: (Output) Number of Data Bits (5, 6, 7, 8, or 9).
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_GetEncoding()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetEncoding ( int32_t cardIndex,
int32_t module,
int32_t channel,
nai_ser_encoding_t * outencoding )

Retrieves the Encoding in the Data Configuration 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]).
outencoding: (Output) Encoding (0=None, 1=NRZ, 2=NRZI, 4=FM0, 5=FM1, 6=Manchester).
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_GetInterfaceLevel()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetInterfaceLevel ( int32_t cardIndex,
int32_t module,
int32_t channel,
nai_ser_interface_t * outlevel )

Retrieves interface level 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]).
outlevel: (Output)Interface level: refer to nai_ser_interface_t definition.
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_GetParity()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetParity ( int32_t cardIndex,
int32_t module,
int32_t channel,
nai_ser_parity_t * outparity )

Retrieves the Parity in the Data Configuration 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]).
outparity: (Output) Parity (0=none, 1=space, 3=odd, 5=even, 7=mark).
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_GetPreamble()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetPreamble ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t * outpreamble )

Retrieves the Preamble 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]).
outpreamble: (Output) Preamble defined as follows:
  Lower byte describes the preamble pattern.
  High nibble decodes the number of preambles, 1, 2, 4, or 8 as follows:

  D15  D14  D13  D12  # of preambles
  1    0    0    0    1
  1    0    1    0    2
  1    1    0    0    4
  1    1    1    0    8.
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_GetProtocol()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetProtocol ( int32_t cardIndex,
int32_t module,
int32_t channel,
nai_ser_protocol_t * outprotocol )

Retrieves the protocol for the specified Serial channel specified as follows:

  0x0000   -  Asynchronous
  0x0001   -  Mono-Synchronous
  0x0002   -  Bi-Synchronous
  0x0003   -  HDLC
  0x0004   -  PPP-ASYNC
  0x0005   -  EXT_TRANSPARENT
  0x0006   -  RAWSHIFT
  0x0010   -  Asynchronous-GPO (SC3 FPGA rev. >= 001.000 only)
  0x0020   -  Asynchronous-GPI (SC3 FPGA rev. >= 001.000 only)
  0x4000   -  REVERSED_BIT_ORDER
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]).
outprotocol: (Output) Serial Protocol.
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_GetRxBufferAlmostFull()

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

Retrieves the watermark associated with the Rx Buffer Almost Full value for the specified Serial channel. This watermark specifies the maximum size, in bytes, of the receive buffer before the RxFIFO Almost-Full Status bit D0 in the FIFO status register is flagged. If the Rx Buffer Almost Full interrupt is enabled, an interrupt will be generated when the status is set.

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) Watermark (0 - [GetMaxFifoCount() for module ID]).
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_GetRxBufferHiWatermark()

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

Retrieves the Receive Buffer High Watermark value for the specified Serial channel. When Rx Buffer size equals the High Watermark value, the High Watermark Reached Status bit D2 in the FIFO status register is flagged and:

  If XON/XOFF is enabled, XOFF is sent, and/or
  If RTS/CTS is enabled, RTS goes inactive.

The Watermark registers are used for XON/XOFF and/or RTS/CTS flow control. The Receive Buffer High Watermark register value controls when the XOFF character is sent when using software flow control and controls when the RTS signal would be negated when using hardware flow control. For software flow control operation, the XOFF character would be sent once when the number of bytes in the RX FIFO equals the value in the Receive Buffer High Watermark register. Once the XOFF has been sent, it cannot be sent again until the XON character has been sent. The valid state transitions to sending the XOFF character can be either no previous XON/XOFF character sent or a previous XON character sent. There is also a High Watermark Reached interrupt enable/disable bit in the Interrupt Enable Register and a High Watermark Reached bit in the ISR, (Interrupt Status Register). When the High Watermark Reached, and interrupt request will be generated.

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) Receive Buffer High Watermark (Low Watermark - [GetMaxFifoCount() for module ID]).
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_GetRxBufferLoWatermark()

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

Retrieves the Receive Buffer Low Watermark value for the specified Serial channel. When the Rx Buffer size is less than the Low Watermark value, FIFO Status bit D3 is flagged and;.

  If XON/XOFF is enabled, XON is sent, and/or
  If RTS/CTS is enabled, RTS goes active.

The Watermark registers are used for XON/XOFF and/or RTS/CTS flow control. The Receive Buffer Low Watermark register value controls when the XON character is sent when using software flow control and controls when the RTS signal would be asserted when using hardware flow control. For software flow control operation, the XON character would be sent once when the number of bytes in the Rx FIFO equals the value in the Receive Buffer Low Watermark register AND an XOFF character has be sent prior to this XON character. The valid state transition to sending the XON character can only be from the state of a previous XOFF character that has been sent. There is a Low Watermark Reached interrupt enable/disable bit in the Interrupt Enable Register and a Low Watermark Reached bit in the ISR, (Interrupt Status Register). When the Low Watermark Reached, an interrupt request will be generated.

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) Receive Buffer Low Watermark (0 - High Watermark).
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_GetRxBufferSize()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetRxBufferSize ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t * outRxsize )

Retrieves the size (in bytes) of the Receive 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]).
outRxsize: (Output) Pointer where size (in bytes) of 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_GetRxHdlcAddrsSyncChar()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetRxHdlcAddrsSyncChar ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t * outsyncChar )

Retrieves the Receive HDLC Address/Sync Character for the specified Serial channel. The handling of this value is mode dependent. If using HDLC mode, this value is compared to the address in received message and if it's equal, the message is stored in the receive buffer. If using Mono/Bi-Synchronous mode, this value is considered the 'Sync Character' and is used for communication synchronization. The receiver searches incoming data for the Sync Character, once found, communication is synchronized and additional data is valid.

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]).
outsyncChar: (Output) HDLC Address/Sync Character.
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_GetStopBits()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetStopBits ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint8_t * outstopBits )

Retrieves the Number of Stop Bits in the Data Configuration 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]).
outstopBits: (Output) Number of Stop Bits to set (1 or 2).
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_GetTerminationChar()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetTerminationChar ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint8_t * outtermChar )

Retrieves Termination Character for the specified Serial channel. The termination character used for termination detection. When using the Asynchronous or Bi-Synchronous modes, the receive data stream is monitored for the occurrence of the termination character. If the interrupt mask for SYNC CHAR DETECTED bit is enabled, when this character is detected, an interrupt is generated.

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]).
outtermChar: (Output) Termination Character (0-255).
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_GetTimedSerialConfig()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetTimedSerialConfig ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t * outenable,
uint32_t * outgapTime,
uint32_t * outsubBytes,
uint32_t * outframeCount )

Retrieves the timed configuration for the specified Timed 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]).
outenable: (Output) 0 = disable mode, 1 = enable mode.
outgapTime: (Output) Parameter k, gaptime of Timed Serial channel.
outsubBytes: (Output) Parameter m, Bytes/sub of Timed Serial channel.
outframeCount: (Output) Parameter n, sub count of Timed Serial channel.
  - n parameter -
    n sub frame count: 1 to 8 (integer)
  - m parameter -
    m byte sub frame elements: 1 to 1024 (bytes)
  - k parameter -
    k gap time: 0 to 8192 (bytes)
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_GetTimeout()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetTimeout ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t * outtimeout )

Retrieves the Time Out Value for the specified Serial channel. When there is no receive line activity for the configured period of time, bit D10 in the Interrupt Status register will be set. If the Time Out Occurred interrupt is enabled, an interrupt will be generated when the status is set.

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]).
outtimeout: (Output) Timeout. (0-65535) (LSB = is 25 us).
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_GetTxBufferAlmostEmpty()

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

Retrieves the watermark for the Transmit Buffer Almost Empty for the specified Serial channel. The watermark specifies the minimum size, in bytes, for the transmit buffer before the Tx FIFO Almost Empty Status bit D1 in the FIFO status register is flagged. If the Tx Buffer Almost Empty interrupt is enabled, an interrupt will be generated when the status is set.

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) Watermark (0 - [GetMaxFifoCount() for module ID]).
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_GetTxBufferSize()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetTxBufferSize ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t * outTxsize )

Retrieves the size (in bytes) of 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]).
outTxsize: (Output) Pointer where size (in bytes) of 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_GetTxHdlcAddrsSyncChar()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetTxHdlcAddrsSyncChar ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t * outsyncChar )

Retrieves the Transmit HDLC Address/Sync Character for the specified Serial channel. The handling of this value is mode dependent. If using HDLC mode, this value is prepended to the transmit buffer.

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]).
outsyncChar: (Output) HDLC Address/Sync Character.
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_GetXoffChar()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetXoffChar ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint8_t * outxoffChar )

Retrieves the XOFF Character for in-band flow control when in Async mode 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]).
outxoffChar: (Output) XOFF Character (0-255).
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_GetXonChar()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetXonChar ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint8_t * outxonChar )

Retrieves the XON Character for in-band flow control when in Async mode 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]).
outxonChar: (Output) XON Character (0-255).
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_SetBaudrate()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetBaudrate ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t baudRate )

Sets the baud rate for the specified Serial channel. Note: For 16-bit Baud Rate configuration registers, this function always sets the value of the high register before the setting value for low register.

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]).
baudRate: (Input) Baud rate.
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_SetClockMode()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetClockMode ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t clockMode )

Sets the raw clock mode for the specified Serial channel specified as follows:

  - P8, PC Module -
  0   -  TXINT_RXINT
  1   -  TXEXT_RXEXT
  - P4 Module -
  0   -  TXRXINT_CLKAINT_CLKBINT
  1   -  TXCLKA_RXINT_CLKBINT
  2   -  TXINT_CLKAINT_RXCLKB
  3   -  TXCLKA_RXCLKA
  4   -  TXCLKB_RXCLKB
  5   -  TXCLKA_RXCLKB
  - PD Module -
  0x10   -  CLOCK_GATE_RTS
  0x20   -  CLOCK_GATE_CTS
  0x40   -  CLOCK_TX_INVERTED
  0x80   -  CLOCK_RX_INVERTED
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]).
clockMode: (Input) Clock Mode.
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_SetDataBits()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetDataBits ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint8_t dataBits )

Sets the Number of Data Bits in the Data Configuration 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]).
dataBits: (Input) Number of Data Bits (5, 6, 7, 8, or 9).
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_SetEncoding()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetEncoding ( int32_t cardIndex,
int32_t module,
int32_t channel,
nai_ser_encoding_t encoding )

Sets the Encoding in the Data Configuration 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]).
encoding: (Input) Encoding (0=None, 1=NRZ, 2=NRZI, 4=FM0, 5=FM1, 6=Manchester).
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_SetInterfaceLevel()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetInterfaceLevel ( int32_t cardIndex,
int32_t module,
int32_t channel,
nai_ser_interface_t level )

Sets interface level for the specified Serial channel.

Note
SC3 modules with FPGA revision >= 1.0: when selecting RS485, NAI_SER_GEN5_INTF_TERM_RES_DISABLE will be OR'd in to match behavior of the older SC3. While in RS485, to enable the termination resistor, just clear the NAI_SER_GEN5_INTF_TERM_RES_DISABLE bit.
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]).
level: (Input) Interface level: refer to nai_ser_interface_t definition.
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_SetParity()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetParity ( int32_t cardIndex,
int32_t module,
int32_t channel,
nai_ser_parity_t parity )

Sets the Parity in the Data Configuration 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]).
parity: (Input) Parity (0=none, 1=space, 3=odd, 5=even, 7=mark).
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_SetPreamble()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetPreamble ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t preamble )

Sets the Preamble 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]).
preamble: (Input) Preamble defined as follows:
  Lower byte describes the preamble pattern.
  High nibble decodes the number of preambles, 1, 2, 4, or 8 as follows:

  D15  D14  D13  D12  # of preambles
  1    0    0    0    1
  1    0    1    0    2
  1    1    0    0    4
  1    1    1    0    8.
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_SetProtocol()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetProtocol ( int32_t cardIndex,
int32_t module,
int32_t channel,
nai_ser_protocol_t protocol )

Sets the protocol for the specified Serial channel specified as follows:

  0x0000   -  Asynchronous
  0x0001   -  Mono-Synchronous
  0x0002   -  Bi-Synchronous
  0x0003   -  HDLC
  0x0004   -  PPP-ASYNC
  0x0005   -  EXT_TRANSPARENT
  0x0006   -  RAWSHIFT
  0x0010   -  Asynchronous-GPO (SC3 FPGA rev. >= 001.000 only)
  0x0020   -  Asynchronous-GPI (SC3 FPGA rev. >= 001.000 only)
  0x4000   -  REVERSED_BIT_ORDER
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]).
protocol: (Input) Serial Protocol.
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_SetRxBufferAlmostFull()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetRxBufferAlmostFull ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t count )

Sets the watermark associated with the Rx Buffer Almost Full value for the specified Serial channel. This watermark specifies the maximum size, in bytes, of the receive buffer before the RxFIFO Almost-Full Status bit D0 in the FIFO status register is flagged. If the Rx Buffer Almost Full interrupt is enabled, an interrupt will be generated when the status is set.

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]).
count: (Input) Watermark (0 - [GetMaxFifoCount() for module ID]).
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_SetRxBufferHiWatermark()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetRxBufferHiWatermark ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t count )

Sets the Receive Buffer High Watermark value for the specified Serial channel. When Rx Buffer size equals the High Watermark value, the High Watermark Reached Status bit D2 in the FIFO status register is flagged and:

  If XON/XOFF is enabled, XOFF is sent, and/or
  If RTS/CTS is enabled, RTS goes inactive.

The Watermark registers are used for XON/XOFF and/or RTS/CTS flow control. The Receive Buffer High Watermark register value controls when the XOFF character is sent when using software flow control and controls when the RTS signal would be negated when using hardware flow control. For software flow control operation, the XOFF character would be sent once when the number of bytes in the RX FIFO equals the value in the Receive Buffer High Watermark register. Once the XOFF has been sent, it cannot be sent again until the XON character has been sent. The valid state transitions to sending the XOFF character can be either no previous XON/XOFF character sent or a previous XON character sent. There is also a High Watermark Reached interrupt enable/disable bit in the Interrupt Enable Register and a High Watermark Reached bit in the ISR, (Interrupt Status Register). When the High Watermark Reached, and interrupt request will be generated.

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]).
count: (Input) Receive Buffer High Watermark (Low Watermark - [GetMaxFifoCount() for module ID]).
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_SetRxBufferLoWatermark()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetRxBufferLoWatermark ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t count )

Sets the Receive Buffer Low Watermark value for the specified Serial channel. When the Rx Buffer size is less than the Low Watermark value, FIFO Status bit D3 is flagged and;.

  If XON/XOFF is enabled, XON is sent, and/or
  If RTS/CTS is enabled, RTS goes active.

The Watermark registers are used for XON/XOFF and/or RTS/CTS flow control. The Receive Buffer Low Watermark register value controls when the XON character is sent when using software flow control and controls when the RTS signal would be asserted when using hardware flow control. For software flow control operation, the XON character would be sent once when the number of bytes in the Rx FIFO equals the value in the Receive Buffer Low Watermark register AND an XOFF character has be sent prior to this XON character. The valid state transition to sending the XON character can only be from the state of a previous XOFF character that has been sent. There is a Low Watermark Reached interrupt enable/disable bit in the Interrupt Enable Register and a Low Watermark Reached bit in the ISR, (Interrupt Status Register). When the Low Watermark Reached, an interrupt request will be generated.

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]).
count: (Input) Receive Buffer Low Watermark (0 - High Watermark).
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_SetRxHdlcAddrsSyncChar()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetRxHdlcAddrsSyncChar ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t syncChar )

Sets the Receive HDLC Address/Sync Character for the specified Serial channel. The handling of this value is mode dependent. If using HDLC mode, this value is compared to the address in received message and if it's equal, the message is stored in the receive buffer. If using Mono/Bi-Synchronous mode, this value is considered the 'Sync Character' and is used for communication synchronization. The receiver searches incoming data for the Sync Character, once found, communication is synchronized and additional data is valid.

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]).
syncChar: (Input) HDLC Address/Sync Character.
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_SetStopBits()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetStopBits ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint8_t stopBits )

Sets the Number of Stop Bits in the Data Configuration 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]).
stopBits: (Input) Number of Stop Bits to set (1 or 2).
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_SetTerminationChar()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetTerminationChar ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint8_t termChar )

Sets Termination Character for the specified Serial channel. The termination character used for termination detection. When using the Asynchronous or Bi-Synchronous modes, the receive data stream is monitored for the occurrence of the termination character. If the interrupt mask for SYNC CHAR DETECTED bit is enabled, when this character is detected, an interrupt is generated.

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]).
termChar: (Input) Termination Character (0-255).
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_SetTimedSerialConfig()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetTimedSerialConfig ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t enable,
uint32_t gapTime,
uint32_t subBytes,
uint32_t frameCount )

Sets the timed configuration for the specified Timed Serial channel. User can enable/disable timed mode, as well as set frame count, byte count and gap time.

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]).
enable: (Input) 0 = disable mode, 1 = enable mode.
gapTime: (Input) Parameter k, gaptime of Timed Serial channel.
subBytes: (Input) Parameter m, Bytes/sub of Timed Serial channel.
frameCount: (Input) Parameter n, sub count of Timed Serial channel.
  - n parameter -
    n sub frame count: 1 to 8 (integer)
  - m parameter -
    m byte sub frame elements: 1 to 1024 (bytes)
  - k parameter -
    k gap time: 0 to 8192 (bytes)
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_SetTimeout()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetTimeout ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t timeout )

Sets the Time Out Value for the specified Serial channel. When there is no receive line activity for the configured period of time, bit D10 in the Interrupt Status register will be set. If the Time Out Occurred interrupt is enabled, an interrupt will be generated when the status is set.

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]).
timeout: (Input) Timeout. (0-65535) (LSB = is 25 us).
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_SetTxBufferAlmostEmpty()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetTxBufferAlmostEmpty ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t count )

Sets the watermark for the Transmit Buffer Almost Empty for the specified Serial channel. The watermark specifies the minimum size, in bytes, for the transmit buffer before the Tx FIFO Almost Empty Status bit D1 in the FIFO status register is flagged. If the Tx Buffer Almost Empty interrupt is enabled, an interrupt will be generated when the status is set.

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]).
count: (Input) Watermark (0 - [GetMaxFifoCount() for module ID]).
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_SetTxHdlcAddrsSyncChar()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetTxHdlcAddrsSyncChar ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t syncChar )

Sets the Transmit HDLC Address/Sync Character for the specified Serial channel. The handling of this value is mode dependent. If using HDLC mode, this value is prepended to the transmit buffer.

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]).
syncChar: (Input) HDLC Address/Sync Character.
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_SetXoffChar()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetXoffChar ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint8_t xoffChar )

Sets the XOFF Character for in-band flow control when in Async mode 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]).
xoffChar: (Input) XOFF Character (0-255).
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_SetXonChar()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetXonChar ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint8_t xonChar )

Sets the XON Character for in-band flow control when in Async mode 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]).
xonChar: (Input) XON Character (0-255).
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.