金牌会员
 
- 积分
- 1993
- 金钱
- 1993
- 注册时间
- 2016-2-16
- 在线时间
- 527 小时
|
发表于 2016-6-2 10:06:18
|
显示全部楼层
这个是高级定时器的总输出使能,只有高级定时器才有这个,你用的可能不是高级定时器,或者可能是在输出结构体初始化的时候,封装的函数已经帮你使能了。
/**
* @brief Enables or disables the TIM peripheral Main Outputs.
* @param TIMx: where x can be 1, 8, 15, 16 or 17 to select the TIMx peripheral.
* @param NewState: new state of the TIM peripheral Main Outputs.
* This parameter can be: ENABLE or DISABLE.
* @retval None
*/
void TIM_CtrlPWMOutputs(TIM_TypeDef* TIMx, FunctionalState NewState)
{
/* Check the parameters */
assert_param(IS_TIM_LIST2_PERIPH(TIMx));
assert_param(IS_FUNCTIONAL_STATE(NewState));
if (NewState != DISABLE)
{
/* Enable the TIM Main Output */
TIMx->BDTR |= TIM_BDTR_MOE;
}
else
{
/* Disable the TIM Main Output */
TIMx->BDTR &= (uint16_t)(~((uint16_t)TIM_BDTR_MOE));
}
} |
|