Struct stm32f103xx::SYST [−][src]
pub struct SYST { /* fields omitted */ }SysTick: System Timer
Methods
impl SYST[src]
impl SYSTpub fn clear_current(&mut self)[src]
pub fn clear_current(&mut self)Clears current value to 0
After calling clear_current(), the next call to has_wrapped() will return false.
pub fn disable_counter(&mut self)[src]
pub fn disable_counter(&mut self)Disables counter
pub fn disable_interrupt(&mut self)[src]
pub fn disable_interrupt(&mut self)Disables SysTick interrupt
pub fn enable_counter(&mut self)[src]
pub fn enable_counter(&mut self)Enables counter
NOTE The reference manual indicates that:
"The SysTick counter reload and current value are undefined at reset, the correct initialization sequence for the SysTick counter is:
- Program reload value
- Clear current value
- Program Control and Status register"
The sequence translates to self.set_reload(x); self.clear_current(); self.enable_counter()
pub fn enable_interrupt(&mut self)[src]
pub fn enable_interrupt(&mut self)Enables SysTick interrupt
pub fn get_clock_source(&mut self) -> SystClkSource[src]
pub fn get_clock_source(&mut self) -> SystClkSourceGets clock source
NOTE This takes &mut self because the read operation is side effectful and can clear the
bit that indicates that the timer has wrapped (cf. SYST.has_wrapped)
pub fn get_current() -> u32[src]
pub fn get_current() -> u32Gets current value
pub fn get_reload() -> u32[src]
pub fn get_reload() -> u32Gets reload value
pub fn get_ticks_per_10ms() -> u32[src]
pub fn get_ticks_per_10ms() -> u32Returns the reload value with which the counter would wrap once per 10 ms
Returns 0 if the value is not known (e.g. because the clock can
change dynamically).
pub fn has_reference_clock() -> bool[src]
pub fn has_reference_clock() -> boolChecks if an external reference clock is available
pub fn has_wrapped(&mut self) -> bool[src]
pub fn has_wrapped(&mut self) -> boolChecks if the counter wrapped (underflowed) since the last check
NOTE This takes &mut self because the read operation is side effectful and will clear
the bit of the read register.
pub fn is_counter_enabled(&mut self) -> bool[src]
pub fn is_counter_enabled(&mut self) -> boolChecks if counter is enabled
NOTE This takes &mut self because the read operation is side effectful and can clear the
bit that indicates that the timer has wrapped (cf. SYST.has_wrapped)
pub fn is_interrupt_enabled(&mut self) -> bool[src]
pub fn is_interrupt_enabled(&mut self) -> boolChecks if SysTick interrupt is enabled
NOTE This takes &mut self because the read operation is side effectful and can clear the
bit that indicates that the timer has wrapped (cf. SYST.has_wrapped)
pub fn is_precise() -> bool[src]
pub fn is_precise() -> boolChecks if the calibration value is precise
Returns false if using the reload value returned by
get_ticks_per_10ms() may result in a period significantly deviating
from 10 ms.
pub fn set_clock_source(&mut self, clk_source: SystClkSource)[src]
pub fn set_clock_source(&mut self, clk_source: SystClkSource)Sets clock source
pub fn set_reload(&mut self, value: u32)[src]
pub fn set_reload(&mut self, value: u32)Sets reload value
Valid values are between 1 and 0x00ffffff.
NOTE To make the timer wrap every N ticks set the reload value to N - 1
impl SYST[src]
impl SYSTpub fn ptr() -> *const RegisterBlock[src]
pub fn ptr() -> *const RegisterBlockReturns a pointer to the register block
Trait Implementations
impl Deref for SYST[src]
impl Deref for SYSTtype Target = RegisterBlock
The resulting type after dereferencing.
fn deref(&self) -> &<SYST as Deref>::Target[src]
fn deref(&self) -> &<SYST as Deref>::TargetDereferences the value.
impl Send for SYST[src]
impl Send for SYST