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

40 lines
604 B
C++
Raw Normal View History

2020-10-30 23:22:11 +01:00
/*
* PTT.hpp
*
* Created: 30.10.2020 22:03:26
* Author: netz
*/
#ifndef PTT_HPP_
#define PTT_HPP_
2020-11-02 00:27:02 +01:00
#include <avr/io.h>
#include "ports/pin.hpp"
#include "ports/portd.hpp"
2020-10-30 23:22:11 +01:00
2020-11-02 00:27:02 +01:00
template<typename ptt_pin>
2020-10-30 23:22:11 +01:00
class PttT {
// Methods
private:
protected:
public:
2020-11-02 00:27:02 +01:00
PttT() {
ptt.MakeInput();
EICRA = (1<<ISC01) | (1<<ISC00);
EIMSK = (1<<INT0);
}
bool GetPttActivated() {
return ptt.Value();
}
2020-10-30 23:22:11 +01:00
// Variables
private:
2020-11-02 00:27:02 +01:00
ptt_pin ptt;
2020-10-30 23:22:11 +01:00
};
2020-11-02 00:27:02 +01:00
typedef PttT<blubblib::pin<blubblib::portd, PIND2> > Ptt;
2020-10-30 23:22:11 +01:00
#endif /* PTT_HPP_ */