2022-05-22 21:55:22 -06:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <MIDIUSB.h>
|
|
|
|
#include "keyers.h"
|
|
|
|
#include "polybuzzer.h"
|
|
|
|
|
|
|
|
class VailAdapter: public Transmitter {
|
|
|
|
private:
|
2023-02-25 18:10:14 -07:00
|
|
|
unsigned int txNote = 69;
|
2022-05-22 21:55:22 -06:00
|
|
|
unsigned int ditDuration = 100;
|
2023-02-25 18:10:14 -07:00
|
|
|
bool keyboardMode = true;
|
2022-05-22 21:55:22 -06:00
|
|
|
Keyer *keyer = NULL;
|
|
|
|
PolyBuzzer *buzzer = NULL;
|
|
|
|
|
|
|
|
void midiKey(uint8_t key, bool down);
|
|
|
|
void keyboardKey(uint8_t key, bool down);
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
VailAdapter(unsigned int PiezoPin);
|
2023-02-25 18:10:14 -07:00
|
|
|
bool KeyboardMode();
|
2022-05-22 21:55:22 -06:00
|
|
|
void HandlePaddle(Paddle key, bool pressed);
|
|
|
|
void HandleMIDI(midiEventPacket_t event);
|
|
|
|
void BeginTx();
|
|
|
|
void EndTx();
|
2022-05-28 15:18:28 -06:00
|
|
|
void Tick(unsigned millis);
|
2022-05-22 21:55:22 -06:00
|
|
|
};
|