diff --git a/pid.h b/pid.h --- a/pid.h +++ b/pid.h @@ -1,8 +1,16 @@ #ifndef PIDS_H #define PIDS_H +#include "stm32f0xx_hal.h" #include "states.h" -int16_t pid_update(uint16_t k_p, uint16_t k_i, uint16_t k_d, int16_t temp, uint8_t temp_frac, int16_t setpoint, therm_settings_t* set, therm_status_t* status); +typedef struct { + int16_t last_pid_temp; + uint8_t last_pid_temp_frac; + int32_t i_state; +} pid_state_t; + +void pid_init(pid_state_t* state); +int16_t pid_update(therm_settings_t* set, therm_status_t* status, pid_state_t* state); #endif