Software Library API naibrd 2.24.0
See all documentation at naii.docs.com
|
Functions | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_SER_SetCommProtocol (int32_t cardIndex, int32_t module, int32_t channel, naibrd_ser_protocol_t protocol) |
Sets the protocol for the specified Serial channel specified as follows: | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_SER_GetCommProtocol (int32_t cardIndex, int32_t module, int32_t channel, naibrd_ser_protocol_t *p_outprotocol) |
Retrieves the protocol for the specified Serial channel specified as follows: | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_SER_SetInterface (int32_t cardIndex, int32_t module, int32_t channel, naibrd_ser_interface_t level) |
Sets interfaceLevel level for the specified Serial channel. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_SER_GetInterface (int32_t cardIndex, int32_t module, int32_t channel, naibrd_ser_interface_t *p_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. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_SER_GetBaudrate (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *p_outbaudRate) |
Retrieves the baud rate for the specified Serial channel. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_SER_SetNumDataBits (int32_t cardIndex, int32_t module, int32_t channel, naibrd_ser_data_bits_t dataBits) |
Sets the Number of Data Bits in the Data Configuration for the specified Serial channel. In sync modes, number of data bits is set to 8 and cannot be changed. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_SER_GetNumDataBits (int32_t cardIndex, int32_t module, int32_t channel, naibrd_ser_data_bits_t *p_outdataBits) |
Retrieves the Number of Data Bits in the Data Configuration for the specified Serial channel. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_SER_SetNumStopBits (int32_t cardIndex, int32_t module, int32_t channel, naibrd_ser_stop_bits_t stopBits) |
Sets the Number of Stop Bits in the Data Configuration for the specified Serial channel. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_SER_GetNumStopBits (int32_t cardIndex, int32_t module, int32_t channel, naibrd_ser_stop_bits_t *p_outstopBits) |
Retrieves the Number of Stop Bits in the Data Configuration for the specified Serial channel. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_SER_SetSyncClockMode (int32_t cardIndex, int32_t module, int32_t channel, naibrd_ser_clock_mode_t clockMode) |
Sets the clock mode (Sync/HDLC only) for the specified Serial channel. Clock mode can be either Internal (module drives clock) or External (module is receiving a clock). | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_SER_GetSyncClockMode (int32_t cardIndex, int32_t module, int32_t channel, naibrd_ser_clock_mode_t *p_outclockMode) |
Retrieves the clock mode (Sync/HDLC only) for the specified Serial channel. Clock mode can be either Internal (module drives clock) or External (module is receiving a clock). | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_SER_SetParityType (int32_t cardIndex, int32_t module, int32_t channel, naibrd_ser_parity_t parity) |
Sets the Parity in the Data Configuration register for the specified Serial channel. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_SER_GetParityType (int32_t cardIndex, int32_t module, int32_t channel, naibrd_ser_parity_t *p_outparity) |
Retrieves the Parity in the Data Configuration register for the specified Serial channel. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_SER_SetEncoding (int32_t cardIndex, int32_t module, int32_t channel, naibrd_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, naibrd_ser_encoding_t *p_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 *p_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 Full 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 *p_outcount) |
Retrieves the watermark for the Transmit Buffer Almost Full 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 *p_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 *p_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 *p_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 *p_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 *p_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 *p_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 *p_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 *p_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 Async 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. The timeout is initialized to 40,000 (1 second). | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_SER_GetTimeout (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *p_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. The timeout is initialized to 40,000 (1 second). | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_SER_GetRxBufferSize (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *p_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 *p_outtxSize) |
Retrieves the size (in bytes) of the Transmit FIFO for the specified Serial channel. | |
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetBaudrate | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
uint32_t * | p_outbaudRate ) |
Retrieves the baud rate for the specified Serial channel.
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]). |
p_outbaudRate | : (Output) Baud rate. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetCommProtocol | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
naibrd_ser_protocol_t * | p_outprotocol ) |
Retrieves the protocol for the specified Serial channel specified as follows:
0 - ASYNC 1 - MONO-SYNC 2 - BI-SYNC 3 - HDLC 16 - ASYNC / GPO 32 - ASYNC / GPI
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]). |
p_outprotocol | : (Output) Serial Protocol. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetEncoding | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
naibrd_ser_encoding_t * | p_outencoding ) |
Retrieves the Encoding in the Data Configuration for the specified Serial channel.
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]). |
p_outencoding | : (Output) Encoding. (Refer to naibrd_ser_encoding_t) |
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetInterface | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
naibrd_ser_interface_t * | p_outlevel ) |
Retrieves interface level for the specified Serial channel.
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]). |
p_outlevel | : (Output)Interface level: refer to nai_ser_interface_t definition. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetNumDataBits | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
naibrd_ser_data_bits_t * | p_outdataBits ) |
Retrieves the Number of Data Bits in the Data Configuration for the specified Serial channel.
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]). |
p_outdataBits | : (Output) Number of Data Bits (5, 6, 7, 8, or 9). |
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetNumStopBits | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
naibrd_ser_stop_bits_t * | p_outstopBits ) |
Retrieves the Number of Stop Bits in the Data Configuration for the specified Serial channel.
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]). |
p_outstopBits | : (Output) Number of Stop Bits that are set (1 or 2). |
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetParityType | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
naibrd_ser_parity_t * | p_outparity ) |
Retrieves the Parity in the Data Configuration register for the specified Serial channel.
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]). |
p_outparity | : (Output) Parity, one of the following parity options: None Space Odd Even Mark |
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetPreamble | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
uint32_t * | p_outpreamble ) |
Retrieves the Preamble for the specified Serial channel.
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]). |
p_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 |
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetRxBufferAlmostFull | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
uint32_t * | p_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.
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]). |
p_outcount | : (Output) Watermark (0 - [GetMaxFifoCount() for module ID]). |
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetRxBufferHiWatermark | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
uint32_t * | p_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.
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]). |
p_outcount | : (Output) Receive Buffer High Watermark (Low Watermark - [GetMaxFifoCount() for module ID]). |
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetRxBufferLoWatermark | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
uint32_t * | p_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.
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]). |
p_outcount | : (Output) Receive Buffer Low Watermark (0 - High Watermark). |
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetRxBufferSize | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
uint32_t * | p_outrxSize ) |
Retrieves the size (in bytes) of the Receive FIFO for the specified Serial channel.
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]). |
p_outrxSize | : (Output) Pointer where size (in bytes) of the receive FIFO is returned. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetRxHdlcAddrsSyncChar | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
uint32_t * | p_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.
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]). |
p_outsyncChar | : (Output) HDLC Address/Sync Character. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetSyncClockMode | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
naibrd_ser_clock_mode_t * | p_outclockMode ) |
Retrieves the clock mode (Sync/HDLC only) for the specified Serial channel. Clock mode can be either Internal (module drives clock) or External (module is receiving a clock).
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]). |
p_outclockMode | : (Output) Clock Mode, Internal or External. OR'd combinations of inverted TX/RX also possible. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetTerminationChar | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
uint8_t * | p_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.
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]). |
p_outtermChar | : (Output) Termination Character (0-255). |
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetTimeout | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
uint32_t * | p_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. The timeout is initialized to 40,000 (1 second).
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]). |
p_outtimeout | : (Output) Timeout. (0-65535) (LSB = is 25 us). |
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetTxBufferAlmostEmpty | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
uint32_t * | p_outcount ) |
Retrieves the watermark for the Transmit Buffer Almost Full 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.
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]). |
p_outcount | : (Output) Watermark (0 - [GetMaxFifoCount() for module ID]). |
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetTxBufferSize | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
uint32_t * | p_outtxSize ) |
Retrieves the size (in bytes) of the Transmit FIFO for the specified Serial channel.
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]). |
p_outtxSize | : (Output) Pointer where size (in bytes) of the transmit FIFO is returned. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetTxHdlcAddrsSyncChar | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
uint32_t * | p_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.
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]). |
p_outsyncChar | : (Output) HDLC Address/Sync Character. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetXoffChar | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
uint8_t * | p_outxoffChar ) |
Retrieves the XOFF Character for in-band flow control when in Async mode for the specified Serial channel.
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]). |
p_outxoffChar | : (Output) XOFF Character (0-255). |
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_GetXonChar | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
uint8_t * | p_outxonChar ) |
Retrieves the XON Character for in-band flow control when in Async mode for the specified Serial channel.
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]). |
p_outxonChar | : (Output) XON Character (0-255). |
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.
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. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetCommProtocol | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
naibrd_ser_protocol_t | protocol ) |
Sets the protocol for the specified Serial channel specified as follows:
0 - ASYNC 1 - MONO-SYNC 2 - BI-SYNC 3 - HDLC 16 - ASYNC / GPO 32 - ASYNC / GPI
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. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetEncoding | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
naibrd_ser_encoding_t | encoding ) |
Sets the Encoding in the Data Configuration for the specified Serial channel.
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. (Refer to naibrd_ser_encoding_t) |
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetInterface | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
naibrd_ser_interface_t | level ) |
Sets interfaceLevel level for the specified Serial channel.
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, one of the following interfaces (refer to naibrd_ser_interface_t) NAIBRD_SER_INTF_RS232 NAIBRD_SER_INTF_RS422 NAIBRD_SER_INTF_RS485 NAIBRD_SER_INTF_LOOPBACK NAIBRD_SER_INTF_TRISTATE NAIBRD_SER_INTF_RS423 NAIBRD_SER_INTF_FPGA_LOOPBACK NAIBRD_SER_INTF_GPIO |
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetNumDataBits | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
naibrd_ser_data_bits_t | dataBits ) |
Sets the Number of Data Bits in the Data Configuration for the specified Serial channel. In sync modes, number of data bits is set to 8 and cannot be changed.
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). |
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetNumStopBits | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
naibrd_ser_stop_bits_t | stopBits ) |
Sets the Number of Stop Bits in the Data Configuration for the specified Serial channel.
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). |
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetParityType | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
naibrd_ser_parity_t | parity ) |
Sets the Parity in the Data Configuration register for the specified Serial channel.
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, refer to naibrd_ser_parity_t, one of the following parity options: None Space Odd Even Mark |
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.
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 (D7 - D0) describes the preamble pattern. High nibble (D15 - D12) 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. |
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.
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]). |
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.
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]). |
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.
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). |
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.
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. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_SER_SetSyncClockMode | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
naibrd_ser_clock_mode_t | clockMode ) |
Sets the clock mode (Sync/HDLC only) for the specified Serial channel. Clock mode can be either Internal (module drives clock) or External (module is receiving a clock).
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, Internal or External. OR'd combinations of inverted TX/RX also possible. |
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.
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). |
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 Async 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. The timeout is initialized to 40,000 (1 second).
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). |
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 Full 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.
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]). |
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.
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. |
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.
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). |
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.
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). |