• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ IS_ADC_ALL_PERIPH函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中IS_ADC_ALL_PERIPH函数的典型用法代码示例。如果您正苦于以下问题:C++ IS_ADC_ALL_PERIPH函数的具体用法?C++ IS_ADC_ALL_PERIPH怎么用?C++ IS_ADC_ALL_PERIPH使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了IS_ADC_ALL_PERIPH函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ADC_InjectedSequencerLengthConfig

/**
  * @brief  Configures the sequencer length for injected channels
  * @param  ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
  * @param  Length: The sequencer length. 
  *   This parameter must be a number between 1 to 4.
  * @retval None
  */
void ADC_InjectedSequencerLengthConfig(ADC_TypeDef* ADCx, uint8_t Length)
{
  uint32_t tmpreg1 = 0;
  uint32_t tmpreg2 = 0;
  /* Check the parameters */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));
  assert_param(IS_ADC_INJECTED_LENGTH(Length));
  
  /* Get the old register value */
  tmpreg1 = ADCx->JSQR;
  /* Clear the old injected sequnence lenght JL bits */
  tmpreg1 &= JSQR_JL_Reset;
  /* Set the injected sequnence lenght JL bits */
  tmpreg2 = Length - 1; 
  tmpreg1 |= tmpreg2 << 20;
  /* Store the new register value */
  ADCx->JSQR = tmpreg1;
}
开发者ID:adikabintang,项目名称:campus,代码行数:25,代码来源:stm32f10x_adc.c


示例2: ADC_ExternalTrigInjectedConvCmd

/**
  * @brief  Enables or disables the ADCx injected channels conversion
  *   through external trigger
  * @param ADCx: where x can be 1, 2 to select the ADC peripheral.
  * @param NewState: new state of the selected ADC external trigger
  *   start of injected conversion.
  *   This parameter can be: ENABLE or DISABLE.
  * @retval : None
  */
void ADC_ExternalTrigInjectedConvCmd(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 external event selection for injected group */
    //ADCx->CR2 |= CR2_JEXTTRIG_Set;
		 ADCx->ADCR |= ADCR_EXTTRIG_Set;
  }
  else
  {
    /* Disable the selected ADC external event selection for injected group */
    //ADCx->CR2 &= CR2_JEXTTRIG_Reset;
		ADCx->ADCR &= ADCR_EXTTRIG_Reset;
  }
}
开发者ID:CherishFan,项目名称:MT02_MCO,代码行数:27,代码来源:cc10x_adc.c


示例3: ADC_ITConfig

/**
  * @brief  Enables or disables the specified ADC interrupts.
  * @param  ADCx: where x can be 1 to select the ADC peripheral.
  * @param  ADC_IT: specifies the ADC interrupt sources to be enabled or disabled.
  *          This parameter can be one of the following values:
  *            @arg ADC_IT_ADRDY: ADC ready interrupt 
  *            @arg ADC_IT_EOSMP: End of sampling interrupt
  *            @arg ADC_IT_EOC: End of conversion interrupt 
  *            @arg ADC_IT_EOSEQ: End of sequence of conversion interrupt
  *            @arg ADC_IT_OVR: overrun interrupt
  *            @arg ADC_IT_AWD: Analog watchdog interrupt
  * @param  NewState: new state of the specified ADC interrupts.
  *          This parameter can be: ENABLE or DISABLE.
  * @retval None
  */
void ADC_ITConfig(ADC_TypeDef* ADCx, uint32_t ADC_IT, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));
  assert_param(IS_FUNCTIONAL_STATE(NewState));
  assert_param(IS_ADC_CONFIG_IT(ADC_IT)); 

  if (NewState != DISABLE)
  {
    /* Enable the selected ADC interrupts */
    ADCx->IER |= ADC_IT;
  }
  else
  {
    /* Disable the selected ADC interrupts */
    ADCx->IER &= (~(uint32_t)ADC_IT);
  }
}
开发者ID:Recontech,项目名称:STM32Fx_FreeRTOS_Base,代码行数:33,代码来源:stm32f0xx_adc.c


