Handles CAN message reception, decoding, and response for supercap control. More...
Functions | |
| void | initCANComm (FDCAN_HandleTypeDef *fdcan_) |
| Initializes and configures the CAN peripheral and message filters. | |
| void | HAL_FDCAN_RxFifo0Callback (FDCAN_HandleTypeDef *hfdcan, uint32_t RxFifo0ITs) |
| Callback triggered when a new CAN message is received. | |
| void | HAL_FDCAN_ErrorStatusCallback (FDCAN_HandleTypeDef *hfdcan, uint32_t ErrorStatusITs) |
| Called on FDCAN error interrupt (e.g. bus-off state). | |
Variables | |
| static ref_msg_packet | rxMsg |
| Local message object storing the latest received control packet. | |
Handles CAN message reception, decoding, and response for supercap control.
This module handles communication over FDCAN between the supercapacitor module and the main robot controller. It allows receiving control signals (enable/disable, power limit updates) and transmits supercap status (power, energy).
Created by: Yassine Bakkali Date: Jan 20, 2025
| void HAL_FDCAN_ErrorStatusCallback | ( | FDCAN_HandleTypeDef * | hfdcan, |
| uint32_t | ErrorStatusITs ) |
Called on FDCAN error interrupt (e.g. bus-off state).
Resets the CAN peripheral and reinitializes the communication settings.
| hfdcan | Pointer to the affected CAN instance |
| ErrorStatusITs | Interrupt flags (unused) |
| void HAL_FDCAN_RxFifo0Callback | ( | FDCAN_HandleTypeDef * | hfdcan, |
| uint32_t | RxFifo0ITs ) |
Callback triggered when a new CAN message is received.
If the message matches the expected node ID, it handles:
| hfdcan | FDCAN peripheral instance |
| RxFifo0ITs | Interrupt source bitmask |
| void initCANComm | ( | FDCAN_HandleTypeDef * | fdcan_ | ) |
Initializes and configures the CAN peripheral and message filters.
Initializes CAN communication: configures filters and starts the FDCAN peripheral.
This function sets up the CAN ID filters, enables relevant interrupts, configures delay compensation, and starts the FDCAN interface.
| fdcan_ | Pointer to the FDCAN handle to initialize. |
|
static |
Local message object storing the latest received control packet.