18#include "config/hardware.h"
19#include "config/macros.h"
21#include "pwrctrl/pwrctrl.h"
89 static int8_t temperatureCelsius;
91 temperatureCelsius = 0;
94 return temperatureCelsius;
156 for (index = 0; index <length; index++)
Contains temperature initialization and execution functions.
#define MAX_NUM_SAMPLES_TEMP_BUFFER
These have to be renamed to make the temp device driver abstract.
#define MAX_NUM_SAMPLES_TEMP_BUFFER_AS_EXP_OF_TWO
for bit shifting
Contains public functions relevant for power control communication interface.
#define TEMPERATURE_OFFSET
#define TEMPERATURE_FACTOR
uint16_t Dev_Temp_AverageValue(void)
Returns the average adc temperature reading.
uint8_t Dev_Temp_Is_Over_Temperature(void)
Returns the status of the Over Temperature flag.
void Dev_Temp_Task_100ms(void)
Executes the Temperature reading every 100ms.
void Dev_Temp_Get_ADC_Sample(void)
Gets the temperature ADC sample.
void Dev_Temp_Initialize(void)
Initializes the temperature data structure.
static uint16_t Temp_Calculate_Average(uint16_t *buffer, uint16_t size)
Averages the temperature ADC samples.
TEMP_SETTINGS_t devTempData
Data Object of temperature settings.
int8_t Dev_Temp_Get_Temperature_Celcius(void)
This converts the raw values to temperature celcius as per device lookup table.
static uint16_t Average_Temp_ADC_Samples(void)
Returns the temperature average value.
uint16_t PwrCtrl_GetAdc_Temperature(void)
API function to get the raw ADC value for temperature.
A custom data type for temperature measurement.
uint8_t OverTemperatureFlag
Over temperature flag.
uint16_t TempBuffer[MAX_NUM_SAMPLES_TEMP_BUFFER]
buffer for calcualting average.
uint16_t BufferIndex
buffer index
uint8_t SensorLost
if sensor is present
uint16_t AdcReading
temperature value raw sampled from ADC
uint16_t AdcAverage
temperature
uint16_t TemperatureCelcius
temperature celcius.
uint16_t BufferFull
flag to monitor if full then allow averaging.