Software Library API naibrd 2.24.0
See all documentation at naii.docs.com

Functions

static int32_t GetChannelCount (uint32_t modId)
 Returns the number of CAN channels for the specified Module ID.
 
static int32_t GetMaxPayloadCountForProtocol (naibrd_ar_can_protocol_type_t protocol)
 Returns the maximum payload count for specified protocol.
 
static int32_t GetMaxFifoCount (uint32_t modId)
 Returns the maximum size the CAN Fifo's can hold.
 
static int32_t GetFrameMinByteCount (uint32_t modId)
 Returns the Minimum CAN frame count for the specified Module ID.
 
static int32_t GetMaxFilterCount (uint32_t modId)
 Returns the maximum number of filters that can be configured for the given Module ID.
 
static nai_status_t verify_channel (uint32_t modId, int32_t channel)
 Returns whether the given channel (1-based) is valid for the specified Module ID.
 
static nai_status_t naibrd_WaitForCanControlOptionToFinish (int32_t cardIndex, int32_t module, int32_t channel, bool_t checkConfigEdit, uint32_t controlBitsToWaitOn)
 Performs wait logic for CAN control options. Each control option request bit is set to a one (1) requesting an action to take place. When the task is finished, the bits are set back to a zero (0).
 
static nai_status_t GetCmdBufferAddress (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *p_cmdBufferAddr)
 Returns what address to use for the Cmd Fifo. Newer baremetal implementations have a separate Cmd Fifo while previous versions made use of the Tx Fifo.
 
static nai_status_t GetCmdBufferCountAddress (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *p_cmdBufferCountAddr)
 Returns what address to use for the Cmd Fifo Count. Newer baremetal implementations have a separate Cmd Fifo while previous versions made use of the Tx Fifo.
 
static nai_status_t ResetCmdFifoIfNotEmpty (int32_t cardIndex, int32_t module, int32_t channel)
 Resets the cmd FIFO to make sure.
 
NAIBRDFUNC int32_t NAIAPI naibrd_AR_CAN_GetChannelCount (uint32_t modId)
 Returns the number of channels for the specified CAN Module ID.
 
NAIBRDFUNC int32_t NAIAPI naibrd_AR_CAN_GetChannelCountForModule (uint32_t cardIndex, uint32_t module)
 Returns the number of channels for the specified card and CAN Module Index.
 
NAIBRDFUNC int32_t NAIAPI naibrd_AR_CAN_GetMaxFifoCount (uint32_t modId)
 Returns the max Fifo count for the specified CAN Module ID.
 
NAIBRDFUNC int32_t NAIAPI naibrd_AR_CAN_GetMinFrameByteCount (uint32_t modId)
 Returns the minimum frame byte count for the specified CAN Module ID.
 

Detailed Description

Function Documentation

◆ GetChannelCount()

static int32_t GetChannelCount ( uint32_t modId)
static

Returns the number of CAN channels for the specified Module ID.

Parameters
modId: (Input) CAN Module ID
Returns
  • Number of channels for the Module ID.

◆ GetCmdBufferAddress()

static nai_status_t GetCmdBufferAddress ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t * p_cmdBufferAddr )
static

Returns what address to use for the Cmd Fifo. Newer baremetal implementations have a separate Cmd Fifo while previous versions made use of the Tx 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]).
p_cmdBufferAddr: (Output) Address to be used to access Cmd Fifo.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_NOT_SUPPORTED
  • NAI_ERROR_NOT_OPEN
  • NAI_ERROR_TIMEOUT
  • NAI_ERROR_INVALID_VALUE

◆ GetCmdBufferCountAddress()

static nai_status_t GetCmdBufferCountAddress ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t * p_cmdBufferCountAddr )
static

Returns what address to use for the Cmd Fifo Count. Newer baremetal implementations have a separate Cmd Fifo while previous versions made use of the Tx 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]).
p_cmdBufferCountAddr: (Output) Address to be used to access Cmd Fifo Count.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_NOT_SUPPORTED
  • NAI_ERROR_NOT_OPEN
  • NAI_ERROR_TIMEOUT
  • NAI_ERROR_INVALID_VALUE

◆ GetFrameMinByteCount()

static int32_t GetFrameMinByteCount ( uint32_t modId)
static

