ESPHome  2025.2.0
gpio_arduino.h
Go to the documentation of this file.
1 #pragma once
2 
3 #ifdef USE_LIBRETINY
4 #include "esphome/core/hal.h"
5 
6 namespace esphome {
7 namespace libretiny {
8 
10  public:
11  void set_pin(uint8_t pin) { pin_ = pin; }
12  void set_inverted(bool inverted) { inverted_ = inverted; }
14 
15  void setup() override { pin_mode(flags_); }
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 pin_; }
23  gpio::Flags get_flags() const override { return flags_; }
24  bool is_inverted() const override { return inverted_; }
25 
26  protected:
27  void attach_interrupt(void (*func)(void *), void *arg, gpio::InterruptType type) const override;
28 
29  uint8_t pin_;
30  bool inverted_;
32 };
33 
34 } // namespace libretiny
35 } // namespace esphome
36 
37 #endif // USE_LIBRETINY
void digital_write(bool value) override
gpio::Flags get_flags() const override
Definition: gpio_arduino.h:23
ISRInternalGPIOPin to_isr() const override
Copy of GPIOPin that is safe to use from ISRs (with no virtual functions)
Definition: gpio.h:73
uint8_t type
std::string dump_summary() const override
const uint32_t flags
Definition: stm32flash.h:85
InterruptType
Definition: gpio.h:40
void pin_mode(gpio::Flags flags) override
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
void attach_interrupt(void(*func)(void *), void *arg, gpio::InterruptType type) const override