/*
//用定时器触发ADC转换
void TIM15Config(void)
{
//(1)选择TIM15 Update事件作为触发源(计数器溢出)
RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM15, ENABLE);
//配置基础
TIM_DeInit(TIM15);
TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;
TIM_TimeBaseStructure.TIM_ClockDivision=TIM_CKD_DIV1;//72M 1分频
TIM_TimeBaseStructure.TIM_Prescaler=0;
TIM_TimeBaseStructure.TIM_CounterMode=TIM_CounterMode_Up;
TIM_TimeBaseStructure.TIM_Period=72;//1MHz触发频率
TIM_TimeBaseStructure.TIM_RepetitionCounter=0;//发生RepetitionCounter+1次溢出事件后中断
TIM_TimeBaseInit(TIM15,&TIM_TimeBaseStructure);
TIM_SelectOutputTrigger(TIM15,TIM_TRGOSource_Update);//TIM15的Update事件作为外部TRGO
TIM_ClearFlag(TIM15,TIM_FLAG_Update);
TIM_ARRPreloadConfig(TIM15,ENABLE);//预加载使能
TIM_Cmd(TIM15,ENABLE);//使能TIM15
}
*/
/*
//用定时器触发ADC转换
void TIM15Config(void)
{
//(1)选择TIM15 Update事件作为触发源(计数器溢出)
RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM15, ENABLE);
//配置基础
TIM_DeInit(TIM15);
TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;
TIM_TimeBaseStructure.TIM_ClockDivision=TIM_CKD_DIV1;//72M 1分频
TIM_TimeBaseStructure.TIM_Prescaler=0;
TIM_TimeBaseStructure.TIM_CounterMode=TIM_CounterMode_Up;
TIM_TimeBaseStructure.TIM_Period=72;//1MHz触发频率
TIM_TimeBaseStructure.TIM_RepetitionCounter=0;//发生RepetitionCounter+1次溢出事件后中断
TIM_TimeBaseInit(TIM15,&TIM_TimeBaseStructure);
TIM_SelectOutputTrigger(TIM15,TIM_TRGOSource_Update);//TIM15的Update事件作为外部TRGO
TIM_ClearFlag(TIM15,TIM_FLAG_Update);
TIM_ARRPreloadConfig(TIM15,ENABLE);//预加载使能
TIM_Cmd(TIM15,ENABLE);//使能TIM15
}
*/
举报