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

Functions

NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_StartConfigChanges (int32_t cardIndex, int32_t module, int32_t channel)
 Sets a bit in the control register indicating the user is making configuration changes. Calling this function will force the CAN module to ignore any configuration changes made until such time that the naibrd_CAN_ApplyConfigChanges is called.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_ApplyConfigChanges (int32_t cardIndex, int32_t module, int32_t channel)
 Clears a bit in the control register indicating the user is finished making configuration changes. Calling this function will force the CAN module to once again check and apply any detected changes to the CAN configuration.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_ChannelReset (int32_t cardIndex, int32_t module, int32_t channel)
 Reset the channel specified.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_SetRxEnable (int32_t cardIndex, int32_t module, int32_t channel, bool_t enable)
 Enables or disables Receive for the channel specified.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_GetRxEnable (int32_t cardIndex, int32_t module, int32_t channel, bool_t *outenable)
 Get Receive enable setting for the channel specified.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_SetTxEnable (int32_t cardIndex, int32_t module, int32_t channel, bool_t enable)
 Enables or disables Transmit for the channel specified.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_GetTxEnable (int32_t cardIndex, int32_t module, int32_t channel, bool_t *outenable)
 Get Transmit enable setting for the channel specified.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_SetProtocol (int32_t cardIndex, int32_t module, int32_t channel, nai_can_protocol_type_t protocol)
 naibrd_CAN_SetProtocol sets the CAN protocol to be used for the specified channel. This function is only supported for modules that allow a per channel protocol to be configured (such as the CB3).
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_GetProtocol (int32_t cardIndex, int32_t module, int32_t channel, nai_can_protocol_type_t *protocol)
 naibrd_CAN_GetProtocol gets the CAN protocol being used for the specified channel. Modules such as CB1 will always report a protocol of CAN AB, CB2 will always report a protocol of J1939 and CB3 could potentially be either CAN AB or J1939 depending on how each channel was configured.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_ResetTxFifo (int32_t cardIndex, int32_t module, int32_t channel)
 naibrd_CAN_ResetTxFifo forces the TX FIFO to be emptied without the need to force transmission to empty the FIFO.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_ResetRxFifo (int32_t cardIndex, int32_t module, int32_t channel)
 naibrd_CAN_ResetRxFifo forces the RX FIFO to be emptied without the need to force receiving to empty the FIFO.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_ResetTxAndRxFifos (int32_t cardIndex, int32_t module, int32_t channel)
 naibrd_CAN_ResetTxAndRxFifos forces the TX FIFO and RX FIFO to be emptied without the need to force transmitting and receiving to empty the FIFOs.
 

Detailed Description


Function Documentation

◆ naibrd_CAN_ApplyConfigChanges()

NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_ApplyConfigChanges ( int32_t cardIndex,
int32_t module,
int32_t channel )

Clears a bit in the control register indicating the user is finished making configuration changes. Calling this function will force the CAN module to once again check and apply any detected changes to the CAN configuration.

Parameters
cardIndex: (Input) Logical Card Index assigned to connect 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]).
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_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.
  • NAI_ERROR_TIMEOUT if configuration changes do not finish in time we are willing to wait.

◆ naibrd_CAN_ChannelReset()

NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_ChannelReset ( int32_t cardIndex,
int32_t module,
int32_t channel )

Reset the channel specified.

Parameters
cardIndex: (Input) Logical Card Index assigned to connect 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]).
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_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_CAN_GetProtocol()

NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_GetProtocol ( int32_t cardIndex,
int32_t module,
int32_t channel,
nai_can_protocol_type_t * protocol )

naibrd_CAN_GetProtocol gets the CAN protocol being used for the specified channel. Modules such as CB1 will always report a protocol of CAN AB, CB2 will always report a protocol of J1939 and CB3 could potentially be either CAN AB or J1939 depending on how each channel was configured.

Parameters
cardIndex: (Input) Logical Card Index assigned to connect 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: (Output) CAN protocol channel is currently configured to.
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_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_CAN_GetRxEnable()

NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_GetRxEnable ( int32_t cardIndex,
int32_t module,
int32_t channel,
bool_t * outenable )

Get Receive enable setting for the channel specified.

Parameters
cardIndex: (Input) Logical Card Index assigned to connect 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) TRUE: Enabled, FALSE: Disabled.
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_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_CAN_GetTxEnable()

NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_GetTxEnable ( int32_t cardIndex,
int32_t module,
int32_t channel,
bool_t * outenable )

Get Transmit enable setting for the channel specified.

Parameters
cardIndex: (Input) Logical Card Index assigned to connect 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) TRUE: Enabled, FALSE: Disabled.
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_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_CAN_ResetRxFifo()

NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_ResetRxFifo ( int32_t cardIndex,
int32_t module,
int32_t channel )

naibrd_CAN_ResetRxFifo forces the RX FIFO to be emptied without the need to force receiving to empty the FIFO.

Parameters
cardIndex: (Input) Logical Card Index assigned to connect 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]).
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_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_CAN_ResetTxAndRxFifos()

NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_ResetTxAndRxFifos ( int32_t cardIndex,
int32_t module,
int32_t channel )

naibrd_CAN_ResetTxAndRxFifos forces the TX FIFO and RX FIFO to be emptied without the need to force transmitting and receiving to empty the FIFOs.

Parameters
cardIndex: (Input) Logical Card Index assigned to connect 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]).
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_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_CAN_ResetTxFifo()

NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_ResetTxFifo ( int32_t cardIndex,
int32_t module,
int32_t channel )

naibrd_CAN_ResetTxFifo forces the TX FIFO to be emptied without the need to force transmission to empty the FIFO.

Parameters
cardIndex: (Input) Logical Card Index assigned to connect 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]).
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_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_CAN_SetProtocol()

NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_SetProtocol ( int32_t cardIndex,
int32_t module,
int32_t channel,
nai_can_protocol_type_t protocol )

naibrd_CAN_SetProtocol sets the CAN protocol to be used for the specified channel. This function is only supported for modules that allow a per channel protocol to be configured (such as the CB3).

Parameters
cardIndex: (Input) Logical Card Index assigned to connect 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) CAN protocol to be used for the specified channel
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_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_CAN_SetRxEnable()

NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_SetRxEnable ( int32_t cardIndex,
int32_t module,
int32_t channel,
bool_t enable )

Enables or disables Receive for the channel specified.

Parameters
cardIndex: (Input) Logical Card Index assigned to connect 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) TRUE: Enable, FALSE: Disable.
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_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_CAN_SetTxEnable()

NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_SetTxEnable ( int32_t cardIndex,
int32_t module,
int32_t channel,
bool_t enable )

Enables or disables Transmit for the channel specified.

Parameters
cardIndex: (Input) Logical Card Index assigned to connect 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) TRUE: Enable, FALSE: Disable.
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_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_CAN_StartConfigChanges()

NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_StartConfigChanges ( int32_t cardIndex,
int32_t module,
int32_t channel )

Sets a bit in the control register indicating the user is making configuration changes. Calling this function will force the CAN module to ignore any configuration changes made until such time that the naibrd_CAN_ApplyConfigChanges is called.

Parameters
cardIndex: (Input) Logical Card Index assigned to connect 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]).
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_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.