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

Functions

NAIBRDFUNC nai_status_t NAIAPI naibrd_PWM_SetSerialRxClockEdge (int32_t cardIndex, int32_t module, nai_pwm_clock_edge_t clockEdge)
 Sets the receive clock edge used by the PWM RS-422 SDLC serial port. Note, receive and transmit functions will use opposite edges (i.e. Rx Rising Edge, Tx Falling Edge OR Rx Falling Edge, Tx Rising Edge.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PWM_GetSerialRxClockEdge (int32_t cardIndex, int32_t module, nai_pwm_clock_edge_t *p_outclockEdge)
 Retrieves the receive clock edge used by the PWM RS-422 SDLC serial port. Note, receive and transmit functions will use opposite edges (i.e. Rx Rising Edge, Tx Falling Edge OR Rx Falling Edge, Tx Rising Edge.

 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PWM_GetCRCErrorCount (int32_t cardIndex, int32_t module, int32_t *p_outcrcErrorCnt)
 Retrieves the total RS-422 SDLC Serial Receive Data Frame CRC errors detected. Whenever a CRC error is detected within a received data frame, the error counter is incremented while the "CRC Error Count Disable" register is set to FALSE (0). If the count reaches the maximum value, the counter will stop counting and this register will retain the maximum count value until cleared via setting the "CRC Error Count Disable" register to TRUE (0xFFFF). In other words, the value in this register will not roll back to 0 and continue counting when the maximum count is reached.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PWM_GetDataFrameCount (int32_t cardIndex, int32_t module, int32_t *p_outdataFrameCnt)
 Retrieves the total RS-422 SDLC Serial Receive Data Frames detected. Whenever Data Frame is detected the counter is incremented while the "Data Frame Count Disable" register is set to FALSE (0). If the count reaches the maximum value, the counter will stop counting and this register will retain the maximum count value until cleared via setting the "Data Frame Count Disable" register to TRUE (0xFFFF). In other words, the value in this register will not roll back to 0 and continue counting when the maximum count is reached.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PWM_GetDataFrameStatus (int32_t cardIndex, int32_t module, uint32_t *p_outstatus)
 Retrieves the status of the last RS-422 SDLC Serial Data Frame. If a data frame is interrupted for any reason, an error indication shall be written to this register. The register shall retain the status of the last data frame received until another data frame transmission has completed and the new status is available.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PWM_SetCRCErrorCountDisable (int32_t cardIndex, int32_t module, bool_t disable)
 Sets the "CRC Error Count Disable" state. When set to FALSE (0), the RS-422 SDLC Serial Receive Data Frame CRC error count is incremented. When set to TRUE (0xFFFF), the RS-422 SDLC Serial Receive Data Frame CRC error count is cleared to zero (0) and the "RS-422 SDLC Serial Receive Data Frame CRC error count" register remains at the value zero until this register is set to FALSE (0).
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PWM_GetCRCErrorCountDisable (int32_t cardIndex, int32_t module, bool_t *p_outdisable)
 Retrieves the "CRC Error Count Disable" state. When set to FALSE (0), the RS-422 SDLC Serial Receive Data Frame CRC error count is incremented. When set to TRUE (0xFFFF), the RS-422 SDLC Serial Receive Data Frame CRC error count is cleared to zero (0) and the "RS-422 SDLC Serial Receive Data Frame CRC error count" register remains at the value zero until this register is set to FALSE (0).
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PWM_SetDataFrameCountDisable (int32_t cardIndex, int32_t module, bool_t disable)
 Sets the "Data Frame Count Disable" state. When set to FALSE (0), the RS-422 SDLC Serial Receive Data Frame count is incremented. When set to TRUE (0xFFFF), the RS-422 SDLC Serial Receive Data Frame count is cleared to zero (0) and the "RS-422 SDLC Serial Receive Data Frame count" register remains at the value zero until this register is set to FALSE (0).
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PWM_GetDataFrameCountDisable (int32_t cardIndex, int32_t module, bool_t *p_outdisable)
 Retrieves the "Data Frame Count Disable" state. When set to FALSE (0), the RS-422 SDLC Serial Receive Data Frame count is incremented. When set to TRUE (0xFFFF), the RS-422 SDLC Serial Receive Data Frame count is cleared to zero (0) and the "RS-422 SDLC Serial Receive Data Frame count" register remains at the value zero until this register is set to FALSE (0).
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PWM_SetSerialTxMsgConfig (int32_t cardIndex, int32_t module, nai_pwm_tx_msg_config_t txMsgConfig)
 Sets the behavior of the last byte of the TX Data Frame. The last byte may represent either, the Test Bits (defined using naibrd_PWM_SetSerialTestBits()) or the following STATUS REGISTER:
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PWM_GetSerialTxMsgConfig (int32_t cardIndex, int32_t module, nai_pwm_tx_msg_config_t *p_outtxMsgConfig)
 Retrieves the behavior of the last byte of the TX Data Frame. The last byte may represent either, the Test Bits (defined using naibrd_PWM_SetSerialTestBits()) or the following STATUS REGISTER:
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PWM_SetSerialTestBits (int32_t cardIndex, int32_t module, uint32_t testBits)
 Sets values to be transmitted by the RS-422 SDLC interface whenever the ADC reading is enabled to be transmitted via the "ADC Input" and "ADC Source" registers. Only the least significant bits (D3-D0) are transmitted.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PWM_GetSerialTestBits (int32_t cardIndex, int32_t module, uint32_t *p_outtestBits)
 Retrieves values to be transmitted by the RS-422 SDLC interface whenever the ADC reading is enabled to be transmitted via the "ADC Input" and "ADC Source" registers. Only the least significant bits (D3-D0) are transmitted.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PWM_SetSerialTransmitEnable (int32_t cardIndex, int32_t module, bool_t enable)
 Enables or disables the Serial transmission of a frame after receipt of a valid frame.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PWM_GetSerialTransmitEnable (int32_t cardIndex, int32_t module, bool_t *p_outenable)
 Retrieves the Enable state for the the Serial transmission of a frame after receipt of a valid frame.
 

Detailed Description


Function Documentation

◆ naibrd_PWM_GetCRCErrorCount()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PWM_GetCRCErrorCount ( int32_t cardIndex,
int32_t module,
int32_t * p_outcrcErrorCnt )

Retrieves the total RS-422 SDLC Serial Receive Data Frame CRC errors detected. Whenever a CRC error is detected within a received data frame, the error counter is incremented while the "CRC Error Count Disable" register is set to FALSE (0). If the count reaches the maximum value, the counter will stop counting and this register will retain the maximum count value until cleared via setting the "CRC Error Count Disable" register to TRUE (0xFFFF). In other words, the value in this register will not roll back to 0 and continue counting when the maximum count is reached.

Note: Invoke "naibrd_PWM_SetCRCErrorCountDisable" to clear the CRC Error Count.

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]).
p_outcrcErrorCnt: (Output) Total RS-422 SDLC Serial Receive Data Frame CRC Error Count.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_PWM_GetCRCErrorCountDisable()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PWM_GetCRCErrorCountDisable ( int32_t cardIndex,
int32_t module,
bool_t * p_outdisable )