示例4: ADC_JitterCmd

/**
  * @brief  Enables or disables the jitter when the ADC is clocked by PCLK div2
  *         or div4
  * @note   This function is obsolete and maintained for legacy purpose only. ADC_ClockModeConfig()
  *         function should be used instead.  
  * @param  ADCx: where x can be 1 to select the ADC1 peripheral.
  * @param  ADC_JitterOff: This parameter can be :
  *            @arg ADC_JitterOff_PCLKDiv2: Remove jitter when ADC is clocked by PLCK divided by 2
  *            @arg ADC_JitterOff_PCLKDiv4: Remove jitter when ADC is clocked by PLCK divided by 4
  * @param  NewState: new state of the ADCx jitter. 
  *          This parameter can be: ENABLE or DISABLE.
  * @retval None
  */
void ADC_JitterCmd(ADC_TypeDef* ADCx, uint32_t ADC_JitterOff, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));
  assert_param(IS_ADC_JITTEROFF(ADC_JitterOff));
  assert_param(IS_FUNCTIONAL_STATE(NewState));

  if (NewState != DISABLE)
  {
    /* Disable Jitter */
    ADCx->CFGR2 |= (uint32_t)ADC_JitterOff;
  }
  else
  {
    /* Enable Jitter */
    ADCx->CFGR2 &= (uint32_t)(~ADC_JitterOff);
  }
}
开发者ID:Recontech,项目名称:STM32Fx_FreeRTOS_Base,代码行数:31,代码来源:stm32f0xx_adc.c


示例5: ADC_SoftwareStartInjectedConvCmd

/**
  * @brief  Enables or disables the selected ADC start of the injected 
  *         channels conversion.
  * @param  ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
  * @param  NewState: new state of the selected ADC software start injected conversion.
  *   This parameter can be: ENABLE or DISABLE.
  * @retval None
  */
void ADC_SoftwareStartInjectedConvCmd(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 for injected group on external event and start the selected
       ADC injected conversion */
    ADCx->CR2 |= CR2_JEXTTRIG_JSWSTART_Set;
  }
  else
  {
    /* Disable the selected ADC conversion on external event for injected group and stop the selected
       ADC injected conversion */
    ADCx->CR2 &= CR2_JEXTTRIG_JSWSTART_Reset;
  }
}
开发者ID:adikabintang,项目名称:campus,代码行数:26,代码来源:stm32f10x_adc.c


示例6: ADC_GetSoftwareStartConvStatus

/**
* @brief  Gets the selected ADC Software start conversion Status.
* @param ADCx: where x can be 1, 2 to select the ADC peripheral.
* @retval : The new state of ADC software start conversion (SET or RESET).
*/
FlagStatus ADC_GetSoftwareStartConvStatus(ADC_TypeDef* ADCx)
{
    FlagStatus bitstatus = RESET;
    /* Check the parameters */
    assert_param(IS_ADC_ALL_PERIPH(ADCx));
    /* Check the status of ADST bit */
    if ((ADCx->ADCR & ADCR_SWSTART_Set) != (uint32_t)RESET)
    {
        /* ADST bit is set */
        bitstatus = SET;
    }
    else
    {
        /* ADST bit is reset */
        bitstatus = RESET;
    }
    /* Return the ADST bit status */
    return  bitstatus;
}
开发者ID:heyuanjie87,项目名称:rt-thread,代码行数:24,代码来源:HAL_adc.c


示例7: ADC_DiscModeChannelCountConfig

