野火电子论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15745|回复: 1

ADC

[复制链接]
发表于 2018-10-25 17:44:20 | 显示全部楼层 |阅读模式
#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都使能了,为什么呀?
回复

使用道具 举报

发表于 2018-10-26 08:45:52 | 显示全部楼层
设置为软件使能和外部触发,跟宏的字面意思一致
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

联系站长|手机版|野火电子官网|野火淘宝店铺|野火电子论坛 ( 粤ICP备14069197号 ) 大学生ARM嵌入式2群

GMT+8, 2025-12-6 04:36 , Processed in 0.036973 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表