TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_Inactive;
TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable;
TIM_OCInitStructure.TIM_Pulse = 9000;
TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_High;
TIM_OC1Init(TIM2,&TIM_OCInitStructure);
比较捕获寄存器设置,TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_Inactive;这句话是 输出比较非主动模式 (匹配时设置输出引脚为无效电平,当计数值为比较/捕获寄存器值相同时,强制输出为低电平)
TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_High;
这句话是 极性为正
那这样设置输出是高电平还是低电平? |