ADC revised
This commit is contained in:
parent
f9e56b44f3
commit
2d26632f41
9 changed files with 42 additions and 17 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue