3 #if INC_TSEND_INIT == 0
34 ADC_SR = (1<<ADEN) | (1<<ADSC) | (0<<
AD_FR) | (0<<ADIF) | (1<<ADIE) | (1<<ADPS2) | (1<<ADPS1) | (0<<ADPS0);
42 static UCHAR id=0, meanCnt=0;
109 float rohm = 0.0, div = 0.0;
116 #if INC_TSEND_INIT == 0
117 rohm = (float)((((
float)(((
float)((
float)res / (
float)
ADC_MEAN_VALUES)) * (
float)gArv())) / (
float)
ADC_RES)) * (
float)gRcv();
118 div = log(rohm/(
float)gRri());
119 #elif INC_TSEND_INIT == 1
123 return (
UINT)(((1/(
A1 +
B1*div +
C1*pow(div,2) +
D1*pow(div,3))) - 273.15) * 1000.0);
void ProcessNextConversion(void)
checks whether all converted values are processed and starts a new ADC conversion if the latter evalu...
UCHAR volatile g_justMuxed
UINT CalcSupplyVoltage(UCHAR id)
UINT g_adcData[ADC_INPUTS]
ISR(ADC_vect)
ADC interrupt service.
void SetMux(UCHAR ch)
set multiplexer thus switching between channels
void AdcInit(void)
initialize the adc resource
#define REV_CURRENT_VALUE
UINT CalcAdcTemp(UCHAR id)
calculate the temperature from specific ADC value in data array, specified by id
UCHAR volatile g_adcConverting
void StartAdcConversion(void)
start AD conversion, this will trigger the conversion of all selected channels via the interrupt ...