pub struct Timer<'a> { /* private fields */ }
Expand description
Driver for the physical or virtual timer instance of the CNTBase block.
Implementations§
Source§impl<'a> Timer<'a>
impl<'a> Timer<'a>
Sourcepub fn new(regs: UniqueMmioPointer<'a, TimerRegs>, frequency: u32) -> Self
pub fn new(regs: UniqueMmioPointer<'a, TimerRegs>, frequency: u32) -> Self
Creates new instance.
Sourcepub unsafe fn generate_interrupt_after(&mut self, duration: Duration)
pub unsafe fn generate_interrupt_after(&mut self, duration: Duration)
Sets up timer to generate an interrupt after the given duration.
§Safety
The system must be prepared to take an interrupt. The vector table has to be set and the interrupt controller must be configured properly.
Sourcepub fn cancel_interrupt(&mut self)
pub fn cancel_interrupt(&mut self)
Disables the timer and masks the interrupt.
Auto Trait Implementations§
impl<'a> Freeze for Timer<'a>
impl<'a> RefUnwindSafe for Timer<'a>
impl<'a> Send for Timer<'a>
impl<'a> !Sync for Timer<'a>
impl<'a> Unpin for Timer<'a>
impl<'a> UnwindSafe for Timer<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more