1#if !defined(_RADIOLIB_MORSE_H) && !RADIOLIB_EXCLUDE_MORSE
2#define _RADIOLIB_MORSE_H
4#include "../../TypeDef.h"
5#include "../PhysicalLayer/PhysicalLayer.h"
6#include "../AFSK/AFSK.h"
7#include "../Print/Print.h"
9#define RADIOLIB_MORSE_DOT 0b0
10#define RADIOLIB_MORSE_DASH 0b1
11#define RADIOLIB_MORSE_GUARDBIT 0b1
12#define RADIOLIB_MORSE_UNSUPPORTED 0xFF
13#define RADIOLIB_MORSE_ASCII_OFFSET 32
14#define RADIOLIB_MORSE_INTER_SYMBOL 0x00
15#define RADIOLIB_MORSE_CHAR_COMPLETE 0x01
16#define RADIOLIB_MORSE_WORD_COMPLETE 0x02
17#define RADIOLIB_MORSE_UNKNOWN_SYMBOL '*'
23static const uint8_t MorseTable[] RADIOLIB_NONVOLATILE = {
27 RADIOLIB_MORSE_UNSUPPORTED,
28 RADIOLIB_MORSE_UNSUPPORTED,
29 RADIOLIB_MORSE_UNSUPPORTED,
30 RADIOLIB_MORSE_UNSUPPORTED,
34 RADIOLIB_MORSE_UNSUPPORTED,
51 RADIOLIB_MORSE_UNSUPPORTED,
52 RADIOLIB_MORSE_UNSUPPORTED,
54 RADIOLIB_MORSE_UNSUPPORTED,
83 RADIOLIB_MORSE_UNSUPPORTED,
84 RADIOLIB_MORSE_UNSUPPORTED,
85 RADIOLIB_MORSE_UNSUPPORTED,
102 #if !RADIOLIB_EXCLUDE_AFSK
118 int16_t
begin(
float base, uint8_t speed = 20);
132 static char decode(uint8_t symbol, uint8_t len);
143 #if !RADIOLIB_EXCLUDE_AFSK
144 int read(uint8_t* symbol, uint8_t* len,
float low = 0.75f,
float high = 1.25f);
152 size_t write(uint8_t b)
override;
158 #if !RADIOLIB_EXCLUDE_AFSK
162 uint32_t baseFreq = 0, baseFreqHz = 0;
163 float basePeriod = 0.0f;
164 uint32_t dotLength = 0;
165 uint32_t dashLength = 0;
166 uint32_t letterSpace = 0;
167 uint16_t wordSpace = 0;
170 uint32_t signalCounter = 0;
172 uint32_t pauseCounter = 0;
175 int16_t transmitDirect(uint32_t freq = 0, uint32_t freqHz = 0);
Client for audio-based transmissions. Requires Arduino tone() function, and a module capable of direc...
Definition AFSK.h:16
Client for Morse Code communication. The public interface is the same as Arduino Serial.
Definition Morse.h:94
size_t startSignal()
Send start signal.
Definition Morse.cpp:41
size_t write(uint8_t b) override
Write one byte. Implementation of interface of the RadioLibPrint/Print class.
Definition Morse.cpp:116
int16_t begin(float base, uint8_t speed=20)
Initialization method.
Definition Morse.cpp:23
int read(uint8_t *symbol, uint8_t *len, float low=0.75f, float high=1.25f)
Read Morse tone on input pin.
Definition Morse.cpp:64
static char decode(uint8_t symbol, uint8_t len)
Decode Morse symbol to ASCII.
Definition Morse.cpp:45
Provides common interface for protocols that run on LoRa/FSK modules, such as RTTY or LoRaWAN....
Definition PhysicalLayer.h:216
Printing class, based on Arduino Print class with additional encodings.
Definition Print.h:17
unsigned long RadioLibTime_t
Type used for durations in RadioLib.
Definition TypeDef.h:642