CLINT

Struct CLINT 

Source
pub struct CLINT;
Expand description

CLINT peripheral

Implementations§

Source§

impl CLINT

Source

pub fn is_interrupting() -> bool

Returns true if a machine timer OR software interrupt is pending.

Source

pub fn is_enabled() -> bool

Returns true if machine timer OR software interrupts are enabled.

Source

pub unsafe fn enable()

Enables machine timer AND software interrupts to allow the CLINT to trigger interrupts.

§Safety

Enabling the CLINT may break mask-based critical sections.

Source

pub fn disable()

Disables machine timer AND software interrupts to prevent the CLINT from triggering interrupts.

Source

pub fn mswi_is_interrupting() -> bool

Returns true if a machine software interrupt is pending.

Source

pub fn mswi_is_enabled() -> bool

Returns true if Machine Software Interrupts are enabled.

Source

pub unsafe fn mswi_enable()

Enables the MSWI peripheral.

§Safety

Enabling the MSWI may break mask-based critical sections.

Source

pub fn mswi_disable()

Disables the MSWI peripheral.

Source

pub const fn mswi() -> MSWI

Returns the MSWI peripheral.

Source

pub fn mtimer_is_interrupting() -> bool

Returns true if a machine timer interrupt is pending.

Source

pub fn mtimer_is_enabled() -> bool

Returns true if Machine Timer Interrupts are enabled.

Source

pub unsafe fn mtimer_enable()

Sets the Machine Timer Interrupt bit of the mie CSR. This bit must be set for the MTIMER to trigger machine timer interrupts.

§Safety

Enabling the MTIMER may break mask-based critical sections.

Source

pub fn mtimer_disable()

Clears the Machine Timer Interrupt bit of the mie CSR. When cleared, the MTIMER cannot trigger machine timer interrupts.

Source

pub const fn mtimer() -> MTIMER

Returns the MTIMER peripheral.

Source

pub const fn mtime() -> MTIME

Returns the MTIME register of the MTIMER peripheral.

Source§

impl CLINT

Source

pub const fn freq() -> usize

Returns the frequency of the MTIME register.

Source

pub const fn delay() -> Delay

Delay implementation for CLINT peripherals.

§Note

You must export the [embedded_hal::delay::DelayNs] trait in order to use delay methods.

Source§

impl CLINT

Source

pub fn mtimecmp0() -> MTIMECMP

Returns the mtimecmp register for HART 0 .

Source§

impl CLINT

Source

pub fn msip0() -> MSIP

Returns the msip register for HART 0 .

Trait Implementations§

Source§

impl Clint for CLINT

Source§

const BASE: usize = 33_554_432usize

Base address of the CLINT peripheral.
Source§

impl Clone for CLINT

Source§

fn clone(&self) -> CLINT

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CLINT

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl PartialEq for CLINT

Source§

fn eq(&self, other: &CLINT) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for CLINT

Source§

impl Eq for CLINT

Source§

impl StructuralPartialEq for CLINT

Auto Trait Implementations§

§

impl Freeze for CLINT

§

impl RefUnwindSafe for CLINT

§

impl Send for CLINT

§

impl Sync for CLINT

§

impl Unpin for CLINT

§

impl UnwindSafe for CLINT

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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.