stm32/gpio: expose all functionality as inherent methods.
This commit is contained in:
@ -8,7 +8,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]
|
||||
@ -19,11 +18,11 @@ async fn main(_spawner: Spawner, p: Peripherals) {
|
||||
|
||||
loop {
|
||||
info!("high");
|
||||
unwrap!(led.set_high());
|
||||
led.set_high();
|
||||
Timer::after(Duration::from_millis(300)).await;
|
||||
|
||||
info!("low");
|
||||
unwrap!(led.set_low());
|
||||
led.set_low();
|
||||
Timer::after(Duration::from_millis(300)).await;
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
mod example_common;
|
||||
use cortex_m_rt::entry;
|
||||
use embassy_stm32::gpio::{Input, Pull};
|
||||
use embedded_hal::digital::v2::InputPin;
|
||||
use example_common::*;
|
||||
|
||||
#[entry]
|
||||
@ -18,7 +17,7 @@ fn main() -> ! {
|
||||
let button = Input::new(p.PC13, Pull::Up);
|
||||
|
||||
loop {
|
||||
if unwrap!(button.is_high()) {
|
||||
if button.is_high() {
|
||||
info!("high");
|
||||
} else {
|
||||
info!("low");
|
||||
|
Reference in New Issue
Block a user