gd32f107滴答定时器配置
时间: 2023-08-18 14:05:45 浏览: 115
在配置GD32F107的滴答定时器时,可以使用systick_config()函数进行配置。该函数会设置滴答时钟的频率为1000Hz,即每秒触发1000次中断。具体的配置代码如下所示:
```c
void systick_config(void) {
/* 设置滴答定时器的频率为1000Hz */
if (SysTick_Config(SystemCoreClock / 1000U)){
/* 配置错误处理 */
while (1){
}
}
/* 配置滴答定时器中断的优先级 */
NVIC_SetPriority(SysTick_IRQn, 0x00U);
}
```
在这段代码中,首先通过`SysTick_Config(SystemCoreClock / 1000U)`设置滴答定时器的频率为1000Hz。然后使用`NVIC_SetPriority(SysTick_IRQn, 0x00U)`函数配置滴答定时器中断的优先级为0。这样就完成了GD32F107滴答定时器的配置。\[3\]
#### 引用[.reference_title]
- *1* [GD32与STM32区别](https://blog.csdn.net/weixin_47397155/article/details/124650315)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [GD32 时钟怎么设定为1ms](https://blog.csdn.net/weixin_51042703/article/details/126667133)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [GD32系统时钟、滴答时钟函数配置解析(自用)](https://blog.csdn.net/qq_18519329/article/details/125866492)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文