From 3387ee7238f1c9c4eeccb732ba543cbe38ab7ccd Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Mon, 22 Jan 2024 20:12:36 +0100 Subject: stm32/gpio: remove generics. --- .../ROOT/examples/layer-by-layer/blinky-async/src/main.rs | 4 ++-- .../ROOT/examples/layer-by-layer/blinky-irq/src/main.rs | 13 ++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) (limited to 'docs') diff --git a/docs/modules/ROOT/examples/layer-by-layer/blinky-async/src/main.rs b/docs/modules/ROOT/examples/layer-by-layer/blinky-async/src/main.rs index e6753be28..004602816 100644 --- a/docs/modules/ROOT/examples/layer-by-layer/blinky-async/src/main.rs +++ b/docs/modules/ROOT/examples/layer-by-layer/blinky-async/src/main.rs @@ -3,14 +3,14 @@ use embassy_executor::Spawner; use embassy_stm32::exti::ExtiInput; -use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; +use embassy_stm32::gpio::{Level, Output, Pull, Speed}; use {defmt_rtt as _, panic_probe as _}; #[embassy_executor::main] async fn main(_spawner: Spawner) { let p = embassy_stm32::init(Default::default()); let mut led = Output::new(p.PB14, Level::Low, Speed::VeryHigh); - let mut button = ExtiInput::new(Input::new(p.PC13, Pull::Up), p.EXTI13); + let mut button = ExtiInput::new(p.PC13, p.EXTI13, Pull::Up); loop { button.wait_for_any_edge().await; diff --git a/docs/modules/ROOT/examples/layer-by-layer/blinky-irq/src/main.rs b/docs/modules/ROOT/examples/layer-by-layer/blinky-irq/src/main.rs index aecba0755..743c9d99b 100644 --- a/docs/modules/ROOT/examples/layer-by-layer/blinky-irq/src/main.rs +++ b/docs/modules/ROOT/examples/layer-by-layer/blinky-irq/src/main.rs @@ -6,13 +6,12 @@ use core::cell::RefCell; use cortex_m::interrupt::Mutex; use cortex_m::peripheral::NVIC; use cortex_m_rt::entry; -use embassy_stm32::gpio::{Input, Level, Output, Pin, Pull, Speed}; -use embassy_stm32::peripherals::{PB14, PC13}; +use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; use embassy_stm32::{interrupt, pac}; use {defmt_rtt as _, panic_probe as _}; -static BUTTON: Mutex>>> = Mutex::new(RefCell::new(None)); -static LED: Mutex>>> = Mutex::new(RefCell::new(None)); +static BUTTON: Mutex>>> = Mutex::new(RefCell::new(None)); +static LED: Mutex>>> = Mutex::new(RefCell::new(None)); #[entry] fn main() -> ! { @@ -62,14 +61,14 @@ fn EXTI15_10() { const PORT: u8 = 2; const PIN: usize = 13; -fn check_interrupt(_pin: &mut Input<'static, P>) -> bool { +fn check_interrupt(_pin: &mut Input<'static>) -> bool { let exti = pac::EXTI; let pin = PIN; let lines = exti.pr(0).read(); lines.line(pin) } -fn clear_interrupt(_pin: &mut Input<'static, P>) { +fn clear_interrupt(_pin: &mut Input<'static>) { let exti = pac::EXTI; let pin = PIN; let mut lines = exti.pr(0).read(); @@ -77,7 +76,7 @@ fn clear_interrupt(_pin: &mut Input<'static, P>) { exti.pr(0).write_value(lines); } -fn enable_interrupt(_pin: &mut Input<'static, P>) { +fn enable_interrupt(_pin: &mut Input<'static>) { cortex_m::interrupt::free(|_| { let rcc = pac::RCC; rcc.apb2enr().modify(|w| w.set_syscfgen(true)); -- cgit From 2bc5e9523d4373002487614ecfef1e3f0858fd66 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Mon, 22 Jan 2024 21:19:18 +0100 Subject: nrf/gpio: remove generics. --- docs/modules/ROOT/examples/basic/src/main.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/modules/ROOT/examples/basic/src/main.rs b/docs/modules/ROOT/examples/basic/src/main.rs index 2a4ee5968..4412712c8 100644 --- a/docs/modules/ROOT/examples/basic/src/main.rs +++ b/docs/modules/ROOT/examples/basic/src/main.rs @@ -4,12 +4,11 @@ use defmt::*; use embassy_executor::Spawner; use embassy_nrf::gpio::{Level, Output, OutputDrive}; -use embassy_nrf::peripherals::P0_13; use embassy_time::{Duration, Timer}; use {defmt_rtt as _, panic_probe as _}; // global logger #[embassy_executor::task] -async fn blinker(mut led: Output<'static, P0_13>, interval: Duration) { +async fn blinker(mut led: Output<'static>, interval: Duration) { loop { led.set_high(); Timer::after(interval).await; -- cgit