Functions | |
static void | SysTickEnable (void) |
Enables the SysTick counter. More... | |
static void | SysTickDisable (void) |
Disables the SysTick counter. More... | |
static void | SysTickIntRegister (void(*pfnHandler)(void)) |
Registers an interrupt handler for the SysTick interrupt in the dynamic interrupt table. More... | |
static void | SysTickIntUnregister (void) |
Unregisters the interrupt handler for the SysTick interrupt in the dynamic interrupt table. More... | |
static void | SysTickIntEnable (void) |
Enables the SysTick interrupt. More... | |
static void | SysTickIntDisable (void) |
Disables the SysTick interrupt. More... | |
static void | SysTickPeriodSet (uint32_t ui32Period) |
Sets the period of the SysTick counter. More... | |
static uint32_t | SysTickPeriodGet (void) |
Gets the period of the SysTick counter. More... | |
static uint32_t | SysTickValueGet (void) |
Gets the current value of the SysTick counter. More... | |
The system CPU includes a system timer, SysTick, integrated in the NVIC which provides a simple, 24-bit, clear-on-write, decrementing, wrap-on-zero counter with a flexible control mechanism. When enabled, the timer counts down on each clock from the reload value to 0, reloads (wraps) on the next clock edge, then decrements on subsequent clocks.
The SysTick counter runs on the system clock. If this clock signal is stopped for low-power mode, the SysTick counter stops.
When the processor is halted for debugging, the counter does not decrement.
The API functions can be grouped like this:
Configuration and status:
Enable and disable:
Interrupt configuration:
|
inlinestatic |
|
inlinestatic |
Enables the SysTick counter.
This will start the SysTick counter. If an interrupt handler has been registered, it will be called when the SysTick counter rolls over.
|
inlinestatic |
|
inlinestatic |
Enables the SysTick interrupt.
This function will enable the SysTick interrupt, allowing it to be reflected to the processor.
|
inlinestatic |
Registers an interrupt handler for the SysTick interrupt in the dynamic interrupt table.
This function registers a function as the interrupt handler for a specific interrupt and enables the corresponding interrupt in the interrupt controller.
pfnHandler | is a pointer to the function to be called when the SysTick interrupt occurs. |
|
inlinestatic |
Unregisters the interrupt handler for the SysTick interrupt in the dynamic interrupt table.
This function will clear the handler to be called when a SysTick interrupt occurs.
|
inlinestatic |
Gets the period of the SysTick counter.
This function returns the rate at which the SysTick counter wraps; this equals to the number of processor clocks between interrupts.
|
inlinestatic |
Sets the period of the SysTick counter.
This function sets the rate at which the SysTick counter wraps; this equals to the number of processor clocks between interrupts.
ui32Period
supplied here on the next clock after the SysTick is enabled.ui32Period | is the number of clock ticks in each period of the SysTick counter; must be between 1 and 16,777,216 (0x1000000), both included. |
|
inlinestatic |
Gets the current value of the SysTick counter.
This function returns the current value of the SysTick counter; this will be a value between the (period - 1) and zero, both included.