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
tests/stm32

View file

@ -23,6 +23,7 @@ defmt-rtt = "0.3.0"
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.0", features = ["print-defmt"] }
[profile.dev]

View file

@ -9,7 +9,6 @@ use embassy::executor::Spawner;
use embassy_stm32::spi::{self, Spi};
use embassy_stm32::time::Hertz;
use embassy_stm32::Peripherals;
use embassy_traits::spi::FullDuplex;
use example_common::*;
#[embassy::main(config = "config()")]
@ -43,7 +42,7 @@ async fn main(_spawner: Spawner, p: Peripherals) {
// Arduino pins D11 and D12 (MOSI-MISO) are connected together with a 1K resistor.
// so we should get the data we sent back.
let mut buf = [0; 9];
spi.read_write(&mut buf, &data).await.unwrap();
spi.transfer(&mut buf, &data).await.unwrap();
assert_eq!(buf, data);
info!("Test OK");