10#ifndef M5_UNIT_INFRARED_IR_RC5_CODEC_HPP
11#define M5_UNIT_INFRARED_IR_RC5_CODEC_HPP
41 bool decode(
const gpio::m5_rmt_item_t* items, uint32_t num,
DecodeResult& result)
override;
74 static constexpr uint16_t HALF_BIT{889};
75 static constexpr uint16_t FULL_BIT{1778};
76 static constexpr uint16_t TOLERANCE{250};
Abstract base class for IR protocol encoding/decoding.
Definition ir_codec.hpp:62
Philips RC5 / RC5X IR protocol encoder/decoder.
Definition rc5_codec.hpp:31
bool toggle() const
Toggle bit state (flipped on each new key press)
Definition rc5_codec.hpp:53
void flipToggle()
Flip toggle bit (call on each new key press)
Definition rc5_codec.hpp:66
bool decode(const gpio::m5_rmt_item_t *items, uint32_t num, DecodeResult &result) override
Decode an RC5 / RC5X Manchester frame (14 bits including S1/S2/T)
Definition rc5_codec.cpp:43
Rc5Codec()
Constructor.
Definition rc5_codec.hpp:34
void setToggle(bool t)
Set toggle bit.
Definition rc5_codec.hpp:61
item_container_type encode(uint16_t address, uint16_t command, bool repeat) override
Encode an RC5 or RC5X frame (S2 = ~Cmd[6] when command ≥ 64)
Definition rc5_codec.cpp:17
uint32_t carrierFrequencyHz() const override
Carrier frequency for RC5 (36 kHz)
Definition rc5_codec.hpp:44
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