Retrieves the "CRC Error Count Disable" state. When set to FALSE (0), the RS-422 SDLC Serial Receive Data Frame CRC error count is incremented. When set to TRUE (0xFFFF), the RS-422 SDLC Serial Receive Data Frame CRC error count is cleared to zero (0) and the "RS-422 SDLC Serial Receive Data Frame CRC error count" register remains at the value zero until this register is set to FALSE (0).

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]).
p_outdisable: (Output) FALSE to increment Serial CRC Error Count upon detecting CRC error, TRUE to clear the CRC Error Count.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_PWM_GetDataFrameCount()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PWM_GetDataFrameCount ( int32_t cardIndex,
int32_t module,
int32_t * p_outdataFrameCnt )

Retrieves the total RS-422 SDLC Serial Receive Data Frames detected. Whenever Data Frame is detected the counter is incremented while the "Data Frame Count Disable" register is set to FALSE (0). If the count reaches the maximum value, the counter will stop counting and this register will retain the maximum count value until cleared via setting the "Data Frame Count Disable" register to TRUE (0xFFFF). In other words, the value in this register will not roll back to 0 and continue counting when the maximum count is reached.

Note: Invoke "naibrd_PWM_SetDataFrameCountDisable" to clear the Data Frame Count.

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]).
p_outdataFrameCnt: (Output) Total RS-422 SDLC Serial Receive Data Frame Count.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_PWM_GetDataFrameCountDisable()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PWM_GetDataFrameCountDisable ( int32_t cardIndex,
int32_t module,
bool_t * p_outdisable )

Retrieves the "Data Frame Count Disable" state. When set to FALSE (0), the RS-422 SDLC Serial Receive Data Frame count is incremented. When set to TRUE (0xFFFF), the RS-422 SDLC Serial Receive Data Frame count is cleared to zero (0) and the "RS-422 SDLC Serial Receive Data Frame count" register remains at the value zero until this register is set to FALSE (0).

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]).
p_outdisable: (Output) FALSE to increment Serial Data Frame Count, TRUE to clear the Serial Data Frame Count.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_PWM_GetDataFrameStatus()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PWM_GetDataFrameStatus ( int32_t cardIndex,
int32_t module,
uint32_t * p_outstatus )

Retrieves the status of the last RS-422 SDLC Serial Data Frame. If a data frame is interrupted for any reason, an error indication shall be written to this register. The register shall retain the status of the last data frame received until another data frame transmission has completed and the new status is available.

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]).
p_outstatus: (Output) Status of the last RS-422 SDLC Serial Data Frame (0x0000 = Frame Valid and 0xFFFF = Frame Error).
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_PWM_GetSerialRxClockEdge()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PWM_GetSerialRxClockEdge ( int32_t cardIndex,
int32_t module,
nai_pwm_clock_edge_t * p_outclockEdge )

