Skip to content

Commit

Permalink
Add SYST example
Browse files Browse the repository at this point in the history
  • Loading branch information
newAM committed Jul 1, 2024
1 parent a97747f commit 87ef4e6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cortex-m/src/peripheral/syst.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
//! SysTick: System Timer
//!
//! # Example
//!
//! ```no_run
//! use cortex_m::peripheral::{Peripherals, SYST};
//!
//! let core_periph = cortex_m::peripheral::Peripherals::take().unwrap();
//! let mut syst = core_periph.SYST;
//! syst.set_reload(0xffffff);
//! syst.clear_current();
//! syst.enable_counter();
//!
//! let syst_value: u32 = SYST::get_current();
//! ```

use volatile_register::{RO, RW};

Expand Down

0 comments on commit 87ef4e6

Please sign in to comment.