summaryrefslogtreecommitdiff
path: root/examples/stm32f4/src/bin
diff options
context:
space:
mode:
Diffstat (limited to 'examples/stm32f4/src/bin')
-rw-r--r--examples/stm32f4/src/bin/spi.rs3
-rw-r--r--examples/stm32f4/src/bin/spi_dma.rs3
2 files changed, 2 insertions, 4 deletions
diff --git a/examples/stm32f4/src/bin/spi.rs b/examples/stm32f4/src/bin/spi.rs
index b66eb958..6b04f1fe 100644
--- a/examples/stm32f4/src/bin/spi.rs
+++ b/examples/stm32f4/src/bin/spi.rs
@@ -10,7 +10,6 @@ use embassy_stm32::dma::NoDma;
use embassy_stm32::gpio::{Level, Output, Speed};
use embassy_stm32::spi::{Config, Spi};
use embassy_stm32::time::Hertz;
-use embedded_hal::blocking::spi::Transfer;
use example_common::*;
#[entry]
@@ -35,7 +34,7 @@ fn main() -> ! {
loop {
let mut buf = [0x0Au8; 4];
cs.set_low();
- unwrap!(spi.transfer(&mut buf));
+ unwrap!(spi.blocking_transfer_in_place(&mut buf));
cs.set_high();
info!("xfer {=[u8]:x}", buf);
}
diff --git a/examples/stm32f4/src/bin/spi_dma.rs b/examples/stm32f4/src/bin/spi_dma.rs
index b3bf6fc2..9171f751 100644
--- a/examples/stm32f4/src/bin/spi_dma.rs
+++ b/examples/stm32f4/src/bin/spi_dma.rs
@@ -10,7 +10,6 @@ use embassy::executor::Spawner;
use embassy_stm32::spi::{Config, Spi};
use embassy_stm32::time::Hertz;
use embassy_stm32::Peripherals;
-use embassy_traits::spi::FullDuplex;
use example_common::*;
use heapless::String;
@@ -33,7 +32,7 @@ async fn main(_spawner: Spawner, p: Peripherals) {
let mut write: String<128> = String::new();
let mut read = [0; 128];
core::write!(&mut write, "Hello DMA World {}!\r\n", n).unwrap();
- spi.read_write(&mut read[0..write.len()], write.as_bytes())
+ spi.transfer(&mut read[0..write.len()], write.as_bytes())
.await
.ok();
info!("read via spi+dma: {}", from_utf8(&read).unwrap());