ESPHome  2022.9.2
gpio_arduino.h
Go to the documentation of this file.
1 #pragma once
2 
3 #ifdef USE_ESP32_FRAMEWORK_ARDUINO
4 #include "esphome/core/hal.h"
5 
6 namespace esphome {
7 namespace esp32 {
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 esp32
34 } // namespace esphome
35 
36 #endif // USE_ESP32_FRAMEWORK_ARDUINO
void pin_mode(gpio::Flags flags) override
Copy of GPIOPin that is safe to use from ISRs (with no virtual functions)
Definition: gpio.h:66
ISRInternalGPIOPin to_isr() const override
void set_flags(gpio::Flags flags)
Definition: gpio_arduino.h:13
std::string dump_summary() const override
uint8_t get_pin() const override
Definition: gpio_arduino.h:22
uint8_t type
const uint32_t flags
Definition: stm32flash.h:85
void attach_interrupt(void(*func)(void *), void *arg, gpio::InterruptType type) const override
InterruptType
Definition: gpio.h:40
Definition: a4988.cpp:4
void detach_interrupt() const override
void digital_write(bool value) override