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

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

?? stm32f10x_adc.c

?? ucos2.86版本結合STM板極支持包
?? 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∨色屁股| 国产精品国产三级国产有无不卡| 国产午夜精品在线观看| 中文字幕的久久| 国产精品进线69影院| 一区二区欧美国产| 午夜欧美视频在线观看| 美女一区二区三区| 国产一区二三区| 91在线一区二区三区| 欧美性受xxxx黑人xyx性爽| 欧美精选一区二区| 久久在线免费观看| 亚洲视频1区2区| 肉丝袜脚交视频一区二区| 狠狠色狠狠色综合日日91app| 国产69精品久久久久777| 99久久免费精品| 欧美久久久久久蜜桃| 久久久久久97三级| 亚洲一二三区在线观看| 精品一区二区三区视频| 在线欧美日韩国产| 亚洲精品一区二区三区在线观看 | 国产一区二区三区国产| 国产98色在线|日韩| 91成人免费在线视频| 日韩欧美一级二级三级| 综合久久久久久| 久久超级碰视频| 欧美亚洲日本国产| 国产欧美日韩久久| 精品一区二区免费看| 一本大道久久精品懂色aⅴ| 欧美精品亚洲二区| 亚洲少妇最新在线视频| 国内精品国产三级国产a久久| 色综合久久综合网| 中文字幕免费一区| 久久精品99久久久| 欧美日韩精品综合在线| 综合激情成人伊人| 成人性视频免费网站| 日韩精品资源二区在线| 亚洲成人av一区二区三区| 97精品电影院| 国产亚洲一本大道中文在线| 日韩中文字幕1| 日本韩国精品一区二区在线观看| 国产丝袜欧美中文另类| 精品一区二区三区在线观看| 精品视频一区二区三区免费| 日韩美女啊v在线免费观看| 国产激情视频一区二区在线观看 | 久久久精品国产99久久精品芒果| 亚洲高清免费视频| 欧美在线一二三四区| 亚洲欧洲三级电影| av亚洲精华国产精华精华| 国产女同性恋一区二区| 国产精品一区二区三区乱码| 精品国产一区二区三区久久影院| 石原莉奈在线亚洲三区| 欧美三级欧美一级| 亚洲一区二区偷拍精品| 在线观看视频一区| 亚洲成人777| 欧美一区二区三区爱爱| 男女男精品网站| 日韩视频国产视频| 久久99精品国产麻豆不卡| 久久综合九色综合欧美亚洲| 经典一区二区三区| 亚洲国产高清aⅴ视频| 成人黄色免费短视频| 国产精品成人免费 | 亚洲午夜一区二区| 欧美色成人综合| 欧美aaa在线| 久久久亚洲午夜电影| 高清shemale亚洲人妖| 中文字幕+乱码+中文字幕一区| 成人网男人的天堂| 一区二区三区**美女毛片| 91麻豆精品国产91久久久使用方法 | 亚洲久本草在线中文字幕| 色一区在线观看| 亚洲成a人v欧美综合天堂下载 | 91精品国产91热久久久做人人| 日本在线不卡视频| 久久久高清一区二区三区| 欧亚一区二区三区| 天堂蜜桃一区二区三区| 精品国产免费一区二区三区香蕉| 国产乱码精品一区二区三区五月婷 | 天堂成人免费av电影一区| 日韩亚洲欧美综合| 成人va在线观看| 日韩国产在线观看一区| 久久久久久久久伊人| 色综合久久中文字幕综合网 | 国内精品伊人久久久久影院对白| 国产精品乱人伦中文| 欧美日韩久久久| 不卡的看片网站| 毛片不卡一区二区| 一区二区三区在线观看网站| 日韩精品一区二区三区三区免费| 成人小视频免费观看| 亚洲码国产岛国毛片在线| 日韩精品资源二区在线| 色婷婷综合激情| 国产精品综合av一区二区国产馆| 亚洲精品免费电影| 日本一区二区免费在线| 欧美日韩一区不卡| 成人国产电影网| 狠狠色狠狠色综合系列| 亚洲影院在线观看| 国产精品三级av| 日韩精品一区在线| 欧美性色欧美a在线播放| 成人黄色小视频| 国产一区二区导航在线播放| 午夜欧美电影在线观看| 亚洲激情av在线| 国产精品视频免费| 久久综合给合久久狠狠狠97色69| 欧美日韩高清在线播放| 色婷婷综合久久| 白白色 亚洲乱淫| 国产精品亚洲第一区在线暖暖韩国 | 91蜜桃视频在线| 成人av片在线观看| 国产成人鲁色资源国产91色综 | 欧美国产日本韩| 国产亚洲福利社区一区| 精品国内片67194| 欧美一区二区三级| 91精品国产福利| 7777精品久久久大香线蕉 | 国产在线麻豆精品观看| 美女在线观看视频一区二区| 性做久久久久久久免费看| 亚洲五月六月丁香激情| 一区二区三区精品在线| 亚洲综合一二三区| 亚洲国产精品久久一线不卡| 亚洲国产精品一区二区尤物区| 亚洲精品美国一| 亚洲成人福利片| 丝袜美腿成人在线| 六月丁香综合在线视频| 韩国av一区二区三区| 国产jizzjizz一区二区| 大美女一区二区三区| 99久久777色| 欧美午夜免费电影| 日韩欧美精品在线视频| 国产亚洲欧洲一区高清在线观看| 亚洲精品在线观| 综合欧美一区二区三区| 亚洲一区二区三区美女| 美女视频黄免费的久久| 国产精品亚洲第一区在线暖暖韩国 | 久久只精品国产| 欧美高清在线一区二区| 最新国产成人在线观看| 亚洲综合激情另类小说区| 免费在线一区观看| 国产不卡一区视频| 99久久久精品| 欧美精品电影在线播放| 久久亚洲精精品中文字幕早川悠里| 国产欧美一区二区三区沐欲| 亚洲人成网站色在线观看| 水野朝阳av一区二区三区| 国产一区二区精品久久| 在线观看日韩电影| 久久伊99综合婷婷久久伊| 亚洲女爱视频在线| 精品一区二区三区影院在线午夜 | 国产精品综合视频| 在线视频一区二区免费| 欧美成人欧美edvon| 亚洲免费视频成人| 国内精品伊人久久久久av影院| 色哟哟一区二区在线观看 | 国产成a人无v码亚洲福利| 欧美视频在线不卡| 国产精品第一页第二页第三页| 日本欧美一区二区三区| 成人动漫一区二区三区| 欧美成人欧美edvon| 亚洲丰满少妇videoshd|