/*******************************************************************************
* 函数名称: ADC_DiscModeChannelCountConfig
* 功能描述: 配置选中的ADC常规组为非连续模式.
* 输入参数: (1)ADCx:其中x可以是1、2或3,用来选择ADC外围模块.
*           (2)Number:非连续模式下常规信道计数值。该值范围为1-8。
* 输出参数: 无
* 返回参数: 无
*******************************************************************************/
void ADC_DiscModeChannelCountConfig(ADC_TypeDef* ADCx, u8 Number)
{
  u32 tmpreg1 = 0;
  u32 tmpreg2 = 0;

  /* Check the parameters [检查参数] */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));
  assert_param(IS_ADC_REGULAR_DISC_NUMBER(Number));

  /* Get the old register value [取得过去的寄存器值]*/
  tmpreg1 = ADCx->CR1;
  /* Clear the old discontinuous mode channel count [清除过去的不间断模式通道计数器]*/
  tmpreg1 &= CR1_DISCNUM_Reset;
  /* Set the discontinuous mode channel count [设置不间断模式通道计数器]*/
  tmpreg2 = Number - 1;
  tmpreg1 |= tmpreg2 << 13;
  /* Store the new register value [存储新的寄存器值]*/
  ADCx->CR1 = tmpreg1;
}
开发者ID:WrongChao,项目名称:lammbo-fly,代码行数:27,代码来源:stm32f10x_adc.c


示例8: ADC_SoftwareStartConvCmd

/*******************************************************************************
* 函数名称: ADC_SoftwareStartConvCmd
* 功能描述: 使能/禁止选中的ADC由软件控制开始转换 .
* 输入参数: (1)ADCx:其中x可以是1、2或3,用来选择ADC外围模块.
*           (2)NewState:选中的由软件发出开始信号的ADC的新状态这个参数可以是:ENABLE或DISABLE
* 输出参数: 无
* 返回参数: 无
*******************************************************************************/
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 [允许选择的ADC转换外部事件和启动选择的ADC转换]*/
    ADCx->CR2 |= CR2_EXTTRIG_SWSTART_Set;
  }
  else
  {
    /* Disable the selected ADC conversion on external event and stop the selected
       ADC conversion [禁止选择的ADC转换外部事件和停止选择的ADC转换]*/
    ADCx->CR2 &= CR2_EXTTRIG_SWSTART_Reset;
  }
}
开发者ID:WrongChao,项目名称:lammbo-fly,代码行数:27,代码来源:stm32f10x_adc.c


示例9: ADC_GetCalibrationStatus

/**
  * @brief  Gets the selected ADC calibration status.
  * @param  ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
  * @retval The new state of ADC calibration (SET or RESET).
  */
FlagStatus ADC_GetCalibrationStatus(ADC_TypeDef* ADCx)
{
  FlagStatus bitstatus = RESET;
  /* Check the parameters */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));
  /* Check the status of CAL bit */
  if ((ADCx->CR2 & CR2_CAL_Set) != (uint32_t)RESET)
  {
    /* CAL bit is set: calibration on going */
    bitstatus = SET;
  }
  else
  {
    /* CAL bit is reset: end of calibration */
    bitstatus = RESET;
  }
  /* Return the CAL bit status */
  return  bitstatus;
}
开发者ID:alexd74,项目名称:stm32base,代码行数:24,代码来源:stm32f10x_adc.c


示例10: ADC_GetSoftwareStartInjectedConvCmdStatus

/**
  * @brief  Gets the selected ADC Software start injected conversion Status.
  * @param  ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
  * @retval The new state of ADC software start injected conversion (SET or RESET).
  */
FlagStatus ADC_GetSoftwareStartInjectedConvCmdStatus(ADC_TypeDef* ADCx)
{
  FlagStatus bitstatus = RESET;
  /* Check the parameters */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));
  /* Check the status of JSWSTART bit */
  if ((ADCx->CR2 & CR2_JSWSTART_Set) != (uint32_t)RESET)
  {
    /* JSWSTART bit is set */
    bitstatus = SET;
  }
  else
  {
    /* JSWSTART bit is reset */
    bitstatus = RESET;
  }
  /* Return the JSWSTART bit status */
  return  bitstatus;
}
开发者ID:alexd74,项目名称:stm32base,代码行数:24,代码来源:stm32f10x_adc.c


