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 '*'
31 #if !RADIOLIB_EXCLUDE_AFSK
47 int16_t
begin(
float base, uint8_t speed = 20);
61 static char decode(uint8_t symbol, uint8_t len);
72 #if !RADIOLIB_EXCLUDE_AFSK
73 int read(uint8_t* symbol, uint8_t* len,
float low = 0.75f,
float high = 1.25f);
81 size_t write(uint8_t b)
override;
87 #if !RADIOLIB_EXCLUDE_AFSK
91 uint32_t baseFreq = 0, baseFreqHz = 0;
92 float basePeriod = 0.0f;
93 uint32_t dotLength = 0;
94 uint32_t dashLength = 0;
95 uint32_t letterSpace = 0;
96 uint16_t wordSpace = 0;
99 uint32_t signalCounter = 0;
101 uint32_t pauseCounter = 0;
104 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:23
size_t startSignal()
Send start signal.
Definition Morse.cpp:112
size_t write(uint8_t b) override
Write one byte. Implementation of interface of the RadioLibPrint/Print class.
Definition Morse.cpp:187
int16_t begin(float base, uint8_t speed=20)
Initialization method.
Definition Morse.cpp:94
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:135
static char decode(uint8_t symbol, uint8_t len)
Decode Morse symbol to ASCII.
Definition Morse.cpp:116
Provides common interface for protocols that run on LoRa/FSK modules, such as RTTY or LoRaWAN....
Definition PhysicalLayer.h:390
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:679