5 namespace remote_base {
7 static const char *
const TAG =
"remote.samsung36";
9 static const uint8_t NBITS = 78;
11 static const uint32_t HEADER_HIGH_US = 4500;
12 static const uint32_t HEADER_LOW_US = 4500;
13 static const uint32_t BIT_HIGH_US = 500;
14 static const uint32_t BIT_ONE_LOW_US = 1500;
15 static const uint32_t BIT_ZERO_LOW_US = 500;
16 static const uint32_t MIDDLE_HIGH_US = 500;
17 static const uint32_t MIDDLE_LOW_US = 4500;
18 static const uint32_t FOOTER_HIGH_US = 500;
19 static const uint32_t FOOTER_LOW_US = 59000;
26 dst->
item(HEADER_HIGH_US, HEADER_LOW_US);
29 for (uint32_t mask = 1UL << 15; mask != 0; mask >>= 1) {
31 dst->
item(BIT_HIGH_US, BIT_ONE_LOW_US);
33 dst->
item(BIT_HIGH_US, BIT_ZERO_LOW_US);
38 dst->
item(MIDDLE_HIGH_US, MIDDLE_LOW_US);
41 for (uint32_t mask = 1UL << 19; mask != 0; mask >>= 1) {
43 dst->
item(BIT_HIGH_US, BIT_ONE_LOW_US);
45 dst->
item(BIT_HIGH_US, BIT_ZERO_LOW_US);
50 dst->
item(FOOTER_HIGH_US, FOOTER_LOW_US);
60 if (!src.
expect_item(HEADER_HIGH_US, HEADER_LOW_US))
64 if (src.
size() != NBITS)
68 for (uint8_t i = 0; i < 16; i++) {
72 }
else if (src.
expect_item(BIT_HIGH_US, BIT_ZERO_LOW_US)) {
80 if (!src.
expect_item(MIDDLE_HIGH_US, MIDDLE_LOW_US)) {
85 for (uint8_t i = 0; i < 20; i++) {
89 }
else if (src.
expect_item(BIT_HIGH_US, BIT_ZERO_LOW_US)) {
99 ESP_LOGI(TAG,
"Received Samsung36: address=0x%04X, command=0x%08" PRIX32, data.
address, data.
command);
void dump(const Samsung36Data &data) override
void encode(RemoteTransmitData *dst, const Samsung36Data &data) override
void set_carrier_frequency(uint32_t carrier_frequency)
void item(uint32_t mark, uint32_t space)
optional< Samsung36Data > decode(RemoteReceiveData src) override
Implementation of SPI Controller mode.
void reserve(uint32_t len)
bool expect_item(uint32_t mark, uint32_t space)