示例11: ADC_InjectedSequencerLengthConfig

/*******************************************************************************
* 函数名称: ADC_InjectedSequencerLengthConfig
* 功能描述: 配置注入信道音序器(sequencer)的长度
* 输入参数: (1)ADCx:其中x可以是1、2或3,用来选择ADC外围模块.
*           (2)Length:音序器(sequencer)的长度该参数的范围是1-4.
* 输出参数: 无
* 返回参数: 无
*******************************************************************************/
void ADC_InjectedSequencerLengthConfig(ADC_TypeDef* ADCx, u8 Length)
{
  u32 tmpreg1 = 0;
  u32 tmpreg2 = 0;

  /* Check the parameters [检查参数] */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));
  assert_param(IS_ADC_INJECTED_LENGTH(Length));
  
  /* Get the old register value [取得旧的寄存器值]*/
  tmpreg1 = ADCx->JSQR;
  /* Clear the old injected sequnence lenght JL bits [清除注入信道音序器的长度JL位]*/
  tmpreg1 &= JSQR_JL_Reset;
  /* Set the injected sequnence lenght JL bits [置位注入信道音序器的长度JL位]*/
  tmpreg2 = Length - 1; 
  tmpreg1 |= tmpreg2 << 20;
  /* Store the new register value [存储新的寄存器值]*/
  ADCx->JSQR = tmpreg1;
}
开发者ID:WrongChao,项目名称:lammbo-fly,代码行数:27,代码来源:stm32f10x_adc.c


示例12: ADC_SoftwareStartConvCmd

/**
* @brief  Enables or disables the selected ADC software start conversion .
* @param ADCx: where x can be 1, 2 to select the ADC peripheral.
* @param NewState: new state of the selected ADC software start conversion.
*   This parameter can be: ENABLE or DISABLE.
* @retval : None
*/
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 */
        /*Set ADST bit*/
        ADCx->ADCR |= ADCR_SWSTART_Set;
    }
    else
    {
        /* Disable the selected ADC conversion on external event and stop the selected
        ADC conversion */
        ADCx->ADCR &= ADCR_SWSTART_Reset;
    }
}
开发者ID:heyuanjie87,项目名称:rt-thread,代码行数:26,代码来源:HAL_adc.c


示例13: ADC_Init

/**
  * @brief  Initializes the ADCx peripheral according to the specified parameters
  *   in the ADC_InitStruct.
  * @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
  * @param ADC_InitStruct: pointer to an ADC_InitTypeDef structure that
  *   contains the configuration information for the specified
  *   ADC peripheral.
  * @retval : None
  */
