亚洲春色中文字幕久久久-三上亚,一吻二脱三床四吻胸,国产真实伦对白视频全集,在线毛片观看,精品成品入口黄网,国产毛aⅴ片久久久,亚洲AV色香蕉一区二区三区老师,萧皇后A级艳片,色情日本视频更新,99久久亚洲精品日本无码
標(biāo)題:
stm32設(shè)置編碼器接口后計數(shù)器不計數(shù)是什么情況
[打印本頁]
作者:
電子小萌
時間:
2020-4-4 10:53
標(biāo)題:
stm32設(shè)置編碼器接口后計數(shù)器不計數(shù)是什么情況
如題 求解
void Coder_Configure1()
{
GPIO_InitTypeDef GPIO_InitStructure;
TIM_TimeBaseInitTypeDef TIM_TimeBaseInitStructure;
TIM_ICInitTypeDef TIM_ICInitStructure;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA|RCC_APB2Periph_TIM1,ENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB,ENABLE);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8|GPIO_Pin_9;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_InitStructure.GPIO_Speed= GPIO_Speed_50MHz;
GPIO_Init(GPIOB,&GPIO_InitStructure);
TIM_DeInit(TIM1);
TIM_TimeBaseInitStructure.TIM_Period = 0XFF; //Tout= ((arr+1)*(psc+1))/Tclk
TIM_TimeBaseInitStructure.TIM_Prescaler = 0;TIM_TimeBaseInitStructure.TIM_CounterMode = TIM_CounterMode_Up;
TIM_TimeBaseInitStructure.TIM_ClockDivision = TIM_CKD_DIV1;TIM_TimeBaseInitStructure.TIM_RepetitionCounter = 1;
TIM_TimeBaseInit(TIM1,&TIM_TimeBaseInitStructure);
TIM_EncoderInterfaceConfig(TIM1, TIM_EncoderMode_TI12,
TIM_ICPolarity_Rising,
TIM_ICPolarity_Rising);
TIM_ICInitStructure.TIM_Channel = TIM_Channel_1;
TIM_ICStructInit(&TIM_ICInitStructure);
TIM_ICInitStructure.TIM_Channel = TIM_Channel_2;
TIM_ICStructInit(&TIM_ICInitStructure);
TIM_SetCounter(TIM1, 0);
TIM_Cmd(TIM1,ENABLE);
}
void Coder_Configure4()
{
GPIO_InitTypeDef GPIO_InitStructure;
TIM_TimeBaseInitTypeDef TIM_TimeBaseInitStructure;
TIM_ICInitTypeDef TIM_ICInitStructure;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB,ENABLE);
RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM4,ENABLE);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6|GPIO_Pin_7;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_InitStructure.GPIO_Speed= GPIO_Speed_50MHz;
GPIO_Init(GPIOB,&GPIO_InitStructure);
復(fù)制代碼
作者:
電子小萌
時間:
2020-4-4 12:01
有人可以幫忙解答一下嗎
歡迎光臨 (http://www.denmoz.com/bbs/)
Powered by Discuz! X3.1