Retrieves the receive clock edge used by the PWM RS-422 SDLC serial port. Note, receive and transmit functions will use opposite edges (i.e. Rx Rising Edge, Tx Falling Edge OR Rx Falling Edge, Tx Rising Edge.

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]).
p_outclockEdge: (Output) NAI_PWM_CLOCK_EDGE_RISING or NAI_PWM_CLOCK_EDGE_FALLING.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_PWM_GetSerialTestBits()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PWM_GetSerialTestBits ( int32_t cardIndex,
int32_t module,
uint32_t * p_outtestBits )

Retrieves values to be transmitted by the RS-422 SDLC interface whenever the ADC reading is enabled to be transmitted via the "ADC Input" and "ADC Source" registers. Only the least significant bits (D3-D0) are transmitted.

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]).
p_outtestBits: (Output) Test Bits to transmit.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_PWM_GetSerialTransmitEnable()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PWM_GetSerialTransmitEnable ( int32_t cardIndex,
int32_t module,
bool_t * p_outenable )

Retrieves the Enable state for the the Serial transmission of a frame after receipt of a valid frame.

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]).
p_outenable: (Input) Enables (1) or Disables (0).
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_INVALID_VALUE when invalid value parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_PWM_GetSerialTxMsgConfig()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PWM_GetSerialTxMsgConfig ( int32_t cardIndex,
int32_t module,
nai_pwm_tx_msg_config_t * p_outtxMsgConfig )

Retrieves the behavior of the last byte of the TX Data Frame. The last byte may represent either, the Test Bits (defined using naibrd_PWM_SetSerialTestBits()) or the following STATUS REGISTER:

D3 = PS Overvoltage or Undervoltage D2 = Drive 2 Fault D1 = Drive 1 Fault D2 = Master Drive Status Switch

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]).
p_outtxMsgConfig: (Output) Value defined in nai_pwm_tx_msg_config_t.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_PWM_SetCRCErrorCountDisable()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PWM_SetCRCErrorCountDisable ( int32_t cardIndex,
int32_t module,
bool_t disable )

Sets the "CRC Error Count Disable" state. When set to FALSE (0), the RS-422 SDLC Serial Receive Data Frame CRC error count is incremented. When set to TRUE (0xFFFF), the RS-422 SDLC Serial Receive Data Frame CRC error count is cleared to zero (0) and the "RS-422 SDLC Serial Receive Data Frame CRC error count" register remains at the value zero until this register is set to FALSE (0).

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]).
disable: (Input) FALSE to increment Serial CRC Error Count upon detecting CRC error, TRUE to clear the CRC Error Count.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_PWM_SetDataFrameCountDisable()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PWM_SetDataFrameCountDisable ( int32_t cardIndex,
int32_t module,
bool_t disable )

Sets the "Data Frame Count Disable" state. When set to FALSE (0), the RS-422 SDLC Serial Receive Data Frame count is incremented. When set to TRUE (0xFFFF), the RS-422 SDLC Serial Receive Data Frame count is cleared to zero (0) and the "RS-422 SDLC Serial Receive Data Frame count" register remains at the value zero until this register is set to FALSE (0).

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]).
disable: (Input) FALSE to increment Serial Data Frame Count, TRUE to clear the Serial Data Frame Count.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_PWM_SetSerialRxClockEdge()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PWM_SetSerialRxClockEdge ( int32_t cardIndex,
int32_t module,
nai_pwm_clock_edge_t clockEdge )

Sets the receive clock edge used by the PWM RS-422 SDLC serial port. Note, receive and transmit functions will use opposite edges (i.e. Rx Rising Edge, Tx Falling Edge OR Rx Falling Edge, Tx Rising Edge.

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]).
clockEdge: (Input) NAI_PWM_CLOCK_EDGE_RISING or NAI_PWM_CLOCK_EDGE_FALLING.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_INVALID_VALUE when invalid value parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_PWM_SetSerialTestBits()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PWM_SetSerialTestBits ( int32_t cardIndex,
int32_t module,
uint32_t testBits )

Sets values to be transmitted by the RS-422 SDLC interface whenever the ADC reading is enabled to be transmitted via the "ADC Input" and "ADC Source" registers. Only the least significant bits (D3-D0) are transmitted.

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]).
testBits: (Input) Test Bits to transmit.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_PWM_SetSerialTransmitEnable()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PWM_SetSerialTransmitEnable ( int32_t cardIndex,
int32_t module,
bool_t enable )

Enables or disables the Serial transmission of a frame after receipt of a valid frame.

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]).
enable: (Input) Enables (1) or Disables (0).
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_PWM_SetSerialTxMsgConfig()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PWM_SetSerialTxMsgConfig ( int32_t cardIndex,
int32_t module,
nai_pwm_tx_msg_config_t txMsgConfig )

Sets the behavior of the last byte of the TX Data Frame. The last byte may represent either, the Test Bits (defined using naibrd_PWM_SetSerialTestBits()) or the following STATUS REGISTER:

D3 = PS Overvoltage or Undervoltage D2 = Drive 2 Fault D1 = Drive 1 Fault D2 = Master Drive Status Switch

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]).
txMsgConfig: (Input) Value defined in nai_pwm_tx_msg_config_t.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.