aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32h7
diff options
context:
space:
mode:
authorUlf Lilleengen <[email protected]>2022-01-26 22:39:06 +0100
committerUlf Lilleengen <[email protected]>2022-01-26 22:39:06 +0100
commit4032fc06556312eab27488f05efe1803ade47b45 (patch)
tree0b38343758741e5c4074e86da30867595501f9b6 /examples/stm32h7
parentcd36e3f7332d08865e670ca5b515d1c6efa1bf85 (diff)
Support unstable-trait feature for stm32
Diffstat (limited to 'examples/stm32h7')
-rw-r--r--examples/stm32h7/Cargo.toml3
-rw-r--r--examples/stm32h7/src/bin/camera.rs2
-rw-r--r--examples/stm32h7/src/bin/spi_dma.rs5
3 files changed, 5 insertions, 5 deletions
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"
10[dependencies] 10[dependencies]
11embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] } 11embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] }
12embassy-traits = { version = "0.1.0", path = "../../embassy-traits", features = ["defmt"] } 12embassy-traits = { version = "0.1.0", path = "../../embassy-traits", features = ["defmt"] }
13embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32h743zi", "net", "time-driver-any", "exti", "unstable-pac"] } 13embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32h743zi", "net", "time-driver-any", "exti", "unstable-pac", "unstable-traits"] }
14embassy-net = { path = "../../embassy-net", default-features = false, features = ["defmt", "tcp", "medium-ethernet", "pool-16"] } 14embassy-net = { path = "../../embassy-net", default-features = false, features = ["defmt", "tcp", "medium-ethernet", "pool-16"] }
15embassy-hal-common = { path = "../../embassy-hal-common", default-features = false, features = ["defmt"] } 15embassy-hal-common = { path = "../../embassy-hal-common", default-features = false, features = ["defmt"] }
16 16
@@ -20,6 +20,7 @@ defmt-rtt = "0.3"
20cortex-m = "0.7.3" 20cortex-m = "0.7.3"
21cortex-m-rt = "0.7.0" 21cortex-m-rt = "0.7.0"
22embedded-hal = "0.2.6" 22embedded-hal = "0.2.6"
23embedded-hal-async = { version = "0.0.1", git = "https://github.com/embassy-rs/embedded-hal", branch = "embassy"}
23panic-probe = { version = "0.3", features = ["print-defmt"] } 24panic-probe = { version = "0.3", features = ["print-defmt"] }
24futures = { version = "0.3.17", default-features = false, features = ["async-await"] } 25futures = { version = "0.3.17", default-features = false, features = ["async-await"] }
25heapless = { version = "0.7.5", default-features = false } 26heapless = { 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 {
128 use defmt::Format; 128 use defmt::Format;
129 use embassy::time::{Duration, Timer}; 129 use embassy::time::{Duration, Timer};
130 use embassy_stm32::rcc::{Mco, McoInstance}; 130 use embassy_stm32::rcc::{Mco, McoInstance};
131 use embassy_traits::i2c::I2c; 131 use embedded_hal_async::i2c::I2c;
132 132
133 #[repr(u8)] 133 #[repr(u8)]
134 pub enum RgbFormat { 134 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;
9use embassy::executor::Executor; 9use embassy::executor::Executor;
10use embassy::util::Forever; 10use embassy::util::Forever;
11use embassy_stm32::time::U32Ext; 11use embassy_stm32::time::U32Ext;
12use embassy_traits::spi::FullDuplex;
13use example_common::*; 12use example_common::*;
14 13
15use core::str::from_utf8; 14use core::str::from_utf8;
@@ -24,8 +23,8 @@ async fn main_task(mut spi: spi::Spi<'static, SPI3, DMA1_CH3, DMA1_CH4>) {
24 let mut write: String<128> = String::new(); 23 let mut write: String<128> = String::new();
25 let mut read = [0; 128]; 24 let mut read = [0; 128];
26 core::write!(&mut write, "Hello DMA World {}!\r\n", n).unwrap(); 25 core::write!(&mut write, "Hello DMA World {}!\r\n", n).unwrap();
27 // read_write will slice the &mut read down to &write's actual length. 26 // transfer will slice the &mut read down to &write's actual length.
28 spi.read_write(&mut read, write.as_bytes()).await.ok(); 27 spi.transfer(&mut read, write.as_bytes()).await.ok();
29 info!("read via spi+dma: {}", from_utf8(&read).unwrap()); 28 info!("read via spi+dma: {}", from_utf8(&read).unwrap());
30 } 29 }
31} 30}