Systick嘀嗒定时器是一个24位的递减计数器。该定时器的时钟源可以是内部时钟,也可以是外部时钟。 M4的Systick有四个寄存器,分别是
1. Systick control and status register(STK_CTRL) 控制和状态寄存器;
2. Systick reload value register(STK_LOAD) 重装数值寄存器;
3. Systick current value register(STK_VAL) 当前计数值寄存器;
4. Systick calibration value register(STK_CALIB) 校准数值寄存器。
STM32F4中Systick相关函数主要在misc.c和core.cm4.h中。在misc.c中 void Systic_CLKSourceConfig(uint32_t SysTick_CLKSource) 主要实现时钟源的选择。
/**
* @brief Configures the SysTick clock source.
* @param SysTick_CLKSource: specifies the SysTick clock source.
* This parameter can be one of the following values:
* @arg Sys