5 namespace remote_base {
7 static const char *
const TAG =
"remote.nexa";
9 static const uint8_t NBITS = 32;
10 static const uint32_t HEADER_HIGH_US = 319;
11 static const uint32_t HEADER_LOW_US = 2610;
12 static const uint32_t BIT_HIGH_US = 319;
13 static const uint32_t BIT_ONE_LOW_US = 1000;
14 static const uint32_t BIT_ZERO_LOW_US = 140;
16 static const uint32_t TX_HEADER_HIGH_US = 250;
17 static const uint32_t TX_HEADER_LOW_US = TX_HEADER_HIGH_US * 10;
18 static const uint32_t TX_BIT_HIGH_US = 250;
19 static const uint32_t TX_BIT_ONE_LOW_US = TX_BIT_HIGH_US * 5;
20 static const uint32_t TX_BIT_ZERO_LOW_US = TX_BIT_HIGH_US * 1;
24 dst->
item(TX_BIT_HIGH_US, TX_BIT_ONE_LOW_US);
25 dst->
item(TX_BIT_HIGH_US, TX_BIT_ZERO_LOW_US);
30 dst->
item(TX_BIT_HIGH_US, TX_BIT_ZERO_LOW_US);
31 dst->
item(TX_BIT_HIGH_US, TX_BIT_ONE_LOW_US);
43 for (int16_t i = 26 - 1; i >= 0; i--) {
44 if (data.
device & (1 << i)) {
52 if (data.
group != 0) {
59 if (data.
state == 2) {
61 dst->
item(TX_BIT_HIGH_US, TX_BIT_ZERO_LOW_US);
62 dst->
item(TX_BIT_HIGH_US, TX_BIT_ZERO_LOW_US);
63 }
else if (data.
state == 1) {
70 for (int16_t i = 4 - 1; i >= 0; i--) {
79 if (data.
state == 2) {
80 for (int16_t i = 4 - 1; i >= 0; i--) {
81 if (data.
level & (1 << i)) {
90 dst->
item(TX_BIT_HIGH_US, TX_BIT_ZERO_LOW_US);
127 for (uint8_t i = 0; i < 26; i++) {
144 for (uint8_t i = 0; i < 1; i++) {
161 for (uint8_t i = 0; i < 1; i++) {
193 for (uint8_t i = 0; i < 4; i++) {
215 for (uint8_t i = 0; i < 4; i++) {
235 ESP_LOGI(TAG,
"Received NEXA: device=0x%04" PRIX32
" group=%d state=%d channel=%d level=%d", data.
device, data.
group,
bool expect_pulse_with_gap(uint32_t mark, uint32_t space)
void set_carrier_frequency(uint32_t carrier_frequency)
void one(RemoteTransmitData *dst) const
void item(uint32_t mark, uint32_t space)
optional< NexaData > decode(RemoteReceiveData src) override
void encode(RemoteTransmitData *dst, const NexaData &data) override
void zero(RemoteTransmitData *dst) const
void dump(const NexaData &data) override
uint32_t get_index() const
void sync(RemoteTransmitData *dst) const
Implementation of SPI Controller mode.