ESPHome 2026.8.0b4
Loading...
Searching...
No Matches
zephyr_pwm.h
Go to the documentation of this file.
1#pragma once
2
3#ifdef USE_ZEPHYR
6
7#include <zephyr/device.h>
8
9namespace esphome::zephyr_pwm {
10
12 public:
13 explicit ZephyrPWMChannel(const struct device *device, uint8_t channel, bool pin_inverted, uint32_t period_ns)
14 : device_(device), channel_(channel), pin_inverted_(pin_inverted), period_ns_(period_ns) {}
15
16 void setup() override;
17 void dump_config() override;
19 float get_setup_priority() const override { return setup_priority::HARDWARE; }
20
21 protected:
22 void write_state(float state) override;
23
24 const struct device *device_;
25 uint8_t channel_;
28};
29} // namespace esphome::zephyr_pwm
30
31#endif // USE_ZEPHYR
Base class for all output components that can output a variable level, like PWM.
float get_setup_priority() const override
HARDWARE setup_priority.
Definition zephyr_pwm.h:19
ZephyrPWMChannel(const struct device *device, uint8_t channel, bool pin_inverted, uint32_t period_ns)
Definition zephyr_pwm.h:13
void write_state(float state) override
bool state
Definition fan.h:2
constexpr float HARDWARE
For components that deal with hardware and are very important like GPIO switch.
Definition component.h:43
static void uint32_t