定时器1通道4 触发AD采集相关问题

2019-08-17 03:13发布

最近在做FOC电机驱动,基于ST电机库2.0。用定时器1 CH4 触发ADC(双ADC同步注入模式)采集。在ADC配置中可以配置ADC触发注入组采集时间为
ADC_ExternalTrigInjectedConvConfig(ADC1, ADC_ExternalTrigInjecConv_T1_CC4); //TIM1 CH4触发

然而在配置TIM1作为输出源时候,函数TIM_SelectOutputTrigger(),并没有TIM1 CH4作为输出触发源的选项
/**
  * @brief  Selects the TIMx Trigger Output Mode.
  * @param  TIMx: where x can be 1 to 8 to select the TIM peripheral.
  * @param  TIM_TRGOSource: specifies the Trigger Output source.
  *   This paramter can be one of the following values:
  *
  *  - For all TIMx
  *     @arg TIM_TRGOSource_Reset:  The UG bit in the TIM_EGR register is used as the trigger output (TRGO).
  *     @arg TIM_TRGOSource_Enable: The Counter Enable CEN is used as the trigger output (TRGO).
  *     @arg TIM_TRGOSource_Update: The update event is selected as the trigger output (TRGO).
  *
  *  - For all TIMx except TIM6 and TIM7
  *     @arg TIM_TRGOSource_OC1: The trigger output sends a positive pulse when the CC1IF flag
  *                              is to be set, as soon as a capture or compare match occurs (TRGO).
  *     @arg TIM_TRGOSource_OC1Ref: OC1REF signal is used as the trigger output (TRGO).
  *     @arg TIM_TRGOSource_OC2Ref: OC2REF signal is used as the trigger output (TRGO).
  *     @arg TIM_TRGOSource_OC3Ref: OC3REF signal is used as the trigger output (TRGO).
  *     @arg TIM_TRGOSource_OC4Ref: OC4REF signal is used as the trigger output (TRGO).
  *
  * @retval None
  */

void TIM_SelectOutputTrigger(TIM_TypeDef* TIMx, uint16_t TIM_TRGOSource)
{
  /* Check the parameters */
  assert_param(IS_TIM_ALL_PERIPH(TIMx));
  assert_param(IS_TIM_TRGO_SOURCE(TIM_TRGOSource));
  /* Reset the MMS Bits */
  TIMx->CR2 &= CR2_MMS_Mask;
  /* Select the TRGO source */
  TIMx->CR2 |=  TIM_TRGOSource;
}


查看手册说明确实是存在TIM1 CH4触发ADC采集这个功能,但是TIM1中并没有找到相关标志位。。。。

请问各位,这个怎么搞??

友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。