diff --git a/esp-hal/CHANGELOG.md b/esp-hal/CHANGELOG.md index 038089f9b00..593a808ff83 100644 --- a/esp-hal/CHANGELOG.md +++ b/esp-hal/CHANGELOG.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Added new `Io::new_no_bind_interrupt` constructor (#1861) + ### Changed - Peripheral driver constructors don't take `InterruptHandler`s anymore. Use `set_interrupt_handler` to explicitly set the interrupt handler now. (#1819) diff --git a/esp-hal/src/gpio/mod.rs b/esp-hal/src/gpio/mod.rs index a605027753c..8c72d388eea 100644 --- a/esp-hal/src/gpio/mod.rs +++ b/esp-hal/src/gpio/mod.rs @@ -1213,6 +1213,21 @@ impl Io { pins, } } + + /// Initialize the I/O driver without enabling the GPIO interrupt or + /// binding an interrupt handler to it. + /// + /// *Note:* You probably don't want to use this, it is intended to be used + /// in very specific use cases. Async GPIO functionality will not work + /// when instantiating `Io` using this constructor. + pub fn new_no_bind_interrupt(gpio: GPIO, io_mux: IO_MUX) -> Self { + let pins = gpio.pins(); + + Io { + _io_mux: io_mux, + pins, + } + } } impl crate::private::Sealed for Io {}