10#include "config/macros.h"
13#define SENSOR_OFFSET_NUM_MEASUREMENTS (1000)
42 .MeasurementCounter = 0,
This is the generated driver header file for the ADC1 driver.
#define SENSOR_OFFSET_NUM_MEASUREMENTS
Number of measurement to calculate the average over.
#define ISEC_AVG_SENSOR_OFFSET_LIMIT_LOW
#define ISEC_AVG_SENSOR_OFFSET_LIMIT_HIGH
static void __inline__ Dev_SensorOffsetCal(SENSOR_OFFSET_CAL_t *sensor, uint16_t adcReading)
Measure the sensor offset.
uint16_t Dev_CurrentSensor_Get_CalibrationStatus(void)
API function to get the calibration status.
void Dev_CurrentSensor_Clr_Offset(void)
API function to clear the sensor offset.
uint16_t Dev_CurrentSensor_Get_Offset(void)
API function to get the sensor offset.
void Dev_CurrentSensorOffsetCal(void)
Measures the currents sensor offset.
SENSOR_OFFSET_CAL_t isecAvgCurrentSensor
Data Object of sensor offset calibration.
static uint16_t ADC1_ConversionResultGet(enum ADC_CHANNEL channel)
Returns the conversion value for the channel selected.
Stores data related to sensor calibration, including data related to sensor offset.
uint32_t Accumulator
used for sensor offset measurement at startup
uint16_t LimitHigh
upper bound of what offset should be, offset needs to be < limitHigh and > limitLow for sensorCalibra...
uint16_t MeasurementCounter
used for sensor offset measurement at startup
uint16_t LimitLow
low bound of what offset should be
bool CalibrationComplete
set to true if the sensor is calibrated
uint16_t Offset
measured offset