5 namespace remote_base {
7 static const char *
const TAG =
"remote.panasonic";
9 static const uint32_t HEADER_HIGH_US = 3502;
10 static const uint32_t HEADER_LOW_US = 1750;
11 static const uint32_t BIT_HIGH_US = 502;
12 static const uint32_t BIT_ZERO_LOW_US = 400;
13 static const uint32_t BIT_ONE_LOW_US = 1244;
17 dst->
item(HEADER_HIGH_US, HEADER_LOW_US);
21 for (mask = 1UL << 15; mask != 0; mask >>= 1) {
23 dst->
item(BIT_HIGH_US, BIT_ONE_LOW_US);
25 dst->
item(BIT_HIGH_US, BIT_ZERO_LOW_US);
29 for (mask = 1UL << 31; mask != 0; mask >>= 1) {
31 dst->
item(BIT_HIGH_US, BIT_ONE_LOW_US);
33 dst->
item(BIT_HIGH_US, BIT_ZERO_LOW_US);
36 dst->
mark(BIT_HIGH_US);
43 if (!src.
expect_item(HEADER_HIGH_US, HEADER_LOW_US))
47 for (mask = 1UL << 15; mask != 0; mask >>= 1) {
50 }
else if (src.
expect_item(BIT_HIGH_US, BIT_ZERO_LOW_US)) {
57 for (mask = 1UL << 31; mask != 0; mask >>= 1) {
60 }
else if (src.
expect_item(BIT_HIGH_US, BIT_ZERO_LOW_US)) {
70 ESP_LOGI(TAG,
"Received Panasonic: address=0x%04X, command=0x%08" PRIX32, data.
address, data.
command);
void set_carrier_frequency(uint32_t carrier_frequency)
void item(uint32_t mark, uint32_t space)
optional< PanasonicData > decode(RemoteReceiveData src) override
void encode(RemoteTransmitData *dst, const PanasonicData &data) override
void mark(uint32_t length)
void dump(const PanasonicData &data) override
Implementation of SPI Controller mode.
void reserve(uint32_t len)
bool expect_item(uint32_t mark, uint32_t space)