aboutsummaryrefslogtreecommitdiff
path: root/rtic-monotonics/src
diff options
context:
space:
mode:
Diffstat (limited to 'rtic-monotonics/src')
-rw-r--r--rtic-monotonics/src/imxrt.rs10
-rw-r--r--rtic-monotonics/src/lib.rs3
-rw-r--r--rtic-monotonics/src/nrf/timer.rs2
-rw-r--r--rtic-monotonics/src/rp2040.rs2
-rw-r--r--rtic-monotonics/src/stm32.rs4
-rw-r--r--rtic-monotonics/src/systick.rs4
6 files changed, 16 insertions, 9 deletions
diff --git a/rtic-monotonics/src/imxrt.rs b/rtic-monotonics/src/imxrt.rs
index ee7e2ffe..39448291 100644
--- a/rtic-monotonics/src/imxrt.rs
+++ b/rtic-monotonics/src/imxrt.rs
@@ -1,4 +1,4 @@
-//! [`Monotonic`] impl for the i.MX RT.
+//! [`Monotonic`] implementations for i.MX RT's GPT peripherals.
//!
//! # Example
//!
@@ -55,7 +55,7 @@ macro_rules! __internal_create_imxrt_timer_interrupt {
}};
}
-/// Register GPT1 interrupt for the monotonic.
+/// Register the GPT1 interrupt for the monotonic.
#[cfg(feature = "imxrt_gpt1")]
#[macro_export]
macro_rules! create_imxrt_gpt1_token {
@@ -64,7 +64,7 @@ macro_rules! create_imxrt_gpt1_token {
}};
}
-/// Register GPT2 interrupt for the monotonic.
+/// Register the GPT2 interrupt for the monotonic.
#[cfg(feature = "imxrt_gpt2")]
#[macro_export]
macro_rules! create_imxrt_gpt2_token {
@@ -98,7 +98,7 @@ fn calc_now(period: u32, counter: u32) -> u64 {
macro_rules! make_timer {
($mono_name:ident, $timer:ident, $period:ident, $tq:ident$(, doc: ($($doc:tt)*))?) => {
- /// Monotonic timer queue implementation.
+ /// Timer implementing [`Monotonic`] which runs at 1 MHz.
$(
#[cfg_attr(docsrs, doc(cfg($($doc)*)))]
)?
@@ -113,9 +113,11 @@ macro_rules! make_timer {
impl $mono_name {
/// Starts the monotonic timer.
+ ///
/// - `tick_freq_hz`: The tick frequency of the given timer.
/// - `gpt`: The GPT timer register block instance.
/// - `_interrupt_token`: Required for correct timer interrupt handling.
+ ///
/// This method must be called only once.
pub fn start(tick_freq_hz: u32, gpt: $timer, _interrupt_token: impl crate::InterruptToken<Self>) {
// Find a prescaler that creates our desired tick frequency
diff --git a/rtic-monotonics/src/lib.rs b/rtic-monotonics/src/lib.rs
index 2d7c74f8..6dc703eb 100644
--- a/rtic-monotonics/src/lib.rs
+++ b/rtic-monotonics/src/lib.rs
@@ -9,6 +9,9 @@
//! # 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.
//!
diff --git a/rtic-monotonics/src/nrf/timer.rs b/rtic-monotonics/src/nrf/timer.rs
index bd544d0b..589cc6fd 100644
--- a/rtic-monotonics/src/nrf/timer.rs
+++ b/rtic-monotonics/src/nrf/timer.rs
@@ -1,7 +1,7 @@
//! [`Monotonic`] impl for the 32-bit timers of the nRF series.
//!
//! Not all timers are available on all parts. Ensure that only the available
-//! timers are exposed by having the correct `nrf52*` feature enabled for `rtic-monotonic`.
+//! timers are exposed by having the correct `nrf52*` feature enabled for `rtic-monotonics`.
//!
//! # Example
//!
diff --git a/rtic-monotonics/src/rp2040.rs b/rtic-monotonics/src/rp2040.rs
index 43e67702..130c7d3e 100644
--- a/rtic-monotonics/src/rp2040.rs
+++ b/rtic-monotonics/src/rp2040.rs
@@ -31,7 +31,7 @@ use core::future::Future;
pub use fugit::{self, ExtU64};
use rp2040_pac::{timer, Interrupt, NVIC, RESETS, TIMER};
-/// Timer implementing `rtic_monotonic::Monotonic` which runs at 1 MHz.
+/// Timer implementing [`Monotonic`] which runs at 1 MHz.
pub struct Timer;
impl Timer {
diff --git a/rtic-monotonics/src/stm32.rs b/rtic-monotonics/src/stm32.rs
index 12845a8b..2676a346 100644
--- a/rtic-monotonics/src/stm32.rs
+++ b/rtic-monotonics/src/stm32.rs
@@ -1,7 +1,7 @@
//! [`Monotonic`] impl for the STM32.
//!
//! Not all timers are available on all parts. Ensure that only available
-//! timers are exposed by having the correct `stm32*` feature enabled for `rtic-monotonic`.
+//! timers are exposed by having the correct `stm32*` feature enabled for `rtic-monotonics`.
//!
//! # Example
//!
@@ -137,8 +137,10 @@ macro_rules! make_timer {
impl $mono_name {
/// Starts the monotonic timer.
+ ///
/// - `tim_clock_hz`: `TIMx` peripheral clock frequency.
/// - `_interrupt_token`: Required for correct timer interrupt handling.
+ ///
/// This method must be called only once.
pub fn start(tim_clock_hz: u32, _interrupt_token: impl crate::InterruptToken<Self>) {
_generated::$timer::enable();
diff --git a/rtic-monotonics/src/systick.rs b/rtic-monotonics/src/systick.rs
index fb4f8832..2bdb5e3a 100644
--- a/rtic-monotonics/src/systick.rs
+++ b/rtic-monotonics/src/systick.rs
@@ -5,7 +5,7 @@
//!
//! | Feature | Tick rate | Precision |
//! |:----------------:|----------:|----------:|
-//! | (none / default) | 1 Hz | 1 ms |
+//! | (none / default) | 1 Hz | 1 s |
//! | systick-100hz | 100 Hz | 10 ms |
//! | systick-10khz | 10 KHz | 0.1 ms |
@@ -67,7 +67,7 @@ cfg_if::cfg_if! {
}
}
-/// Systick implementing `rtic_monotonic::Monotonic` which runs at 1 kHz, 100Hz or 10 kHz.
+/// Systick implementing [`Monotonic`] which runs at 1 kHz, 100Hz or 10 kHz.
pub struct Systick;
impl Systick {