7 #if defined(USE_ESP32) && !defined(USE_ESP32_VARIANT_ESP32C3) 8 #include <driver/pcnt.h> 13 namespace pulse_counter {
59 void setup()
override;
60 void update()
override;
62 void dump_config()
override;
67 uint32_t last_time_{0};
68 uint32_t current_total_{0};
ISRInternalGPIOPin isr_pin
volatile pulse_counter_t counter
const float DATA
For components that import data from directly connected sensors like DHT.
bool pulse_counter_setup(InternalGPIOPin *pin)
Copy of GPIOPin that is safe to use from ISRs (with no virtual functions)
void set_total_sensor(sensor::Sensor *total_sensor)
static void gpio_intr(PulseCounterStorage *arg)
This class simplifies creating components that periodically check a state.
void set_pin(InternalGPIOPin *pin)
float get_setup_priority() const override
pulse_counter_t read_raw_value()
PulseCounterCountMode rising_edge_mode
void set_rising_edge_mode(PulseCounterCountMode mode)
pulse_counter_t last_value
volatile uint32_t last_pulse
sensor::Sensor * total_sensor_
PulseCounterCountMode falling_edge_mode
Base-class for all sensors.
void set_falling_edge_mode(PulseCounterCountMode mode)
void set_filter_us(uint32_t filter)
PulseCounterStorage storage_