12#ifndef STM_UTILS_INC_MSG_HANDLER_HPP_
13#define STM_UTILS_INC_MSG_HANDLER_HPP_
21#define CAN_NODE_ID 0x067
26#define DEVC_NODE_ID 0x077
74 CANComm(FDCAN_HandleTypeDef* fdcan_) : fdcan(fdcan_) { txHeaderConfig(); }
90 void txHeaderConfig();
95 void handleInterrupts();
97 FDCAN_HandleTypeDef* fdcan;
99 FDCAN_RxHeaderTypeDef RxHeader;
101 FDCAN_TxHeaderTypeDef TxHeader;
void sendMessage()
Sends the current supercap_msg_packet status over CAN.
Definition msg_handler.cpp:75
~CANComm()
Destructor (does nothing but defined for completeness).
Definition msg_handler.hpp:79
CANComm(FDCAN_HandleTypeDef *fdcan_)
Constructor: sets up header configuration for outgoing messages.
Definition msg_handler.hpp:74
This file contains all the function prototypes for the fdcan.c file.
void initCANComm(FDCAN_HandleTypeDef *fdcan_)
Initializes CAN communication: configures filters and starts the FDCAN peripheral.
Definition msg_handler.cpp:24
class CANComm __attribute__
Definition syscalls.c:80
Incoming reference message structure received over CAN.
Definition msg_handler.hpp:35
uint16_t energy_buffer
Optional buffer value to apply limiting strategy.
Definition msg_handler.hpp:39
uint8_t pow_limit
Maximum power budget (W)
Definition msg_handler.hpp:38
uint8_t enable_module
Enable/disable flag for supercap control loop.
Definition msg_handler.hpp:36
uint8_t reset
If set, triggers a software reset.
Definition msg_handler.hpp:37
Outgoing status message structure sent over CAN.
Definition msg_handler.hpp:49
uint8_t cap_energy
Supercap charge percentage (0–255 mapped)
Definition msg_handler.hpp:52
uint8_t error
Error code or flag (0 = OK)
Definition msg_handler.hpp:51
float chassis_power
Computed instantaneous power drawn by chassis.
Definition msg_handler.hpp:50