Crate morse_codec

source
Expand description

Library for live decoding and encoding of morse code messages. no_std to support multiple devices including embedded. UTF-8 is not supported at the moment, but can be implemented behind a feature flag in the future.

You can create messages by sending individual high and low signals in milliseconds to decoder, from the keyboard, mouse clicks, or a button connected to some embedded device. You can also bypass signal input and add prepared short or long morse signals to characters directly.

Use the encoder to turn your messages or characters into morse code strings or create a sequence of signals from the encoder to drive an external component such as an LED, step motor or speaker.

§Features

  • Decoder
  • Encoder

The lib is no_std outside testing to make sure it will work on embedded devices as well as operating systems.

Modules§

  • Live decoder for morse code that converts morse code to ASCII characters. Supports real-time decoding of incoming signals and decoding prepared morse signals.
  • Morse code encoder to turn text into morse code text or signals.

Enums§

Constants§

  • Maximum number of characters in a mapping set of morse code to letters.
  • If a decoding error happens, we put this character as a placeholder.
  • Default international morse code characters. It includes English language letters, numbers and punctuation marks.
  • We use this character to fill message arrays so when we encounter this char it actually means there’s no character there.
  • Char version of the FILLER_BYTE coz why not? It’s mainly used while generating bytes from &str slices. A char which is utf-8 by default in Rust, can be more than one byte, turning chars into bytes if they’re ascii makes the code stable.
  • Internal representation of morse characters. It’s an array of length CHARACTER_SET_LENGTH.
  • This corresponds to empty character ’ ’ which is the default character

Type Aliases§

  • Client code can use this type to construct a different character mapping to morse code and construct the decoder or encoder with this custom character set.