THW-Funk-Audio-Switch/Programm/Audio-Switch/io/Comperator.hpp

29 lines
474 B
C++
Raw Normal View History

2020-10-30 23:22:11 +01:00
/*
* Comperator.hpp
*
* Created: 30.10.2020 19:01:31
* Author: netz
*/
#ifndef COMPERATOR_HPP_
#define COMPERATOR_HPP_
2020-11-02 00:27:02 +01:00
#include <avr/io.h>
2020-10-30 23:22:11 +01:00
class Comperator {
// Methods
public:
2020-11-02 00:27:02 +01:00
Comperator() {
ADCSRB = 0;
ACSR = (1<<ACI) | (1<<ACIE) | (1<<ACIS1) | (1<<ACIS0);
}
bool GetInterruptActivated() {
if(ACSR & (1<<ACO)) {
return true;
}
return false;
}
2020-10-30 23:22:11 +01:00
};
#endif /* COMPERATOR_HPP_ */