Support unstable-trait feature for stm32

This commit is contained in:
Ulf Lilleengen
2022-01-26 22:39:06 +01:00
parent cd36e3f733
commit 4032fc0655
32 changed files with 604 additions and 673 deletions

View File

@ -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 {

View File

@ -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());
}
}