#include <string.h>
#include <stdio.h>
#include "compiler.h"
#include "s_temperature.h"
#include "board.h"
#include "gpio.h"
#include "adc.h"
Functions | |
bool | b_temperature_get_value (char *buf) |
Get the current temperature value. More... | |
Variables | |
static volatile avr32_adc_t * | adc = (volatile avr32_adc_t *) &AVR32_ADC |
const unsigned short | temperature_code [] |
The following table give the correspondence between the ADC code and the temperature Each elements of the table corresponds to an ADC code value. More... | |
bool b_temperature_get_value | ( | char * | buf | ) |
Get the current temperature value.
buf | char buffer in which the temperature value is stored. |
References adc, adc_disable(), adc_enable(), adc_get_value(), adc_start(), ADC_TEMPERATURE_CHANNEL, and temperature_code.
Referenced by device_full_custom_task().
|
static |
ADC cell.
const unsigned short temperature_code[] |
The following table give the correspondence between the ADC code and the temperature Each elements of the table corresponds to an ADC code value.
The index in the table give the corresponding temperature (inC) with the following formula : Tempeature=index-20. table[O] corresponds to -20C temperature code The following table gives the ADC code for VCC=3.3V and Aref=AVcc
Referenced by b_temperature_get_value().