初级会员

- 积分
- 83
- 金钱
- 83
- 注册时间
- 2016-5-14
- 在线时间
- 14 小时
|

楼主 |
发表于 2016-6-18 17:05:52
|
显示全部楼层
定时器初始化
[mw_shl_code=c,true]static void TIM6_Config(void)
{
TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;
RCC_APB1PeriphClockCmd(TIM6_CLK, ENABLE);
TIM_TimeBaseStructure.TIM_Period = 4999-1;
TIM_TimeBaseStructure.TIM_Prescaler = 180-1;
TIM_TimeBaseInit(TIM6_Port, &TIM_TimeBaseStructure);
//TIM_ClearFlag(TIM6_Port, TIM_FLAG_Update);
//TIM_ITConfig(TIM6_Port,TIM_IT_Update,ENABLE);
//TIM_Cmd(TIM6_Port, ENABLE);
}[/mw_shl_code]
|
|