admin管理员组

文章数量:1516870

/*
以STM32F407为例子,为什么参数是这个
0. (SystemCoreClock / (1000U / uwTickFreq)): (表示systick的reload value)
1. SystemCoreClock 系统时钟 168000000: (1s可以计数这么多)
2. (1000U / uwTickFreq): (将1s分成1000份即1ms, 所以uwTickFreq毫秒后,触发systick中断)
3. (1000U / uwTickFreq): (1S将中断这么多次)
*/HAL_SYSTICK_Config(SystemCoreClock /(1000U/ uwTickFreq))

扩展

/*stm32f4xx_hal_cortex.c*//**
  * @brief  Initializes the System Timer and its interrupt, and starts the System Tick Timer.
  *         Counter is in free running mode to generate periodic interrupts.
  * @param  TicksNumb Specifies the ticks Number of ticks between two interrupts.
  * @retval status:  - 0  Function succeeded.
  *                  - 1  Function failed.
  */uint32_tHAL_SYSTICK_Config(uint32_t TicksNumb){
   
   returnSysTick_Config(TicksNumb);}/*core_cm4.h.c*//**
  \brief   System Tick Configuration
  \details Initializes the System Timer and its interrupt, and starts the System Tick Timer.
           Counter is in free running mode to generate periodic interrupts.
  \param [in]  ticks  Number of ticks between two interrupts.
  \return          0  Function succeeded.
  \return          1  Function failed.
  \note    When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the
           function <b>SysTick_Config</b> is not included. In this case, the file <b><i>device</i>.h</b>
           must contain a vendor-specific implementation of this function.
 */
__STATIC_INLINE uint32_tSysTick_Config(

本文标签: 配置的技系统编程