mod sys_tick;
pub use self::sys_tick::{SysTick, SysTickTokens};
use drone_core::thread::{RoutineFuture, RoutineStreamUnit};
use reg::prelude::*;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct TimerOverflow;
pub trait Timer
where
Self: Sized + Send + Sync + 'static,
Self::Tokens: From<Self>,
{
type InputTokens;
type Tokens;
type Duration;
type Ctrl: for<'a> WRegShared<'a, Ftt>;
fn new(tokens: Self::InputTokens) -> Self;
fn sleep(
&mut self,
duration: Self::Duration,
ctrl_val: <Self::Ctrl as Reg<Ftt>>::Val,
) -> RoutineFuture<(), !>;
fn interval(
&mut self,
duration: Self::Duration,
ctrl_val: <Self::Ctrl as Reg<Ftt>>::Val,
) -> RoutineStreamUnit<TimerOverflow>;
fn interval_skip(
&mut self,
duration: Self::Duration,
ctrl_val: <Self::Ctrl as Reg<Ftt>>::Val,
) -> RoutineStreamUnit<!>;
fn stop(&mut self, ctrl_val: <Self::Ctrl as Reg<Ftt>>::Val);
}