Struct GenericTimerControl

Source
pub struct GenericTimerControl<'a> { /* private fields */ }
Expand description

Driver for the CNTControlBase block.

Implementations§

Source§

impl<'a> GenericTimerControl<'a>

Source

pub fn new(regs: UniqueMmioPointer<'a, CntControlBase>) -> Self

Creates new instance.

Source

pub fn set_enable(&mut self, enable: bool)

Enables or disables the timer.

Source

pub fn request_frequency(&mut self, index: usize)

Sets the number of the entry in the Frequency modes table to select.

Source

pub fn frequency_index(&self) -> usize

Gets currently selected entry index in the Frequency modes table.

Source

pub fn count(&self) -> u64

Gets timer count value.

Source

pub fn set_count(&mut self, count: u64)

Sets timer count value.

Source

pub fn scaling_implemented(&self) -> bool

Checks whether scaling is implemented by the timer.

Source

pub fn scale(&self) -> u32

Gets scale value.

Source

pub fn enable_scaling(&mut self, scale: u32)

Sets scale and enable scaling.

Source

pub fn disable_scaling(&mut self)

Disables scaling.

Source

pub fn base_frequency(&self) -> u32

Indicates the base frequency of the system counter in Hz.

Source

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.

Source

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.