55 #include PLATFORM_HEADER
61 #include "dev/temperature-sensor.h"
63 #define SUPPLY_OFFSET 500
77 static uint16_t ADCvalue;
81 halStartAdcConversion(ADC_USER_APP, ADC_REF_INT, ADC_SOURCE(halGetADCChannelFromGPIO(
TEMPERATURE_SENSOR_GPIO),ADC_MUX_VREF2), ADC_CONVERSION_TIME_US_4096);
83 halReadAdcBlocking(ADC_USER_APP, &ADCvalue);
91 return ((18663 - (int32_t)volts)*100)/1169;
96 configure(
int type,
int value)
122 value, configure, status);
struct sensors_sensor temperature_sensor
NOTE: For the temperature measurement, the ADC extended range mode is needed; but this is inaccurate ...
#define TEMPERATURE_SENSOR_GPIO
Description temperature sensor GPIO.
#define TRUE
An alias for one, used for clarity.
Header for A/D converter.
#define SUPPLY_OFFSET
NOTE: For the temperature measurement, the ADC extended range mode is needed; but this is inaccurate ...
Generic set of HAL includes for all platforms.
Return codes for API functions and module definitions.
const TempSensorResourceType * temperatureSensor
Board infrared temeprature sensor description.
uint8_t div
Voltage divider network from sensor vout and GPIO.