implementation of the reading and converting the ADC values More...
#include "adc.h"#include "led.h"#include "gpio.h"#include "uart.h"#include "timer.h"#include "dcfReceive.h"Go to the source code of this file.
Functions | |
| __interrupt void | ADC10_ISR (void) |
| ADC interrupt routine, gets called when end interrupt of ISR_TA0(void) is reached via startAdcConv(). | |
| void | setupAdc () |
| Setup ADC, get called in startup from main(), Shortest samling rate, with 2.5V reference, no prdivider, setup channels and enable conversion interrupts. | |
| void | startAdcConv () |
| Start the ADC conversion'(s), gets called when end interrupt of ISR_TA0(void) is reached. | |
| double | convertAdc2Voltage (int R1, int R2, int adcReading) |
| Convert the adc reading to a voltage before voltage divider. | |
Variables | |
| volatile unsigned int | ADCvar |
| volatile unsigned char | currentChannel = 0 |
| volatile double | voltReading |
implementation of the reading and converting the ADC values
Definition in file adc.c.
| __interrupt void ADC10_ISR | ( | void | ) |
ADC interrupt routine, gets called when end interrupt of ISR_TA0(void) is reached via startAdcConv().
Definition at line 28 of file adc.c.
References adcResults, changeLedBrightness(), convertAdc2Voltage(), countDcf77Messages, currentChannel, sleep(), voltReading, and wakeUp().
| double convertAdc2Voltage | ( | int | R1, |
| int | R2, | ||
| int | adcReading ) |
Convert the adc reading to a voltage before voltage divider.
Definition at line 132 of file adc.c.
References adcMax, and referenceVoltage.
Referenced by ADC10_ISR().
| void setupAdc | ( | ) |
Setup ADC, get called in startup from main(), Shortest samling rate, with 2.5V reference, no prdivider, setup channels and enable conversion interrupts.
Definition at line 86 of file adc.c.
Referenced by main().
| void startAdcConv | ( | ) |
Start the ADC conversion'(s), gets called when end interrupt of ISR_TA0(void) is reached.
Definition at line 119 of file adc.c.
Referenced by ISR_TA0().
| volatile unsigned char currentChannel = 0 |
Definition at line 19 of file adc.c.
Referenced by ADC10_ISR().
| volatile double voltReading |
Definition at line 20 of file adc.c.
Referenced by ADC10_ISR().