ADC

[复制链接]
477|0
 楼主| 张さん 发表于 2020-4-24 17:18 | 显示全部楼层 |阅读模式
#define CR2_EXTTRIG_SWSTART_Set     ((uint32_t)0x00500000)
void ADC_SoftwareStartConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));
  assert_param(IS_FUNCTIONAL_STATE(NewState));
  if (NewState != DISABLE)
  {
    /* Enable the selected ADC conversion on external event and start the selected
       ADC conversion */
    ADCx->CR2 |= CR2_EXTTRIG_SWSTART_Set;
  }
  else
  {
    /* Disable the selected ADC conversion on external event and stop the selected
       ADC conversion */
    ADCx->CR2 &= CR2_EXTTRIG_SWSTART_Reset;
  }
}
这里“#define CR2_EXTTRIG_SWSTART_Set     ((uint32_t)0x00500000)”把ADC_CR2的位22SWSTART和位20EXTTRIG都使能了,为什么呀?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

448

主题

464

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部