# [−] [src] Struct cortex_m::peripheral::SYST

    pub struct SYST { /* fields omitted */ }

SysTick: System Timer

## Methods

###

`impl SYST`

[src]

####

`pub fn clear_current(&mut self)`

[src]

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]

Disables counter

####

`pub fn disable_interrupt(&mut self)`

[src]

Disables SysTick interrupt

####

`pub fn enable_counter(&mut self)`

[src]

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]

Enables SysTick interrupt

####

`pub fn get_clock_source(&mut self) -> SystClkSource`

[src]

Gets 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]

Gets current value

####

`pub fn get_reload() -> u32`

[src]

Gets reload value

####

`pub fn get_ticks_per_10ms() -> u32`

[src]

Returns 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]

Checks if an external reference clock is available

####

`pub fn has_wrapped(&mut self) -> bool`

[src]

Checks 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]

Checks 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]

Checks 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]

Checks 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]

Sets clock source

####

`pub fn set_reload(&mut self, value: u32)`

[src]

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]

####

`pub fn ptr() -> *const RegisterBlock`

[src]

Returns a pointer to the register block

## Trait Implementations

###

`impl Send for SYST`

[src]

###

`impl Deref for SYST`

[src]

#### `type Target = RegisterBlock`

The resulting type after dereferencing.

####

`fn deref(&self) -> &Self::Target`

[src]

Dereferences the value.

## Auto Trait Implementations

###

`impl !Sync for SYST`

## Blanket Implementations

###

`impl<T, U> TryFrom for T where T: From<U>,`

[src]

#### `type Error = !`

🔬 This is a nightly-only experimental API. (`try_from`)

The type returned in the event of a conversion error.

####

`fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>`

[src]

🔬 This is a nightly-only experimental API. (`try_from`)

Performs the conversion.

###

`impl<T> From for T`

[src]

####

`fn from(t: T) -> T`

[src]

Performs the conversion.

###

`impl<T, U> TryInto for T where U: TryFrom<T>,`

[src]

#### `type Error = <U as TryFrom<T>>::Error`

🔬 This is a nightly-only experimental API. (`try_from`)

The type returned in the event of a conversion error.

####

`fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>`

[src]

🔬 This is a nightly-only experimental API. (`try_from`)

Performs the conversion.

###

`impl<T, U> Into for T where U: From<T>,`

[src]

####

`fn into(self) -> U`

[src]

Performs the conversion.

###

`impl<T> Borrow for T where T: ?Sized,`

[src]

####

`fn borrow(&self) -> &T`

[src]

Immutably borrows from an owned value. Read more

###

`impl<T> BorrowMut for T where T: ?Sized,`

[src]

####

`fn borrow_mut(&mut self) -> &mut T`

[src]

Mutably borrows from an owned value. Read more

###

`impl<T> Any for T where T: 'static + ?Sized,`

[src]

####

`fn get_type_id(&self) -> TypeId`

[src]

🔬 This is a nightly-only experimental API. (`get_type_id`)

this method will likely be replaced by an associated static

Gets the `TypeId` of `self`. Read more

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g. `str,u8` or `String,struct:Vec,test`)