Core control logic for the supercapacitor power manager. More...
Go to the source code of this file.
Data Structures | |
| class | supercap_control_manager |
| Main control class for managing the supercapacitor charge/discharge behavior. More... | |
Macros | |
| #define | HRTIM_PERIOD 34000 |
| Defines the full period (and half-period) for HRTIM PWM in timer ticks. Used to calculate duty cycle offset during PWM generation. | |
| #define | HRTIM_HALF_PERIOD 17000 |
Enumerations | |
| enum | Safety_DetectItemTypedef { voltageErr , currentErr } |
| Enumerates the various error detection sources used for safety monitoring. More... | |
| enum | safetyLevelDef { safe , warning , wtf , runAway , itsJoever } |
| Safety level definitions for runtime system checks. More... | |
| enum | Mode_ModeTypedef { idle , normal } |
| Modes for the supercap control loop. More... | |
Functions | |
| void | softwareReset () |
| Software-triggered MCU reset function (called on fatal error or remote command). | |
Variables | |
| uint8_t | safetyItemLevel [8] |
| Global safety flags indexed by Safety_DetectItemTypedef. | |
| float | chassis_voltage |
| Extern global values for chassis voltage and battery current (used across control loops and diagnostics). | |
| float | battery_current |
Core control logic for the supercapacitor power manager.
This header defines the controller class and enums responsible for managing the supercapacitor charge/discharge behavior, error safety levels, and PID loops.
Created on: Jul 6, 2024 Author: Yassine Bakkali
| #define HRTIM_HALF_PERIOD 17000 |
| #define HRTIM_PERIOD 34000 |
Defines the full period (and half-period) for HRTIM PWM in timer ticks. Used to calculate duty cycle offset during PWM generation.
| enum Mode_ModeTypedef |
| enum safetyLevelDef |
Safety level definitions for runtime system checks.
These are used internally to determine how critical a condition is and what kind of reaction the controller should take.
| void softwareReset | ( | ) |
Software-triggered MCU reset function (called on fatal error or remote command).
Software-triggered MCU reset function (called on fatal error or remote command).
Used during critical fault recovery to completely reboot the board. Disables interrupts and enters an infinite loop until the system reset is triggered via NVIC.
|
extern |
|
extern |
Extern global values for chassis voltage and battery current (used across control loops and diagnostics).
|
extern |
Global safety flags indexed by Safety_DetectItemTypedef.
Global safety flags indexed by Safety_DetectItemTypedef.