Crate morse_codec

Source
Expand description

Rust library for live decoding and encoding of morse code messages. Supports multiple embedded devices and operating systems by being no_std.

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. Decoder supports three precision (difficulty) modes. Lazy (easiest), Accurate (hardest) and Farnsworth mode (somewhere inbetween)

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

§Features

  • Decoder
  • Encoder

UTF-8 is supported behind a feature flag. When not used it should not interfere with embedded device applications.

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

Re-exports§

Modules§

  • Contains morse code to character set mappings.
  • Live decoder for morse code that converts morse code to characters. Supports real-time decoding of incoming signals and decoding prepared morse signals. This module supports Farnsworth timing mode and can be used for morse code practice.
  • Morse code encoder to turn text into morse code text or signals.
  • Message struct to hold decoded message or message to be encoded.

Enums§

Constants§

  • If a decoding error happens, we put this character as a placeholder.
  • 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 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. In ASCII mode, turning chars into bytes if they’re only ascii makes sense.
  • This corresponds to empty character ’ ’ which is the default character

Type Aliases§