[][src]Crate ppm_decode

This library provides decoding of PPM pulse edges into PPM frames. It does not require a particular interrupt handling or input pin measurement strategy. All the user needs to provide is the relative timing of pulses, and the library will extract PPM frames from that.

PPM channel values are encoded as the gap between multiple pulses. Typically PPM pulses are high values and the gaps between them are low values; however, some PPM receivers invert the signal, where the PPM signal is pulled high and pulses are low values. PPM frames consist of multiple channels encoded in this way, with a longer duration gap between the last channel and the first channel, after which comes the next frame. This frame-separating gap is referred to as a frame sync or reset. So a PPM frame with five channels might look like:

||||||___ Where high values are the pulses and low values are the gaps between pulses. The pulse duration itself is typically tuned to be as short as possible and still reliably transmitted.

The library provides defaults for common configuration values such as:

  • Minimum PPM channel value (the minimum gap between pulses)
  • Maximum PPM channel value (the maximum gap between pulses)
  • Minimum frame sync duration (the minimum time for a gap between pulses to be considered a frame sync / reset)
  • Minimum number of PPM channels to be considered a valid frame.

Structs

ParserConfig

Configuration values for PpmParser

PpmFrame

A single group of PPM channel values

PpmParser

Constants

MAX_CHAN_VAL

Default maximum channel value

MAX_PPM_CHANNELS

Maximum PPM channels this library supports

MID_CHAN_VAL

Default midpoint channel value

MIN_CHAN_VAL

Default minimum channel value

MIN_PPM_CHANNELS

Default minimum number of channels per frame

MIN_SYNC_WIDTH

Default minimum gap between frames (no pulses / inactive/ sync)

Type Definitions

Microseconds

Base type for PPM timing Your clock for measuring pulse edges will need at least microsecond resolution.

PpmTime

PPM timing values