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