ESPHome 2025.5.0
Loading...
Searching...
No Matches
gpio.h
Go to the documentation of this file.
1#pragma once
2
3#ifdef USE_RP2040
4
5#include <Arduino.h>
6#include "esphome/core/hal.h"
7
8namespace esphome {
9namespace rp2040 {
10
12 public:
13 void set_pin(uint8_t pin) { pin_ = pin; }
14 void set_inverted(bool inverted) { inverted_ = inverted; }
15 void set_flags(gpio::Flags flags) { flags_ = flags; }
16
17 void setup() override { pin_mode(flags_); }
18 void pin_mode(gpio::Flags flags) override;
19 bool digital_read() override;
20 void digital_write(bool value) override;
21 std::string dump_summary() const override;
22 void detach_interrupt() const override;
23 ISRInternalGPIOPin to_isr() const override;
24 uint8_t get_pin() const override { return pin_; }
25 gpio::Flags get_flags() const override { return flags_; }
26 bool is_inverted() const override { return inverted_; }
27
28 protected:
29 void attach_interrupt(void (*func)(void *), void *arg, gpio::InterruptType type) const override;
30
31 uint8_t pin_;
34};
35
36} // namespace rp2040
37} // namespace esphome
38
39#endif // USE_RP2040
Copy of GPIOPin that is safe to use from ISRs (with no virtual functions)
Definition gpio.h:73
bool is_inverted() const override
Definition gpio.h:26
uint8_t get_pin() const override
Definition gpio.h:24
void set_flags(gpio::Flags flags)
Definition gpio.h:15
void detach_interrupt() const override
Definition gpio.cpp:77
void digital_write(bool value) override
Definition gpio.cpp:74
bool digital_read() override
Definition gpio.cpp:71
void set_pin(uint8_t pin)
Definition gpio.h:13
gpio::Flags get_flags() const override
Definition gpio.h:25
ISRInternalGPIOPin to_isr() const override
Definition gpio.cpp:32
void set_inverted(bool inverted)
Definition gpio.h:14
void pin_mode(gpio::Flags flags) override
Definition gpio.cpp:61
std::string dump_summary() const override
Definition gpio.cpp:65
void attach_interrupt(void(*func)(void *), void *arg, gpio::InterruptType type) const override
Definition gpio.cpp:39
void setup() override
Definition gpio.h:17
uint8_t type
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7