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

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

?? stm32f10x_adc.c

?? 用于STM32實時時鐘程序,可以代PC8563使用.
?? C
?? 第 1 頁 / 共 4 頁
字號:
/*******************************************************************************
* Function Name  : ADC_ResetCalibration
* Description    : Resets the selected ADC calibration registers.
* Input          : - ADCx: where x can be 1 or 2 to select the ADC peripheral.
* Output         : None
* Return         : None
*******************************************************************************/
void ADC_ResetCalibration(ADC_TypeDef* 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 or 2 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 status of RSTCAL bit */
  if ((ADCx->CR2 & CR2_RSTCAL_Set) != (u16)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 or 2 to select the ADC peripheral.
* Output         : None
* Return         : None
*******************************************************************************/
void ADC_StartCalibration(ADC_TypeDef* 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 or 2 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 status of CAL bit */
  if ((ADCx->CR2 & CR2_CAL_Set) != (u16)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 or 2 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(IS_FUNCTIONAL_STATE(NewState));

  if (NewState != DISABLE)
  {
    /* Enable the selected ADC conversion on external event */
	/* Starts the selected ADC conversion */
	ADCx->CR2 |= CR2_EXTTRIG_SWSTRT_Set;
  }
  else
  {
    /* Stops the selected ADC conversion */
    /* Disable the selected ADC conversion on external event */
	ADCx->CR2 &= CR2_EXTTRIG_SWSTRT_Reset;
  }
}

/*******************************************************************************
* Function Name  : ADC_GetSoftwareStartConvStatus
* Description    : Gets the selected ADC Software start conversion Status.
* Input          : - ADCx: where x can be 1 or 2 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 status of SWSTRT bit */
  if ((ADCx->CR2 & CR2_SWSTRT_Set) != (u32)RESET)
  {
    /* SWSTRT bit is set */
    bitstatus = SET;
  }
  else
  {
    /* SWSTRT bit is reset */
    bitstatus = RESET;
  }
  /* Return the SWSTRT 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 or 2 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;
  u8 tmpreg2 = 0;

  /* Check the parameters */
  assert(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 |= ((u32)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 or 2 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(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 or 2 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(IS_ADC_CHANNEL(ADC_Channel));
  assert(IS_ADC_REGULAR_RANK(Rank));
  assert(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 = (u32)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 = (u32)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 = (u32)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 = (u32)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 = (u32)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 or 2 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
*******************************************************************************/
void ADC_ExternalTrigConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState)
{

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人av电影在线播放| 日韩一区二区三区四区五区六区| 91久久精品一区二区三区| 日韩午夜av电影| 亚洲精品成a人| 久久99精品久久久久久国产越南| 色偷偷久久一区二区三区| 精品99一区二区三区| 亚洲国产sm捆绑调教视频| 国产99一区视频免费| 91精品国产入口| 亚洲欧美日韩久久| 国产精品夜夜嗨| 日韩欧美资源站| 亚洲午夜三级在线| av一区二区三区四区| 欧美精品一区二| 蜜臀av一区二区三区| 欧美日韩大陆一区二区| 亚洲人亚洲人成电影网站色| 国产精品正在播放| 精品久久久久久久久久久院品网| 亚洲国产美国国产综合一区二区| 99久久伊人网影院| 久久久久久久久久久黄色| 美国毛片一区二区| 91精品免费观看| 五月婷婷综合网| 日韩一卡二卡三卡四卡| 日韩专区中文字幕一区二区| 在线免费精品视频| 亚洲精品福利视频网站| 欧美在线观看一二区| 一区二区久久久| 在线观看日韩一区| 一区二区三国产精华液| 精品视频999| 五月天丁香久久| 日韩一区二区精品在线观看| 调教+趴+乳夹+国产+精品| 欧美日韩中文另类| 婷婷中文字幕一区三区| 欧美一区二区三区在线观看视频| 日韩电影在线一区二区| 精品欧美乱码久久久久久1区2区 | 国产亚洲精品7777| 国产一区二区在线视频| 国产精品看片你懂得| 97精品电影院| 亚洲成在人线在线播放| 欧美一区二区国产| 精品一区二区综合| 精品国产91乱码一区二区三区| 国产一区二区三区香蕉| 中文字幕国产一区| 日本精品一级二级| 亚洲男人天堂av网| 欧美一级免费大片| 国产曰批免费观看久久久| 国产精品视频线看| 91丝袜国产在线播放| 亚洲国产裸拍裸体视频在线观看乱了 | 国产成人av电影在线| 日韩伦理免费电影| 欧美精品在欧美一区二区少妇| 久久精品国产99久久6| 中文字幕不卡在线| 777色狠狠一区二区三区| 国产大陆精品国产| 亚洲线精品一区二区三区八戒| 久久色.com| 欧美视频自拍偷拍| 国产一区 二区 三区一级| 一区二区三区在线播放| 精品少妇一区二区三区免费观看 | 国产精品一区二区x88av| 亚洲日穴在线视频| 日韩一区二区三区视频| www.欧美.com| 久久99精品久久只有精品| 亚洲综合丝袜美腿| 久久久久久久久蜜桃| 欧美日韩激情在线| va亚洲va日韩不卡在线观看| 久久99精品国产.久久久久久| 亚洲免费观看高清完整版在线观看| 日韩免费看的电影| 一本色道**综合亚洲精品蜜桃冫 | 国产欧美一区二区精品性色| 91麻豆精品91久久久久同性| 色婷婷精品大在线视频| 国产高清在线观看免费不卡| 日韩二区三区四区| 亚洲精品国产视频| 中文字幕亚洲电影| 久久蜜桃一区二区| 91精品国产色综合久久ai换脸| 欧洲一区二区三区免费视频| av欧美精品.com| 大陆成人av片| 国产成人一级电影| 国产中文字幕一区| 视频在线观看一区| 一级中文字幕一区二区| 亚洲精品乱码久久久久久黑人| 久久久午夜电影| 精品国产凹凸成av人网站| 日韩欧美www| 日韩欧美的一区| 欧美www视频| 精品久久久久久久久久久院品网| 日韩一区二区三区电影在线观看| 91.com在线观看| 911精品产国品一二三产区| 欧美最猛黑人xxxxx猛交| 91猫先生在线| 在线观看一区不卡| 日本韩国欧美三级| 在线观看91视频| 欧美放荡的少妇| 91麻豆精品91久久久久久清纯 | 欧美日韩久久一区| 欧美中文字幕亚洲一区二区va在线| 99re免费视频精品全部| 91在线精品一区二区| 99精品视频一区二区三区| 色综合久久88色综合天天6| 欧洲精品一区二区| 欧美日韩另类一区| 日韩欧美综合在线| 久久久久久免费毛片精品| 久久久精品国产99久久精品芒果| 国产欧美一区在线| 中文字幕在线不卡国产视频| 亚洲乱码国产乱码精品精小说| 亚洲香肠在线观看| 蜜桃传媒麻豆第一区在线观看| 国产精品一卡二卡| 不卡视频在线看| 欧美视频中文字幕| 26uuu精品一区二区三区四区在线| 国产日韩欧美一区二区三区乱码| ●精品国产综合乱码久久久久| 亚洲主播在线观看| 青青草原综合久久大伊人精品 | 狠狠色狠狠色综合日日91app| 国产成人福利片| 欧美在线免费观看亚洲| 日韩欧美激情一区| 国产欧美一区二区三区在线老狼 | 老司机免费视频一区二区| 国产精品自拍网站| 在线观看亚洲一区| 欧美变态口味重另类| 亚洲激情图片一区| 蜜桃视频一区二区三区| 93久久精品日日躁夜夜躁欧美| 337p亚洲精品色噜噜| 国产亚洲综合在线| 午夜成人在线视频| 成人深夜福利app| 日韩一区二区三区视频在线观看| 国产精品灌醉下药二区| 视频一区视频二区中文| 成人av在线播放网站| 91精品国产高清一区二区三区蜜臀 | 亚洲国产aⅴ天堂久久| 国产精品一级在线| 欧美久久久一区| 国产精品色呦呦| 国产一区福利在线| 欧美日韩一区二区电影| 欧美国产激情二区三区| 日韩在线一二三区| 97se亚洲国产综合自在线不卡| 久久色在线观看| 免费观看一级欧美片| 欧美午夜电影一区| 国产精品激情偷乱一区二区∴| 久久疯狂做爰流白浆xx| 欧美男人的天堂一二区| 亚洲免费av在线| 91偷拍与自偷拍精品| 欧美激情中文字幕一区二区| 精品在线免费观看| 91麻豆精品久久久久蜜臀 | 青青草一区二区三区| 欧美视频在线播放| 综合婷婷亚洲小说| 不卡欧美aaaaa| 久久精品人人做人人爽97| 黄色精品一二区| 日韩免费观看2025年上映的电影| 午夜a成v人精品| 欧美精品国产精品| 午夜精品免费在线| 91精品国产高清一区二区三区| 日韩精品乱码免费| 欧美一卡二卡在线| 久久精品国产澳门|