C# Class Emlid.WindowsIot.Hardware.Protocols.Pwm.CppmDecoder

PWM decoder for the CPPM protocol.

A complete CPPM frame is about 22.5 ms (can vary between manufacturer). Signal low state is about 0.3 ms but sometimes a bit longer (PwmLowLimit). It begins with a start pulse (state high for more than 2 ms PwmSyncLengthMinium). Each channel (up to 8) is encoded by the time of the high state (CPPM high state + 0.3 x (PPM low state) = servo PWM pulse width).

See https://en.wikipedia.org/wiki/Pulse-position_modulation for more information.
Inheritance: IPwmDecoder
Exibir arquivo Open project: emlid/Navio-SDK-Windows-IoT

Public Methods

Method Description
DecodePulse ( ConcurrentQueue inputBuffer, AutoResetEvent inputTrigger, ConcurrentQueue outputBuffer, AutoResetEvent outputTrigger, CancellationToken stop ) : void

Runs the decoder thread.

Private Methods

Method Description
DecodeCycle ( PwmCycle cycle ) : PwmFrame

Decodes the incoming PWM signal (each complete cycle) using the CPPM protocol.

Method Details

DecodePulse() public method

Runs the decoder thread.
public DecodePulse ( ConcurrentQueue inputBuffer, AutoResetEvent inputTrigger, ConcurrentQueue outputBuffer, AutoResetEvent outputTrigger, CancellationToken stop ) : void
inputBuffer ConcurrentQueue Buffer from which new PWM values are read.
inputTrigger System.Threading.AutoResetEvent Trigger which is fired by the caller when new data arrives.
outputBuffer ConcurrentQueue Buffer into which decoded PWM frames are written.
outputTrigger System.Threading.AutoResetEvent Trigger which is fired by this decoder when new data has been decoded.
stop System.Threading.CancellationToken Signals when the decoder should stop.
return void