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

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

?? stm32f10x_adc.c

?? STM32USART1串口接收程序(中斷方式)
?? 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一区二区三区| 日韩小视频在线观看专区| 欧美日韩大陆一区二区| 精品成人一区二区三区| 亚洲日本中文字幕区| 日韩电影一区二区三区四区| 99这里只有久久精品视频| 日韩一级完整毛片| 亚洲国产三级在线| 99精品视频中文字幕| 久久―日本道色综合久久| 午夜视黄欧洲亚洲| 色综合天天综合网天天看片| 国产亚洲成年网址在线观看| 久久精品国产网站| 欧美日韩国产一级片| 亚洲裸体xxx| 97久久久精品综合88久久| 国产午夜精品一区二区三区嫩草 | 久久精品国内一区二区三区 | 国产aⅴ综合色| 日韩欧美国产三级电影视频| 亚洲18色成人| 欧美亚洲国产一区在线观看网站| 中文字幕在线不卡视频| www.在线欧美| 日韩美女啊v在线免费观看| 高清beeg欧美| 国产精品免费视频网站| 成人午夜又粗又硬又大| 国产欧美精品一区二区三区四区 | 午夜精品123| 欧美男男青年gay1069videost| 有码一区二区三区| 日本高清视频一区二区| 亚洲欧美色一区| 欧美亚洲国产一区二区三区va | 日韩一区二区电影网| 日韩一区欧美二区| 欧美一区二区三区四区高清| 美腿丝袜亚洲综合| 精品国产1区二区| 国产盗摄精品一区二区三区在线| 久久免费精品国产久精品久久久久| 精品在线视频一区| 精品国产91亚洲一区二区三区婷婷| 精品亚洲porn| 国产精品久久久久四虎| 欧洲亚洲国产日韩| 视频一区二区不卡| 精品国产乱码久久久久久老虎 | 久久99国产乱子伦精品免费| 26uuu国产一区二区三区| 国产成人精品午夜视频免费| 中文字幕在线不卡一区二区三区| 欧美性猛交xxxx黑人交| 免费观看一级特黄欧美大片| 精品日韩欧美在线| 成人91在线观看| 婷婷国产在线综合| 欧美激情在线看| 欧美视频在线不卡| 国产一区二区中文字幕| 亚洲欧美日韩国产手机在线| 91精品国产乱码| 波多野洁衣一区| 奇米精品一区二区三区在线观看 | 欧美国产欧美综合| 欧美色偷偷大香| 国产盗摄一区二区| 午夜av一区二区三区| 国产午夜一区二区三区| 欧美日韩精品欧美日韩精品一 | 欧洲一区二区三区免费视频| 精品一区二区国语对白| 一区二区免费在线| 久久嫩草精品久久久精品一| 欧美系列日韩一区| 国产a视频精品免费观看| 午夜精品在线看| 国产精品久久久久久福利一牛影视| 欧美日韩国产在线播放网站| 高清日韩电视剧大全免费| 日韩精品久久久久久| 日韩毛片一二三区| 精品国产亚洲一区二区三区在线观看| 91色视频在线| 成人小视频在线| 久久99久久99| 香蕉av福利精品导航 | 国产欧美精品国产国产专区| 欧美另类z0zxhd电影| 99精品视频在线播放观看| 国产伦精品一区二区三区免费| 日本亚洲最大的色成网站www| 亚洲品质自拍视频| 国产精品视频yy9299一区| 精品国产一区久久| 欧美夫妻性生活| 欧美性生活大片视频| 一本色道久久综合亚洲精品按摩| 国产精一区二区三区| 精品亚洲成a人| 久久精品国产澳门| 捆绑调教一区二区三区| 免费日本视频一区| 日韩精品久久理论片| 午夜视频一区在线观看| 亚洲va韩国va欧美va精品| 亚洲精选免费视频| 亚洲人成网站色在线观看| 亚洲丝袜制服诱惑| 中文字幕亚洲在| 亚洲丝袜自拍清纯另类| 亚洲色图视频网| 樱桃国产成人精品视频| 亚洲国产另类精品专区| 亚洲午夜久久久久久久久电影院| 亚洲精品中文在线观看| 亚洲乱码国产乱码精品精的特点| 亚洲精品欧美二区三区中文字幕| 日韩毛片视频在线看| 亚洲精选在线视频| 亚洲国产毛片aaaaa无费看| 天天影视色香欲综合网老头| 日产精品久久久久久久性色| 另类成人小视频在线| 国产精品夜夜嗨| 成人黄色777网| 在线观看免费视频综合| 91精品国产色综合久久不卡蜜臀| 日韩精品专区在线影院观看| 久久综合久久综合亚洲| 中国色在线观看另类| 亚洲精品成a人| 美日韩黄色大片| 懂色av一区二区三区免费看| 色婷婷国产精品久久包臀| 欧美精品在线一区二区三区| 精品国产一区二区三区久久影院| 欧美激情中文字幕一区二区| 亚洲永久精品国产| 另类小说综合欧美亚洲| av一区二区三区黑人| 欧美日韩dvd在线观看| 久久先锋资源网| 亚洲男人的天堂在线aⅴ视频| 日本在线不卡一区| 成人国产精品免费观看| 欧美裸体bbwbbwbbw| 日本一区二区动态图| 亚洲va欧美va人人爽| 粉嫩aⅴ一区二区三区四区| 欧美日韩一卡二卡三卡| 亚洲国产高清在线观看视频| 亚洲一区二区三区影院| 国产激情一区二区三区| 欧美日韩国产精选| 欧美韩日一区二区三区| 琪琪久久久久日韩精品| 色综合久久综合中文综合网| 精品欧美黑人一区二区三区| 亚洲影院理伦片| av一区二区三区黑人| 久久综合国产精品| 午夜欧美视频在线观看| av电影在线观看完整版一区二区| 欧美精品一二三四| 1000部国产精品成人观看| 久久er99精品| 欧美精品三级在线观看| 亚洲男人天堂一区| 不卡欧美aaaaa| 久久人人爽人人爽| 久久不见久久见免费视频1| 在线电影一区二区三区| 亚洲靠逼com| 91视频观看视频| 国产精品成人一区二区艾草 | 天堂影院一区二区| 一本高清dvd不卡在线观看| 国产日产亚洲精品系列| 蜜臀a∨国产成人精品| 欧美伊人久久久久久午夜久久久久| 国产视频一区二区三区在线观看| 美女网站色91| 91精品久久久久久久久99蜜臂| 一区二区三区在线免费| 色婷婷久久久久swag精品| 1024国产精品| www.在线欧美| 亚洲欧美日韩国产手机在线| 99免费精品视频| 亚洲三级电影网站| 91在线视频官网| 亚洲天堂福利av| 91高清视频免费看| 一级特黄大欧美久久久| 91福利在线免费观看| 一区二区三区欧美激情|