aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32l4/src
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2024-01-22 20:12:36 +0100
committerDario Nieuwenhuis <[email protected]>2024-01-22 21:31:06 +0100
commit3387ee7238f1c9c4eeccb732ba543cbe38ab7ccd (patch)
tree0b2353dcc0c44c6415a1d765427b59318c6e3a63 /examples/stm32l4/src
parent9f76dbb93b4ab5efc8a0d51b4507ab7eb144fcd9 (diff)
stm32/gpio: remove generics.
Diffstat (limited to 'examples/stm32l4/src')
-rw-r--r--examples/stm32l4/src/bin/button_exti.rs5
-rw-r--r--examples/stm32l4/src/bin/spe_adin1110_http_server.rs13
2 files changed, 8 insertions, 10 deletions
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 @@
4use defmt::*; 4use defmt::*;
5use embassy_executor::Spawner; 5use embassy_executor::Spawner;
6use embassy_stm32::exti::ExtiInput; 6use embassy_stm32::exti::ExtiInput;
7use embassy_stm32::gpio::{Input, Pull}; 7use embassy_stm32::gpio::Pull;
8use {defmt_rtt as _, panic_probe as _}; 8use {defmt_rtt as _, panic_probe as _};
9 9
10#[embassy_executor::main] 10#[embassy_executor::main]
@@ -12,8 +12,7 @@ async fn main(_spawner: Spawner) {
12 let p = embassy_stm32::init(Default::default()); 12 let p = embassy_stm32::init(Default::default());
13 info!("Hello World!"); 13 info!("Hello World!");
14 14
15 let button = Input::new(p.PC13, Pull::Up); 15 let mut button = ExtiInput::new(p.PC13, p.EXTI13, Pull::Up);
16 let mut button = ExtiInput::new(button, p.EXTI13);
17 16
18 info!("Press the USER button..."); 17 info!("Press the USER button...");
19 18
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);
58const HTTP_LISTEN_PORT: u16 = 80; 58const HTTP_LISTEN_PORT: u16 = 80;
59 59
60pub type SpeSpi = Spi<'static, peripherals::SPI2, peripherals::DMA1_CH1, peripherals::DMA1_CH2>; 60pub type SpeSpi = Spi<'static, peripherals::SPI2, peripherals::DMA1_CH1, peripherals::DMA1_CH2>;
61pub type SpeSpiCs = ExclusiveDevice<SpeSpi, Output<'static, peripherals::PB12>, Delay>; 61pub type SpeSpiCs = ExclusiveDevice<SpeSpi, Output<'static>, Delay>;
62pub type SpeInt = exti::ExtiInput<'static, peripherals::PB11>; 62pub type SpeInt = exti::ExtiInput<'static>;
63pub type SpeRst = Output<'static, peripherals::PC7>; 63pub type SpeRst = Output<'static>;
64pub type Adin1110T = ADIN1110<SpeSpiCs>; 64pub type Adin1110T = ADIN1110<SpeSpiCs>;
65pub type TempSensI2c = I2c<'static, peripherals::I2C3, peripherals::DMA1_CH6, peripherals::DMA1_CH7>; 65pub type TempSensI2c = I2c<'static, peripherals::I2C3, peripherals::DMA1_CH6, peripherals::DMA1_CH7>;
66 66
@@ -134,8 +134,7 @@ async fn main(spawner: Spawner) {
134 let spe_cfg1 = Input::new(dp.PC9, Pull::None); 134 let spe_cfg1 = Input::new(dp.PC9, Pull::None);
135 let _spe_ts_capt = Output::new(dp.PC6, Level::Low, Speed::Low); 135 let _spe_ts_capt = Output::new(dp.PC6, Level::Low, Speed::Low);
136 136
137 let spe_int = Input::new(dp.PB11, Pull::None); 137 let spe_int = exti::ExtiInput::new(dp.PB11, dp.EXTI11, Pull::None);
138 let spe_int = exti::ExtiInput::new(spe_int, dp.EXTI11);
139 138
140 let spe_spi_cs_n = Output::new(dp.PB12, Level::High, Speed::High); 139 let spe_spi_cs_n = Output::new(dp.PB12, Level::High, Speed::High);
141 let spe_spi_sclk = dp.PB13; 140 let spe_spi_sclk = dp.PB13;
@@ -298,7 +297,7 @@ async fn wait_for_config(stack: &'static Stack<Device<'static>>) -> embassy_net:
298} 297}
299 298
300#[embassy_executor::task] 299#[embassy_executor::task]
301async fn heartbeat_led(mut led: Output<'static, peripherals::PE6>) { 300async fn heartbeat_led(mut led: Output<'static>) {
302 let mut tmr = Ticker::every(Duration::from_hz(3)); 301 let mut tmr = Ticker::every(Duration::from_hz(3));
303 loop { 302 loop {
304 led.toggle(); 303 led.toggle();
@@ -308,7 +307,7 @@ async fn heartbeat_led(mut led: Output<'static, peripherals::PE6>) {
308 307
309// ADT7422 308// ADT7422
310#[embassy_executor::task] 309#[embassy_executor::task]
311async fn temp_task(temp_dev_i2c: TempSensI2c, mut led: Output<'static, peripherals::PG15>) -> ! { 310async fn temp_task(temp_dev_i2c: TempSensI2c, mut led: Output<'static>) -> ! {
312 let mut tmr = Ticker::every(Duration::from_hz(1)); 311 let mut tmr = Ticker::every(Duration::from_hz(1));
313 let mut temp_sens = ADT7422::new(temp_dev_i2c, 0x48).unwrap(); 312 let mut temp_sens = ADT7422::new(temp_dev_i2c, 0x48).unwrap();
314 313