题目内容
static void GENERAL_TIM_Mode_Config(void){TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;GENERAL_TIM_APBxClock_FUN(GENERAL_TIM_CLK, ENABLE);TIM_TimeBaseStructure.TIM_Period=GENERAL_TIM_Period;TIM_TimeBaseStructure.TIM_Prescaler= GENERAL_TIM_Prescaler;TIM_TimeBaseStructure.TIM_ClockDivision=TIM_CKD_DIV1;TIM_TimeBaseStructure.TIM_CounterMode=TIM_CounterMode_Up;TIM_TimeBaseStructure.TIM_RepetitionCounter=0;TIM_TimeBaseInit(GENERAL_TIM, &TIM_TimeBaseStructure);TIM_ClearFlag(GENERAL_TIM, TIM_FLAG_Update);TIM_ITConfig(GENERAL_TIM,TIM_IT_Update,ENABLE);TIM_Cmd(GENERAL_TIM, ENABLE);}以上函数是STM32对定时器的初始化函数,请解释每行代码的功能?
查看答案
搜索结果不匹配?点我反馈