51 #include PLATFORM_HEADER
53 #include "hal/error.h"
57 #include "dev/temperature-sensor.h"
72 static int16u ADCvalue;
75 halStartAdcConversion(ADC_USER_APP, ADC_REF_INT, ADC_SOURCE(halGetADCChannelFromGPIO(
TEMPERATURE_SENSOR_GPIO),ADC_MUX_VREF2), ADC_CONVERSION_TIME_US_4096);
77 halReadAdcBlocking(ADC_USER_APP, &ADCvalue);
80 volts = halConvertValueToVolts(ADCvalue);
83 return ((18663 - (int32s)volts)*100)/1169;
88 configure(
int type,
int value)
113 SENSORS_SENSOR(temperature_sensor, TEMPERATURE_SENSOR,
114 value, configure, status);