Skip to content

Commit

Permalink
Add a new constructor to gpio::Io which does not bind an interrupt …
Browse files Browse the repository at this point in the history
…handler (esp-rs#1861)

* Add a new constructor to `gpio::Io` which does not bind an interrupt handler

* Update `CHANGELOG.md`
  • Loading branch information
jessebraham authored Jul 26, 2024
1 parent 2744a5d commit 237804e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions esp-hal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
15 changes: 15 additions & 0 deletions esp-hal/src/gpio/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Expand Down

0 comments on commit 237804e

Please sign in to comment.