Software Library API naibrd 1.62
See all documentation at naii.docs.com
|
Functions | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_CAN_QueueTransmit (int32_t cardIndex, int32_t module, int32_t channel, bool_t ismodeA, int32_t msgid, uint8_t *buffer, int32_t length) |
Queues a message to transmit on a CAN A/B channel's Tx FIFO. The message will be sent once the TX_ENABLE bit is set in the channel's control register. If that bit is already set, the message will be transmitted immediately. If the Tx FIFO does not have enough space to hold the message, the function will return immediately with a value of NAI_ERROR_FULL. If the message is longer than NAI_AB_MAX_DATA_LEN, the function will return immediately with a value of NAI_ERROR_INVALID_RANGE. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_CAN_QueueTransmit_Ex (int32_t cardIndex, int32_t module, int32_t channel, bool_t ismodeA, int32_t msgid, uint32_t width, void *buffer, uint32_t length) |
Queues a CAN AB message for transmit on the channels FIFO. The message will be sent once the TX_ENABLE bit is set in the channel's control register. If that bit is already set, the message will be transmitted immediately. If the Tx FIFO does not have enough space to hold the message, the function will return immediately with a value of NAI_ERROR_FULL. If the message is longer than NAI_AB_MAX_DATA_LEN, the function will return immediately with a value of NAI_ERROR_INVALID_RANGE. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_CAN_Transmit (int32_t cardIndex, int32_t module, int32_t channel, bool_t ismodeA, int32_t msgid, uint8_t *buffer, int32_t length) |
Queues a message to transmit on a CAN A/B channel's Tx FIFO, then enables the transmit bit in the channel's control word. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_CAN_Transmit_Ex (int32_t cardIndex, int32_t module, int32_t channel, bool_t ismodeA, int32_t msgid, uint32_t width, void *buffer, uint32_t length) |
Queues a message to transmit on a CAN A/B channel's Tx FIFO, then enables the transmit bit in the channel's control word. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_CAN_Receive (int32_t cardIndex, int32_t module, int32_t channel, int32_t buflen, bool_t *outismodeA, int32_t *outmsgid, uint8_t *outbuffer, int32_t *outlength) |
Attempts to read a message off a CAN A/B channel's Rx FIFO. If there are no messages waiting, this function will return immediately with a value of NAI_ERROR_EMPTY. If the message exceeds the length of the buffer, the function will fill as much as it can, discard the rest of the message, and return NAI_ERROR_MORE_DATA. You can avoid this by passing a buffer of length NAI_AB_MAX_DATA_LEN. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_CAN_Receive_Ex (int32_t cardIndex, int32_t module, int32_t channel, uint32_t buflen, bool_t *outismodeA, int32_t *outmsgid, uint32_t width, void *outbuffer, uint32_t *outlength) |
Reads a CAN AB message off a channel. If there are no messages waiting, this function will return NAI_ERROR_EMPTY. If the format of the message on the fifo is invalid the function will return NAI_ERROR_MISMATCH. If the message exceeds buflen the function will fill as much as it can, discard the rest of the message, and return NAI_ERROR_MORE_DATA. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_CAN_QueueTransmit_J1939 (int32_t cardIndex, int32_t module, int32_t channel, int32_t PGN, int32_t priority, int32_t destination, uint8_t *buffer, int32_t length) |
Queues a message to transmit on a J1939 channel's Tx FIFO. The message will be sent once the TX_ENABLE bit is set in the channel's control register. If that bit is already set, the message will be transmitted immediately. If the Tx FIFO does not have enough space to hold the message, the function will return immediately with a value of NAI_ERROR_FULL. If the message is longer than NAI_J1939_MAX_DATA_LEN, the function will return immediately with a value of NAI_ERROR_INVALID_RANGE. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_CAN_QueueTransmit_J1939_Ex (int32_t cardIndex, int32_t module, int32_t channel, int32_t PGN, int32_t priority, int32_t destination, uint32_t width, void *buffer, uint32_t length) |
Queues a J1939 message, for transmit on the given channel. The message will be sent once the TX_ENABLE bit is set in the channel's control register. If that bit is already set, the message will be transmitted immediately. If the Tx FIFO does not have enough space to hold the message, the function will return immediately with a value of NAI_ERROR_FULL. If the message is longer than NAI_J1939_MAX_DATA_LEN, the function will return immediately with a value of NAI_ERROR_INVALID_RANGE. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_CAN_Transmit_J1939 (int32_t cardIndex, int32_t module, int32_t channel, int32_t PGN, int32_t priority, int32_t destination, uint8_t *buffer, int32_t length) |
Queues a message to transmit on a J1939 channel's Tx FIFO, then enables the transmit bit in the channel's control word. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_CAN_Transmit_J1939_Ex (int32_t cardIndex, int32_t module, int32_t channel, int32_t PGN, int32_t priority, int32_t destination, uint32_t width, void *buffer, uint32_t length) |
Queues a message to transmit on a J1939 channel's Tx FIFO, then enables the transmit bit in the channel's control word. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_CAN_Receive_J1939 (int32_t cardIndex, int32_t module, int32_t channel, int32_t buflen, int32_t *outPGN, int32_t *outsource, int32_t *outdestination, uint8_t *outbuffer, int32_t *outlength) |
Attempts to read a message off a J1939 channel's Rx FIFO. If there are no messages waiting, this function will return immediately with a value of NAI_ERROR_EMPTY. If the message exceeds the length of the buffer, the function will fill as much as it can, discard the rest of the message, and return NAI_ERROR_MORE_DATA. You can avoid this by passing a buffer of length NAI_J1939_MAX_DATA_LEN. | |
NAIBRDFUNC nai_status_t NAIAPI | naibrd_CAN_Receive_J1939_Ex (int32_t cardIndex, int32_t module, int32_t channel, uint32_t buflen, int32_t *outPGN, int32_t *outsource, int32_t *outdestination, uint32_t width, void *outbuffer, uint32_t *outlength) |
Reads a J1939 message off a channel on a gen5 module. If there are no messages waiting, this function will return NAI_ERROR_EMPTY. If the format of the message on the fifo is invalid the function will return NAI_ERROR_MISMATCH. If the message exceeds buflen the function will fill as much as it can, discard the rest of the message, and return NAI_ERROR_MORE_DATA. | |
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_QueueTransmit | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
bool_t | ismodeA, | ||
int32_t | msgid, | ||
uint8_t * | buffer, | ||
int32_t | length ) |
Queues a message to transmit on a CAN A/B channel's Tx FIFO. The message will be sent once the TX_ENABLE bit is set in the channel's control register. If that bit is already set, the message will be transmitted immediately. If the Tx FIFO does not have enough space to hold the message, the function will return immediately with a value of NAI_ERROR_FULL. If the message is longer than NAI_AB_MAX_DATA_LEN, the function will return immediately with a value of NAI_ERROR_INVALID_RANGE.
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]). |
ismodeA | : (Input) Mode (TRUE: CAN-A, FALSE: CAN-B.) |
msgid | : (Input) Message ID (11-bits for CAN-A, 29 bits for CAN-B). |
buffer | : (Input) Pointer to the buffer containing the message. |
length | : (Input) Length of the message (in bytes). |
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_QueueTransmit_Ex | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
bool_t | ismodeA, | ||
int32_t | msgid, | ||
uint32_t | width, | ||
void * | buffer, | ||
uint32_t | length ) |
Queues a CAN AB message for transmit on the channels FIFO. The message will be sent once the TX_ENABLE bit is set in the channel's control register. If that bit is already set, the message will be transmitted immediately. If the Tx FIFO does not have enough space to hold the message, the function will return immediately with a value of NAI_ERROR_FULL. If the message is longer than NAI_AB_MAX_DATA_LEN, the function will return immediately with a value of NAI_ERROR_INVALID_RANGE.
This function provides optimized performance for 32 bit buffer writes.
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]). |
ismodeA | : (Input) Mode (TRUE: CAN-A, FALSE: CAN-B.) |
msgid | : (Input) Message ID (11-bits for CAN-A, 29 bits for CAN-B). |
width | : (Input) Word size of the buffer. |
buffer | : (Input) Pointer to the buffer containing the message. Buffer should either be of type uint16_t* or uint32_t* |
length | : (Input) Length of the message (in bytes). |
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_QueueTransmit_J1939 | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
int32_t | PGN, | ||
int32_t | priority, | ||
int32_t | destination, | ||
uint8_t * | buffer, | ||
int32_t | length ) |
Queues a message to transmit on a J1939 channel's Tx FIFO. The message will be sent once the TX_ENABLE bit is set in the channel's control register. If that bit is already set, the message will be transmitted immediately. If the Tx FIFO does not have enough space to hold the message, the function will return immediately with a value of NAI_ERROR_FULL. If the message is longer than NAI_J1939_MAX_DATA_LEN, the function will return immediately with a value of NAI_ERROR_INVALID_RANGE.
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]). |
PGN | : (Input) Parameter Group Number. |
priority | : (Input) Priority of the message (0 being highest and 7 being lowest). |
destination | : (Input) Destination of the message (0 to FE, or FF to broadcast). |
buffer | : (Input) Pointer to the buffer containing the message. |
length | : (Input) Length of the message (in bytes). |
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_QueueTransmit_J1939_Ex | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
int32_t | PGN, | ||
int32_t | priority, | ||
int32_t | destination, | ||
uint32_t | width, | ||
void * | buffer, | ||
uint32_t | length ) |
Queues a J1939 message, for transmit on the given channel. The message will be sent once the TX_ENABLE bit is set in the channel's control register. If that bit is already set, the message will be transmitted immediately. If the Tx FIFO does not have enough space to hold the message, the function will return immediately with a value of NAI_ERROR_FULL. If the message is longer than NAI_J1939_MAX_DATA_LEN, the function will return immediately with a value of NAI_ERROR_INVALID_RANGE.
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]). |
PGN | : (Input) Parameter Group Number. |
priority | : (Input) Priority of the message (0 being highest and 7 being lowest). |
destination | : (Input) Destination of the message (0 to FE, or FF to broadcast). |
width | : (Input) Word size of the buffer. |
buffer | : (Input) Pointer to the buffer containing the message. Buffer should either be of type uint16_t* or uint32_t* |
length | : (Input) Length of the message (in bytes). |
This function provides optimized performance for 32 bit buffer writes.
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_Receive | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
int32_t | buflen, | ||
bool_t * | outismodeA, | ||
int32_t * | outmsgid, | ||
uint8_t * | outbuffer, | ||
int32_t * | outlength ) |
Attempts to read a message off a CAN A/B channel's Rx FIFO. If there are no messages waiting, this function will return immediately with a value of NAI_ERROR_EMPTY. If the message exceeds the length of the buffer, the function will fill as much as it can, discard the rest of the message, and return NAI_ERROR_MORE_DATA. You can avoid this by passing a buffer of length NAI_AB_MAX_DATA_LEN.
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]). |
buflen | : (Input) Number of bytes allocated to the buffer passed in. |
outismodeA | : (Output) Pointer to a bool_t indicating CAN mode A or B (TRUE: CAN-A, FALSE: CAN-B). |
outmsgid | : (Output) Pointer to an integer to store the message ID. |
outbuffer | : (Output) Buffer containing the received message. |
outlength | : (Output) Pointer to an integer containing the received message size (in bytes). |
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_Receive_Ex | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
uint32_t | buflen, | ||
bool_t * | outismodeA, | ||
int32_t * | outmsgid, | ||
uint32_t | width, | ||
void * | outbuffer, | ||
uint32_t * | outlength ) |
Reads a CAN AB message off a channel. If there are no messages waiting, this function will return NAI_ERROR_EMPTY. If the format of the message on the fifo is invalid the function will return NAI_ERROR_MISMATCH. If the message exceeds buflen the function will fill as much as it can, discard the rest of the message, and return NAI_ERROR_MORE_DATA.
This function provides optimized performance for 32 bit buffers.
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]). |
buflen | : (Input) Number of bytes allocated to the buffer passed in. |
outismodeA | : (Output) Pointer to a bool_t indicating CAN mode A or B (TRUE: CAN-A, FALSE: CAN-B). |
outmsgid | : (Output) Pointer to an integer to store the message ID. |
width | : (Input) Message Width. |
outbuffer | : (Output) Buffer containing the received message. Buffer should be either type uint16_t* or uint32_t* |
outlength | : (Output) Pointer to an integer containing the received message size (in bytes). |
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_Receive_J1939 | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
int32_t | buflen, | ||
int32_t * | outPGN, | ||
int32_t * | outsource, | ||
int32_t * | outdestination, | ||
uint8_t * | outbuffer, | ||
int32_t * | outlength ) |
Attempts to read a message off a J1939 channel's Rx FIFO. If there are no messages waiting, this function will return immediately with a value of NAI_ERROR_EMPTY. If the message exceeds the length of the buffer, the function will fill as much as it can, discard the rest of the message, and return NAI_ERROR_MORE_DATA. You can avoid this by passing a buffer of length NAI_J1939_MAX_DATA_LEN.
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]). |
buflen | : (Input) Number of bytes allocated to the buffer passed in. |
outPGN | : (Output) Pointer to a integer to store the Parameter Group Number. |
outsource | : (Output) Pointer to an integer to store the source of the message. |
outdestination | : (Output) Pointer to an integer to store the destination of the message (0 to FE, or FF to broadcast). |
outbuffer | : (Output) Buffer containing the received message. |
outlength | : (Output) Pointer to an integer containing the received message size (in bytes). |
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_Receive_J1939_Ex | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
uint32_t | buflen, | ||
int32_t * | outPGN, | ||
int32_t * | outsource, | ||
int32_t * | outdestination, | ||
uint32_t | width, | ||
void * | outbuffer, | ||
uint32_t * | outlength ) |
Reads a J1939 message off a channel on a gen5 module. If there are no messages waiting, this function will return NAI_ERROR_EMPTY. If the format of the message on the fifo is invalid the function will return NAI_ERROR_MISMATCH. If the message exceeds buflen the function will fill as much as it can, discard the rest of the message, and return NAI_ERROR_MORE_DATA.
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]). |
buflen | : (Input) Number of bytes allocated to the buffer passed in. |
outPGN | : (Output) Pointer to a integer to store the Parameter Group Number. |
outsource | : (Output) Pointer to an integer to store the source of the message. |
outdestination | : (Output) Pointer to an integer to store the destination of the message (0 to FE, or FF to broadcast). |
width | : (Input) Word size of the outbuffer |
outbuffer | : (Output) Buffer containing the received message. Only the first byte of each word in the outbuffer contains the data. |
outlength | : (Output) Pointer to an integer containing the received message size (in bytes). |
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_Transmit | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
bool_t | ismodeA, | ||
int32_t | msgid, | ||
uint8_t * | buffer, | ||
int32_t | length ) |
Queues a message to transmit on a CAN A/B channel's Tx FIFO, then enables the transmit bit in the channel's control word.
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]). |
ismodeA | : (Input) Mode (TRUE: CAN-A, FALSE: CAN-B.) |
msgid | : (Input) Message ID (11-bits for CAN-A, 29 bits for CAN-B). |
buffer | : (Input) Pointer to the buffer containing the message. |
length | : (Input) Length of the message (in bytes). |
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_Transmit_Ex | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
bool_t | ismodeA, | ||
int32_t | msgid, | ||
uint32_t | width, | ||
void * | buffer, | ||
uint32_t | length ) |
Queues a message to transmit on a CAN A/B channel's Tx FIFO, then enables the transmit bit in the channel's control word.
This function provides optimized performance for 32 bit buffer writes.
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]). |
ismodeA | : (Input) Mode (TRUE: CAN-A, FALSE: CAN-B.) |
msgid | : (Input) Message ID (11-bits for CAN-A, 29 bits for CAN-B). |
width | : (Input) Word size of the buffer. |
buffer | : (Input) Pointer to the buffer containing the message. Buffer should either be of type uint16_t* or uint32_t* |
length | : (Input) Length of the message (in bytes). |
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_Transmit_J1939 | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
int32_t | PGN, | ||
int32_t | priority, | ||
int32_t | destination, | ||
uint8_t * | buffer, | ||
int32_t | length ) |
Queues a message to transmit on a J1939 channel's Tx FIFO, then enables the transmit bit in the channel's control word.
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]). |
PGN | : (Input) Parameter Group Number. |
priority | : (Input) Priority of the message (0 being highest and 7 being lowest). |
destination | : (Input) Destination of the message (0 to FE, or FF to broadcast). |
buffer | : (Input) Pointer to the buffer containing the message. |
length | : (Input) Length of the message (in bytes). |
NAIBRDFUNC nai_status_t NAIAPI naibrd_CAN_Transmit_J1939_Ex | ( | int32_t | cardIndex, |
int32_t | module, | ||
int32_t | channel, | ||
int32_t | PGN, | ||
int32_t | priority, | ||
int32_t | destination, | ||
uint32_t | width, | ||
void * | buffer, | ||
uint32_t | length ) |
Queues a message to transmit on a J1939 channel's Tx FIFO, then enables the transmit bit in the channel's control word.
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]). |
PGN | : (Input) Parameter Group Number. |
priority | : (Input) Priority of the message (0 being highest and 7 being lowest). |
destination | : (Input) Destination of the message (0 to FE, or FF to broadcast). |
width | : (Input) word size of buffer. |
buffer | : (Input) Pointer to the buffer containing the message. Buffer should be of type uint16_t* or uint32_t* |
length | : (Input) Length of the message (in bytes). |