9 #if defined(USE_ESP32) && !defined(USE_ESP32_VARIANT_ESP32C3) 10 #include <driver/pcnt.h> 15 namespace pulse_counter {
47 volatile uint32_t last_pulse{0};
73 void set_total_pulses(uint32_t pulses);
76 void setup()
override;
77 void update()
override;
79 void dump_config()
override;
84 uint32_t last_time_{0};
85 uint32_t current_total_{0};
const float DATA
For components that import data from directly connected sensors like DHT.
PulseCounterSensor(bool hw_pcnt=false)
Copy of GPIOPin that is safe to use from ISRs (with no virtual functions)
PulseCounterCountMode rising_edge_mode
PulseCounterStorageBase * get_storage(bool hw_pcnt)
void set_total_sensor(sensor::Sensor *total_sensor)
ISRInternalGPIOPin isr_pin
This class simplifies creating components that periodically check a state.
void set_pin(InternalGPIOPin *pin)
float get_setup_priority() const override
void set_rising_edge_mode(PulseCounterCountMode mode)
virtual pulse_counter_t read_raw_value()=0
BedjetMode mode
BedJet operating mode.
PulseCounterStorageBase & storage_
pulse_counter_t last_value
Implementation of SPI Controller mode.
Base-class for all sensors.
virtual bool pulse_counter_setup(InternalGPIOPin *pin)=0
void set_falling_edge_mode(PulseCounterCountMode mode)
void set_filter_us(uint32_t filter)
PulseCounterCountMode falling_edge_mode