aboutsummaryrefslogtreecommitdiff
path: root/rtic-monotonics/src/systick.rs
diff options
context:
space:
mode:
authorEmil Fresk <emil.fresk@gmail.com>2023-04-01 20:48:23 +0200
committerEmil Fresk <emil.fresk@gmail.com>2023-04-02 15:19:07 +0200
commita2f153249f926876e7169016f3dc8e861a9ef065 (patch)
tree1f2ccf36f5b8fc878792704d162924337f54eaf4 /rtic-monotonics/src/systick.rs
parent064cf19265f72d7f01e0847c545e6250391a2172 (diff)
Added nRF monotonics
Diffstat (limited to 'rtic-monotonics/src/systick.rs')
-rw-r--r--rtic-monotonics/src/systick.rs23
1 files changed, 22 insertions, 1 deletions
diff --git a/rtic-monotonics/src/systick.rs b/rtic-monotonics/src/systick.rs
index f4345d4..f1d49da 100644
--- a/rtic-monotonics/src/systick.rs
+++ b/rtic-monotonics/src/systick.rs
@@ -1,4 +1,25 @@
-//! ...
+//! A monotonics based on Cortex-M SysTick. Note that this implementation is inefficient as it
+//! ticks, and generates interrupts, at a constant rate.
+//!
+//! # Example
+//!
+//! ```
+//! use rtic_monotonics::systick::*;
+//!
+//! # async fn usage() {
+//! # let systick = unsafe { core::mem::transmute(()) };
+//! // Generate the required token
+//! let systick_token = rtic_monotonics::create_systick_token!();
+//!
+//! // Start the monotonic
+//! Systick::start(systick, 12_000_000, systick_token);
+//!
+//! loop {
+//! // Use the monotonic
+//! Systick::delay(100.millis()).await;
+//! }
+//! # }
+//! ```
use super::Monotonic;
pub use super::{TimeoutError, TimerQueue};