01_TIM定时器用于周期任务(100us)

张开发
2026/4/13 19:50:22 15 分钟阅读

分享文章

01_TIM定时器用于周期任务(100us)
配置TIM6定时器开启定时器中断生成代码手写代码启动定时器中断HAL_TIM_Base_Start_IT(htim6);重新定义回调函数该函数原本为weak类型voidHAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef*htim){HAL_GPIO_TogglePin(GPIOC,GPIO_PIN_13);/* NOTE : This function should not be modified, when the callback is needed, the HAL_TIM_PeriodElapsedCallback could be implemented in the user file */}编译测试

更多文章