Skip to content
Snippets Groups Projects
temperatureRegulation.c 1.8 KiB
Newer Older
/*
 * temperatureRegulation.c
 *
 *  Created on: Apr 16, 2023
 *      Author: Flax
 *
 *      Prefix : REG
 */

// ==============
// Local includes
// ==============

// ===============
// Local constants
// ===============
#define cREGTempSPTMax				(400U)
#define cREGTempSPTMin				(50U)
// ===============
// Local variables
// ===============
bool RegOffState_B;
bool RegStandbyState_B;
bool RegErrorState_B;

// ==========================
// 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 = temp_spt_u16;
		ret_B = true;
	}
	return (ret_B);
}

uint16_t REGSPTGet (void)
{
	return RegTempSPT;
}