亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? stm32f10x_adc.c

?? STM32手持式示波器源代碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
  if (NewState != DISABLE)
  {
    /* Enable the selected ADC DMA request */
    ADCx->CR2 |= CR2_DMA_Set;
  }
  else
  {
    /* Disable the selected ADC DMA request */
    ADCx->CR2 &= CR2_DMA_Reset;
  }
}

/**
  * @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);
  }
}

/**
  * @brief  Resets the selected ADC calibration registers.
  * @param  ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
  * @retval None
  */
void ADC_ResetCalibration(ADC_TypeDef* ADCx)
{
  /* Check the parameters */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));
  /* Resets the selected ADC calibartion registers */  
  ADCx->CR2 |= CR2_RSTCAL_Set;
}

/**
  * @brief  Gets the selected ADC reset calibration registers status.
  * @param  ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
  * @retval The new state of ADC reset calibration registers (SET or 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 */
  if ((ADCx->CR2 & CR2_RSTCAL_Set) != (uint32_t)RESET)
  {
    /* RSTCAL bit is set */
    bitstatus = SET;
  }
  else
  {
    /* RSTCAL bit is reset */
    bitstatus = RESET;
  }
  /* Return the RSTCAL bit status */
  return  bitstatus;
}

/**
  * @brief  Starts the selected ADC calibration process.
  * @param  ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
  * @retval None
  */
void ADC_StartCalibration(ADC_TypeDef* ADCx)
{
  /* Check the parameters */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));
  /* Enable the selected ADC calibration process */  
  ADCx->CR2 |= CR2_CAL_Set;
}

/**
  * @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;
}

/**
  * @brief  Enables or disables the selected ADC software start 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 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 */
    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;
  }
}

/**
  * @brief  Gets the selected ADC Software start 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 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 SWSTART bit */
  if ((ADCx->CR2 & CR2_SWSTART_Set) != (uint32_t)RESET)
  {
    /* SWSTART bit is set */
    bitstatus = SET;
  }
  else
  {
    /* SWSTART bit is reset */
    bitstatus = RESET;
  }
  /* Return the SWSTART bit status */
  return  bitstatus;
}

/**
  * @brief  Configures the discontinuous mode for the selected ADC regular
  *   group channel.
  * @param  ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
  * @param  Number: specifies the discontinuous mode regular channel
  *   count value. This number must be between 1 and 8.
  * @retval None
  */
void ADC_DiscModeChannelCountConfig(ADC_TypeDef* ADCx, uint8_t Number)
{
  uint32_t tmpreg1 = 0;
  uint32_t 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;
}

/**
  * @brief  Enables or disables the discontinuous mode on regular group
  *   channel for the specified ADC
  * @param  ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
  * @param  NewState: new state of the selected ADC discontinuous mode
  *   on regular group channel.
  *   This parameter can be: ENABLE or DISABLE.
  * @retval None
  */
void ADC_DiscModeCmd(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 regular discontinuous mode */
    ADCx->CR1 |= CR1_DISCEN_Set;
  }
  else
  {
    /* Disable the selected ADC regular discontinuous mode */
    ADCx->CR1 &= CR1_DISCEN_Reset;
  }
}

/**
  * @brief  Configures for the selected ADC regular channel its corresponding
  *   rank in the sequencer and its sample time.
  * @param  ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
  * @param  ADC_Channel: the ADC channel to configure. 
  *   This parameter can be one 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
  *     @arg ADC_Channel_11: ADC Channel11 selected
  *     @arg ADC_Channel_12: ADC Channel12 selected
  *     @arg ADC_Channel_13: ADC Channel13 selected
  *     @arg ADC_Channel_14: ADC Channel14 selected
  *     @arg ADC_Channel_15: ADC Channel15 selected
  *     @arg ADC_Channel_16: ADC Channel16 selected
  *     @arg ADC_Channel_17: ADC Channel17 selected
  * @param  Rank: The rank in the regular group sequencer. This parameter must be between 1 to 16.
  * @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_1Cycles5: Sample time equal to 1.5 cycles
  *     @arg ADC_SampleTime_7Cycles5: Sample time equal to 7.5 cycles
  *     @arg ADC_SampleTime_13Cycles5: Sample time equal to 13.5 cycles
  *     @arg ADC_SampleTime_28Cycles5: Sample time equal to 28.5 cycles	
  *     @arg ADC_SampleTime_41Cycles5: Sample time equal to 41.5 cycles	
  *     @arg ADC_SampleTime_55Cycles5: Sample time equal to 55.5 cycles	
  *     @arg ADC_SampleTime_71Cycles5: Sample time equal to 71.5 cycles	
  *     @arg ADC_SampleTime_239Cycles5: Sample time equal to 239.5 cycles	
  * @retval None
  */
