ADC revised

This commit is contained in:
Tristan Krause 2019-04-03 14:09:58 +02:00
parent f9e56b44f3
commit 2d26632f41
9 changed files with 42 additions and 17 deletions

View file

@ -2,14 +2,29 @@
#define ADC_H
#include <avr/io.h>
#include <util/delay.h>
#include <stdint.h>
class ADU
{
public:
/**
* Konfiguriert die ADC Register
*/
void init(void) volatile;
uint16_t getValue(uint8_t) volatile;
/**
* Behandlungsroutine für ADC interrupt
*/
void handleConversionComplete(void) volatile;
/**
* Startet eine AD Konvertierung, wartet auf Abschluss und liefert Ergebnis
* \param channel Auswahl des ADC Kanals (0-7), Kanal 6 und 7 sind Poti R36 und R37
*/
uint16_t getValue(uint8_t channel) volatile;
private:
volatile bool active = false;
};
#endif // ADC_H