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};
74 void set_total_pulses(uint32_t pulses);
77 void setup()
override;
78 void update()
override;
80 void dump_config()
override;
85 uint32_t last_time_{0};
86 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)
pcnt_channel_t pcnt_channel
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