[][src]Struct ruspiro_mailbox::Mailbox

pub struct Mailbox;

MAILBOX peripheral representation

Methods

impl Mailbox[src]

pub fn get_arm_memory(&self) -> Result<(u32, u32), &'static str>[src]

Get the ARM memory base address and size as configured in the boot config file. Returns a tuple Ok((address:u32, size:u32)) on success or an Err(msg: &str) on failure

Example

let arm_memory = MAILBOX.take_for(|mb| mb.get_arm_memory().expect("unable to get arm memory"));

pub fn get_clockrate(&self, clock_id: ArmClockId) -> Result<u32, &'static str>[src]

Get the clock rate via mailbox interface for the clockId given. Returns Ok(rate:u32) on success or Err(msg: &str) on failure

Example

let clock_rate = MAILBOX.take_for(|mb| mb.get_clockrate(ArmClockId::Core).expect("unable to get core clock rate"));

pub fn set_clockrate(
    &self,
    clock_id: ArmClockId,
    rate: u32
) -> Result<u32, &'static str>
[src]

Set the clock rate via the mailbox interface for the clockId given. The rate will be set to the closest valid value. Returns Ok(rate:u32) with the new clock rate set on success ore Err(msg: &str) on failure

Example

let new_clock_rate = MAILBOX.take_for(|mb| mb.set_clockrate(ArmClockId::Core, 250_000_000).expect("unable to set core clock rate"));

Auto Trait Implementations

impl Unpin for Mailbox

impl Sync for Mailbox

impl Send for Mailbox

Blanket Implementations

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]