ESPHome 2025.9.0-dev
Loading...
Searching...
No Matches
gpio.h
Go to the documentation of this file.
1#pragma once
2
3#ifdef USE_ZEPHYR
4#include "esphome/core/hal.h"
5struct device;
6namespace esphome {
7namespace zephyr {
8
10 public:
11 void set_pin(uint8_t pin) { this->pin_ = pin; }
12 void set_inverted(bool inverted) { this->inverted_ = inverted; }
13 void set_flags(gpio::Flags flags) { this->flags_ = flags; }
14
15 void setup() override;
16 void pin_mode(gpio::Flags flags) override;
17 bool digital_read() override;
18 void digital_write(bool value) override;
19 std::string dump_summary() const override;
20 void detach_interrupt() const override;
21 ISRInternalGPIOPin to_isr() const override;
22 uint8_t get_pin() const override { return this->pin_; }
23 bool is_inverted() const override { return this->inverted_; }
24 gpio::Flags get_flags() const override { return flags_; }
25
26 protected:
27 void attach_interrupt(void (*func)(void *), void *arg, gpio::InterruptType type) const override;
28 uint8_t pin_;
31 const device *gpio_ = nullptr;
32 bool value_ = false;
33};
34
35} // namespace zephyr
36} // namespace esphome
37
38#endif // USE_ZEPHYR
Copy of GPIOPin that is safe to use from ISRs (with no virtual functions)
Definition gpio.h:73
const device * gpio_
Definition gpio.h:31
void digital_write(bool value) override
Definition gpio.cpp:98
void attach_interrupt(void(*func)(void *), void *arg, gpio::InterruptType type) const override
Definition gpio.cpp:48
void setup() override
Definition gpio.cpp:52
void set_flags(gpio::Flags flags)
Definition gpio.h:13
bool digital_read() override
Definition gpio.cpp:91
bool is_inverted() const override
Definition gpio.h:23
uint8_t get_pin() const override
Definition gpio.h:22
std::string dump_summary() const override
Definition gpio.cpp:85
ISRInternalGPIOPin to_isr() const override
Definition gpio.cpp:41
gpio::Flags get_flags() const override
Definition gpio.h:24
void set_pin(uint8_t pin)
Definition gpio.h:11
void detach_interrupt() const override
Definition gpio.cpp:107
void pin_mode(gpio::Flags flags) override
Definition gpio.cpp:78
void set_inverted(bool inverted)
Definition gpio.h:12
uint8_t type
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7