mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-09-10 00:29:33 +00:00
Rtty tx and rx (#2977)
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
#ifndef BAUDOT_HPP
|
||||
#define BAUDOT_HPP
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
namespace ui::external_app::rtty_tx {
|
||||
|
||||
class BaudotCoder {
|
||||
public:
|
||||
enum ShiftState { LETTERS,
|
||||
FIGURES };
|
||||
|
||||
BaudotCoder()
|
||||
: shiftState(LETTERS) {}
|
||||
char decode(uint8_t baudotCode);
|
||||
void encode(const std::string& src, uint8_t* dest, uint16_t* dest_length, uint16_t dest_max_size);
|
||||
void set_usos(bool enable) { usos_enabled = enable; } // shift == set to letters too
|
||||
|
||||
private:
|
||||
ShiftState shiftState;
|
||||
bool usos_enabled = true;
|
||||
char get_char_mapping(bool is_figures, uint8_t index) const;
|
||||
};
|
||||
|
||||
} // namespace ui::external_app::rtty_tx
|
||||
|
||||
#endif // BAUDOT_HPP
|
||||
Reference in New Issue
Block a user