GpioIrqBinding class final
#include <hal/gpio_irq.hpp>
Pico GPIO IRQ binding helper.
This helper centralizes MCU-specific callback registration so higher layers can request edge notifications without including Pico GPIO headers or owning global callback state directly.
Contract:
- multiple bindings may coexist globally on different GPIO pins,
- one binding instance owns exactly one GPIO pin at a time,
- shared ownership of one GPIO pin by multiple bindings is not supported,
- disabling one binding turns the MCU IRQ source off for that GPIO pin.
Callers must therefore ensure that one physical GPIO pin is managed by only one GpioIrqBinding at a time.
Public types
Constructors, destructors, conversion operators
- GpioIrqBinding() defaulted
- GpioIrqBinding(const GpioIrqBinding&) deleted
- ~GpioIrqBinding()
Public functions
- void disable()
- Disables previously enabled GPIO IRQ binding.
- auto enable(const GpioPin& pin, uint32_t events, Callback callback, void* user_ctx) -> bool
- Binds edge callback for one GPIO pin.
- auto enabled() const -> bool
- auto operator=(const GpioIrqBinding&) -> GpioIrqBinding& deleted
- auto pin_number() const -> uint32_t