kopia lustrzana https://github.com/mobilinkd/tnc3-firmware
45 wiersze
847 B
C++
45 wiersze
847 B
C++
// Copyright 2015 Robert C. Riggs <rob@pangalactic.org>
|
|
// All rights reserved.
|
|
|
|
#ifndef INC_PTT_HPP_
|
|
#define INC_PTT_HPP_
|
|
|
|
#include "GPIO.hpp"
|
|
#include "LEDIndicator.h"
|
|
|
|
namespace mobilinkd { namespace tnc {
|
|
|
|
struct PTT {
|
|
virtual void on() = 0;
|
|
virtual void off() = 0;
|
|
virtual ~PTT() {}
|
|
};
|
|
|
|
struct SimplexPTT : PTT {
|
|
void on() {
|
|
tx_on(); // LED
|
|
gpio::PTT_SIMPLEX::on(); // PTT
|
|
}
|
|
void off() {
|
|
tx_off(); // LED
|
|
gpio::PTT_SIMPLEX::off(); // PTT
|
|
}
|
|
};
|
|
|
|
|
|
struct MultiplexPTT : PTT {
|
|
void on() {
|
|
tx_on(); // LED
|
|
gpio::PTT_MULTIPLEX::on(); // PTT
|
|
}
|
|
void off() {
|
|
tx_off(); // LED
|
|
gpio::PTT_MULTIPLEX::off(); // PTT
|
|
}
|
|
};
|
|
|
|
}} // mobilinkd::tnc
|
|
|
|
|
|
#endif // INC_PTT_HPP_
|