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

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

?? stm32f10x_adc.c

?? 英倍特公司的STM32V100開發板配套庫函數及例程源代碼
?? 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一区二区三区免费野_久草精品视频
蜜桃91丨九色丨蝌蚪91桃色| 国产成a人亚洲精| 亚洲综合色噜噜狠狠| 国产精品久久777777| 久久精品一区八戒影视| 国产无一区二区| 久久精品视频在线看| 久久久不卡网国产精品一区| 欧美精品一区二区三区视频| 精品国产一区二区三区四区四| 日韩欧美视频在线 | 精品国产乱码久久久久久闺蜜| 91精品国产免费| 日韩一区二区三| 精品国产免费人成在线观看| 2023国产一二三区日本精品2022| 久久久精品综合| 国产精品久久久久aaaa樱花| 中文字幕亚洲区| 亚洲综合成人在线视频| 亚洲一区二区三区四区在线| 亚洲亚洲人成综合网络| 日韩电影在线观看电影| 国内精品久久久久影院色| 粉嫩蜜臀av国产精品网站| 91丨九色porny丨蝌蚪| 欧美午夜精品一区二区三区| 91精品国产全国免费观看| 久久久精品黄色| 亚洲日本成人在线观看| 亚洲va欧美va人人爽午夜| 理论片日本一区| 成人精品小蝌蚪| 欧美日韩久久久| 精品va天堂亚洲国产| 日韩美女视频一区二区| 性感美女久久精品| 国产一区在线观看视频| 日本伦理一区二区| 精品精品欲导航| 成人欧美一区二区三区黑人麻豆 | 久久九九久精品国产免费直播| 国产日韩欧美亚洲| 一区二区三区日韩精品视频| 日韩二区在线观看| 成人福利视频在线看| 欧美日韩国产三级| 欧美国产欧美综合| 亚洲午夜一区二区| 国产乱妇无码大片在线观看| 在线观看国产一区二区| 久久综合色之久久综合| 亚洲成a天堂v人片| 成人在线综合网站| 91麻豆精品国产无毒不卡在线观看 | 91精品在线观看入口| 国产欧美精品一区二区三区四区 | 久久er99热精品一区二区| 91亚洲资源网| 欧美精品一区二区三区在线 | 视频一区在线视频| 成人精品视频一区二区三区| 69堂国产成人免费视频| 中文字幕五月欧美| 九九九精品视频| 欧美亚洲动漫精品| 国产精品青草久久| 久久国产夜色精品鲁鲁99| 色欧美日韩亚洲| 国产欧美日韩综合精品一区二区| 天天综合网 天天综合色| 99v久久综合狠狠综合久久| 精品av久久707| 性欧美大战久久久久久久久| 91色乱码一区二区三区| 国产目拍亚洲精品99久久精品| 天天综合天天综合色| 色婷婷综合视频在线观看| 国产日韩欧美综合在线| 裸体歌舞表演一区二区| 欧美人伦禁忌dvd放荡欲情| 亚洲日本在线视频观看| 国产盗摄一区二区三区| 精品日韩一区二区| 日本欧美在线观看| 欧美日韩aaa| 亚洲午夜视频在线观看| 欧美无砖砖区免费| 亚洲免费在线看| 99麻豆久久久国产精品免费| 国产欧美日韩三区| 国产揄拍国内精品对白| 精品国产91亚洲一区二区三区婷婷| 日韩专区中文字幕一区二区| 精品视频1区2区| 一区二区三区免费| 日本精品一级二级| 亚洲精品国产第一综合99久久| 99久久综合色| 日韩久久一区二区| 不卡在线视频中文字幕| 亚洲天堂网中文字| 色悠悠久久综合| 一区二区三区欧美日韩| 欧美日韩在线精品一区二区三区激情| 一区二区三区在线视频免费| 色老综合老女人久久久| 亚洲综合视频网| 欧美日韩一区二区三区视频| 亚洲国产精品久久艾草纯爱| 欧美日韩精品欧美日韩精品| 亚洲成人动漫av| 欧美一区午夜精品| 看电影不卡的网站| 久久精品网站免费观看| 成人av资源在线观看| 一区二区三区在线免费播放| 欧美在线三级电影| 日韩不卡在线观看日韩不卡视频| 91精品国产综合久久婷婷香蕉 | 麻豆久久久久久| 精品久久人人做人人爱| 国产精品性做久久久久久| 国产丝袜欧美中文另类| a美女胸又www黄视频久久| 一区二区三区四区乱视频| 欧美色图12p| 蓝色福利精品导航| 国产精品久久夜| 在线观看免费成人| 精品一区二区三区免费播放| 国产婷婷一区二区| 色94色欧美sute亚洲线路二| 日韩黄色片在线观看| 精品sm捆绑视频| 91福利精品视频| 精品夜夜嗨av一区二区三区| 国产精品高潮呻吟久久| 欧美系列在线观看| 国模套图日韩精品一区二区| 亚洲欧洲成人av每日更新| 欧美日韩专区在线| 国产东北露脸精品视频| 亚洲va欧美va人人爽午夜| 久久久亚洲国产美女国产盗摄| av午夜精品一区二区三区| 首页国产欧美久久| 国产精品美女一区二区| 欧美视频一区二区| 国产精品一区二区在线看| 一区二区三区不卡在线观看 | 亚洲欧美电影院| 欧美一二区视频| www.av精品| 蜜臀av性久久久久蜜臀aⅴ流畅 | 亚洲综合另类小说| 日韩精品一区二区三区swag | 日韩欧美在线1卡| 99久免费精品视频在线观看| 麻豆久久一区二区| 亚洲精品欧美在线| 国产亚洲欧洲一区高清在线观看| 在线观看欧美日本| 成人黄色软件下载| 另类小说一区二区三区| 亚洲午夜久久久久久久久电影院 | 亚洲成av人片在线观看| 国产欧美日韩不卡免费| 欧美一区二视频| 91蜜桃免费观看视频| 国产乱子轮精品视频| 五月开心婷婷久久| 亚洲私人影院在线观看| 欧美精品一区二区在线观看| 欧美日韩精品是欧美日韩精品| 99免费精品在线观看| 国产一区二区在线观看免费| 午夜精品久久久久久久蜜桃app| 国产精品天干天干在观线| 日韩精品最新网址| 欧美色手机在线观看| av电影天堂一区二区在线| 国产精品1区2区3区在线观看| 琪琪久久久久日韩精品| 午夜视频在线观看一区二区| 中文字幕一区二区三区乱码在线| 337p日本欧洲亚洲大胆精品| 91精品国产欧美一区二区| 欧美日韩国产天堂| 欧美视频一区二区三区四区 | 日韩精品一区二区三区中文精品| 欧美亚洲另类激情小说| av不卡免费电影| 国产99久久久国产精品免费看| 看电影不卡的网站| 极品少妇xxxx精品少妇| 免费在线视频一区| 视频一区二区三区中文字幕| 亚洲国产美女搞黄色| 亚洲午夜在线观看视频在线|