traits: add delay trait
delay allows downstream libraries to use async delay without depending on a specific delay implementation
This commit is contained in:
9
embassy-traits/src/delay.rs
Normal file
9
embassy-traits/src/delay.rs
Normal file
@ -0,0 +1,9 @@
|
||||
use core::future::Future;
|
||||
use core::pin::Pin;
|
||||
|
||||
pub trait Delay {
|
||||
type DelayFuture<'a>: Future<Output = ()> + 'a;
|
||||
|
||||
fn delay_ms<'a>(self: Pin<&'a mut Self>, millis: u64) -> Self::DelayFuture<'a>;
|
||||
fn delay_us<'a>(self: Pin<&'a mut Self>, micros: u64) -> Self::DelayFuture<'a>;
|
||||
}
|
@ -5,6 +5,7 @@
|
||||
#![feature(const_option)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
pub mod delay;
|
||||
pub mod flash;
|
||||
pub mod gpio;
|
||||
pub mod uart;
|
||||
|
Reference in New Issue
Block a user