Skip to main content

PhysicalSecureTimer

Struct PhysicalSecureTimer 

Source
pub struct PhysicalSecureTimer(/* private fields */);
Available on crate feature el1 and (AArch64 or crate feature fakes) only.
Expand description

Physical Secure Timer

Uses CNTPS_* system registers.

Implementations§

Source§

impl PhysicalSecureTimer

Source

pub const unsafe fn new() -> Self

Creates an instance of the Physical Secure Timer.

§Safety

The caller must ensure that no other instance exists and that there is no concurrent access to the CNTPS_* system registers.

Trait Implementations§

Source§

impl TimerInterface for PhysicalSecureTimer

Source§

fn enable(&mut self)

Enables timer
Source§

fn frequency(&self) -> u32

Returns the frequency in Hz.
Source§

fn timer_value(&self) -> i32

Returns the down-counter value.
Source§

fn enable_interrupt(&mut self, enabled: bool)

Unmasks / masks interrupts for the counter.
Source§

fn compare_value(&self) -> u64

Returns the compare value.
Source§

fn set_timer_value(&mut self, timer_value: i32)

Sets timer value. This programs the compare value relative to the physical counter, which affects the value returned by TimerInterface::compare_value(). Setting a negative value will trigger an interrupt, if enabled.
Source§

fn set_compare_value(&mut self, compare_value: u64)

Sets the compare value. This also affects the down-counter value queried using TimerInterface::timer_value().

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.