heat control
r71
|
#include "types.h"
Go to the source code of this file.
Macros | |
#define | ADC_VREF_SEL ((0<<REFS1) | (0<<REFS0) | (0<<ADLAR)) |
#define | ADC_INPUTS LAST_ADC_INPUT - FIRST_ADC_INPUT + 1 |
#define | ADC_RES 1024 |
#define | ADC_MEAN_VALUES 50 |
#define | A1 3.354016e-3 |
#define | B1 2.519107e-4 |
#define | C1 3.510939e-6 |
#define | D1 1.105179e-7 |
Functions | |
void | AdcInit (void) |
initialize the adc resource More... | |
ISR (ADC_vect) | |
ADC interrupt service. More... | |
void | ProcessNextConversion (void) |
checks whether all converted values are processed and starts a new ADC conversion if the latter evaluates to TRUE More... | |
void | StartAdcConversion (void) |
start AD conversion, this will trigger the conversion of all selected channels via the interrupt More... | |
void | SetMux (UCHAR id) |
set multiplexer thus switching between channels More... | |
UINT | CalcAdcTemp (UCHAR id) |
calculate the temperature from specific ADC value in data array, specified by id More... | |
UINT | CalcSupplyVoltage (UCHAR id) |
#define A1 3.354016e-3 |
Steinhart-Hart coefficient for temperature calculation
Definition at line 25 of file adc.h.
Referenced by CalcAdcTemp().
#define ADC_INPUTS LAST_ADC_INPUT - FIRST_ADC_INPUT + 1 |
#define ADC_MEAN_VALUES 50 |
number of mean values to form up a valid converted value
Definition at line 21 of file adc.h.
Referenced by CalcAdcTemp(), CalcSupplyVoltage(), and ISR().
#define ADC_RES 1024 |
adc resolution
Definition at line 17 of file adc.h.
Referenced by CalcAdcTemp(), and CalcSupplyVoltage().
#define ADC_VREF_SEL ((0<<REFS1) | (0<<REFS0) | (0<<ADLAR)) |
#define B1 2.519107e-4 |
Steinhart-Hart coefficient for temperature calculation
Definition at line 29 of file adc.h.
Referenced by CalcAdcTemp().
#define C1 3.510939e-6 |
Steinhart-Hart coefficient for temperature calculation
Definition at line 33 of file adc.h.
Referenced by CalcAdcTemp().
#define D1 1.105179e-7 |
Steinhart-Hart coefficient for temperature calculation
Definition at line 37 of file adc.h.
Referenced by CalcAdcTemp().
void AdcInit | ( | void | ) |
calculate the temperature from specific ADC value in data array, specified by id
id | for data array cell to get the temperature for |
Definition at line 107 of file adc.c.
References A1, ADC_MEAN_VALUES, ADC_REF_VOLTAGE, ADC_RES, ADC_TMP_INNER_ID, B1, C1, D1, g_adcConverting, g_adcData, INVALID_VAL_U16, ProcessNextConversion(), REV_CURRENT_VALUE, RR_IN, RR_OUT, and UINT.
Referenced by main().
Definition at line 126 of file adc.c.
References ADC_MEAN_VALUES, ADC_REF_VOLTAGE, ADC_RES, ADC_SUP_DIV_FCT, g_adcConverting, g_adcData, INVALID_VAL_U16, ProcessNextConversion(), and UINT.
Referenced by main().
ISR | ( | ADC_vect | ) |
ADC interrupt service.
ADC_vect | adc interrupt vector |
Definition at line 41 of file adc.c.
References ADC_INPUTS, ADC_MEAN_VALUES, FALSE, g_adcConverting, g_adcData, g_justMuxed, SetMux(), StartAdcConversion(), and UCHAR.
void ProcessNextConversion | ( | void | ) |
checks whether all converted values are processed and starts a new ADC conversion if the latter evaluates to TRUE
Definition at line 74 of file adc.c.
References ADC_TMP_INNER_ID, ADC_TMP_OUTER_ID, g_adcData, INC_TSEND_INIT, INVALID_VAL_U16, and StartAdcConversion().
Referenced by CalcAdcTemp(), and CalcSupplyVoltage().
void SetMux | ( | UCHAR | ch | ) |
set multiplexer thus switching between channels
ch | adc channel id |
Definition at line 97 of file adc.c.
References ADC_VREF_SEL, FIRST_ADC_INPUT, g_justMuxed, and TRUE.
Referenced by AdcInit(), and ISR().
void StartAdcConversion | ( | void | ) |
start AD conversion, this will trigger the conversion of all selected channels via the interrupt
Definition at line 87 of file adc.c.
References ADC_SR, g_adcConverting, and TRUE.
Referenced by ISR(), and ProcessNextConversion().