ESPHome 2026.12.0-dev
Loading...
Searching...
No Matches
beken_irda.h
Go to the documentation of this file.
1#pragma once
2
5
6namespace esphome::beken_irda {
7
9 public:
10 explicit BekenIrdaComponent(InternalGPIOPin *pin) : remote_base::RemoteReceiverBase(pin) {}
11
12 void setup() override;
13 void loop() override;
14 void dump_config() override;
15 float get_setup_priority() const override { return setup_priority::HARDWARE; }
16
17 protected:
18 static void irda_isr();
19 void handle_isr_();
20 void dispatch_full_(uint32_t code);
21 void dispatch_repeat_();
22
23 volatile uint32_t last_code_{0};
24 // Rejected codes and IRDA errors, and codes overwritten before dispatch; reset by every loop pass.
25 // Saturating, so a flood between passes reads as 255 rather than wrapping to zero
26 volatile uint8_t error_count_{0};
27 volatile uint8_t dropped_count_{0};
28 // Bit fields keep the flags in one byte; the loop changes them only under InterruptLock
29 volatile bool raw_ready_ : 1 {false};
30 volatile bool repeat_ready_ : 1 {false};
32 volatile bool repeats_valid_ : 1 {false};
33};
34
35} // namespace esphome::beken_irda
volatile bool repeats_valid_
Repeats belong to the last frame the ISR read, so they are dropped after a rejected one.
Definition beken_irda.h:32
float get_setup_priority() const override
Definition beken_irda.h:15
BekenIrdaComponent(InternalGPIOPin *pin)
Definition beken_irda.h:10
constexpr float HARDWARE
For components that deal with hardware and are very important like GPIO switch.
Definition component.h:43
static void uint32_t