Module lm4f120::cortex_m4f::systick [] [src]

SysTick for the Cortex-M4F

Each Cortex-M4 has a timer peripheral typically used for OS scheduling tick. Here we configure it as a countdown timer that overflows every 2**24 ticks (so about once a second at 16MHz), and maintain a separate atomic overflow count to accurately track time since power-up.

Structs

SYSTICK_WRAP_COUNT

total number of times SysTick has wrapped

Constants

SYSTICK_MAX

SysTick is a 24-bit timer

Functions

get_overflows

Returns how many times SysTick has overflowed.

get_overflows_ticks

Returns (overflows, ticks), correctly handling the case that it overflowed between the two separate reads that are required.

get_since

Calculates the elapsed period in SysTicks between start and the current value.

get_ticks

Gets the current SysTick value

init

Initialises the SysTick system.

isr

Should be attached to the SysTick vector in the interrupt vector table. Called when SysTick hits zero. Increments an overflow counter atomically.

run_time_ticks

How long since the system booted in ticks. The u64 is good for 584,000 years.