pub struct Timer {}Expand description
Direct access to the MIPS core timer (CP0 timer) and related interrupt control
Can write to the “compare” register of MIPS core timer and can thus be
instantiated only once. Write to the “count” register is not implemented to
avoid conflicts with the Delay struct.
Implementations§
Source§impl Timer
impl Timer
Sourcepub fn read_count(&self) -> u32
pub fn read_count(&self) -> u32
Read Count register (CP0 register 9, select 0)
Sourcepub fn read_compare(&self) -> u32
pub fn read_compare(&self) -> u32
Read Compare register (CP0 register 11, select 0)
Sourcepub fn write_compare(&self, compare: u32)
pub fn write_compare(&self, compare: u32)
Write to Compare register (CPP0 register 11, select 0)
Sourcepub fn enable_interrupts(&self, int: &INT)
pub fn enable_interrupts(&self, int: &INT)
Enable interrupts
Sourcepub fn disable_interrupts(&self, int: &INT) -> bool
pub fn disable_interrupts(&self, int: &INT) -> bool
Disable interrupts and return whether interrupts were previously enabled.
Sourcepub fn set_interrupt_prio(&self, int: &INT, prio: u8, subprio: u8)
pub fn set_interrupt_prio(&self, int: &INT, prio: u8, subprio: u8)
Set interrupt priority and sub priority. A priority level of 0 is the lowest priority level and disables the interrupts.
Auto Trait Implementations§
impl Freeze for Timer
impl RefUnwindSafe for Timer
impl Send for Timer
impl Sync for Timer
impl Unpin for Timer
impl UnwindSafe for Timer
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