/* * temperatureRegulation.c * * Created on: Apr 16, 2023 * Author: Flax * * Prefix : REG */ // ============== // Local includes // ============== #include "temperatureRegulation.h" // =============== // Local constants // =============== #define cREGTempSPTMax (400U) #define cREGTempSPTMin (50U) // =============== // Local variables // =============== bool RegOffState_B; bool RegStandbyState_B; bool RegErrorState_B; uint16_t RegTempSPT_U16; uint16_t RegTempMeas_U16; // ========================== // Local functions prototypes // ========================== static void RegGetInputs (void); static void RegUpdate (void); static void RegSetOutputs (void); // =========================== // Local functions definitions // =========================== // ============================ // Shared functions definitions // ============================ void REGInit (void) { RegOffState_B = true; RegStandbyState_B = false; } void REGStart (void) { } void REGStop (void) { } void REGCyclicTask (void) { } bool REGIsError (void) { return RegErrorState_B; } bool REGIsStandby(void) { return RegStandbyState_B; } bool REGIsOff(void) { return RegOffState_B; } void REGErrorReset (void) { RegOffState_B = false; } void REGStandbySet(void) { RegStandbyState_B = true; } void REGStandbyReset(void) { RegStandbyState_B = false; } void REGOffSet(void) { RegOffState_B = true; } void REGOffReset(void) { RegOffState_B = false; } bool REGSPTSet (uint16_t temp_spt_u16) { bool ret_B = false; if ((temp_spt_u16 <= (uint16_t)cREGTempSPTMax) && (temp_spt_u16 >= (uint16_t)cREGTempSPTMin)) { RegTempSPT_U16 = temp_spt_u16; ret_B = true; } return (ret_B); } uint16_t REGSPTGet (void) { return RegTempSPT_U16; } uint16_t REGTempGet (void) { return RegTempMeas_U16; }