|
void | canlib_tx_task_init (Task_Init_t *init_ptr, enum can_bus bus, FDCAN_HandleTypeDef *hfdcan, uint16_t tx_queue_length) |
| Initializes a FreeRTOS CAN transmit task for bus and creates a transmit queue with capacity tx_queue_length .
|
void | canlib_rx_task_init (Task_Init_t *init_ptr, enum can_bus bus, FDCAN_HandleTypeDef *hfdcan, uint32_t rx_location, CAN_Rx_Handler_t handler) |
| Initializes a FreeRTOS CAN receive task for bus that receives messages from rx_location . Calls callback when a new message is received.
|
void | canlib_start (void) |
| Starts all STM32 FDCAN peripherals that were registered to a CAN transmit or receive task.
|
void | canlib_register_timeout_ids (enum can_bus bus, FDCAN_HandleTypeDef *hfdcan, uint32_t timeout_ids_ptr[], unsigned timeout_ids_cnt) |
| Registers CAN messages for timeout tracking by the CAN receive task for a CAN bus (also sorts the array of CAN IDs in ascending order, lol)
|
TimerHandle_t | canlib_register_scheduled_msgs (struct canlib_scheduled_msg_params *params_ptr) |
| Registers an array of CAN messages for periodic transmission on a set interval with a FreeRTOS software timer.
|
uint32_t | canlib_get_msg_timeout (enum can_bus bus, uint32_t msg_id) |
| Get the time since a message with ID msg_id was received on bus . If the CAN ID wasn't registered with canlib_register_timeout_ids() first on initialization, the returned value will be CANLIB_TIMEOUT_INVALID (UINT32_MAX)
|
bool | canlib_tx_generic (const CAN_Msg_t *msg_ptr, TickType_t block_time, bool is_critical) |
| Queues a CAN message for transmission.
|
static __always_inline bool | canlib_tx (const CAN_Msg_t *msg_ptr, TickType_t block_time) |
static __always_inline bool | canlib_tx_critical (const CAN_Msg_t *msg_ptr, TickType_t block_time) |
bool | canlib_is_bus_ok (enum can_bus bus) |
| Checks for protocol errors on bus .
|
FreeRTOS CAN receive and transmit tasks for STM32H7xx.
- Author
- Jamie Pruett :)
- Date
- 2025-01-14