void ADC_Init(ADC_TypeDef* ADCx, ADC_InitTypeDef* ADC_InitStruct)
{
  uint32_t tmpreg1 = 0;
 
  /* Check the parameters */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));
  assert_param(IS_ADC_MODE(ADC_InitStruct->ADC_Mode));
  assert_param(IS_FUNCTIONAL_STATE(ADC_InitStruct->ADC_ScanConvMode));
  assert_param(IS_FUNCTIONAL_STATE(ADC_InitStruct->ADC_ContinuousConvMode));
  assert_param(IS_ADC_EXT_TRIG(ADC_InitStruct->ADC_ExternalTrigConv));   
  assert_param(IS_ADC_DATA_ALIGN(ADC_InitStruct->ADC_DataAlign)); 
  assert_param(IS_ADC_REGULAR_LENGTH(ADC_InitStruct->ADC_NbrOfChannel));
	/*---------------------------- ADCx ADCFG Configuration -----------------*/
  /* Get the ADCx ADCFG value */
  tmpreg1 = ADCx->ADCFG;
	/* Clear ADCPRE bits */
  tmpreg1 &= ADCFG_CLEAR_Mask;
	/* Configure ADCx: AD convertion prescare*/
  /* Set ADCPRE bit according to ADC_PRESCARE value */
  tmpreg1 |= (uint32_t)(ADC_InitStruct->ADC_PRESCARE);         
	 /* Write to ADCx ADCFG */
  ADCx->ADCFG = tmpreg1;

  /*---------------------------- ADCx ADCR Configuration -----------------*/
  /* Get the ADCx ADCR value */
  tmpreg1 = ADCx->ADCR;
	/* Clear ALIGN , ADMD, and TRGEN and TRGSEL bits */
  tmpreg1 &= ADCR_CLEAR_Mask;
	/* Configure ADCx: external trigger event and AD conversion mode and ALIGN*/
  /* Set ALIGN bit according to ADC_DataAlign value */
  /* Set TRGEN bits according to ADC_TRGEN value */
	/* Set TRGSEL bits according to ADC_ExternalTrigConv value */
  /* Set ADMD bit according to ADC_Mode value */
  /*tmpreg1 |= ((uint32_t)ADC_InitStruct->ADC_DataAlign) | ADC_InitStruct->ADC_ExternalTrigConv |
            ((uint32_t)ADC_InitStruct->ADC_Mode) | ((uint32_t)ADC_InitStruct->ADC_TRGEN);*/
	
	tmpreg1 |= ((uint32_t)ADC_InitStruct->ADC_DataAlign) |
            ((uint32_t)ADC_InitStruct->ADC_Mode) | (((uint32_t)ADC_InitStruct->ADC_TRGEN)<<2);
	 /* Write to ADCx ADCR */
  ADCx->ADCR = tmpreg1;

}
开发者ID:CherishFan,项目名称:MT02_MCO,代码行数:51,代码来源:cc10x_adc.c


示例14: ADC_AnalogWatchdogSingleChannelConfig

/**
  * @brief  Configures the analog watchdog guarded single channel
  * @param  ADCx: where x can be 1 to select the ADC1 peripheral.
  * @param  ADC_AnalogWatchdog_Channel: the ADC channel to configure for the analog watchdog.
  *          This parameter can be one of the following values:
  *            @arg ADC_AnalogWatchdog_Channel_0: ADC Channel0 selected
  *            @arg ADC_AnalogWatchdog_Channel_1: ADC Channel1 selected
  *            @arg ADC_AnalogWatchdog_Channel_2: ADC Channel2 selected
  *            @arg ADC_AnalogWatchdog_Channel_3: ADC Channel3 selected
  *            @arg ADC_AnalogWatchdog_Channel_4: ADC Channel4 selected
  *            @arg ADC_AnalogWatchdog_Channel_5: ADC Channel5 selected
  *            @arg ADC_AnalogWatchdog_Channel_6: ADC Channel6 selected
  *            @arg ADC_AnalogWatchdog_Channel_7: ADC Channel7 selected
  *            @arg ADC_AnalogWatchdog_Channel_8: ADC Channel8 selected
  *            @arg ADC_AnalogWatchdog_Channel_9: ADC Channel9 selected
  *            @arg ADC_AnalogWatchdog_Channel_10: ADC Channel10 selected
  *            @arg ADC_AnalogWatchdog_Channel_11: ADC Channel11 selected
  *            @arg ADC_AnalogWatchdog_Channel_12: ADC Channel12 selected
  *            @arg ADC_AnalogWatchdog_Channel_13: ADC Channel13 selected
  *            @arg ADC_AnalogWatchdog_Channel_14: ADC Channel14 selected
  *            @arg ADC_AnalogWatchdog_Channel_15: ADC Channel15 selected
  *            @arg ADC_AnalogWatchdog_Channel_16: ADC Channel16 selected
  *            @arg ADC_AnalogWatchdog_Channel_17: ADC Channel17 selected
  *            @arg ADC_AnalogWatchdog_Channel_18: ADC Channel18 selected
  * @note   The channel selected on the AWDCH must be also set into the CHSELR
  *         register
  * @retval None
  */
