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

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

?? stm32f10x_adc.c

?? 基于STM32 的IAP升級庫
?? 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一区二区三区免费野_久草精品视频
国产大陆a不卡| 欧美大片一区二区| 日韩一区二区免费电影| 国产精品人妖ts系列视频| 日韩黄色免费网站| 色哟哟一区二区三区| 久久日韩粉嫩一区二区三区| 秋霞电影一区二区| 欧美在线你懂得| 亚洲乱码国产乱码精品精的特点| 国产激情视频一区二区在线观看| 制服.丝袜.亚洲.另类.中文| 亚洲影视在线观看| 91丝袜美女网| 亚洲人成在线观看一区二区| 成人av网在线| 亚洲国产精品t66y| 国产成人精品免费视频网站| 欧美精品一区二区三区在线播放 | 国产精品第四页| 国产在线一区二区| 日韩美女视频一区二区在线观看| 亚洲高清在线视频| 在线亚洲一区二区| 亚洲乱码国产乱码精品精98午夜 | 色噜噜狠狠成人中文综合| 国产精品麻豆久久久| 成人丝袜高跟foot| 欧美激情一区三区| fc2成人免费人成在线观看播放| 国产欧美日韩在线| 成人av影院在线| 亚洲品质自拍视频| 91亚洲精华国产精华精华液| 尤物在线观看一区| 欧美日韩大陆在线| 蜜臀av一区二区三区| 精品欧美乱码久久久久久1区2区 | 青青草国产精品亚洲专区无| 欧美一级午夜免费电影| 免费看欧美女人艹b| 精品久久久影院| 国产乱码精品一区二区三| 国产欧美精品一区二区色综合朱莉| 国产宾馆实践打屁股91| 亚洲欧美另类图片小说| 欧美亚洲高清一区二区三区不卡| 日韩制服丝袜av| 精品久久久久av影院| 丁香婷婷综合激情五月色| 成人欧美一区二区三区1314| 欧美亚洲图片小说| 蜜臀久久99精品久久久久宅男| 精品成人私密视频| 97久久精品人人澡人人爽| 亚洲图片欧美色图| 欧美成人r级一区二区三区| 成人午夜激情在线| 亚洲成人激情综合网| 久久无码av三级| 91免费看视频| 麻豆精品一区二区av白丝在线| 国产日韩欧美精品在线| 欧美艳星brazzers| 国产成人一区在线| 亚洲国产视频a| 久久奇米777| 欧美日韩国产欧美日美国产精品| 国产在线精品免费| 伊人性伊人情综合网| 久久综合999| 欧美肥妇free| 99久久精品免费| 精久久久久久久久久久| 一区二区三区在线免费视频| 久久久久久电影| 欧美区在线观看| www.成人网.com| 精品一区二区免费在线观看| 亚洲国产日日夜夜| 国产精品传媒视频| 久久色在线观看| 欧美年轻男男videosbes| 99re视频精品| 国产精品自拍三区| 美国欧美日韩国产在线播放| 亚洲自拍偷拍欧美| 国产精品卡一卡二卡三| 欧美精品一区在线观看| 欧美精品日韩一区| 色国产精品一区在线观看| 国产精品12区| 久久电影网站中文字幕| 日韩二区三区在线观看| 亚洲品质自拍视频| 国产精品天美传媒沈樵| 久久精品视频网| 欧美变态口味重另类| 91精品国产综合久久久蜜臀图片 | 日本系列欧美系列| 亚洲精品日日夜夜| 亚洲靠逼com| 国产精品国产精品国产专区不片| 国产亲近乱来精品视频| 久久久一区二区三区捆绑**| 欧美变态凌虐bdsm| 日韩精品中午字幕| 欧美成人激情免费网| 日韩精品一区二区三区在线观看| 欧美丰满一区二区免费视频| 欧美久久高跟鞋激| 7777精品伊人久久久大香线蕉的 | 日韩色在线观看| 欧美一级高清片在线观看| 欧美日韩国产在线观看| 色屁屁一区二区| 欧美亚州韩日在线看免费版国语版| 在线看国产一区二区| 欧美综合一区二区三区| 欧美日本在线一区| 91麻豆精品91久久久久久清纯| 欧美一级片在线| 精品国产精品网麻豆系列| 欧美sm美女调教| 国产清纯在线一区二区www| 国产精品乱码一区二区三区软件| 最新久久zyz资源站| 一区二区三区欧美| 日韩精品乱码av一区二区| 卡一卡二国产精品| 国产美女久久久久| av亚洲产国偷v产偷v自拍| 一本久久综合亚洲鲁鲁五月天| 色综合亚洲欧洲| 欧美一区二区三区免费大片| 欧美刺激午夜性久久久久久久| 久久精品一区二区三区不卡 | 国产亚洲欧美一级| 中文字幕中文字幕一区二区| 亚洲国产乱码最新视频 | 蜜臀av一区二区在线观看 | 91久久久免费一区二区| 欧美日韩国产在线观看| 久久这里只有精品视频网| 中文字幕中文乱码欧美一区二区| 亚洲成人先锋电影| 国产 欧美在线| 欧美三级一区二区| 国产午夜亚洲精品不卡| 亚洲综合久久久| 国产成人精品综合在线观看 | www.99精品| 69堂亚洲精品首页| 国产精品久久久久久户外露出 | 91色.com| 国产欧美日韩精品一区| 亚洲午夜久久久久久久久久久| 精品一区二区三区免费观看| 在线观看视频91| 国产日韩视频一区二区三区| 爽爽淫人综合网网站| 国产成人av电影在线观看| 欧美高清视频不卡网| 欧美高清在线视频| 奇米亚洲午夜久久精品| 色综合天天做天天爱| 国产亚洲精品bt天堂精选| 亚洲成人av福利| 色综合久久综合中文综合网| 26uuu国产日韩综合| 丝袜美腿亚洲一区| 一本久久综合亚洲鲁鲁五月天| 久久综合九色综合97_久久久| 午夜精品免费在线观看| av福利精品导航| 国产无人区一区二区三区| 久久成人综合网| 宅男在线国产精品| 亚洲综合一区二区精品导航| 成人国产精品免费| 国产欧美视频在线观看| 韩国精品主播一区二区在线观看| 欧美精品丝袜久久久中文字幕| 亚洲三级电影网站| bt7086福利一区国产| 中文字幕二三区不卡| 国产剧情一区二区| 久久综合久久鬼色| 国产精品一区二区久久不卡 | 国产suv一区二区三区88区| 日韩欧美中文字幕制服| 日本不卡高清视频| 91精品国产综合久久精品性色| 五月激情六月综合| 欧美人妇做爰xxxⅹ性高电影| 亚洲成人手机在线| 555www色欧美视频| 奇米影视7777精品一区二区| 日韩一级视频免费观看在线| 毛片不卡一区二区|