void ADC_RegularChannelConfig(ADC_TypeDef* ADCx, uint8_t ADC_Channel, uint8_t Rank, uint8_t ADC_SampleTime)
{
  uint32_t tmpreg1 = 0, tmpreg2 = 0;
  /* Check the parameters */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));
  assert_param(IS_ADC_CHANNEL(ADC_Channel));
  assert_param(IS_ADC_REGULAR_RANK(Rank));
  assert_param(IS_ADC_SAMPLE_TIME(ADC_SampleTime));
  /* if ADC_Channel_10 ... ADC_Channel_17 is selected */
  if (ADC_Channel > ADC_Channel_9)
  {
    /* Get the old register value */
    tmpreg1 = ADCx->SMPR1;
    /* Calculate the mask to clear */
    tmpreg2 = SMPR1_SMP_Set << (3 * (ADC_Channel - 10));
    /* Clear the old channel sample time */
    tmpreg1 &= ~tmpreg2;
    /* Calculate the mask to set */
    tmpreg2 = (uint32_t)ADC_SampleTime << (3 * (ADC_Channel - 10));
    /* Set the new channel sample time */
    tmpreg1 |= tmpreg2;
    /* Store the new register value */
    ADCx->SMPR1 = tmpreg1;
  }
  else /* ADC_Channel include in ADC_Channel_[0..9] */
  {
    /* Get the old register value */
    tmpreg1 = ADCx->SMPR2;
    /* Calculate the mask to clear */
    tmpreg2 = SMPR2_SMP_Set << (3 * ADC_Channel);
    /* Clear the old channel sample time */
    tmpreg1 &= ~tmpreg2;
    /* Calculate the mask to set */
    tmpreg2 = (uint32_t)ADC_SampleTime << (3 * ADC_Channel);
    /* Set the new channel sample time */
    tmpreg1 |= tmpreg2;
    /* Store the new register value */
    ADCx->SMPR2 = tmpreg1;
  }
  /* For Rank 1 to 6 */
  if (Rank < 7)
  {
    /* Get the old register value */
    tmpreg1 = ADCx->SQR3;
    /* Calculate the mask to clear */
    tmpreg2 = SQR3_SQ_Set << (5 * (Rank - 1));
    /* Clear the old SQx bits for the selected rank */
    tmpreg1 &= ~tmpreg2;
    /* Calculate the mask to set */
    tmpreg2 = (uint32_t)ADC_Channel << (5 * (Rank - 1));
    /* Set the SQx bits for the selected rank */
    tmpreg1 |= tmpreg2;
    /* Store the new register value */
    ADCx->SQR3 = tmpreg1;
  }
  /* For Rank 7 to 12 */
  else if (Rank < 13)
  {
    /* Get the old register value */
    tmpreg1 = ADCx->SQR2;
    /* Calculate the mask to clear */
    tmpreg2 = SQR2_SQ_Set << (5 * (Rank - 7));
    /* Clear the old SQx bits for the selected rank */
    tmpreg1 &= ~tmpreg2;
    /* Calculate the mask to set */
    tmpreg2 = (uint32_t)ADC_Channel << (5 * (Rank - 7));

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99re成人在线| 成人免费小视频| 中文字幕一区二区三区精华液 | 在线视频你懂得一区| 欧美xxxxxxxx| 亚洲五月六月丁香激情| 成人午夜视频网站| 久久免费精品国产久精品久久久久| 一区二区欧美视频| 99国产麻豆精品| 国产日韩欧美麻豆| 久久成人免费网站| 欧美日韩成人综合天天影院| **性色生活片久久毛片| 国产69精品久久99不卡| 精品国产乱码久久| 九九视频精品免费| 欧美本精品男人aⅴ天堂| 免费观看在线综合色| 宅男在线国产精品| 天天操天天综合网| 欧美熟乱第一页| 一区二区三区四区亚洲| 色综合激情久久| 亚洲精品美腿丝袜| 在线看国产日韩| 亚洲一本大道在线| 欧美色综合网站| 五月天激情综合网| 欧美一区二区精品在线| 蜜臀av性久久久久蜜臀aⅴ| 欧美片网站yy| 久久精品二区亚洲w码| 日韩一区二区三区在线| 久久99久久久久久久久久久| 日韩欧美在线网站| 国产在线精品一区二区夜色| 日韩亚洲欧美一区二区三区| 蜜桃一区二区三区四区| 欧美精品一区二区三区一线天视频| 美脚の诱脚舐め脚责91 | 欧美精品一卡两卡| 亚洲成人你懂的| 日韩女优制服丝袜电影| 国内精品视频一区二区三区八戒| 欧美xxxx在线观看| 成人丝袜18视频在线观看| 亚洲欧洲日产国产综合网| 色综合婷婷久久| 免费在线看一区| 久久久激情视频| 色八戒一区二区三区| 日韩电影在线观看电影| 久久嫩草精品久久久久| 91免费小视频| 七七婷婷婷婷精品国产| 久久久久久9999| 99精品欧美一区二区三区综合在线| 亚洲一区二区三区国产| 欧美成人一级视频| 成人免费毛片片v| 一区二区在线观看不卡| 日韩欧美综合一区| 91免费看`日韩一区二区| 亚洲成av人综合在线观看| 久久综合九色综合欧美就去吻| 99re视频精品| 狠狠色丁香婷综合久久| 中文在线一区二区| 欧美日韩亚洲综合在线| 狠狠色伊人亚洲综合成人| 亚洲免费电影在线| 久久久久久久久久久久电影| 欧美午夜精品久久久| 国产在线精品一区二区三区不卡| 亚洲一区自拍偷拍| 欧美极品美女视频| 日韩欧美成人一区二区| 91久久国产最好的精华液| 国产剧情一区在线| 免费观看成人鲁鲁鲁鲁鲁视频| 国产精品久久久久久久蜜臀| 日韩亚洲欧美一区| 精品视频999| 日本高清无吗v一区| 成人午夜伦理影院| 黄一区二区三区| 美国毛片一区二区三区| 午夜视频一区二区三区| 亚洲码国产岛国毛片在线| 欧美激情一区二区三区不卡| 欧美videos中文字幕| 91精品国产高清一区二区三区蜜臀| av亚洲精华国产精华| 国产精品一区二区免费不卡| 久久se精品一区二区| 日产欧产美韩系列久久99| 亚洲一区二区中文在线| 亚洲天堂2016| 国产精品久久久久一区二区三区共 | 国产精品福利av| 国产亚洲污的网站| 久久久五月婷婷| 久久久久九九视频| 久久综合国产精品| 欧美精品一区二区三区高清aⅴ| 日韩一区二区三区观看| 欧美精品日韩一区| 4438x亚洲最大成人网| 欧美高清一级片在线| 欧美日韩aaaaaa| 欧美男生操女生| 日韩视频中午一区| 精品福利一区二区三区| 精品国产一区久久| 国产欧美一区二区精品婷婷| 国产日产欧美精品一区二区三区| 欧美成人乱码一区二区三区| 精品久久久久久久久久久久久久久| 欧美成人免费网站| 国产日韩欧美精品在线| 亚洲国产精品ⅴa在线观看| 国产精品成人免费在线| 一区二区视频免费在线观看| 亚洲黄色在线视频| 日本亚洲三级在线| 国产专区综合网| 成a人片国产精品| 欧美三级电影在线看| 欧美日韩亚洲高清一区二区| 欧美高清精品3d| 精品国产制服丝袜高跟| 国产欧美精品一区二区色综合| 国产精品久久一卡二卡| 一区二区三区免费看视频| 性感美女极品91精品| 国内不卡的二区三区中文字幕 | 国产成人在线视频免费播放| 国产成人av福利| 99精品黄色片免费大全| 欧美精品在线一区二区三区| 欧美一区二区三级| 国产女人aaa级久久久级| 亚洲精选视频在线| 麻豆精品久久久| 99久久精品国产一区| 欧美一区二区日韩| 成人免费一区二区三区视频| 日韩1区2区3区| 91视视频在线观看入口直接观看www| 欧美色图激情小说| 久久久亚洲欧洲日产国码αv| 亚洲精品午夜久久久| 精品一区二区影视| 色婷婷狠狠综合| 亚洲精品在线一区二区| 亚洲免费在线看| 精品一区二区三区欧美| 91原创在线视频| 日韩你懂的电影在线观看| 亚洲美女区一区| 国产福利一区二区三区| 欧美日韩成人综合天天影院| 中日韩免费视频中文字幕| 三级久久三级久久| 99精品桃花视频在线观看| 2020日本不卡一区二区视频| 亚洲成人综合视频| 色综合久久天天综合网| 久久精品在这里| 精品一区二区久久久| 欧美美女一区二区| 亚洲在线视频网站| 99精品一区二区三区| 国产精品欧美综合在线| 国产高清在线精品| 精品国偷自产国产一区| 久久爱另类一区二区小说| 91麻豆精品91久久久久久清纯 | 欧美亚男人的天堂| 国产精品成人一区二区艾草 | 激情国产一区二区 | 麻豆视频一区二区| 欧美精品视频www在线观看| 亚洲精品免费在线播放| 99久久99久久久精品齐齐| 国产精品无圣光一区二区| 国产成人精品一区二区三区四区| 精品日韩在线一区| 精品一区二区久久久| 欧美一二三四区在线| 蜜桃视频一区二区| 日韩美女一区二区三区四区| 蜜臀av一区二区| 欧美xxxx在线观看| 国产精品一区二区在线观看不卡| 精品国产在天天线2019| 国产精品综合久久| 国产精品久久久久三级| 色综合久久久久久久久久久|