stm32/gpio: expose all functionality as inherent methods.
This commit is contained in:
@ -9,7 +9,6 @@ use embassy::executor::Spawner;
|
||||
use embassy::time::{Duration, Timer};
|
||||
use embassy_stm32::gpio::{Level, Output, Speed};
|
||||
use embassy_stm32::Peripherals;
|
||||
use embedded_hal::digital::v2::OutputPin;
|
||||
use example_common::*;
|
||||
|
||||
#[embassy::main]
|
||||
@ -20,11 +19,11 @@ async fn main(_spawner: Spawner, p: Peripherals) {
|
||||
|
||||
loop {
|
||||
info!("high");
|
||||
unwrap!(led.set_high());
|
||||
led.set_high();
|
||||
Timer::after(Duration::from_millis(1000)).await;
|
||||
|
||||
info!("low");
|
||||
unwrap!(led.set_low());
|
||||
led.set_low();
|
||||
Timer::after(Duration::from_millis(1000)).await;
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,6 @@ mod example_common;
|
||||
|
||||
use embassy::executor::Spawner;
|
||||
use embassy_stm32::gpio::{Level, Output, Speed};
|
||||
use embedded_hal::digital::v2::OutputPin;
|
||||
use example_common::*;
|
||||
|
||||
use embassy_stm32::dma::NoDma;
|
||||
@ -35,9 +34,9 @@ async fn main(_spawner: Spawner, p: Peripherals) {
|
||||
|
||||
loop {
|
||||
let mut buf = [0x0Au8; 4];
|
||||
unwrap!(cs.set_low());
|
||||
cs.set_low();
|
||||
unwrap!(spi.transfer(&mut buf));
|
||||
unwrap!(cs.set_high());
|
||||
cs.set_high();
|
||||
info!("xfer {=[u8]:x}", buf);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user