42#include "lib/sensors.h"
57 return 25000 + ((raw >> 4) - 1422) * 10000 / 42;
64configure(
int type,
int value)
Header file for the cc2538 ADC driver.
Generic header usable by all CC2538 sensor drivers.
int16_t adc_get(uint8_t channel, uint8_t ref, uint8_t div)
Performs a single conversion on a given ADC channel.
#define CC2538_SENSORS_ERROR
Generic Error.
#define CC2538_SENSORS_VALUE_TYPE_CONVERTED
Request the converted reading.
#define CC2538_SENSORS_VALUE_TYPE_RAW
Request the raw reading.
#define SOC_ADC_ADCCON_CH_TEMP
Temperature sensor.
#define SOC_ADC_ADCCON_DIV_512
512 decimation rate (12 bits ENOB)
#define SOC_ADC_ADCCON_REF_INT
Internal reference.
const struct sensors_sensor cc2538_temp_sensor
Exports a global symbol to be used by the sensor API.