pub struct GenericTimerControl<'a> { /* private fields */ }
Expand description
Driver for the CNTControlBase block.
Implementations§
Source§impl<'a> GenericTimerControl<'a>
impl<'a> GenericTimerControl<'a>
Sourcepub fn new(regs: UniqueMmioPointer<'a, CntControlBase>) -> Self
pub fn new(regs: UniqueMmioPointer<'a, CntControlBase>) -> Self
Creates new instance.
Sourcepub fn set_enable(&mut self, enable: bool)
pub fn set_enable(&mut self, enable: bool)
Enables or disables the timer.
Sourcepub fn request_frequency(&mut self, index: usize)
pub fn request_frequency(&mut self, index: usize)
Sets the number of the entry in the Frequency modes table to select.
Sourcepub fn frequency_index(&self) -> usize
pub fn frequency_index(&self) -> usize
Gets currently selected entry index in the Frequency modes table.
Sourcepub fn scaling_implemented(&self) -> bool
pub fn scaling_implemented(&self) -> bool
Checks whether scaling is implemented by the timer.
Sourcepub fn enable_scaling(&mut self, scale: u32)
pub fn enable_scaling(&mut self, scale: u32)
Sets scale and enable scaling.
Sourcepub fn disable_scaling(&mut self)
pub fn disable_scaling(&mut self)
Disables scaling.
Sourcepub fn base_frequency(&self) -> u32
pub fn base_frequency(&self) -> u32
Indicates the base frequency of the system counter in Hz.
Sourcepub fn frequency_mode(&self, index: usize) -> Option<u32>
pub fn frequency_mode(&self, index: usize) -> Option<u32>
Gets frequency mode of the given index in Hz. The availablity of the frequency mode is implementation defined.
Sourcepub fn set_frequency_mode(&mut self, index: usize, frequency: u32)
pub fn set_frequency_mode(&mut self, index: usize, frequency: u32)
Sets frequency mode of the given index. The availablity of the frequency mode is implementation defined.
Auto Trait Implementations§
impl<'a> Freeze for GenericTimerControl<'a>
impl<'a> RefUnwindSafe for GenericTimerControl<'a>
impl<'a> Send for GenericTimerControl<'a>
impl<'a> !Sync for GenericTimerControl<'a>
impl<'a> Unpin for GenericTimerControl<'a>
impl<'a> UnwindSafe for GenericTimerControl<'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