Returns the Minimum CAN frame count for the specified Module ID.

Parameters
modId: (Input) CAN Module ID
Returns
  • Minimum CAN frame count in bytes for the specified Module ID.

◆ GetMaxFifoCount()

static int32_t GetMaxFifoCount ( uint32_t modId)
static

Returns the maximum size the CAN Fifo's can hold.

Parameters
modId: (Input) CAN Module ID
Returns
  • Number of entries at which the Fifo is considered to be full.

◆ GetMaxFilterCount()

static int32_t GetMaxFilterCount ( uint32_t modId)
static

Returns the maximum number of filters that can be configured for the given Module ID.

Parameters
modId: (Input) CAN Module ID
Returns
  • Maximum number of filters that can be configured for given Module ID.

◆ GetMaxPayloadCountForProtocol()

static int32_t GetMaxPayloadCountForProtocol ( naibrd_ar_can_protocol_type_t protocol)
static

Returns the maximum payload count for specified protocol.

Parameters
protocol: (Input) Protocol of which to get maximum payload count for
Returns
  • Maximum payload count for given protocol

◆ naibrd_AR_CAN_GetChannelCount()

NAIBRDFUNC int32_t NAIAPI naibrd_AR_CAN_GetChannelCount ( uint32_t modId)

Returns the number of channels for the specified CAN Module ID.

Parameters
modId: (Input) CAN Module ID
Returns
  • Number of channels for the Module ID.

◆ naibrd_AR_CAN_GetChannelCountForModule()

NAIBRDFUNC int32_t NAIAPI naibrd_AR_CAN_GetChannelCountForModule ( uint32_t cardIndex,
uint32_t module )

Returns the number of channels for the specified card and CAN Module Index.

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]).
Returns
  • Number of channels for the Module Index.

◆ naibrd_AR_CAN_GetMaxFifoCount()

NAIBRDFUNC int32_t NAIAPI naibrd_AR_CAN_GetMaxFifoCount ( uint32_t modId)

Returns the max Fifo count for the specified CAN Module ID.

Parameters
modId: (Input) CAN Module ID
Returns
  • Max Fifo count for the Module ID.

◆ naibrd_AR_CAN_GetMinFrameByteCount()

NAIBRDFUNC int32_t NAIAPI naibrd_AR_CAN_GetMinFrameByteCount ( uint32_t modId)

Returns the minimum frame byte count for the specified CAN Module ID.

Parameters
modId: (Input) CAN Module ID
Returns
  • Frame count for the Module ID.

◆ naibrd_WaitForCanControlOptionToFinish()

static nai_status_t naibrd_WaitForCanControlOptionToFinish ( int32_t cardIndex,
int32_t module,
int32_t channel,
bool_t checkConfigEdit,
uint32_t controlBitsToWaitOn )
static

Performs wait logic for CAN control options. Each control option request bit is set to a one (1) requesting an action to take place. When the task is finished, the bits are set back to a zero (0).

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]).
checkConfigEdit: (Input) NAI_TRUE indicates to only attempt to wait if the control bit signaling editing configuration is not set.
controlBitsToWaitOn: (Input) Control Bits to wait on.
Returns
  • NAI_SUCCESS if specified filter is within a valid range for the specified Module ID.
  • NAI_ERROR_TIMEOUT if the control bits are not set back to zero in the time we are willing to wait.

◆ ResetCmdFifoIfNotEmpty()

static nai_status_t ResetCmdFifoIfNotEmpty ( int32_t cardIndex,
int32_t module,
int32_t channel )
static

Resets the cmd FIFO to make sure.

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_NOT_SUPPORTED
  • NAI_ERROR_NOT_OPEN
  • NAI_ERROR_TIMEOUT
  • NAI_ERROR_INVALID_VALUE

◆ verify_channel()

static nai_status_t verify_channel ( uint32_t modId,
int32_t channel )
static

Returns whether the given channel (1-based) is valid for the specified Module ID.

Parameters
modId: (Input) CAN Module ID
channel: (Input) Channel Number of the channel to access (1 - [max channels for module]).
Returns
  • NAI_SUCCESS if channel value is within a valid range for the specified Module ID.
  • NAI_ERROR_INVALID_VALUE if channel value is not within a valid range for the specified Module ID.