Module imxrt

Source
Expand description

Monotonic implementations for i.MX RT’s GPT peripherals.

§Example

use rtic_monotonics::imxrt::prelude::*;

// Create the type `Mono`. It will manage the GPT1 timer, and
// run with a resolution of 1 µs (1,000,000 ticks per second).
imxrt_gpt1_monotonic!(Mono, 1_000_000);

fn init() {
    // Obtain ownership of the timer register block.
    let gpt1 = unsafe { imxrt_ral::gpt::GPT1::instance() };

    // Configure the timer tick rate as specified earlier
    todo!("Configure the gpt1 peripheral to a tick rate of 1_000_000");

    // Start the monotonic
    Mono::start(gpt1);
}

async fn usage() {
    loop {
         // You can use the monotonic to get the time...
         let timestamp = Mono::now();
         // ...and you can use it to add a delay to this async function
         Mono::delay(100.millis()).await;
    }
}

Re-exports§

pub use imxrt_ral as ral;

Modules§

prelude
Common definitions and traits for using the i.MX RT monotonics

Structs§

Gpt1Backend
GPT based TimerQueueBackend.
Gpt2Backend
GPT based TimerQueueBackend.