15 #ifndef APP_CONTROLLER_HPP__
16 #define APP_CONTROLLER_HPP__
72 void set_setpoint_throttling_enabled(
bool new_val);
74 void set_frequency_min_khz(
float n);
75 void set_frequency_max_khz(
float n);
76 void set_frequency_khz(
float n);
80 void _set_frequency_raw(
float n);
82 void set_duty_min_percent(
float n);
83 void set_duty_max_percent(
float n);
84 void set_duty_percent(
float n);
88 void _set_duty_raw(
float n);
90 void set_lag_dt_ns(
float n);
91 void set_lead_dt_ns(
float n);
105 void clear_shutdown();
107 void set_current_limit(
float n);
112 void set_temp_2_limit(
float n);
114 void set_relay_ref_active(
bool new_val);
116 void set_relay_dut_active(
bool new_val);
139 static TaskHandle_t _app_event_task_handle;
141 static EventGroupHandle_t _app_event_group;
143 Ticker event_timer_fast;
144 Ticker event_timer_slow;
152 void _initialize_ps_pwm_drv();
156 void _create_app_event_task();
160 void _register_http_api(
APIServer* api_server);
164 void _connect_timer_callbacks();
170 static void _app_event_task(
void *pVParameters);
175 void _on_fast_timer_event_update_state();
179 void _evaluate_temperature_sensors();
184 static void _send_state_changed_event();
189 void _push_state_update();
Auxiliary hardware driver for ESP-AJAX-Lab.
AJAX HTTP API server for ESP-AJAX-Lab.
Definition: api_server.hpp:45
Application main controller for PS-PWM generator hardware.
Definition: app_controller.hpp:46
void set_temp_1_limit(float n)
Set overtemperature shutdown limits.
Definition: app_controller.cpp:224
void set_oneshot_len(float n)
Set power output oneshot pulse timer pulse length in seconds.
Definition: app_controller.cpp:192
void set_fan_override(bool new_val)
When set to true, override automatic and set fan permanently on.
Definition: app_controller.cpp:242
static constexpr auto constants
Configuration and initial values for the application state.
Definition: app_controller.hpp:50
void set_duty_changerate_percent_sec(float n)
Set rate of change of duty cycle in percent per second.
Definition: app_controller.cpp:141
void save_settings()
Save all runtime configurable settings to SPI flash. The settings are a subset of all values in struc...
Definition: app_controller.cpp:253
void trigger_oneshot()
Trigger the power output oneshot pulse.
Definition: app_controller.cpp:199
void set_frequency_changerate_khz_sec(float n)
Set rate of change of frequency in kHz per second.
Definition: app_controller.cpp:117
void set_power_pwm_active(bool new_val)
Activate PWM power output if arg is true.
Definition: app_controller.cpp:168
void restore_settings()
Read state back from SPI flash file and initialize the hardware with these settings.
Definition: app_controller.cpp:263
void begin()
Begin operation. This also starts the timer callbacks etc. This will fail if networking etc....
Definition: app_controller.cpp:88
Auxiliary hardware driver for ESP-AJAX-Lab This implements GPIO control for relays,...
Definition: aux_hw_drv.hpp:32
Ticker timer derivative allowing for a fixed number of repeated calls.
Definition: multi_timer.hpp:35
Ticker timer derivative allowing for a fixed number of repeated calls.
Constant / compile-time config values go here!
Definition: app_config.hpp:131
Application state containing data and settings model.
Definition: app_state_model.hpp:50