10#ifndef M5_UNIT_INFRARED_IR_NEC_CODEC_HPP
11#define M5_UNIT_INFRARED_IR_NEC_CODEC_HPP
49 bool decode(
const gpio::m5_rmt_item_t* items, uint32_t num,
DecodeResult& result)
override;
72 static constexpr uint16_t LEADER_MARK{9000};
73 static constexpr uint16_t LEADER_SPACE{4500};
74 static constexpr uint16_t BIT_MARK{560};
75 static constexpr uint16_t ONE_SPACE{1690};
76 static constexpr uint16_t ZERO_SPACE{560};
77 static constexpr uint16_t REPEAT_SPACE{2250};
78 static constexpr uint16_t TOLERANCE{200};
Abstract base class for IR protocol encoding/decoding.
Definition ir_codec.hpp:62
NEC / Extended NEC IR protocol encoder/decoder.
Definition nec_codec.hpp:39
bool decode(const gpio::m5_rmt_item_t *items, uint32_t num, DecodeResult &result) override
Decode a NEC full frame or repeat frame.
Definition nec_codec.cpp:70
item_container_type encodeRepeat()
Encode NEC repeat code.
Definition nec_codec.cpp:58
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.
Definition nec_codec.cpp:17
NecCodec()
Constructor.
Definition nec_codec.hpp:42
item_container_type encodeRaw(uint32_t data)
Encode with explicit 32-bit raw data.
Definition nec_codec.cpp:41
uint32_t carrierFrequencyHz() const override
Carrier frequency for NEC (38 kHz)
Definition nec_codec.hpp:52
IR protocol codec base class and types.
std::vector< m5::unit::gpio::m5_rmt_item_t > item_container_type
RMT item container.
Definition ir_codec.hpp:54
CodecType
Identifies the IR protocol codec implementation.
Definition ir_codec.hpp:27
Top level namespace of M5Stack.
Result of decoding a received IR frame.
Definition ir_codec.hpp:44