recuperator fan control with esp32
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
esp-recuperator/main/fancontrol.h

51 lines
1.1 KiB

//
// Created by MightyPork on 2022/08/20.
//
#ifndef FANCTL_FANCONTROL_H
#define FANCTL_FANCONTROL_H
#include <stdint.h>
#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;
};
extern struct FanControlState gState;
#endif //FANCTL_FANCONTROL_H