From 4032fc06556312eab27488f05efe1803ade47b45 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Wed, 26 Jan 2022 22:39:06 +0100 Subject: Support unstable-trait feature for stm32 --- examples/stm32h7/Cargo.toml | 3 ++- examples/stm32h7/src/bin/camera.rs | 2 +- examples/stm32h7/src/bin/spi_dma.rs | 5 ++--- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'examples/stm32h7') diff --git a/examples/stm32h7/Cargo.toml b/examples/stm32h7/Cargo.toml index 67f1cfc94..16adcdb91 100644 --- a/examples/stm32h7/Cargo.toml +++ b/examples/stm32h7/Cargo.toml @@ -10,7 +10,7 @@ resolver = "2" [dependencies] embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] } embassy-traits = { version = "0.1.0", path = "../../embassy-traits", features = ["defmt"] } -embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32h743zi", "net", "time-driver-any", "exti", "unstable-pac"] } +embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32h743zi", "net", "time-driver-any", "exti", "unstable-pac", "unstable-traits"] } embassy-net = { path = "../../embassy-net", default-features = false, features = ["defmt", "tcp", "medium-ethernet", "pool-16"] } embassy-hal-common = { path = "../../embassy-hal-common", default-features = false, features = ["defmt"] } @@ -20,6 +20,7 @@ defmt-rtt = "0.3" cortex-m = "0.7.3" cortex-m-rt = "0.7.0" embedded-hal = "0.2.6" +embedded-hal-async = { version = "0.0.1", git = "https://github.com/embassy-rs/embedded-hal", branch = "embassy"} panic-probe = { version = "0.3", features = ["print-defmt"] } futures = { version = "0.3.17", default-features = false, features = ["async-await"] } heapless = { version = "0.7.5", default-features = false } diff --git a/examples/stm32h7/src/bin/camera.rs b/examples/stm32h7/src/bin/camera.rs index 9e8071bb3..9760d0f74 100644 --- a/examples/stm32h7/src/bin/camera.rs +++ b/examples/stm32h7/src/bin/camera.rs @@ -128,7 +128,7 @@ mod ov7725 { use defmt::Format; use embassy::time::{Duration, Timer}; use embassy_stm32::rcc::{Mco, McoInstance}; - use embassy_traits::i2c::I2c; + use embedded_hal_async::i2c::I2c; #[repr(u8)] pub enum RgbFormat { diff --git a/examples/stm32h7/src/bin/spi_dma.rs b/examples/stm32h7/src/bin/spi_dma.rs index 192e2e864..15ae09973 100644 --- a/examples/stm32h7/src/bin/spi_dma.rs +++ b/examples/stm32h7/src/bin/spi_dma.rs @@ -9,7 +9,6 @@ use core::fmt::Write; use embassy::executor::Executor; use embassy::util::Forever; use embassy_stm32::time::U32Ext; -use embassy_traits::spi::FullDuplex; use example_common::*; use core::str::from_utf8; @@ -24,8 +23,8 @@ async fn main_task(mut spi: spi::Spi<'static, SPI3, DMA1_CH3, DMA1_CH4>) { let mut write: String<128> = String::new(); let mut read = [0; 128]; core::write!(&mut write, "Hello DMA World {}!\r\n", n).unwrap(); - // read_write will slice the &mut read down to &write's actual length. - spi.read_write(&mut read, write.as_bytes()).await.ok(); + // transfer will slice the &mut read down to &write's actual length. + spi.transfer(&mut read, write.as_bytes()).await.ok(); info!("read via spi+dma: {}", from_utf8(&read).unwrap()); } } -- cgit