diff --git a/states.h b/states.h new file mode 100644 --- /dev/null +++ b/states.h @@ -0,0 +1,51 @@ +#ifndef STATES_H +#define STATES_H + +typedef struct { + int32_t temp; + uint8_t temp_frac; + uint8_t state_resume; + uint8_t state; + int32_t setpoint; + uint8_t pid_enabled; +} therm_status_t; + +typedef struct { + uint8_t boottobrew; + uint8_t temp_units; + uint16_t windup_guard; + uint16_t k_p; + uint16_t k_i; + uint16_t k_d; + uint8_t ignore_tc_error; + int16_t setpoint_brew; + int16_t setpoint_steam; +} therm_settings_t; + + + +enum tempunits { + TEMP_UNITS_CELSIUS = 0, + TEMP_UNITS_FAHRENHEIT, +}; + +enum state { + STATE_IDLE = 0, + + STATE_SETP, + STATE_SETI, + STATE_SETD, + STATE_SETSTEPS, + STATE_SETWINDUP, + STATE_SETBOOTTOBREW, + STATE_SETUNITS, + + STATE_PREHEAT_BREW, + STATE_MAINTAIN_BREW, + STATE_PREHEAT_STEAM, + STATE_MAINTAIN_STEAM, + + STATE_TC_ERROR +}; + +#endif