|
Arduino PulseWire Transceiver Library
|
Differential Manchester encoding/decoding utility class for IR communication. More...
#include <DifferentialManchesterCodec.h>


Public Member Functions | |
| DifferentialManchesterCodec (Preamble &preambleDetector) | |
| bool | begin (uint16_t bitFrequencyHz) override |
| initialization method for codecs that require setup before use (e.g., loading PIO programs, configuring state machines). | |
| CodecEnum | getCodecType () const override |
| instance. | |
| bool | decodeEdge (uint32_t durationUs, bool level, uint8_t &result) override |
| Decode incoming edges to reconstruct bytes. Handles multiple edges per bit for noise tolerance by averaging edge durations and applying decodeEdge() logic to the average. This allows for robust decoding even in noisy environments where multiple edges may be detected. | |
| int | getEndOfFrameDelayUs () override |
| Provide the end of frame delay in microseconds for this protocol, used by RX driver to. | |
| virtual void | init (Preamble &detector, uint32_t shortPulseUs=600, uint32_t longPulseUs=1200, uint32_t toleranceUs=200) |
| Preamble & | getPreamble () |
| Get the preamble detector associated with this codec. | |
| void | setPreamble (Preamble &preamble) |
| Set the Preamble Detector object. | |
| size_t | encodePreamble (Vector< OutputEdge > &output) |
| virtual size_t | encode (uint8_t byte, Vector< OutputEdge > &output) |
| Fill output vector with protocol-specific OutputSpec(s) for a byte. | |
| void | setFrameSize (uint16_t size) |
| virtual void | encodeByte (uint8_t byte, std::vector< bool > &bits) const |
| Encode a byte to protocol bitstream. Default implementation encodes to raw bits (MSB first), but can be overridden by protocols that require different bit formatting (e.g., Manchester). The output bits are stored in. | |
| const char * | name () const |
| Get the name of the codec type as a string (e.g., "PulseDistance", "Manchester"). | |
Protected Member Functions | |
| size_t | encodeBit (bool bit, Vector< OutputEdge > &output) override |
| Fill output vector with protocol-specific OutputSpec(s) for a bit. | |
| bool | decodeByte (Vector< OutputEdge > &edges, uint8_t &result) override |
| Decode edges into a byte. | |
| void | reset () override |
| bool | getIdleLevel () const override |
| Provides the initial ldle state (low or hith) | |
| size_t | getEdgeCount () const override |
| Get the number of edges used to encode a byte (16 for Manchester). | |
Protected Attributes | |
| bool | _lastLevelEncode = false |
| bool | _lastLevelDecode = false |
| CustomPreambleUs | _defaultPreamble |
| Preamble * | _preamble = &_defaultPreamble |
| uint16_t | _bitFrequencyHz = 0 |
| uint32_t | _bitPeriodUs = 0 |
| Vector< OutputEdge > | _decodeEdgeStream |
| volatile bool | _inFrame = false |
Differential Manchester encoding/decoding utility class for IR communication.
Definition at line 14 of file DifferentialManchesterCodec.h.
|
inline |
Definition at line 16 of file DifferentialManchesterCodec.h.
initialization method for codecs that require setup before use (e.g., loading PIO programs, configuring state machines).
Reimplemented from pulsewire::Codec.
Definition at line 19 of file DifferentialManchesterCodec.h.
|
inlineoverrideprotectedvirtual |
Decode edges into a byte.
Implements pulsewire::Codec.
Definition at line 55 of file DifferentialManchesterCodec.h.
|
inlineoverridevirtualinherited |
Decode incoming edges to reconstruct bytes. Handles multiple edges per bit for noise tolerance by averaging edge durations and applying decodeEdge() logic to the average. This allows for robust decoding even in noisy environments where multiple edges may be detected.
| durationUs | |
| level | |
| result |
Reimplemented from pulsewire::Codec.
Definition at line 50 of file ManchesterCodec.h.
|
inlinevirtualinherited |
Fill output vector with protocol-specific OutputSpec(s) for a byte.
Encodes the byte to protocol bits and appends OutputSpec(s) for each bit.
| byte | The byte to encode. |
| output | Vector to append OutputSpec(s). |
Reimplemented in pulsewire::NRZCodec.
|
inlineoverrideprotectedvirtual |
Fill output vector with protocol-specific OutputSpec(s) for a bit.
| bit | The bit to encode (true/false). |
| output | Vector to append OutputSpec(s). |
Reimplemented from pulsewire::Codec.
Definition at line 31 of file DifferentialManchesterCodec.h.
|
inlinevirtualinherited |
Encode a byte to protocol bitstream. Default implementation encodes to raw bits (MSB first), but can be overridden by protocols that require different bit formatting (e.g., Manchester). The output bits are stored in.
| byte | The input byte to encode. |
| bits | Output buffer for encoded bits (protocol-specific format). |
Reimplemented in pulsewire::RecorderCodec.
|
inlineinherited |
|
inlineoverridevirtual |
instance.
Get the codec type (e.g., PulseDistance, Manchester) for this Codec
Implements pulsewire::Codec.
Definition at line 24 of file DifferentialManchesterCodec.h.
|
inlineoverrideprotectedvirtualinherited |
Get the number of edges used to encode a byte (16 for Manchester).
Implements pulsewire::Codec.
Definition at line 78 of file ManchesterCodec.h.
|
inlineoverridevirtualinherited |
Provide the end of frame delay in microseconds for this protocol, used by RX driver to.
Implements pulsewire::Codec.
Definition at line 72 of file ManchesterCodec.h.
|
inlineoverrideprotectedvirtual |
Provides the initial ldle state (low or hith)
Reimplemented from pulsewire::Codec.
Definition at line 84 of file DifferentialManchesterCodec.h.
|
inlineinherited |
|
inlinevirtualinherited |
Used by IRTransceiver to initialize codec with protocol-specific parameters
Reimplemented in pulsewire::PulseWidthCodec, pulsewire::PulseDistanceCodec, and pulsewire::RecorderCodec.
|
inlineoverrideprotectedvirtual |
Reimplemented from pulsewire::Codec.
Definition at line 78 of file DifferentialManchesterCodec.h.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
Definition at line 90 of file DifferentialManchesterCodec.h.
Definition at line 89 of file DifferentialManchesterCodec.h.
|
protectedinherited |