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. --- examples/stm32l4/src/bin/button_exti.rs | 5 ++--- examples/stm32l4/src/bin/spe_adin1110_http_server.rs | 13 ++++++------- 2 files changed, 8 insertions(+), 10 deletions(-) (limited to 'examples/stm32l4/src') diff --git a/examples/stm32l4/src/bin/button_exti.rs b/examples/stm32l4/src/bin/button_exti.rs index 1e970fdd6..34a08bbc6 100644 --- a/examples/stm32l4/src/bin/button_exti.rs +++ b/examples/stm32l4/src/bin/button_exti.rs @@ -4,7 +4,7 @@ use defmt::*; use embassy_executor::Spawner; use embassy_stm32::exti::ExtiInput; -use embassy_stm32::gpio::{Input, Pull}; +use embassy_stm32::gpio::Pull; use {defmt_rtt as _, panic_probe as _}; #[embassy_executor::main] @@ -12,8 +12,7 @@ async fn main(_spawner: Spawner) { let p = embassy_stm32::init(Default::default()); info!("Hello World!"); - let button = Input::new(p.PC13, Pull::Up); - let mut button = ExtiInput::new(button, p.EXTI13); + let mut button = ExtiInput::new(p.PC13, p.EXTI13, Pull::Up); info!("Press the USER button..."); diff --git a/examples/stm32l4/src/bin/spe_adin1110_http_server.rs b/examples/stm32l4/src/bin/spe_adin1110_http_server.rs index 5b4cdfe5e..026a3a477 100644 --- a/examples/stm32l4/src/bin/spe_adin1110_http_server.rs +++ b/examples/stm32l4/src/bin/spe_adin1110_http_server.rs @@ -58,9 +58,9 @@ const IP_ADDRESS: Ipv4Cidr = Ipv4Cidr::new(Ipv4Address([192, 168, 1, 5]), 24); const HTTP_LISTEN_PORT: u16 = 80; pub type SpeSpi = Spi<'static, peripherals::SPI2, peripherals::DMA1_CH1, peripherals::DMA1_CH2>; -pub type SpeSpiCs = ExclusiveDevice, Delay>; -pub type SpeInt = exti::ExtiInput<'static, peripherals::PB11>; -pub type SpeRst = Output<'static, peripherals::PC7>; +pub type SpeSpiCs = ExclusiveDevice, Delay>; +pub type SpeInt = exti::ExtiInput<'static>; +pub type SpeRst = Output<'static>; pub type Adin1110T = ADIN1110; pub type TempSensI2c = I2c<'static, peripherals::I2C3, peripherals::DMA1_CH6, peripherals::DMA1_CH7>; @@ -134,8 +134,7 @@ async fn main(spawner: Spawner) { let spe_cfg1 = Input::new(dp.PC9, Pull::None); let _spe_ts_capt = Output::new(dp.PC6, Level::Low, Speed::Low); - let spe_int = Input::new(dp.PB11, Pull::None); - let spe_int = exti::ExtiInput::new(spe_int, dp.EXTI11); + let spe_int = exti::ExtiInput::new(dp.PB11, dp.EXTI11, Pull::None); let spe_spi_cs_n = Output::new(dp.PB12, Level::High, Speed::High); let spe_spi_sclk = dp.PB13; @@ -298,7 +297,7 @@ async fn wait_for_config(stack: &'static Stack>) -> embassy_net: } #[embassy_executor::task] -async fn heartbeat_led(mut led: Output<'static, peripherals::PE6>) { +async fn heartbeat_led(mut led: Output<'static>) { let mut tmr = Ticker::every(Duration::from_hz(3)); loop { led.toggle(); @@ -308,7 +307,7 @@ async fn heartbeat_led(mut led: Output<'static, peripherals::PE6>) { // ADT7422 #[embassy_executor::task] -async fn temp_task(temp_dev_i2c: TempSensI2c, mut led: Output<'static, peripherals::PG15>) -> ! { +async fn temp_task(temp_dev_i2c: TempSensI2c, mut led: Output<'static>) -> ! { let mut tmr = Ticker::every(Duration::from_hz(1)); let mut temp_sens = ADT7422::new(temp_dev_i2c, 0x48).unwrap(); -- cgit