diff options
Diffstat (limited to 'examples/stm32h7/src/bin')
| -rw-r--r-- | examples/stm32h7/src/bin/camera.rs | 2 | ||||
| -rw-r--r-- | examples/stm32h7/src/bin/spi_dma.rs | 5 |
2 files changed, 3 insertions, 4 deletions
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; | |||
| 9 | use embassy::executor::Executor; | 9 | use embassy::executor::Executor; |
| 10 | use embassy::util::Forever; | 10 | use embassy::util::Forever; |
| 11 | use embassy_stm32::time::U32Ext; | 11 | use embassy_stm32::time::U32Ext; |
| 12 | use embassy_traits::spi::FullDuplex; | ||
| 13 | use example_common::*; | 12 | use example_common::*; |
| 14 | 13 | ||
| 15 | use core::str::from_utf8; | 14 | use 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 | } |
