Morse special chars and tx duration indication

This commit is contained in:
furrtek 2017-02-15 04:27:51 +00:00
parent 445503c606
commit 0ba05fea5e
7 changed files with 115 additions and 73 deletions

View file

@ -26,7 +26,6 @@
#include "tonesets.hpp"
#include "portapack_shared_memory.hpp"
//#define MORSE_UNIT (MORSE_SAMPLE_RATE * 0.05) // 1536000*0.05 (50ms)
#define MORSE_DOT 1
#define MORSE_DASH 3
#define MORSE_SYMBOL_SPACE 1
@ -43,7 +42,8 @@ const uint32_t morse_symbols[5] = {
MORSE_WORD_SPACE
};
size_t morse_encode(std::string& message, const uint32_t time_unit_ms, const uint32_t tone);
size_t morse_encode(std::string& message, const uint32_t time_unit_ms,
const uint32_t tone, uint32_t * const time_units);
const std::string foxhunt_codes[11] = {
{ "MOE" }, // -----.
@ -60,48 +60,8 @@ const std::string foxhunt_codes[11] = {
};
// 0=dot 1=dash
const uint8_t morse_ITU[36] = {
// Code Size
0b11111101, // 0: 11111 101
0b01111101, // 1: 01111 101
0b00111101, // 2: 00111 101
0b00011101, // 3: 00011 101
0b00001101, // 4: 00001 101
0b00000101, // 5: 00000 101
0b10000101, // 6: 10000 101
0b11000101, // 7: 11000 101
0b11100101, // 8: 11100 101
0b11110101, // 9: 11110 101
0b01000010, // A: 01--- 010
0b10000100, // B: 1000- 100
0b10100100, // C: 1010- 100
0b10000011, // D: 100-- 011
0b00000001, // E: 0---- 001
0b00100100, // F: 0010- 100
0b11000011, // G: 110-- 011
0b00000100, // H: 0000- 100
0b00000010, // I: 00--- 010
0b01110100, // J: 0111- 100
0b10100011, // K: 101-- 011
0b01000100, // L: 0100- 100
0b11000010, // M: 11--- 010
0b10000010, // N: 10--- 010
0b11100011, // O: 111-- 011
0b01100100, // P: 0110- 100 .#-###-###.# ##.#-### ##.#-###.# ##.#.# ##.#.#.# = 48 units
0b11010100, // Q: 1101- 100 60s: 1.25s/unit
0b01000011, // R: 010-- 011 75s: 1.5625s/unit
0b00000011, // S: 000-- 011
0b10000001, // T: 1---- 001
0b00100011, // U: 001-- 011
0b00010100, // V: 0001- 100
0b01100011, // W: 011-- 011
0b10010100, // X: 1001- 100
0b10110100, // Y: 1011- 100
0b11000100 // Z: 1100- 100
};
const uint16_t morse_special[23] = {
// Code Size
const uint16_t morse_ITU[63] = {
// Code Size
0b1010110000000110, // !: 101011- 110
0b0100100000000110, // ": 010010- 110
0, // #
@ -117,7 +77,16 @@ const uint16_t morse_special[23] = {
0b1000010000000110, // -: 100001- 110
0b0101010000000110, // .: 010101- 110
0b1001000000000101, // /: 10010-- 101
0b1111100000000101, // 0: 11111-- 101
0b0111100000000101, // 1: 01111-- 101
0b0011100000000101, // 2: 00111-- 101
0b0001100000000101, // 3: 00011-- 101
0b0000100000000101, // 4: 00001-- 101
0b0000000000000101, // 5: 00000-- 101
0b1000000000000101, // 6: 10000-- 101
0b1100000000000101, // 7: 11000-- 101
0b1110000000000101, // 8: 11100-- 101
0b1111000000000101, // 9: 11110-- 101
0b1110000000000110, // :: 111000- 110
0b1010100000000110, // ;: 101010- 110
0, // <
@ -125,7 +94,36 @@ const uint16_t morse_special[23] = {
0, // >
0b0011000000000110, // ?: 001100- 110
0b0110100000000110, // @: 011010- 110
0b0100000000000010, // A: 01----- 010
0b1000000000000100, // B: 1000--- 100
0b1010000000000100, // C: 1010--- 100
0b1000000000000011, // D: 100---- 011
0b0000000000000001, // E: 0------ 001
0b0010000000000100, // F: 0010--- 100
0b1100000000000011, // G: 110---- 011
0b0000000000000100, // H: 0000--- 100
0b0000000000000010, // I: 00----- 010
0b0111000000000100, // J: 0111--- 100
0b1010000000000011, // K: 101---- 011
0b0100000000000100, // L: 0100--- 100
0b1100000000000010, // M: 11----- 010
0b1000000000000010, // N: 10----- 010
0b1110000000000011, // O: 111---- 011
0b0110000000000100, // P: 0110--- 100 .#-###-###.# ##.#-### ##.#-###.# ##.#.# ##.#.#.# = 48 units
0b1101000000000100, // Q: 1101--- 100
0b0100000000000011, // R: 010---- 011
0b0000000000000011, // S: 000---- 011
0b1000000000000001, // T: 1------ 001
0b0010000000000011, // U: 001---- 011
0b0001000000000100, // V: 0001--- 100
0b0110000000000011, // W: 011---- 011
0b1001000000000100, // X: 1001--- 100
0b1011000000000100, // Y: 1011--- 100
0b1100000000000100, // Z: 1100--- 100
0, // [
0, // Back-slash
0, // ]
0, // ^
0b0011010000000110 // _: 001101- 110
};