nrf/gpio: add infallible inherent methods, remove some duplication.
This implements Input and Output using FlexPin, to avoid some code duplication.
This commit is contained in:
parent
fcb43caa36
commit
22bc1e4ae1
6 changed files with 221 additions and 262 deletions
docs/modules/ROOT/examples/basic/src
|
@ -14,14 +14,13 @@ use embassy_nrf::{
|
|||
peripherals::P0_13,
|
||||
Peripherals,
|
||||
};
|
||||
use embedded_hal::digital::v2::OutputPin;
|
||||
|
||||
#[embassy::task]
|
||||
async fn blinker(mut led: Output<'static, P0_13>, interval: Duration) {
|
||||
loop {
|
||||
unwrap!(led.set_high());
|
||||
led.set_high();
|
||||
Timer::after(interval).await;
|
||||
unwrap!(led.set_low());
|
||||
led.set_low();
|
||||
Timer::after(interval).await;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue