61 SYSTICK->SYST_CVR = 0;
65 uint32_t one_ms_clk_cycle = cpu_clk / 1000;
66 uint32_t reload_value = one_ms_clk_cycle + 1;
67 if (reload_value == 0 || reload_value > 0x01000000U) {
72 SYSTICK->SYST_RVR &= ~(0xFFFFFF);
73 SYSTICK->SYST_RVR |= (reload_value - 1);
96 SYSTICK->SYST_CVR = 0;
98 SYSTICK->SYST_RVR &= ~(0xFFFFFF);
Register definitions and bit position enumerations for the Arm Cortex-M4 core peripherals.
static struct internal_state_s internal_state
Singleton instance of the SysTick driver internal state.
Arm Cortex-M4 SysTick driver public API.
System-wide error code definitions.
void systick_get_def_cfg(SYSTICK_CFG_ts *systick_cfg_o)
Populates a configuration structure with the default SysTick settings.
void systick_deinit(void)
Deinitializes the SysTick timer.
void SysTick_Handler(void)
SysTick exception handler. Increments the millisecond counter on each 1 ms wrap.
ERR_te systick_init(SYSTICK_CFG_ts const *systick_cfg)
Initializes and starts the SysTick timer.
uint32_t systick_get_ms(void)
Returns the number of milliseconds elapsed since SysTick was initialized.
@ SYSTICK_CLK_SOURCE_PROCESSOR
ERR_te
Standard return type used by all public API functions.
@ ERR_MODULE_ALREADY_INITIALIZED
uint32_t rcc_get_ahb_clk(void)
Returns the current AHB bus clock frequency in Hz.
STM32F401RE RCC driver public API.
Configuration structure for initializing the SysTick timer.
SYSTICK_CLK_SOURCE_te clk_source
Internal state of the SysTick driver.
uint32_t volatile elapsed_ms