#real-time #monotonic #rtic #clock #interrupt #cortex-m

no-std rtic-monotonics

A library that provides implementations of the Monotonic trait from rtic-time

10 releases (stable)

2.0.3 Oct 24, 2024
2.0.2 Jul 6, 2024
2.0.1 Jun 2, 2024
1.5.0 Jan 10, 2024
1.0.0 May 31, 2023

#168 in Concurrency

Download history 1232/week @ 2024-07-17 1286/week @ 2024-07-24 967/week @ 2024-07-31 1010/week @ 2024-08-07 1946/week @ 2024-08-14 1022/week @ 2024-08-21 1029/week @ 2024-08-28 1093/week @ 2024-09-04 1463/week @ 2024-09-11 1907/week @ 2024-09-18 1404/week @ 2024-09-25 1130/week @ 2024-10-02 520/week @ 2024-10-09 1104/week @ 2024-10-16 751/week @ 2024-10-23 747/week @ 2024-10-30

3,297 downloads per month
Used in 6 crates

MIT/Apache

305KB
2K SLoC

In-tree implementations of the rtic_time::Monotonic (reexported) trait for timers & clocks found on commonly used microcontrollers.

If you are using a microcontroller where CAS operations are not available natively, you might have to enable the critical-section or unsafe-assume-single-core feature of the portable-atomic dependency yourself for this dependency to compile.

To enable the implementations, you must enable a feature for the specific MCU you're targeting.

Cortex-M Systick

The systick monotonic works on all cortex-M parts, and requires that the feature cortex-m-systick is enabled.

RP2040

The RP2040 monotonics require that the rp2040 feature is enabled.

i.MX RT

The i.MX RT monotonics require that the feature imxrt_gpt1 or imxrt_gpt2 is enabled.

nRF

nRF monotonics require that one of the available nrf52* features is enabled.

All implementations of timers for the nRF52 family are documented here. Monotonics that are not available on all parts in this family will have an Available on crate features X only tag, describing what parts do support that monotonic. Monotonics without an Available on crate features X only tag are available on any nrf52* feature.

Priority of interrupt handlers

The priority of timer interrupts are based on RTIC_ASYNC_MAX_LOGICAL_PRIO generated by RTIC. It is calculated to be 1 less than the maximum hardware task priority (to not have impact on hardware tasks), or, if no hardware task is available, is set to the maximum priority in the system.

Dependencies

~2–64MB
~2M SLoC