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