Struct cortex_m::peripheral::SYST

source ·
pub struct SYST { /* private fields */ }
Expand description

SysTick: System Timer

Implementations§

Clears current value to 0

After calling clear_current(), the next call to has_wrapped() will return false.

Disables counter

Disables SysTick interrupt

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()

Enables SysTick interrupt

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)

Gets current value

Gets reload value

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).

Checks if an external reference clock is available

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.

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)

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)

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.

Sets clock source

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

Pointer to the register block

👎Deprecated since 0.7.5: Use the associated constant PTR instead

Returns a pointer to the register block

Trait Implementations§

The resulting type after dereferencing.
Dereferences the value.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.