void ADC_AnalogWatchdogSingleChannelConfig(ADC_TypeDef* ADCx, uint32_t ADC_AnalogWatchdog_Channel)
{
    uint32_t tmpreg = 0;

    /* Check the parameters */
    assert_param(IS_ADC_ALL_PERIPH(ADCx));
    assert_param(IS_ADC_ANALOG_WATCHDOG_CHANNEL(ADC_AnalogWatchdog_Channel));

    /* Get the old register value */
    tmpreg = ADCx->CFGR1;

    /* Clear the Analog watchdog channel select bits */
    tmpreg &= ~ADC_CFGR1_AWDCH;

    /* Set the Analog watchdog channel */
    tmpreg |= ADC_AnalogWatchdog_Channel;

    /* Store the new register value */
    ADCx->CFGR1 = tmpreg;
}
开发者ID:TomTinkering,项目名称:bragmap_touch,代码行数:48,代码来源:stm32f0xx_adc.c


示例15: ADC_ITConfig

/**
  * @brief  Enables or disables the specified ADC interrupts.
  * @param  ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
  * @param  ADC_IT: specifies the ADC interrupt sources to be enabled or disabled.
  *   This parameter can be any combination of the following values:
  *     @arg ADC_IT_EOC: End of conversion interrupt mask
  *     @arg ADC_IT_AWD: Analog watchdog interrupt mask
  *     @arg ADC_IT_JEOC: End of injected conversion interrupt mask
  * @param  NewState: new state of the specified ADC interrupts.
  *   This parameter can be: ENABLE or DISABLE.
  * @retval None
  */
void ADC_ITConfig(ADC_TypeDef* ADCx, uint16_t ADC_IT, FunctionalState NewState)
{
  uint8_t itmask = 0;
  /* Check the parameters */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));
  assert_param(IS_FUNCTIONAL_STATE(NewState));
  assert_param(IS_ADC_IT(ADC_IT));
  /* Get the ADC IT index */
  itmask = (uint8_t)ADC_IT;
  if (NewState != DISABLE)
  {
    /* Enable the selected ADC interrupts */
    ADCx->CR1 |= itmask;
  }
  else
  {
    /* Disable the selected ADC interrupts */
    ADCx->CR1 &= (~(uint32_t)itmask);
  }
}
开发者ID:alexd74,项目名称:stm32base,代码行数:32,代码来源:stm32f10x_adc.c


示例16: ADC_GetFlagStatus

/**
  * @brief  Checks whether the specified ADC flag is set or not.
  * @param  ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
  * @param  ADC_FLAG: specifies the flag to check.
  *   This parameter can be one of the following values:
  *     @arg ADC_FLAG_AWD: Analog watchdog flag
  *     @arg ADC_FLAG_EOC: End of conversion flag
  *     @arg ADC_FLAG_JEOC: End of injected group conversion flag
  *     @arg ADC_FLAG_JSTRT: Start of injected group conversion flag
  *     @arg ADC_FLAG_STRT: Start of regular group conversion flag
  * @retval The new state of ADC_FLAG (SET or RESET).
  */
FlagStatus ADC_GetFlagStatus(ADC_TypeDef* ADCx, uint8_t ADC_FLAG)
{
  FlagStatus bitstatus = RESET;
  /* Check the parameters */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));
  assert_param(IS_ADC_GET_FLAG(ADC_FLAG));
  /* Check the status of the specified ADC flag */
  if ((ADCx->SR & ADC_FLAG) != (uint8_t)RESET)
  {
    /* ADC_FLAG is set */
    bitstatus = SET;
  }
  else
  {
    /* ADC_FLAG is reset */
    bitstatus = RESET;
  }
  /* Return the ADC_FLAG status */
  return  bitstatus;
}
开发者ID:alexd74,项目名称:stm32base,代码行数:32,代码来源:stm32f10x_adc.c


