stm32/gpio: expose all functionality as inherent methods.
This commit is contained in:
@ -11,7 +11,6 @@ use embassy_stm32::spi::{Config, Spi};
|
||||
use embassy_stm32::time::Hertz;
|
||||
use embassy_stm32::Peripherals;
|
||||
use embassy_traits::spi::FullDuplex;
|
||||
use embedded_hal::digital::v2::{InputPin, OutputPin};
|
||||
use example_common::*;
|
||||
|
||||
#[embassy::main]
|
||||
@ -38,17 +37,17 @@ async fn main(_spawner: Spawner, p: Peripherals) {
|
||||
let ready = Input::new(p.PE1, Pull::Up);
|
||||
|
||||
cortex_m::asm::delay(100_000);
|
||||
unwrap!(reset.set_high());
|
||||
reset.set_high();
|
||||
cortex_m::asm::delay(100_000);
|
||||
|
||||
while unwrap!(ready.is_low()) {
|
||||
while ready.is_low() {
|
||||
info!("waiting for ready");
|
||||
}
|
||||
|
||||
let write = [0x0A; 10];
|
||||
let mut read = [0; 10];
|
||||
unwrap!(cs.set_low());
|
||||
cs.set_low();
|
||||
spi.read_write(&mut read, &write).await.ok();
|
||||
unwrap!(cs.set_high());
|
||||
cs.set_high();
|
||||
info!("xfer {=[u8]:x}", read);
|
||||
}
|
||||
|
Reference in New Issue
Block a user