|  | Dual Active Bridge Development Board (Part-No. ) |
Content |  |  |  |  |  |

Loading...
Searching...
No Matches
dev_temp.h
Go to the documentation of this file.
1
15// This is a guard condition so that contents of this file are not included
16// more than once.
17#ifndef DEV_TEMP_H
18#define DEV_TEMP_H
19
20#include <xc.h> // include processor files - each processor file is guarded.
21#include <stdint.h>
22
23
28#include "adc/adc1.h"
29
30
35#define MAX_NUM_SAMPLES_TEMP_BUFFER 64
36#define MAX_NUM_SAMPLES_TEMP_BUFFER_AS_EXP_OF_TWO 6
// end of dev-temp-sys-spec-macros
38
39
43 struct TEMP_SETTINGS_s {
44 uint8_t OverTemperatureFlag;
45 uint8_t SensorLost;
46 uint16_t AdcReading;
47 uint16_t AdcAverage;
48 uint16_t TemperatureCelcius;
49 uint16_t TempBuffer[MAX_NUM_SAMPLES_TEMP_BUFFER];
50 uint16_t BufferFull;
51 uint16_t ResetBuffer;
52 uint16_t BufferIndex;
53};
54 typedef struct TEMP_SETTINGS_s TEMP_SETTINGS_t;
55
56
63extern TEMP_SETTINGS_t* devTempDataPtr;
64extern TEMP_SETTINGS_t devTempData;
65
66
69void Dev_Temp_Initialize(void);
70void Dev_Temp_Task_100ms(void);
71int8_t Dev_Temp_Get_Temperature_Celcius();
72uint16_t Dev_Temp_AverageValue(void);
73uint8_t Dev_Temp_Is_Over_Temperature();
74void Dev_Temp_Get_ADC_Sample(void);
75#endif /* DEV_TEMP_H */
76
adc1.h
This is the generated driver header file for the ADC1 driver.
devTempDataPtr
TEMP_SETTINGS_t * devTempDataPtr
dev temp data object pointer external
Definition dev_temp.c:31
MAX_NUM_SAMPLES_TEMP_BUFFER
#define MAX_NUM_SAMPLES_TEMP_BUFFER
These have to be renamed to make the temp device driver abstract.
Definition dev_temp.h:35
Dev_Temp_AverageValue
uint16_t Dev_Temp_AverageValue(void)
Returns the average adc temperature reading.
Definition dev_temp.c:73
Dev_Temp_Is_Over_Temperature
uint8_t Dev_Temp_Is_Over_Temperature()
Returns the status of the Over Temperature flag.
Definition dev_temp.c:105
Dev_Temp_Task_100ms
void Dev_Temp_Task_100ms(void)
Executes the Temperature reading every 100ms.
Definition dev_temp.c:60
Dev_Temp_Get_ADC_Sample
void Dev_Temp_Get_ADC_Sample(void)
Gets the temperature ADC sample.
Definition dev_temp.c:117
Dev_Temp_Initialize
void Dev_Temp_Initialize(void)
Initializes the temperature data structure.
Definition dev_temp.c:45
devTempData
TEMP_SETTINGS_t devTempData
Data Object of temperature settings.
Definition dev_temp.c:30
Dev_Temp_Get_Temperature_Celcius
int8_t Dev_Temp_Get_Temperature_Celcius()
This converts the raw values to temperature celcius as per device lookup table.
Definition dev_temp.c:87
TEMP_SETTINGS_s
A custom data type for temperature measurement.
Definition dev_temp.h:43
TEMP_SETTINGS_s::OverTemperatureFlag
uint8_t OverTemperatureFlag
Over temperature flag.
Definition dev_temp.h:44
TEMP_SETTINGS_s::TempBuffer
uint16_t TempBuffer[MAX_NUM_SAMPLES_TEMP_BUFFER]
buffer for calcualting average.
Definition dev_temp.h:49
TEMP_SETTINGS_s::BufferIndex
uint16_t BufferIndex
buffer index
Definition dev_temp.h:52
TEMP_SETTINGS_s::SensorLost
uint8_t SensorLost
if sensor is present
Definition dev_temp.h:45
TEMP_SETTINGS_s::AdcReading
uint16_t AdcReading
temperature value raw sampled from ADC
Definition dev_temp.h:46
TEMP_SETTINGS_s::AdcAverage
uint16_t AdcAverage
temperature
Definition dev_temp.h:47
TEMP_SETTINGS_s::TemperatureCelcius
uint16_t TemperatureCelcius
temperature celcius.
Definition dev_temp.h:48
TEMP_SETTINGS_s::BufferFull
uint16_t BufferFull
flag to monitor if full then allow averaging.
Definition dev_temp.h:50
TEMP_SETTINGS_s::ResetBuffer
uint16_t ResetBuffer
reset Temp_buffer
Definition dev_temp.h:51