Skip to content

Commit

Permalink
gpio: Make AnyPin and AnyInputOnlyPin available from gpio module
Browse files Browse the repository at this point in the history
We can now use `use esp32::gpio::AnyPin` as it is done on embassy nrf
and stm32.

Signed-off-by: Priit Laes <plaes@plaes.org>
  • Loading branch information
plaes committed Aug 10, 2024
1 parent 2e8937a commit e15b141
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions esp-hal/src/gpio/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ use crate::{
pub(crate) use crate::{touch_common, touch_into};

pub mod any_pin;
pub use any_pin::{AnyInputOnlyPin, AnyPin};
pub mod dummy_pin;

#[cfg(soc_etm)]
Expand Down
4 changes: 2 additions & 2 deletions esp-hal/src/uart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
//! ```rust, no_run
#![doc = crate::before_snippet!()]
//! # use esp_hal::uart::{config::Config, Uart};
//! use esp_hal::gpio::{Io, any_pin::AnyPin};
//! use esp_hal::gpio::{AnyPin, Io};
//! let io = Io::new(peripherals.GPIO, peripherals.IO_MUX);
//!
//! let tx = AnyPin::new_inverted(io.pins.gpio1);
Expand All @@ -103,7 +103,7 @@
//! ```rust, no_run
#![doc = crate::before_snippet!()]
//! # use esp_hal::uart::{config::Config, UartTx, UartRx};
//! use esp_hal::gpio::{Io, any_pin::AnyPin};
//! use esp_hal::gpio::{AnyPin, Io};
//! let io = Io::new(peripherals.GPIO, peripherals.IO_MUX);
//!
//! let tx = UartTx::new(peripherals.UART0, &clocks,
Expand Down
2 changes: 1 addition & 1 deletion examples/src/bin/spi_loopback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use esp_backtrace as _;
use esp_hal::{
clock::ClockControl,
delay::Delay,
gpio::{any_pin::AnyPin, Io},
gpio::{AnyPin, Io},
peripherals::Peripherals,
prelude::*,
spi::{master::Spi, SpiMode},
Expand Down

0 comments on commit e15b141

Please sign in to comment.