driver_interface/
timer.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
use alloc::boxed::Box;

pub trait Driver: super::DriverGeneric {
    fn set_interval(&mut self, ticks: u64);
    fn current_ticks(&self) -> u64;
    fn tick_hz(&self) -> u64;
    fn set_enable(&mut self, enable: bool);
    fn set_irq_enable(&mut self, enable: bool);
    fn read_irq_status(&self) -> bool;
    fn irq_num(&self) -> u64;
}

pub type BoxDriver = Box<dyn Driver>;