ESPHome 2026.6.0-dev
Loading...
Searching...
No Matches
duty_cycle_sensor.h
Go to the documentation of this file.
1#pragma once
2
4#include "esphome/core/hal.h"
6
7namespace esphome::duty_cycle {
8
12 volatile uint32_t on_time{0};
13 volatile bool last_level{false};
15
16 static void gpio_intr(DutyCycleSensorStore *arg);
17};
18
20 public:
21 void set_pin(InternalGPIOPin *pin) { pin_ = pin; }
22
23 void setup() override;
24 void dump_config() override;
25 void update() override;
26
27 protected:
29
32};
33
34} // namespace esphome::duty_cycle
Copy of GPIOPin that is safe to use from ISRs (with no virtual functions)
Definition gpio.h:92
This class simplifies creating components that periodically check a state.
Definition component.h:585
void set_pin(InternalGPIOPin *pin)
Base-class for all sensors.
Definition sensor.h:47
static void uint32_t
Store data in a class that doesn't use multiple-inheritance (vtables in flash)
static void gpio_intr(DutyCycleSensorStore *arg)