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

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

?? stm32f10x_adc.c

?? 萬利開發板上的lcd例程
?? 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| 国产成人综合精品三级| 蜜桃精品视频在线| 奇米影视一区二区三区小说| 五月天国产精品| 日韩高清在线一区| 久久国产日韩欧美精品| 在线视频欧美精品| 欧美日韩中文精品| 91精品国模一区二区三区| 欧美成人性福生活免费看| 久久精品亚洲麻豆av一区二区| 久久久国产精品麻豆| 1000精品久久久久久久久| 亚洲女同一区二区| 免费av成人在线| 国内成+人亚洲+欧美+综合在线| 国产99一区视频免费| 99精品视频中文字幕| 欧美欧美午夜aⅴ在线观看| 69堂精品视频| 国产欧美精品一区二区色综合朱莉 | 亚洲高清一区二区三区| 视频一区二区中文字幕| 国产一区欧美二区| 91一区二区三区在线观看| 在线观看91精品国产麻豆| 欧美精品一区二区三区高清aⅴ| 久久综合色之久久综合| 亚洲免费大片在线观看| 久久99最新地址| 91国产丝袜在线播放| 欧美xfplay| 亚洲综合区在线| 国产一区二区三区黄视频 | 综合分类小说区另类春色亚洲小说欧美| 亚洲私人黄色宅男| 免费成人在线视频观看| 91蜜桃在线观看| 精品久久久久久无| 亚洲午夜私人影院| 成人午夜短视频| 欧美α欧美αv大片| 一区二区三区丝袜| 成人黄动漫网站免费app| 欧美一区二区免费视频| 成人欧美一区二区三区小说 | 三级亚洲高清视频| 91在线视频网址| 久久久久久久久久久久电影| 午夜精品免费在线观看| 99久久99久久精品国产片果冻 | 日本韩国精品一区二区在线观看| 亚洲成精国产精品女| 国产精品夜夜爽| 精品欧美久久久| 青青草国产精品亚洲专区无| 91精品福利视频| 亚洲欧美一区二区久久| 成人在线视频首页| 久久久国产精品午夜一区ai换脸| 美日韩黄色大片| 日韩一区二区在线观看视频播放| 一区二区三区四区激情 | 日韩三级高清在线| 轻轻草成人在线| 日韩欧美视频一区| 麻豆精品一区二区av白丝在线| 欧美日韩国产另类一区| 亚洲成a人v欧美综合天堂| 91啦中文在线观看| 一区二区三区欧美日| 欧美在线观看视频一区二区三区 | 美女精品一区二区| 4438x亚洲最大成人网| 水野朝阳av一区二区三区| 欧美日韩国产片| 日韩不卡一区二区三区| 日韩一区二区中文字幕| 久久91精品国产91久久小草| 精品国产乱码久久久久久免费 | 国产精品久久久久久久久免费丝袜| 精品伊人久久久久7777人| 日韩精品一区二区三区蜜臀 | 久久亚洲一区二区三区明星换脸| 久久99精品久久久久久国产越南| 精品99999| 北条麻妃国产九九精品视频| 最新国产精品久久精品| 欧美在线免费视屏| 久久精品国产99久久6| 国产亚洲成aⅴ人片在线观看| 国产精品综合在线视频| 中文字幕亚洲精品在线观看| 色悠久久久久综合欧美99| 午夜视频久久久久久| 日韩欧美aaaaaa| 成年人网站91| 视频一区中文字幕国产| 精品福利一二区| 94色蜜桃网一区二区三区| 亚洲图片有声小说| 欧美精品一区二区三区在线 | 韩国女主播一区| 国产精品美女久久久久aⅴ| 欧洲另类一二三四区| 久久99日本精品| 亚洲欧美日韩小说| 日韩视频不卡中文| 色综合欧美在线| 美女一区二区视频| 亚洲女人的天堂| 又紧又大又爽精品一区二区| 5566中文字幕一区二区电影| 成人涩涩免费视频| 秋霞影院一区二区| 亚洲欧美日韩系列| 久久精品无码一区二区三区| 色国产综合视频| 国产成人精品影视| 青青草一区二区三区| 亚洲精品国产精品乱码不99| 精品国产免费视频| 欧美老女人在线| 99久久婷婷国产综合精品电影| 日韩中文字幕av电影| 亚洲欧洲另类国产综合| 亚洲精品一线二线三线无人区| 色婷婷亚洲综合| 成人精品一区二区三区中文字幕| 日本aⅴ免费视频一区二区三区 | 国产盗摄精品一区二区三区在线| 亚洲免费电影在线| 中文字幕成人在线观看| 久久久美女毛片| 日韩精品自拍偷拍| 精品婷婷伊人一区三区三| 91丨九色丨尤物| 国产成人精品免费| 国产乱国产乱300精品| 欧美a级一区二区| 亚洲国产精品一区二区久久| 亚洲日本在线a| 一区视频在线播放| 国产欧美精品一区aⅴ影院| 久久亚洲精华国产精华液| 4438x成人网最大色成网站| 制服丝袜亚洲网站| 欧美二区三区的天堂| 欧美日本一区二区三区| 欧美三级资源在线| 欧美在线影院一区二区| 色综合视频在线观看| 在线亚洲免费视频| 欧美色综合网站| 91精品国产综合久久蜜臀| 日韩一区和二区| 精品国产乱码久久久久久图片 | 99久久精品国产一区| 不卡的看片网站| 色先锋久久av资源部| 欧美体内she精视频| 欧美日本视频在线| 精品久久久久av影院| 久久午夜电影网| 国产精品毛片久久久久久久| 18欧美乱大交hd1984| 亚洲精品视频在线| 亚洲成人免费电影| 裸体一区二区三区| 国产99久久久国产精品免费看| 99视频热这里只有精品免费| 91久久国产最好的精华液| 91精品国产色综合久久不卡电影 | 日日摸夜夜添夜夜添精品视频| 美腿丝袜在线亚洲一区 | 亚洲人成7777| 五月婷婷久久综合| 另类成人小视频在线| 成人一区在线观看| 精品视频在线免费看| 久久综合色8888| 亚洲视频狠狠干| 青青草国产成人99久久| 成人免费视频caoporn| 欧美日韩一区二区三区不卡| 欧美精品一区二区三区一线天视频 | 亚洲视频在线一区观看| 秋霞午夜av一区二区三区| 不卡的电影网站| 日韩免费福利电影在线观看| 国产精品人成在线观看免费| 亚洲成人综合在线| 国产成人8x视频一区二区 | 黄一区二区三区| 欧美怡红院视频| 国产精品久久久一区麻豆最新章节| 亚洲高清不卡在线观看| 成人免费视频播放|