Skip to content

Commit

Permalink
Merge pull request #545 from newAM/syst-example
Browse files Browse the repository at this point in the history
Add SYST example
  • Loading branch information
adamgreig authored Jul 1, 2024
2 parents a97747f + 87ef4e6 commit 52da23b
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 52da23b

Please sign in to comment.