随后笔者采用了莽着来的定点清楚的操作:
-
- (void)TMRA_PWM_StructInit(&stcPwmInit);
-
- stcPwmInit.u16StartPolarity = TMRA_PWM_LOW;
- stcPwmInit.u16StopPolarity = TMRA_PWM_HIGH;
- stcPwmInit.u16CompareMatchPolarity = TMRA_PWM_HIGH;
- stcPwmInit.u16PeriodMatchPolarity = TMRA_PWM_LOW;
- GPIO_SetFunc(GPIO_PORT_A, GPIO_PIN_04, TMRA_PWM_PIN_FUNC);
- stcPwmInit.u32CompareValue = ret_compare;
- (void)TMRA_PWM_Init(CM_TMRA_3, TMRA_CH5, &stcPwmInit);
- TMRA_SetPeriodValue(CM_TMRA_3,ret_period);
- TMRA_SetCompareValue(CM_TMRA_3, TMRA_CH5, ret_compare);
|