// // Created by MightyPork on 2022/08/20. // #ifndef FANCTL_FANCONTROL_H #define FANCTL_FANCONTROL_H #include #include "actuators.h" void fancontrol_init(); enum ventilation_mode { VENT_MODE_OFF = 0, VENT_MODE_FREE = 1, VENT_MODE_OUT = 3, VENT_MODE_IN = 5, VENT_MODE_RECUP = 7, }; struct FanControlState { /** * Poloha roletky, 0<->blind_time, inkrement/dekrement 1 za sekundu. * Pri zmene blind_time se musi hodnota aktualizovat, pokud je na doraze nebo za. */ uint16_t blind_position; /** * Power requested trough register or as the default value */ uint16_t set_power; /** * Cas chodu motoru v aktualnim smeru, inkrement 1 za sekundu. */ uint16_t run_time; /** * "stav chodu motoru". 0=stop, ramp_time = jede. */ uint16_t ramp; /** * skutecny aktualni pohyb motoru (zustava stejny, dokud ramp time nedosahne nuly) */ enum motor_direction real_direction; /** * rezim ventilace */ enum ventilation_mode vent_mode; uint16_t t_indoor; uint16_t t_outdoor; uint16_t t_intake; uint16_t t_exhaust; uint16_t t_actual_1; uint16_t t_actual_2; }; extern struct FanControlState gState; #endif //FANCTL_FANCONTROL_H