ESPHome  2024.4.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  bool is_inverted() const override { return inverted_; }
24 
25  protected:
26  void attach_interrupt(void (*func)(void *), void *arg, gpio::InterruptType type) const override;
27 
28  uint8_t pin_;
29  bool inverted_;
31 };
32 
33 } // namespace libretiny
34 } // namespace esphome
35 
36 #endif // USE_LIBRETINY
void digital_write(bool value) override
ISRInternalGPIOPin to_isr() const override
Copy of GPIOPin that is safe to use from ISRs (with no virtual functions)
Definition: gpio.h:66
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
This is a workaround until we can figure out a way to get the tflite-micro idf component code availab...
Definition: a01nyub.cpp:7
void attach_interrupt(void(*func)(void *), void *arg, gpio::InterruptType type) const override