ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
gpio_arduino.h
Go to the documentation of this file.
1#pragma once
2
3#ifdef USE_LIBRETINY
5
6namespace esphome::libretiny {
7
8class ArduinoInternalGPIOPin final : public GPIOPin {
9 public:
10 void set_pin(uint8_t pin) { pin_ = pin; }
11 void set_inverted(bool inverted) { inverted_ = inverted; }
13
14 void setup() override { pin_mode(flags_); }
15 void pin_mode(gpio::Flags flags) override;
16 bool digital_read() override;
17 void digital_write(bool value) override;
18 size_t dump_summary(char *buffer, size_t len) const override;
19 void detach_interrupt() const;
20 template<typename T> void attach_interrupt(void (*func)(T *), T *arg, gpio::InterruptType type) const {
21 this->attach_interrupt_(reinterpret_cast<void (*)(void *)>(func), arg, type);
22 }
24 uint8_t get_pin() const { return pin_; }
25 gpio::Flags get_flags() const override { return flags_; }
26 bool is_inverted() const { return inverted_; }
27 bool is_internal() override { return true; }
28
29 protected:
30 void attach_interrupt_(void (*func)(void *), void *arg, gpio::InterruptType type) const;
31
32 uint8_t pin_;
33 bool inverted_{};
35};
36
37} // namespace esphome::libretiny
38
39#endif // USE_LIBRETINY
Copy of GPIOPin that is safe to use from ISRs (with no virtual functions)
Definition gpio_pin.h:98
void attach_interrupt(void(*func)(T *), T *arg, gpio::InterruptType type) const
void pin_mode(gpio::Flags flags) override
gpio::Flags get_flags() const override
void attach_interrupt_(void(*func)(void *), void *arg, gpio::InterruptType type) const
size_t dump_summary(char *buffer, size_t len) const override
uint16_t flags
uint8_t type
uint32_t buffer
Definition gif.cpp:50
const void size_t len
Definition hal.h:68