CAN communication handler for sending and receiving control messages related to the supercapacitor power module. More...
Go to the source code of this file.
Data Structures | |
| struct | ref_msg_packet |
| Incoming reference message structure received over CAN. More... | |
| struct | supercap_msg_packet |
| Outgoing status message structure sent over CAN. More... | |
| class | CANComm |
| Abstraction class to manage CAN communication for the supercap board. More... | |
Macros | |
| #define | CAN_NODE_ID 0x067 |
| CAN ID for receiving command messages intended for this board. | |
| #define | DEVC_NODE_ID 0x077 |
| CAN ID used by this board to send messages to others. | |
Functions | |
| struct ref_msg_packet | __attribute__ ((packed)) |
| void | initCANComm (FDCAN_HandleTypeDef *fdcan_) |
| Initializes CAN communication: configures filters and starts the FDCAN peripheral. | |
Variables | |
| uint8_t | enable_module |
| Enable/disable flag for supercap control loop. | |
| uint8_t | reset |
| If set, triggers a software reset. | |
| uint8_t | pow_limit |
| Maximum power budget (W) | |
| uint16_t | energy_buffer |
| Optional buffer value to apply limiting strategy. | |
| float | chassis_power |
| Computed instantaneous power drawn by chassis. | |
| uint8_t | error |
| Error code or flag (0 = OK) | |
| uint8_t | cap_energy |
| Supercap charge percentage (0–255 mapped) | |
| class CANComm | __attribute__ |
CAN communication handler for sending and receiving control messages related to the supercapacitor power module.
This header defines the message packet structures and the CANComm class that abstracts transmission and reception of messages using STM32's FDCAN peripheral.
Created on: Jan 20, 2025 Author: Yassine Bakkali
| #define CAN_NODE_ID 0x067 |
CAN ID for receiving command messages intended for this board.
< Standard integer types FDCAN peripheral definitions
| #define DEVC_NODE_ID 0x077 |
CAN ID used by this board to send messages to others.
| struct ref_msg_packet __attribute__ | ( | (packed) | ) |
| void initCANComm | ( | FDCAN_HandleTypeDef * | fdcan_ | ) |
Initializes CAN communication: configures filters and starts the FDCAN peripheral.
| fdcan_ | Pointer to the FDCAN handle used (typically &hfdcan3). |
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. |
| struct supercap_msg_packet __attribute__ |
| uint8_t cap_energy |
Supercap charge percentage (0–255 mapped)
| float chassis_power |
Computed instantaneous power drawn by chassis.
| uint8_t enable_module |
Enable/disable flag for supercap control loop.
| uint16_t energy_buffer |
Optional buffer value to apply limiting strategy.
| uint8_t error |
Error code or flag (0 = OK)
| uint8_t pow_limit |
Maximum power budget (W)
| uint8_t reset |
If set, triggers a software reset.