aboutsummaryrefslogtreecommitdiff
path: root/embassy-traits/src/delay.rs
blob: b893ee4a337c4328c3c09d10e787d7d69440dbff (plain)
1
2
3
4
5
6
7
8
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>;
}