示例17: ADC_ChannelConfig

/**
  * @brief  Configures for the selected ADC and its sampling time.
  * @param  ADCx: where x can be 1 to select the ADC peripheral.
  * @param  ADC_Channel: the ADC channel to configure. 
  *          This parameter can be any combination of the following values:
  *            @arg ADC_Channel_0: ADC Channel0 selected
  *            @arg ADC_Channel_1: ADC Channel1 selected
  *            @arg ADC_Channel_2: ADC Channel2 selected
  *            @arg ADC_Channel_3: ADC Channel3 selected
  *            @arg ADC_Channel_4: ADC Channel4 selected
  *            @arg ADC_Channel_5: ADC Channel5 selected
  *            @arg ADC_Channel_6: ADC Channel6 selected
  *            @arg ADC_Channel_7: ADC Channel7 selected
  *            @arg ADC_Channel_8: ADC Channel8 selected
  *            @arg ADC_Channel_9: ADC Channel9 selected
  *            @arg ADC_Channel_10: ADC Channel10 selected, not available for STM32F031 devices
  *            @arg ADC_Channel_11: ADC Channel11 selected, not available for STM32F031 devices
  *            @arg ADC_Channel_12: ADC Channel12 selected, not available for STM32F031 devices
  *            @arg ADC_Channel_13: ADC Channel13 selected, not available for STM32F031 devices
  *            @arg ADC_Channel_14: ADC Channel14 selected, not available for STM32F031 devices
  *            @arg ADC_Channel_15: ADC Channel15 selected, not available for STM32F031 devices
  *            @arg ADC_Channel_16: ADC Channel16 selected
  *            @arg ADC_Channel_17: ADC Channel17 selected
  *            @arg ADC_Channel_18: ADC Channel18 selected, not available for STM32F030 devices
  * @param  ADC_SampleTime: The sample time value to be set for the selected channel. 
  *          This parameter can be one of the following values:
  *            @arg ADC_SampleTime_1_5Cycles: Sample time equal to 1.5 cycles  
  *            @arg ADC_SampleTime_7_5Cycles: Sample time equal to 7.5 cycles
  *            @arg ADC_SampleTime_13_5Cycles: Sample time equal to 13.5 cycles
  *            @arg ADC_SampleTime_28_5Cycles: Sample time equal to 28.5 cycles
  *            @arg ADC_SampleTime_41_5Cycles: Sample time equal to 41.5 cycles
  *            @arg ADC_SampleTime_55_5Cycles: Sample time equal to 55.5 cycles
  *            @arg ADC_SampleTime_71_5Cycles: Sample time equal to 71.5 cycles
  *            @arg ADC_SampleTime_239_5Cycles: Sample time equal to 239.5 cycles
  * @retval None
  */
void ADC_ChannelConfig(ADC_TypeDef* ADCx, uint32_t ADC_Channel, uint32_t ADC_SampleTime)
{
  uint32_t tmpreg = 0;

  /* Check the parameters */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));
  assert_param(IS_ADC_CHANNEL(ADC_Channel));
  assert_param(IS_ADC_SAMPLE_TIME(ADC_SampleTime));

  /* Configure the ADC Channel */
  ADCx->CHSELR |= (uint32_t)ADC_Channel;

  /* Clear the Sampling time Selection bits */
  tmpreg &= ~ADC_SMPR1_SMPR;

  /* Set the ADC Sampling Time register */
  tmpreg |= (uint32_t)ADC_SampleTime;

  /* Configure the ADC Sample time register */
  ADCx->SMPR = tmpreg ;
}
开发者ID:Recontech,项目名称:STM32Fx_FreeRTOS_Base,代码行数:57,代码来源:stm32f0xx_adc.c


示例18: ADC_GetResetCalibrationStatus

