[][src]Crate ruspiro_mailbox

Mailbox property tag interface

This crate provides an abstraction on the mailbox property tag interface available in the Raspberry Pi. There are currently a limmited number of functions for the following property tag messages implemented:

  • GetArmMemory
  • GetClockRate
  • SetClockRate

Check the official documentation of those property tags and their purpose.

Usage

The crate provides a singleton wrapper to call the different Raspberry Pi mailbox property tag messages. The following example demonstrates the usage with the GetClockRate message.

use ruspiro_mailbox::*;
 
fn demo() {
    // use the mailbox to retrieve the core clock rate
    if let Ok(core_rate) = MAILBOX.take_for(|mb| mb.get_clockrate(ArmClockId::Core)) {
        // here we know the core clock rate do something with it...
        // remeber - println is just a show case here as it might not be available in bare metal environment
        println!("Core clock rate {}", core_rate);
    }
}

Structs

Mailbox

MAILBOX peripheral representation

Enums

ArmClockId

Definition of the different ARM clock id's used in the mailbox interface

Statics

MAILBOX

static "singleton" accessor to the MAILBOX peripheral