stm32/gpio: expose all functionality as inherent methods.

This commit is contained in:
Dario Nieuwenhuis
2022-01-14 22:02:00 +01:00
parent 52e156b429
commit 58fc64722c
34 changed files with 266 additions and 210 deletions

View File

@@ -6,7 +6,6 @@
mod example_common;
use cortex_m_rt::entry;
use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed};
use embedded_hal::digital::v2::{InputPin, OutputPin};
use example_common::*;
#[entry]
@@ -20,14 +19,14 @@ fn main() -> ! {
let mut led2 = Output::new(p.PE15, Level::High, Speed::Low);
loop {
if unwrap!(button.is_high()) {
if button.is_high() {
info!("high");
unwrap!(led1.set_high());
unwrap!(led2.set_low());
led1.set_high();
led2.set_low();
} else {
info!("low");
unwrap!(led1.set_low());
unwrap!(led2.set_high());
led1.set_low();
led2.set_high();
}
}
}