|
PER Firmware
|
#include "cooling_fsm.h"#include "can_library/generated/PDU.h"#include "common/bangbang/bangbang.h"#include "common/phal_F4/pwm/pwm.h"#include "common/utils/max.h"#include "cooling_callbacks.h"#include "main.h"Macros | |
| #define | FAN_PWM_TIM (TIM1) |
Enumerations | |
| enum | cooling_state_t { COOLING_STATE_INIT = 0 , COOLING_STATE_AUTO = 1 , COOLING_STATE_MANUAL = 2 , COOLING_STATE_DEBUG = 3 } |
Functions | |
| INIT_BANG_BANG (powertrain_pumps, POWERTRAIN_PUMPS_UPPER_LIMIT, POWERTRAIN_PUMPS_LOWER_LIMIT, powertrain_pumps_on, powertrain_pumps_off, POWERTRAIN_PUMPS_INTERVAL) | |
| INIT_BANG_BANG (hx_fan, HX_FAN_UPPER_LIMIT, HX_FAN_LOWER_LIMIT, hx_fan_on, hx_fan_off, HX_FAN_INTERVAL) | |
| INIT_BANG_BANG (battery_fans, BATTERY_FAN_UPPER_LIMIT, BATTERY_FAN_LOWER_LIMIT, battery_fans_on, battery_fans_off, BATTERY_FAN_INTERVAL) | |
| static void | update_bangbang (void) |
| void | cooling_fsm_periodic (void) |
Variables | |
| static cooling_state_t | cooling_state = COOLING_STATE_INIT |
| static cooling_state_t | next_cooling_state = COOLING_STATE_INIT |
| static constexpr uint32_t | PWM_FREQUENCY_HZ = 25'000 |
| static constexpr uint8_t | NUM_BATTERY_FANS = 4 |
| static constexpr uint8_t | FANS_PWM_DUTY = 50 |
| static constexpr float | POWERTRAIN_PUMPS_UPPER_LIMIT = 40.0f |
| static constexpr float | POWERTRAIN_PUMPS_LOWER_LIMIT = 35.0f |
| static constexpr uint32_t | POWERTRAIN_PUMPS_INTERVAL = 5000 |
| static constexpr float | HX_FAN_UPPER_LIMIT = 35.0f |
| static constexpr float | HX_FAN_LOWER_LIMIT = 25.0f |
| static constexpr uint32_t | HX_FAN_INTERVAL = 1000 |
| static constexpr float | BATTERY_FAN_UPPER_LIMIT = 35.0f |
| static constexpr float | BATTERY_FAN_LOWER_LIMIT = 25.0f |
| static constexpr uint32_t | BATTERY_FAN_INTERVAL = 1000 |
| #define FAN_PWM_TIM (TIM1) |
| enum cooling_state_t |
| void cooling_fsm_periodic | ( | void | ) |
| INIT_BANG_BANG | ( | battery_fans | , |
| BATTERY_FAN_UPPER_LIMIT | , | ||
| BATTERY_FAN_LOWER_LIMIT | , | ||
| battery_fans_on | , | ||
| battery_fans_off | , | ||
| BATTERY_FAN_INTERVAL | ) |
| INIT_BANG_BANG | ( | hx_fan | , |
| HX_FAN_UPPER_LIMIT | , | ||
| HX_FAN_LOWER_LIMIT | , | ||
| hx_fan_on | , | ||
| hx_fan_off | , | ||
| HX_FAN_INTERVAL | ) |
| INIT_BANG_BANG | ( | powertrain_pumps | , |
| POWERTRAIN_PUMPS_UPPER_LIMIT | , | ||
| POWERTRAIN_PUMPS_LOWER_LIMIT | , | ||
| powertrain_pumps_on | , | ||
| powertrain_pumps_off | , | ||
| POWERTRAIN_PUMPS_INTERVAL | ) |
|
inlinestatic |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
static |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
static |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |