WPILibC++ 2023.4.3
|
Classes | |
struct | HAL_CANStreamMessage |
Storage for CAN Stream Messages. More... | |
Macros | |
#define | HAL_CAN_SEND_PERIOD_NO_REPEAT 0 |
#define | HAL_CAN_SEND_PERIOD_STOP_REPEATING -1 |
#define | HAL_CAN_IS_FRAME_REMOTE 0x80000000 |
#define | HAL_CAN_IS_FRAME_11BIT 0x40000000 |
#define | HAL_ERR_CANSessionMux_InvalidBuffer -44086 |
#define | HAL_ERR_CANSessionMux_MessageNotFound -44087 |
#define | HAL_WARN_CANSessionMux_NoToken 44087 |
#define | HAL_ERR_CANSessionMux_NotAllowed -44088 |
#define | HAL_ERR_CANSessionMux_NotInitialized -44089 |
#define | HAL_ERR_CANSessionMux_SessionOverrun 44050 |
Functions | |
void | HAL_CAN_SendMessage (uint32_t messageID, const uint8_t *data, uint8_t dataSize, int32_t periodMs, int32_t *status) |
Sends a CAN message. More... | |
void | HAL_CAN_ReceiveMessage (uint32_t *messageID, uint32_t messageIDMask, uint8_t *data, uint8_t *dataSize, uint32_t *timeStamp, int32_t *status) |
Receives a CAN message. More... | |
void | HAL_CAN_OpenStreamSession (uint32_t *sessionHandle, uint32_t messageID, uint32_t messageIDMask, uint32_t maxMessages, int32_t *status) |
Opens a CAN stream. More... | |
void | HAL_CAN_CloseStreamSession (uint32_t sessionHandle) |
Closes a CAN stream. More... | |
void | HAL_CAN_ReadStreamSession (uint32_t sessionHandle, struct HAL_CANStreamMessage *messages, uint32_t messagesToRead, uint32_t *messagesRead, int32_t *status) |
Reads a CAN stream message. More... | |
void | HAL_CAN_GetCANStatus (float *percentBusUtilization, uint32_t *busOffCount, uint32_t *txFullCount, uint32_t *receiveErrorCount, uint32_t *transmitErrorCount, int32_t *status) |
Gets CAN status information. More... | |
#define HAL_CAN_IS_FRAME_11BIT 0x40000000 |
#define HAL_CAN_IS_FRAME_REMOTE 0x80000000 |
#define HAL_CAN_SEND_PERIOD_NO_REPEAT 0 |
#define HAL_CAN_SEND_PERIOD_STOP_REPEATING -1 |
#define HAL_ERR_CANSessionMux_InvalidBuffer -44086 |
#define HAL_ERR_CANSessionMux_MessageNotFound -44087 |
#define HAL_ERR_CANSessionMux_NotAllowed -44088 |
#define HAL_ERR_CANSessionMux_NotInitialized -44089 |
#define HAL_ERR_CANSessionMux_SessionOverrun 44050 |
#define HAL_WARN_CANSessionMux_NoToken 44087 |
void HAL_CAN_CloseStreamSession | ( | uint32_t | sessionHandle | ) |
Closes a CAN stream.
sessionHandle | the session to close |
void HAL_CAN_GetCANStatus | ( | float * | percentBusUtilization, |
uint32_t * | busOffCount, | ||
uint32_t * | txFullCount, | ||
uint32_t * | receiveErrorCount, | ||
uint32_t * | transmitErrorCount, | ||
int32_t * | status | ||
) |
Gets CAN status information.
[out] | percentBusUtilization | the bus utilization |
[out] | busOffCount | the number of bus off errors |
[out] | txFullCount | the number of tx full errors |
[out] | receiveErrorCount | the number of receive errors |
[out] | transmitErrorCount | the number of transmit errors |
[out] | status | Error status variable. 0 on success. |
void HAL_CAN_OpenStreamSession | ( | uint32_t * | sessionHandle, |
uint32_t | messageID, | ||
uint32_t | messageIDMask, | ||
uint32_t | maxMessages, | ||
int32_t * | status | ||
) |
Opens a CAN stream.
[out] | sessionHandle | output for the session handle |
[in] | messageID | the message ID to read |
[in] | messageIDMask | the mssage ID mask |
[in] | maxMessages | the maximum number of messages to stream |
[out] | status | Error status variable. 0 on success. |
void HAL_CAN_ReadStreamSession | ( | uint32_t | sessionHandle, |
struct HAL_CANStreamMessage * | messages, | ||
uint32_t | messagesToRead, | ||
uint32_t * | messagesRead, | ||
int32_t * | status | ||
) |
Reads a CAN stream message.
[in] | sessionHandle | the session handle |
[in] | messages | array of messages |
[in] | messagesToRead | the max number of messages to read |
[out] | messagesRead | the number of messages actually read |
[out] | status | Error status variable. 0 on success. |
void HAL_CAN_ReceiveMessage | ( | uint32_t * | messageID, |
uint32_t | messageIDMask, | ||
uint8_t * | data, | ||
uint8_t * | dataSize, | ||
uint32_t * | timeStamp, | ||
int32_t * | status | ||
) |
Receives a CAN message.
[out] | messageID | store for the received message ID |
[in] | messageIDMask | the message ID mask to look for |
[out] | data | data output (8 bytes) |
[out] | dataSize | data length (0-8 bytes) |
[out] | timeStamp | the packet received timestamp (based off of CLOCK_MONOTONIC) |
[out] | status | Error status variable. 0 on success. |
void HAL_CAN_SendMessage | ( | uint32_t | messageID, |
const uint8_t * | data, | ||
uint8_t | dataSize, | ||
int32_t | periodMs, | ||
int32_t * | status | ||
) |
Sends a CAN message.
[in] | messageID | the CAN ID to send |
[in] | data | the data to send (0-8 bytes) |
[in] | dataSize | the size of the data to send (0-8 bytes) |
[in] | periodMs | the period to repeat the packet at. Use HAL_CAN_SEND_PERIOD_NO_REPEAT to not repeat. |
[out] | status | Error status variable. 0 on success. |