Software Library API naibrd 1.62
See all documentation at naii.docs.com
|
Functions | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_CAN_GetTxBufferCount (int32_t cardIndex, int32_t module, int32_t channel, int32_t *outcount) |
Get the number of words used in the Tx FIFO. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_CAN_GetRxBufferCount (int32_t cardIndex, int32_t module, int32_t channel, int32_t *outcount) |
Get the number of words used in the Rx FIFO. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_CAN_GetTxFrameCount (int32_t cardIndex, int32_t module, int32_t channel, int32_t *outcount) |
Get the number of frames in the Tx FIFO. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_CAN_GetRxFrameCount (int32_t cardIndex, int32_t module, int32_t channel, int32_t *outcount) |
Get the number of frames in the Rx FIFO. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_CAN_GetTxMessageWaiting (int32_t cardIndex, int32_t module, int32_t channel, bool_t *outmsgwaiting) |
Determine whether or not a Tx message is waiting to be transmitted. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_CAN_GetRxMessageWaiting (int32_t cardIndex, int32_t module, int32_t channel, bool_t *outmsgwaiting) |
Determine whether or not a Rx message is waiting to be transmitted. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_CAN_GetCoreStatus (int32_t cardIndex, int32_t module, int32_t channel, int32_t *outstatus) |
Get the core status of a channel. This is the status of actual CAN core. The meaning of bits having been set high (1) is listed here: BIT 0 = Configuration Mode Indicator (1 = CAN core is in configuration mode. 0 = CAN core is NOT in configuration mode) BIT 1 = Loopback Mode Indicator (1 = CAN core is in loopback mode. 0 = CAN core is NOT in loopback mode) BIT 2 = Sleep Mode Indicator (1 = CAN core is in sleep mode. 0 = CAN core is NOT in sleep mode) BIT 3 = Normal Mode Indicator (1 = CAN core is in normal mode. 0 = CAN core is NOT in normal mode) BIT 4 = Bus Idle Indicator (1 = No bus communication is taking place. 0 = CAN core is either in configuration mode or the bus is busy) BIT 5 = Bus Busy Indicator (1 = CAN core is either receiving a message or transmitting a message. 0 = CAN core is either in configuration mode or the bus is idle) BIT 6 = Error Warning Indicator (1 = Indicates either the Transmit Error counter or the Receive Error counter have count of 96 or greater. 0 indicates neither counter have reached a count of 96) BIT 7 and 8 = Error Status Indicator (00 = Indicates configuration mode and error state is undefined. 01 = Indicates Error Active State. 11 = Indicates Error Passive State. 10 = Indicates Bus Off State) BIT 9 - 31 = RESERVED. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_CAN_GetCommStatus (int32_t cardIndex, int32_t module, int32_t channel, nai_can_comm_status_t *outstatus) |
Get the communication status of a channel. For P6 and PA modules, the valid communication status flags are defined by the nai_can_comm_status_t type (see header file). For Gen_5 modules (CB1, CB2 and CB3), the communication status are 32 bit error codes (not bitmapped). | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_CAN_GetBusStatus (int32_t cardIndex, int32_t module, int32_t channel, int32_t *outstatus) |
Get the bus status of a channel. This indicates the type of error that has occurred on the bus. If more than one error occurs, all relevant error flag bits are set in this outstatus value. Bit meanings are as follows: | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_CAN_GetLastError (int32_t cardIndex, int32_t module, int32_t channel, int32_t *outlasterror) |
Get the last error of a channel. For Gen 3 modules (P6 and PA), the valid error values are defined by the nai_can_error enumeration. For Gen 5 modules (CB1, CB2 and CB3), the valid error values will either be errors as defined in naibrd_CAN_GetBusStatus or naibrd_CAN_GetCommStatus. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_CAN_GetHardwareError (int32_t cardIndex, int32_t module, nai_can_hardware_error_t *outherror) |
Get the hardware error flags as defined by the P6_HARDWARE_ERROR enumeration. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_CAN_GetErrorCount (int32_t cardIndex, int32_t module, int32_t channel, bool_t *outiserrorpassive, int32_t *outrxerrors, int32_t *outtxerrors) |
Get the error statistics for a given channel. | |
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_GetBusStatus | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
int32_t * | outstatus ) |
Get the bus status of a channel. This indicates the type of error that has occurred on the bus. If more than one error occurs, all relevant error flag bits are set in this outstatus value. Bit meanings are as follows:
BIT 0 = CRC Error (1 = Indicates a CRC error has occurred. 0 = Indicates no CRC error) BIT 1 = Form Error (1 = Indicates a form error has occurred. 0 = Indicates no form error) BIT 2 = Stuff Error (1 = Indicates a stuff error has occurred. 0 = Indicates no stuff error) BIT 3 = Bit Error (1 = Indicates a bit error has occurred (received bit is not the same as the transmitted bit). 0 = Indicates no bit error) BIT 4 = Ack Error (1 = Indicates an acknowledgment error has occurred. 0 = Indicates no acknowledgment error) BIT 5 - 31 = RESERVED
enumeration.
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]). |
outstatus | : (Output) Core Status. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_GetCommStatus | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
nai_can_comm_status_t * | outstatus ) |
Get the communication status of a channel. For P6 and PA modules, the valid communication status flags are defined by the nai_can_comm_status_t type (see header file). For Gen_5 modules (CB1, CB2 and CB3), the communication status are 32 bit error codes (not bitmapped).
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]). |
outstatus | : (Output) Communication Status. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_GetCoreStatus | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
int32_t * | outstatus ) |
Get the core status of a channel. This is the status of actual CAN core. The meaning of bits having been set high (1) is listed here: BIT 0 = Configuration Mode Indicator (1 = CAN core is in configuration mode. 0 = CAN core is NOT in configuration mode) BIT 1 = Loopback Mode Indicator (1 = CAN core is in loopback mode. 0 = CAN core is NOT in loopback mode) BIT 2 = Sleep Mode Indicator (1 = CAN core is in sleep mode. 0 = CAN core is NOT in sleep mode) BIT 3 = Normal Mode Indicator (1 = CAN core is in normal mode. 0 = CAN core is NOT in normal mode) BIT 4 = Bus Idle Indicator (1 = No bus communication is taking place. 0 = CAN core is either in configuration mode or the bus is busy) BIT 5 = Bus Busy Indicator (1 = CAN core is either receiving a message or transmitting a message. 0 = CAN core is either in configuration mode or the bus is idle) BIT 6 = Error Warning Indicator (1 = Indicates either the Transmit Error counter or the Receive Error counter have count of 96 or greater. 0 indicates neither counter have reached a count of 96) BIT 7 and 8 = Error Status Indicator (00 = Indicates configuration mode and error state is undefined. 01 = Indicates Error Active State. 11 = Indicates Error Passive State. 10 = Indicates Bus Off State) BIT 9 - 31 = RESERVED.
enumeration.
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]). |
outstatus | : (Output) Core Status. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_GetErrorCount | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
bool_t * | outiserrorpassive, | ||
int32_t * | outrxerrors, | ||
int32_t * | outtxerrors ) |
Get the error statistics for a given channel.
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]). |
outiserrorpassive | : (Output) TRUE: if error is passive, FALSE: if not passive. |
outrxerrors | : (Output) Number of Rx errors. |
outtxerrors | : (Output) Number of Tx errors. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_GetHardwareError | ( | int32_t | cardIndex, |
int32_t | module, | ||
nai_can_hardware_error_t * | outherror ) |
Get the hardware error flags as defined by the P6_HARDWARE_ERROR enumeration.
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]). |
outherror | : (Output) The Last Error. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_GetLastError | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
int32_t * | outlasterror ) |
Get the last error of a channel. For Gen 3 modules (P6 and PA), the valid error values are defined by the nai_can_error enumeration. For Gen 5 modules (CB1, CB2 and CB3), the valid error values will either be errors as defined in naibrd_CAN_GetBusStatus or naibrd_CAN_GetCommStatus.
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]). |
outlasterror | : (Output) The Last Error. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_GetRxBufferCount | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
int32_t * | outcount ) |
Get the number of words used in the Rx FIFO.
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]). |
outcount | : (Output) Number of words currently in the Rx FIFO. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_GetRxFrameCount | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
int32_t * | outcount ) |
Get the number of frames in the Rx FIFO.
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]). |
outcount | : (Output) Number of frames in the Rx FIFO. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_GetRxMessageWaiting | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
bool_t * | outmsgwaiting ) |
Determine whether or not a Rx message is waiting to be transmitted.
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]). |
outmsgwaiting | : (Output) Message waiting (TRUE: message is waiting, FALSE: no message waiting). |
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_GetTxBufferCount | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
int32_t * | outcount ) |
Get the number of words used in the Tx FIFO.
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]). |
outcount | : (Output) Number of words currently in the Tx FIFO. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_GetTxFrameCount | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
int32_t * | outcount ) |
Get the number of frames in the Tx FIFO.
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]). |
outcount | : (Output) Number of frames in the Tx FIFO. |
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_GetTxMessageWaiting | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
bool_t * | outmsgwaiting ) |
Determine whether or not a Tx message is waiting to be transmitted.
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]). |
outmsgwaiting | : (Output) Message waiting (TRUE: message is waiting, FALSE: no message waiting). |