9static const char *
const TAG =
"rp2040";
19 return INPUT_PULLDOWN;
34 auto *arg =
new ISRPinArg{};
35 arg->pin = this->
pin_;
37 arg->mask = 1 << this->
pin_;
42 PinStatus arduino_mode = LOW;
45 arduino_mode =
inverted_ ? FALLING : RISING;
48 arduino_mode =
inverted_ ? RISING : FALLING;
51 arduino_mode = CHANGE;
61 attachInterrupt(
pin_, func, arduino_mode, arg);
68 return snprintf(buffer,
len,
"GPIO%u", this->
pin_);
81using namespace rp2040;
84 auto *arg =
reinterpret_cast<ISRPinArg *
>(this->
arg_);
85 return bool(sio_hw->gpio_in & arg->mask) != arg->inverted;
89 auto *arg =
reinterpret_cast<ISRPinArg *
>(this->
arg_);
90 if (value != arg->inverted) {
91 sio_hw->gpio_set = arg->mask;
93 sio_hw->gpio_clr = arg->mask;
104 auto *arg =
reinterpret_cast<ISRPinArg *
>(this->
arg_);
106 sio_hw->gpio_oe_set = arg->mask;
108 sio_hw->gpio_oe_clr = arg->mask;
109 hw_write_masked(&padsbank0_hw->io[arg->pin],
112 PADS_BANK0_GPIO0_PUE_BITS | PADS_BANK0_GPIO0_PDE_BITS);
Copy of GPIOPin that is safe to use from ISRs (with no virtual functions)
void digital_write(bool value)
void pin_mode(gpio::Flags flags)
size_t dump_summary(char *buffer, size_t len) const override
void detach_interrupt() const override
void digital_write(bool value) override
bool digital_read() override
ISRInternalGPIOPin to_isr() const override
void pin_mode(gpio::Flags flags) override
void attach_interrupt(void(*func)(void *), void *arg, gpio::InterruptType type) const override
Providing packet encoding functions for exchanging data with a remote host.