6 namespace pulse_meter {
8 static const char *
const TAG =
"pulse_meter";
37 auto *temp = this->
set_;
58 float pulse_width_us = delta_us / float(this->
get_->
count_);
67 const uint32_t now =
micros();
76 ESP_LOGD(TAG,
"No pulse detected for %" PRIu32
"s, assuming 0 pulses/min",
77 time_since_valid_edge_us / 1000000);
90 LOG_SENSOR(
"",
"Pulse Meter",
this);
91 LOG_PIN(
" Pin: ", this->
pin_);
93 ESP_LOGCONFIG(TAG,
" Filtering rising edges less than %" PRIu32
" µs apart", this->
filter_us_);
95 ESP_LOGCONFIG(TAG,
" Filtering pulses shorter than %" PRIu32
" µs", this->
filter_us_);
97 ESP_LOGCONFIG(TAG,
" Assuming 0 pulses/min after not receiving a pulse for %" PRIu32
"s",
104 const uint32_t now =
micros();
116 const uint32_t now =
micros();
const float DATA
For components that import data from directly connected sensors like DHT.
static void edge_intr(PulseMeterSensor *sensor)
InternalFilterMode filter_mode_
sensor::Sensor * total_sensor_
uint32_t last_edge_candidate_us_
uint32_t IRAM_ATTR HOT micros()
uint32_t last_detected_edge_us_
uint32_t last_processed_edge_us_
void dump_config() override
void publish_state(float state)
Publish a new state to the front-end.
void set_total_pulses(uint32_t pulses)
static void pulse_intr(PulseMeterSensor *sensor)
virtual ISRInternalGPIOPin to_isr() const =0
This is a workaround until we can figure out a way to get the tflite-micro idf component code availab...
float get_setup_priority() const override
ISRInternalGPIOPin isr_pin_
void attach_interrupt(void(*func)(T *), T *arg, gpio::InterruptType type) const