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

@ -10,7 +10,6 @@ use embassy::traits::rng::Random;
use embassy_stm32::gpio::{Level, Output, Speed};
use embassy_stm32::rng::Rng;
use embassy_stm32::Peripherals;
use embedded_hal::digital::v2::OutputPin;
use example_common::*;
#[embassy::main]
@ -23,11 +22,11 @@ async fn main(_spawner: Spawner, p: Peripherals) {
loop {
info!("high {}", unwrap!(rng.next_u8(16).await));
unwrap!(led.set_high());
led.set_high();
Timer::after(Duration::from_millis(500)).await;
info!("low {}", unwrap!(rng.next_u8(16).await));
unwrap!(led.set_low());
led.set_low();
Timer::after(Duration::from_millis(500)).await;
}
}