|
M5Unit-INFRARED 0.2.0 git rev:76ad9e1
|
NEC / Extended NEC IR protocol encoder/decoder. More...
#include <nec_codec.hpp>
Public Member Functions | |
| NecCodec () | |
| Constructor. | |
| item_container_type | encode (uint16_t address, uint16_t command, bool repeat) override |
Encode a standard or extended NEC frame, or the 2-item repeat frame when repeat is true. | |
| bool | decode (const gpio::m5_rmt_item_t *items, uint32_t num, DecodeResult &result) override |
| Decode a NEC full frame or repeat frame. | |
| uint32_t | carrierFrequencyHz () const override |
| Carrier frequency for NEC (38 kHz) | |
| item_container_type | encodeRaw (uint32_t data) |
| Encode with explicit 32-bit raw data. | |
| item_container_type | encodeRepeat () |
| Encode NEC repeat code. | |
Public Member Functions inherited from m5::unit::ir::IRCodec | |
| IRCodec (CodecType t) | |
| CodecType | type () const |
| Get codec type for safe downcasting. | |
| virtual float | carrierDuty () const |
| Carrier duty cycle (0.0 - 1.0) | |
| virtual uint8_t | minFrames () const |
| Number of frames that should be transmitted per keypress for this protocol. | |
| virtual uint16_t | frameGapUs () const |
| Inter-frame gap (microseconds) when transmitting multiple frames in one burst. | |
| virtual bool | decode (const m5::unit::gpio::m5_rmt_item_t *items, uint32_t num, DecodeResult &result)=0 |
| Try to decode RMT items into an IR command. | |
NEC / Extended NEC IR protocol encoder/decoder.
| Element | Mark (us) | Space (us) |
|---|---|---|
| Leader | 9000 | 4500 |
| Bit "1" | 560 | 1690 |
| Bit "0" | 560 | 560 |
| Repeat | 9000 | 2250 |
| Stop | 560 | - |
|
inlineoverridevirtual |
Carrier frequency for NEC (38 kHz)
Implements m5::unit::ir::IRCodec.
|
overridevirtual |
Encode a standard or extended NEC frame, or the 2-item repeat frame when repeat is true.
Implements m5::unit::ir::IRCodec.
| item_container_type m5::unit::ir::NecCodec::encodeRaw | ( | uint32_t | data | ) |
Encode with explicit 32-bit raw data.
| data | 32-bit NEC frame (address + ~address + command + ~command) |
| item_container_type m5::unit::ir::NecCodec::encodeRepeat | ( | ) |
Encode NEC repeat code.