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

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

?? stm32f10x_adc.c

?? 基于Cortex-M3的STM32的IAR EWARM的工程模塊
?? C
?? 第 1 頁 / 共 4 頁
字號:
/*******************************************************************************
* Function Name  : ADC_ResetCalibration
* Description    : Resets the selected ADC calibration registers.
* Input          : - ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
* Output         : None
* Return         : 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;
}

/*******************************************************************************
* Function Name  : ADC_GetResetCalibrationStatus
* Description    : Gets the selected ADC reset calibration registers status.
* Input          : - ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
* Output         : None
* Return         : 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) != (u32)RESET)
  {
    /* RSTCAL bit is set */
    bitstatus = SET;
  }
  else
  {
    /* RSTCAL bit is reset */
    bitstatus = RESET;
  }

  /* Return the RSTCAL bit status */
  return  bitstatus;
}

/*******************************************************************************
* Function Name  : ADC_StartCalibration
* Description    : Starts the selected ADC calibration process.
* Input          : - ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
* Output         : None
* Return         : 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;
}

/*******************************************************************************
* Function Name  : ADC_GetCalibrationStatus
* Description    : Gets the selected ADC calibration status.
* Input          : - ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
* Output         : None
* Return         : 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) != (u32)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;
}

/*******************************************************************************
* Function Name  : ADC_SoftwareStartConvCmd
* Description    : Enables or disables the selected ADC software start conversion .
* Input          : - ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
*                  - NewState: new state of the selected ADC software start conversion.
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : 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;
  }
}

/*******************************************************************************
* Function Name  : ADC_GetSoftwareStartConvStatus
* Description    : Gets the selected ADC Software start conversion Status.
* Input          : - ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
* Output         : None
* Return         : 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) != (u32)RESET)
  {
    /* SWSTART bit is set */
    bitstatus = SET;
  }
  else
  {
    /* SWSTART bit is reset */
    bitstatus = RESET;
  }

  /* Return the SWSTART bit status */
  return  bitstatus;
}

/*******************************************************************************
* Function Name  : ADC_DiscModeChannelCountConfig
* Description    : Configures the discontinuous mode for the selected ADC regular
*                  group channel.
* Input          : - ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
*                  - Number: specifies the discontinuous mode regular channel
*                    count value. This number must be between 1 and 8.
* Output         : None
* Return         : None
*******************************************************************************/
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;
}

/*******************************************************************************
* Function Name  : ADC_DiscModeCmd
* Description    : Enables or disables the discontinuous mode on regular group
*                  channel for the specified ADC
* Input          : - ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
*                  - NewState: new state of the selected ADC discontinuous mode
*                    on regular group channel.
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : 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;
  }
}

/*******************************************************************************
* Function Name  : ADC_RegularChannelConfig
* Description    : Configures for the selected ADC regular channel its corresponding
*                  rank in the sequencer and its sample time.
* Input          : - ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
*                  - ADC_Channel: the ADC channel to configure. 
*                    This parameter can be one of the following values:
*                       - ADC_Channel_0: ADC Channel0 selected
*                       - ADC_Channel_1: ADC Channel1 selected
*                       - ADC_Channel_2: ADC Channel2 selected
*                       - ADC_Channel_3: ADC Channel3 selected
*                       - ADC_Channel_4: ADC Channel4 selected
*                       - ADC_Channel_5: ADC Channel5 selected
*                       - ADC_Channel_6: ADC Channel6 selected
*                       - ADC_Channel_7: ADC Channel7 selected
*                       - ADC_Channel_8: ADC Channel8 selected
*                       - ADC_Channel_9: ADC Channel9 selected
*                       - ADC_Channel_10: ADC Channel10 selected
*                       - ADC_Channel_11: ADC Channel11 selected
*                       - ADC_Channel_12: ADC Channel12 selected
*                       - ADC_Channel_13: ADC Channel13 selected
*                       - ADC_Channel_14: ADC Channel14 selected
*                       - ADC_Channel_15: ADC Channel15 selected
*                       - ADC_Channel_16: ADC Channel16 selected
*                       - ADC_Channel_17: ADC Channel17 selected
*                  - Rank: The rank in the regular group sequencer. This parameter
*                    must be between 1 to 16.
*                  - ADC_SampleTime: The sample time value to be set for the
*                    selected channel. 
*                    This parameter can be one of the following values:
*                       - ADC_SampleTime_1Cycles5: Sample time equal to 1.5 cycles
*                       - ADC_SampleTime_7Cycles5: Sample time equal to 7.5 cycles
*                       - ADC_SampleTime_13Cycles5: Sample time equal to 13.5 cycles
*                       - ADC_SampleTime_28Cycles5: Sample time equal to 28.5 cycles	
*                       - ADC_SampleTime_41Cycles5: Sample time equal to 41.5 cycles	
*                       - ADC_SampleTime_55Cycles5: Sample time equal to 55.5 cycles	
*                       - ADC_SampleTime_71Cycles5: Sample time equal to 71.5 cycles	
*                       - ADC_SampleTime_239Cycles5: Sample time equal to 239.5 cycles	
* Output         : None
* Return         : None
*******************************************************************************/
void ADC_RegularChannelConfig(ADC_TypeDef* ADCx, u8 ADC_Channel, u8 Rank, u8 ADC_SampleTime)
{
  u32 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 discontinuous mode channel count */
    tmpreg1 &= ~tmpreg2;
    /* Calculate the mask to set */
    tmpreg2 = (u32)ADC_SampleTime << (3 * (ADC_Channel - 10));
    /* Set the discontinuous mode channel count */
    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 discontinuous mode channel count */
    tmpreg1 &= ~tmpreg2;
    /* Calculate the mask to set */
    tmpreg2 = (u32)ADC_SampleTime << (3 * ADC_Channel);
    /* Set the discontinuous mode channel count */
    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 = (u32)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 = (u32)ADC_Channel << (5 * (Rank - 7));
    /* Set the SQx bits for the selected rank */
    tmpreg1 |= tmpreg2;
    /* Store the new register value */
    ADCx->SQR2 = tmpreg1;
  }
  /* For Rank 13 to 16 */
  else
  {
    /* Get the old register value */
    tmpreg1 = ADCx->SQR1;
    /* Calculate the mask to clear */
    tmpreg2 = SQR1_SQ_Set << (5 * (Rank - 13));
    /* Clear the old SQx bits for the selected rank */
    tmpreg1 &= ~tmpreg2;
    /* Calculate the mask to set */
    tmpreg2 = (u32)ADC_Channel << (5 * (Rank - 13));
    /* Set the SQx bits for the selected rank */
    tmpreg1 |= tmpreg2;
    /* Store the new register value */
    ADCx->SQR1 = tmpreg1;
  }
}

