diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-01-26 22:01:46 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-01-26 22:01:46 +0000 |
| commit | d76cd5ceaf5140c48ef97180beae156c0c0e07c8 (patch) | |
| tree | a453271d10c017854184335584188bc8709ed517 /examples/stm32h7/src | |
| parent | cd36e3f7332d08865e670ca5b515d1c6efa1bf85 (diff) | |
| parent | c8347fafb0814078466d7ed220224b9f4c7d78cf (diff) | |
Merge #592
592: Initial work on unstable-trait feature for stm32 r=lulf a=lulf
Implements async traits for exti for now.
Co-authored-by: Ulf Lilleengen <[email protected]>
Diffstat (limited to 'examples/stm32h7/src')
| -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 | } |
