[][src]Macro r3_support_rza1::use_os_timer

macro_rules! use_os_timer {
    (unsafe impl PortTimer for $ty:ty) => { ... };
}

Attach the implementation of PortTimer that is based on RZ/A1 OS Timer to a given system type. This macro also implements Timer on the system type. Requires OsTimerOptions and Gic.

You should do the following:

  • Implement OsTimerOptions on the system type $ty.
  • Call $ty::configure_os_timer() in your configuration function. See the following example.
This example is not tested
r3_support_rza1::use_os_timer!(unsafe impl PortTimer for System);

impl r3_support_rza1::OsTimerOptions for System {
    const FREQUENCY: u64 = 1_000_000;
}

const fn configure_app(b: &mut CfgBuilder<System>) -> Objects {
    System::configure_os_timer(b);
    /* ... */
}

Safety

  • OsTimerOptions must be configured correctly.