/*******************************************************************************
* Function Name  : ADC_ExternalTrigConvCmd
* Description    : Enables or disables the ADCx conversion through external trigger.
* Input          : - ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
*                  - NewState: new state of the selected ADC external trigger
*                    start of conversion.
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : None
*******************************************************************************/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91丝袜呻吟高潮美腿白嫩在线观看| 中文字幕免费不卡| 午夜激情久久久| 欧美日韩午夜在线视频| 五月天网站亚洲| 欧美一级生活片| 国产乱人伦偷精品视频不卡| 精品国产一区二区三区av性色| 精品夜夜嗨av一区二区三区| 久久久精品tv| 一本到高清视频免费精品| 一区二区三区在线看| 欧美一区二区成人| 国产精品538一区二区在线| 中文字幕一区二区三区在线观看| 在线视频国产一区| 精品亚洲免费视频| 日韩理论片一区二区| 91精品国产免费| 国产成人免费视频网站高清观看视频| 中文字幕在线免费不卡| 精品婷婷伊人一区三区三| 精品一区二区三区在线播放视频| 国产精品五月天| 91超碰这里只有精品国产| 国产成人夜色高潮福利影视| 一区二区三区日韩精品| 精品久久久久久久人人人人传媒| 成人一二三区视频| 日韩在线一区二区| 国产精品女主播在线观看| 欧美日韩午夜在线视频| 丰满白嫩尤物一区二区| 首页国产丝袜综合| 国产精品久久久久久久午夜片 | 国产高清不卡一区| 亚洲成av人片在线| 中文字幕av一区二区三区免费看 | 91精品国产综合久久福利| 成人深夜视频在线观看| 日本不卡视频在线观看| 日韩理论电影院| 久久久久久久综合色一本| 欧美日本在线一区| 91色.com| 高潮精品一区videoshd| 免费看精品久久片| 亚洲线精品一区二区三区八戒| 国产三级三级三级精品8ⅰ区| 欧美丰满一区二区免费视频| 99在线热播精品免费| 国产麻豆9l精品三级站| 日韩精品一级中文字幕精品视频免费观看 | 在线精品视频一区二区三四| 国产成人午夜视频| 奇米在线7777在线精品| 亚洲夂夂婷婷色拍ww47| 中文久久乱码一区二区| 精品国一区二区三区| 91精品久久久久久久99蜜桃| 欧美色倩网站大全免费| 91免费小视频| av不卡在线观看| 粉嫩13p一区二区三区| 国产麻豆91精品| 精品无人区卡一卡二卡三乱码免费卡| 婷婷中文字幕一区三区| 亚洲成人黄色小说| 亚洲一区自拍偷拍| 亚洲综合色噜噜狠狠| 一区二区三区精密机械公司| 亚洲欧美在线aaa| 最新国产精品久久精品| 1区2区3区欧美| 亚洲精品中文字幕在线观看| 亚洲丝袜另类动漫二区| 一区二区三区资源| 一区二区三区免费观看| 亚洲精品视频在线| 亚洲黄色免费电影| 亚洲电影第三页| 奇米精品一区二区三区在线观看一| 天天亚洲美女在线视频| 日韩黄色免费网站| 久久精品国产秦先生| 久久99精品一区二区三区| 国产伦精品一区二区三区视频青涩| 国产麻豆精品theporn| 成人毛片在线观看| 91猫先生在线| 欧美精品成人一区二区三区四区| 91精品午夜视频| 国产日韩欧美高清在线| 国产精品蜜臀av| 亚洲综合一区二区精品导航| 石原莉奈在线亚洲三区| 国产一区在线看| 色综合久久久久久久久久久| 欧美三片在线视频观看| 日韩小视频在线观看专区| 国产亚洲欧美在线| 亚洲欧美日韩国产中文在线| 午夜精品免费在线| 国产在线一区二区综合免费视频| 成人av免费在线观看| 欧美在线三级电影| 精品国产露脸精彩对白| 中文字幕av一区二区三区免费看| 亚洲日本中文字幕区| 日韩av二区在线播放| 国产suv精品一区二区6| 欧美人妇做爰xxxⅹ性高电影| 精品欧美乱码久久久久久1区2区| 国产精品久久久久久久久搜平片 | 美女一区二区在线观看| 国产传媒日韩欧美成人| 欧美三级中文字幕| 久久精品亚洲精品国产欧美| 亚洲午夜电影网| 粉嫩av亚洲一区二区图片| 制服丝袜亚洲播放| 一区免费观看视频| 麻豆精品在线播放| 在线国产亚洲欧美| 国产拍揄自揄精品视频麻豆| 日本不卡中文字幕| 91丨九色porny丨蝌蚪| 精品免费视频.| 亚洲国产一区二区三区青草影视| 国产精品99精品久久免费| 欧美三级中文字幕| 综合久久久久久久| 国产乱子伦视频一区二区三区 | 国产精品免费网站在线观看| 日韩高清中文字幕一区| 91麻豆国产在线观看| 精品国产不卡一区二区三区| 亚洲专区一二三| 99久久久久久| 日本一区二区三区免费乱视频| 五月激情综合网| 色婷婷精品久久二区二区蜜臀av| 久久久国产精品午夜一区ai换脸| 三级欧美韩日大片在线看| 91麻豆免费视频| 国产精品国产馆在线真实露脸 | 日韩一区二区影院| 亚洲图片一区二区| 99热在这里有精品免费| 国产校园另类小说区| 精品一区二区三区在线观看 | 色婷婷激情久久| 欧美极品少妇xxxxⅹ高跟鞋| 免费高清在线视频一区·| 欧美视频一区二区| 亚洲精品网站在线观看| 色综合夜色一区| 国产精品妹子av| 粗大黑人巨茎大战欧美成人| 久久久久国产精品免费免费搜索| 国产又黄又大久久| 久久综合色综合88| 激情综合网最新| 91精品国产美女浴室洗澡无遮挡| 午夜成人免费电影| 欧美理论电影在线| 日韩专区欧美专区| 欧美一级一区二区| 亚洲欧美日本韩国| 成人自拍视频在线观看| 欧美一二三四区在线| 亚洲va欧美va人人爽午夜| 色菇凉天天综合网| 综合电影一区二区三区 | 中文字幕亚洲在| 色综合天天综合狠狠| 亚洲激情综合网| 精品1区2区3区| 亚洲sss视频在线视频| 欧美中文字幕久久| 一区二区三区**美女毛片| 日本高清免费不卡视频| 亚洲成人av电影在线| 欧美日韩视频在线观看一区二区三区 | 成人一区二区视频| 最新高清无码专区| 91在线码无精品| 亚洲丶国产丶欧美一区二区三区| 欧美日韩1234| 国内精品免费**视频| 亚洲国产精品成人综合色在线婷婷| 99久久99久久久精品齐齐| 椎名由奈av一区二区三区| 欧美系列在线观看| 另类调教123区| 国产精品福利一区二区三区| 精品视频免费在线| 麻豆精品一区二区三区| 国产精品色在线观看| 欧美性欧美巨大黑白大战|