/*******************************************************************************
* 函数名称: ADC_GetResetCalibrationStatus
* 功能描述: 得到选中的ADC重置校准寄存器的状态.
* 输入参数: ADCx:其中x可以是1、2或3,用来选择ADC外围模块.
* 输出参数: 无
* 返回参数: ADC重置校准寄存器的新状态(SET或RESET).
*******************************************************************************/
FlagStatus ADC_GetResetCalibrationStatus(ADC_TypeDef* ADCx)
{
  FlagStatus bitstatus = RESET;

  /* Check the parameters [检查参数] */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));

  /* Check the status of RSTCAL bit [检查状态位RSTCAL]*/
  if ((ADCx->CR2 & CR2_RSTCAL_Set) != (u32)RESET)
  {
    /* RSTCAL bit is set [置位RSTCAL]*/
    bitstatus = SET;
  }
  else
  {
    /* RSTCAL bit is reset [复位RSTCAL]*/
    bitstatus = RESET;
  }

  /* Return the RSTCAL bit status [返回状态位RSTCAL]*/
  return  bitstatus;
}
开发者ID:WrongChao,项目名称:lammbo-fly,代码行数:29,代码来源:stm32f10x_adc.c


示例19: ADC_GetCalibrationStatus

/*******************************************************************************
* 函数名称: ADC_GetCalibrationStatus
* 功能描述: 得到选中的ADC 校准的状态
* 输入参数: ADCx:其中x可以是1、2或3,用来选择ADC外围模块..
* 输出参数: 无
* 返回参数: ADC 校准的新状态(SET 或RESET).
*******************************************************************************/
FlagStatus ADC_GetCalibrationStatus(ADC_TypeDef* ADCx)
{
  FlagStatus bitstatus = RESET;

  /* Check the parameters [检查参数] */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));

  /* Check the status of CAL bit [检查状态位CAL]*/
  if ((ADCx->CR2 & CR2_CAL_Set) != (u32)RESET)
  {
    /* CAL bit is set: calibration on going [CAL设置:校准开始]*/
    bitstatus = SET;
  }
  else
  {
    /* CAL bit is reset: end of calibration [CAL复位:结束校准]*/
    bitstatus = RESET;
  }

  /* Return the CAL bit status [返回状态位CAL]*/
  return  bitstatus;
}
开发者ID:WrongChao,项目名称:lammbo-fly,代码行数:29,代码来源:stm32f10x_adc.c


示例20: ADC_GetSoftwareStartConvStatus

/*******************************************************************************
* 函数名称: ADC_GetSoftwareStartConvStatus
* 功能描述: 获得选中ADC软件开始转换状态。
* 输入参数: ADCx:其中x可以是1、2或3,用来选择ADC外围模块.
* 输出参数: 无
* 返回参数: ADC软件开始转换的新状态(SET或RESET).
*******************************************************************************/
FlagStatus ADC_GetSoftwareStartConvStatus(ADC_TypeDef* ADCx)
{
  FlagStatus bitstatus = RESET;

  /* Check the parameters [检查参数] */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));

  /* Check the status of SWSTART bit [检查状态位SWSTART]*/
  if ((ADCx->CR2 & CR2_SWSTART_Set) != (u32)RESET)
  {
    /* SWSTART bit is set [置位SWSTART]*/
    bitstatus = SET;
  }
  else
  {
    /* SWSTART bit is reset [复位SWSTART]*/
    bitstatus = RESET;
  }

  /* Return the SWSTART bit status [返回状态位SWSTART]*/
  return  bitstatus;
}
开发者ID:WrongChao,项目名称:lammbo-fly,代码行数:29,代码来源:stm32f10x_adc.c



注:本文中的IS_ADC_ALL_PERIPH函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ IS_ADC_CHANNEL函数代码示例发布时间:2022-05-30
下一篇:
C++ IS_ADC_ALL_INSTANCE函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap