Support unstable-trait feature for stm32
This commit is contained in:
@ -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 {
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user