Support unstable-trait feature for stm32
This commit is contained in:
@ -10,7 +10,7 @@ resolver = "2"
|
||||
[dependencies]
|
||||
embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt" ] }
|
||||
embassy-traits = { version = "0.1.0", path = "../../embassy-traits", features = ["defmt"] }
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "unstable-pac", "stm32l4s5vi", "time-driver-any", "exti"] }
|
||||
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "unstable-pac", "stm32l4s5vi", "time-driver-any", "exti", "unstable-traits"] }
|
||||
|
||||
defmt = "0.3"
|
||||
defmt-rtt = "0.3"
|
||||
@ -18,6 +18,7 @@ defmt-rtt = "0.3"
|
||||
cortex-m = "0.7.3"
|
||||
cortex-m-rt = "0.7.0"
|
||||
embedded-hal = "0.2.6"
|
||||
embedded-hal-async = { version = "0.0.1", git = "https://github.com/embassy-rs/embedded-hal", branch = "embassy"}
|
||||
panic-probe = { version = "0.3", features = ["print-defmt"] }
|
||||
futures = { version = "0.3.17", default-features = false, features = ["async-await"] }
|
||||
heapless = { version = "0.7.5", default-features = false }
|
||||
|
@ -11,7 +11,8 @@ use embassy_stm32::i2c::I2c;
|
||||
use embassy_stm32::interrupt;
|
||||
use embassy_stm32::time::Hertz;
|
||||
use embassy_stm32::Peripherals;
|
||||
use embassy_traits::{adapter::BlockingAsync, i2c::I2c as _};
|
||||
use embassy_traits::adapter::BlockingAsync;
|
||||
use embedded_hal_async::i2c::I2c as I2cTrait;
|
||||
use example_common::{info, unwrap};
|
||||
|
||||
const ADDRESS: u8 = 0x5F;
|
||||
|
@ -11,7 +11,8 @@ use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed};
|
||||
use embassy_stm32::spi::{Config, Spi};
|
||||
use embassy_stm32::time::Hertz;
|
||||
use embassy_stm32::Peripherals;
|
||||
use embassy_traits::{adapter::BlockingAsync, spi::FullDuplex};
|
||||
use embassy_traits::adapter::BlockingAsync;
|
||||
use embedded_hal_async::spi::ReadWrite;
|
||||
use example_common::*;
|
||||
|
||||
#[embassy::main]
|
||||
@ -47,10 +48,10 @@ async fn main(_spawner: Spawner, p: Peripherals) {
|
||||
info!("waiting for ready");
|
||||
}
|
||||
|
||||
let write = [0x0A; 10];
|
||||
let mut read = [0; 10];
|
||||
let write: [u8; 10] = [0x0A; 10];
|
||||
let mut read: [u8; 10] = [0; 10];
|
||||
cs.set_low();
|
||||
spi.read_write(&mut read, &write).await.ok();
|
||||
spi.transfer(&mut read, &write).await.ok();
|
||||
cs.set_high();
|
||||
info!("xfer {=[u8]:x}", read);
|
||||
}
|
||||
|
@ -10,7 +10,6 @@ use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed};
|
||||
use embassy_stm32::spi::{Config, Spi};
|
||||
use embassy_stm32::time::Hertz;
|
||||
use embassy_stm32::Peripherals;
|
||||
use embassy_traits::spi::FullDuplex;
|
||||
use example_common::*;
|
||||
|
||||
#[embassy::main]
|
||||
@ -47,7 +46,7 @@ async fn main(_spawner: Spawner, p: Peripherals) {
|
||||
let write = [0x0A; 10];
|
||||
let mut read = [0; 10];
|
||||
cs.set_low();
|
||||
spi.read_write(&mut read, &write).await.ok();
|
||||
spi.transfer(&mut read, &write).await.ok();
|
||||
cs.set_high();
|
||||
info!("xfer {=[u8]:x}", read);
|
||||
}
|
||||
|
@ -6,13 +6,11 @@
|
||||
mod example_common;
|
||||
|
||||
use embassy::executor::Spawner;
|
||||
use embassy::traits::{
|
||||
adapter::BlockingAsync,
|
||||
uart::{Read, Write},
|
||||
};
|
||||
use embassy::traits::adapter::BlockingAsync;
|
||||
use embassy_stm32::dma::NoDma;
|
||||
use embassy_stm32::usart::{Config, Uart};
|
||||
use embassy_stm32::Peripherals;
|
||||
use embedded_hal_async::serial::{Read, Write};
|
||||
use example_common::*;
|
||||
|
||||
#[embassy::main]
|
||||
|
Reference in New Issue
Block a user