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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? stm32f10x_adc.c

?? 學(xué)習(xí)stm32定時(shí)器
?? C
?? 第 1 頁 / 共 4 頁
字號:
  /* Store the new register value */
  ADCx->JSQR = tmpreg1;
}

/**
  * @brief  Configures the sequencer length for injected channels
  * @param  ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
  * @param  Length: The sequencer length. 
  *   This parameter must be a number between 1 to 4.
  * @retval None
  */
void ADC_InjectedSequencerLengthConfig(ADC_TypeDef* ADCx, uint8_t Length)
{
  uint32_t tmpreg1 = 0;
  uint32_t tmpreg2 = 0;
  /* Check the parameters */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));
  assert_param(IS_ADC_INJECTED_LENGTH(Length));
  
  /* Get the old register value */
  tmpreg1 = ADCx->JSQR;
  /* Clear the old injected sequnence lenght JL bits */
  tmpreg1 &= JSQR_JL_Reset;
  /* Set the injected sequnence lenght JL bits */
  tmpreg2 = Length - 1; 
  tmpreg1 |= tmpreg2 << 20;
  /* Store the new register value */
  ADCx->JSQR = tmpreg1;
}

/**
  * @brief  Set the injected channels conversion value offset
  * @param  ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
  * @param  ADC_InjectedChannel: the ADC injected channel to set its offset. 
  *   This parameter can be one of the following values:
  *     @arg ADC_InjectedChannel_1: Injected Channel1 selected
  *     @arg ADC_InjectedChannel_2: Injected Channel2 selected
  *     @arg ADC_InjectedChannel_3: Injected Channel3 selected
  *     @arg ADC_InjectedChannel_4: Injected Channel4 selected
  * @param  Offset: the offset value for the selected ADC injected channel
  *   This parameter must be a 12bit value.
  * @retval None
  */
void ADC_SetInjectedOffset(ADC_TypeDef* ADCx, uint8_t ADC_InjectedChannel, uint16_t Offset)
{
  __IO uint32_t tmp = 0;
  
  /* Check the parameters */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));
  assert_param(IS_ADC_INJECTED_CHANNEL(ADC_InjectedChannel));
  assert_param(IS_ADC_OFFSET(Offset));  
  
  tmp = (uint32_t)ADCx;
  tmp += ADC_InjectedChannel;
  
  /* Set the selected injected channel data offset */
  *(__IO uint32_t *) tmp = (uint32_t)Offset;
}

/**
  * @brief  Returns the ADC injected channel conversion result
  * @param  ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
  * @param  ADC_InjectedChannel: the converted ADC injected channel.
  *   This parameter can be one of the following values:
  *     @arg ADC_InjectedChannel_1: Injected Channel1 selected
  *     @arg ADC_InjectedChannel_2: Injected Channel2 selected
  *     @arg ADC_InjectedChannel_3: Injected Channel3 selected
  *     @arg ADC_InjectedChannel_4: Injected Channel4 selected
  * @retval The Data conversion value.
  */
uint16_t ADC_GetInjectedConversionValue(ADC_TypeDef* ADCx, uint8_t ADC_InjectedChannel)
{
  __IO uint32_t tmp = 0;
  
  /* Check the parameters */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));
  assert_param(IS_ADC_INJECTED_CHANNEL(ADC_InjectedChannel));

  tmp = (uint32_t)ADCx;
  tmp += ADC_InjectedChannel + JDR_Offset;
  
  /* Returns the selected injected channel conversion data value */
  return (uint16_t) (*(__IO uint32_t*)  tmp);   
}

/**
  * @brief  Enables or disables the analog watchdog on single/all regular
  *         or injected channels
  * @param  ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
  * @param  ADC_AnalogWatchdog: the ADC analog watchdog configuration.
  *   This parameter can be one of the following values:
  *     @arg ADC_AnalogWatchdog_SingleRegEnable: Analog watchdog on a single regular channel
  *     @arg ADC_AnalogWatchdog_SingleInjecEnable: Analog watchdog on a single injected channel
  *     @arg ADC_AnalogWatchdog_SingleRegOrInjecEnable: Analog watchdog on a single regular or injected channel
  *     @arg ADC_AnalogWatchdog_AllRegEnable: Analog watchdog on  all regular channel
  *     @arg ADC_AnalogWatchdog_AllInjecEnable: Analog watchdog on  all injected channel
  *     @arg ADC_AnalogWatchdog_AllRegAllInjecEnable: Analog watchdog on all regular and injected channels
  *     @arg ADC_AnalogWatchdog_None: No channel guarded by the analog watchdog
  * @retval None	  
  */
void ADC_AnalogWatchdogCmd(ADC_TypeDef* ADCx, uint32_t ADC_AnalogWatchdog)
{
  uint32_t tmpreg = 0;
  /* Check the parameters */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));
  assert_param(IS_ADC_ANALOG_WATCHDOG(ADC_AnalogWatchdog));
  /* Get the old register value */
  tmpreg = ADCx->CR1;
  /* Clear AWDEN, AWDENJ and AWDSGL bits */
  tmpreg &= CR1_AWDMode_Reset;
  /* Set the analog watchdog enable mode */
  tmpreg |= ADC_AnalogWatchdog;
  /* Store the new register value */
  ADCx->CR1 = tmpreg;
}

/**
  * @brief  Configures the high and low thresholds of the analog watchdog.
  * @param  ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
  * @param  HighThreshold: the ADC analog watchdog High threshold value.
  *   This parameter must be a 12bit value.
  * @param  LowThreshold: the ADC analog watchdog Low threshold value.
  *   This parameter must be a 12bit value.
  * @retval None
  */
void ADC_AnalogWatchdogThresholdsConfig(ADC_TypeDef* ADCx, uint16_t HighThreshold,
                                        uint16_t LowThreshold)
{
  /* Check the parameters */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));
  assert_param(IS_ADC_THRESHOLD(HighThreshold));
  assert_param(IS_ADC_THRESHOLD(LowThreshold));
  /* Set the ADCx high threshold */
  ADCx->HTR = HighThreshold;
  /* Set the ADCx low threshold */
  ADCx->LTR = LowThreshold;
}

/**
  * @brief  Configures the analog watchdog guarded single channel
  * @param  ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
  * @param  ADC_Channel: the ADC channel to configure for the analog watchdog. 
  *   This parameter can be one of the following values:
  *     @arg ADC_Channel_0: ADC Channel0 selected
  *     @arg ADC_Channel_1: ADC Channel1 selected
  *     @arg ADC_Channel_2: ADC Channel2 selected
  *     @arg ADC_Channel_3: ADC Channel3 selected
  *     @arg ADC_Channel_4: ADC Channel4 selected
  *     @arg ADC_Channel_5: ADC Channel5 selected
  *     @arg ADC_Channel_6: ADC Channel6 selected
  *     @arg ADC_Channel_7: ADC Channel7 selected
  *     @arg ADC_Channel_8: ADC Channel8 selected
  *     @arg ADC_Channel_9: ADC Channel9 selected
  *     @arg ADC_Channel_10: ADC Channel10 selected
  *     @arg ADC_Channel_11: ADC Channel11 selected
  *     @arg ADC_Channel_12: ADC Channel12 selected
  *     @arg ADC_Channel_13: ADC Channel13 selected
  *     @arg ADC_Channel_14: ADC Channel14 selected
  *     @arg ADC_Channel_15: ADC Channel15 selected
  *     @arg ADC_Channel_16: ADC Channel16 selected
  *     @arg ADC_Channel_17: ADC Channel17 selected
  * @retval None
  */
void ADC_AnalogWatchdogSingleChannelConfig(ADC_TypeDef* ADCx, uint8_t ADC_Channel)
{
  uint32_t tmpreg = 0;
  /* Check the parameters */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));
  assert_param(IS_ADC_CHANNEL(ADC_Channel));
  /* Get the old register value */
  tmpreg = ADCx->CR1;
  /* Clear the Analog watchdog channel select bits */
  tmpreg &= CR1_AWDCH_Reset;
  /* Set the Analog watchdog channel */
  tmpreg |= ADC_Channel;
  /* Store the new register value */
  ADCx->CR1 = tmpreg;
}

/**
  * @brief  Enables or disables the temperature sensor and Vrefint channel.
  * @param  NewState: new state of the temperature sensor.
  *   This parameter can be: ENABLE or DISABLE.
  * @retval None
  */
void ADC_TempSensorVrefintCmd(FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_FUNCTIONAL_STATE(NewState));
  if (NewState != DISABLE)
  {
    /* Enable the temperature sensor and Vrefint channel*/
    ADC1->CR2 |= CR2_TSVREFE_Set;
  }
  else
  {
    /* Disable the temperature sensor and Vrefint channel*/
    ADC1->CR2 &= CR2_TSVREFE_Reset;
  }
}

/**
  * @brief  Checks whether the specified ADC flag is set or not.
  * @param  ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
  * @param  ADC_FLAG: specifies the flag to check. 
  *   This parameter can be one of the following values:
  *     @arg ADC_FLAG_AWD: Analog watchdog flag
  *     @arg ADC_FLAG_EOC: End of conversion flag
  *     @arg ADC_FLAG_JEOC: End of injected group conversion flag
  *     @arg ADC_FLAG_JSTRT: Start of injected group conversion flag
  *     @arg ADC_FLAG_STRT: Start of regular group conversion flag
  * @retval The new state of ADC_FLAG (SET or RESET).
  */
FlagStatus ADC_GetFlagStatus(ADC_TypeDef* ADCx, uint8_t ADC_FLAG)
{
  FlagStatus bitstatus = RESET;
  /* Check the parameters */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));
  assert_param(IS_ADC_GET_FLAG(ADC_FLAG));
  /* Check the status of the specified ADC flag */
  if ((ADCx->SR & ADC_FLAG) != (uint8_t)RESET)
  {
    /* ADC_FLAG is set */
    bitstatus = SET;
  }
  else
  {
    /* ADC_FLAG is reset */
    bitstatus = RESET;
  }
  /* Return the ADC_FLAG status */
  return  bitstatus;
}

/**
  * @brief  Clears the ADCx's pending flags.
  * @param  ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
  * @param  ADC_FLAG: specifies the flag to clear. 
  *   This parameter can be any combination of the following values:
  *     @arg ADC_FLAG_AWD: Analog watchdog flag
  *     @arg ADC_FLAG_EOC: End of conversion flag
  *     @arg ADC_FLAG_JEOC: End of injected group conversion flag
  *     @arg ADC_FLAG_JSTRT: Start of injected group conversion flag
  *     @arg ADC_FLAG_STRT: Start of regular group conversion flag
  * @retval None
  */
void ADC_ClearFlag(ADC_TypeDef* ADCx, uint8_t ADC_FLAG)
{
  /* Check the parameters */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));
  assert_param(IS_ADC_CLEAR_FLAG(ADC_FLAG));
  /* Clear the selected ADC flags */
  ADCx->SR = ~(uint32_t)ADC_FLAG;
}

/**
  * @brief  Checks whether the specified ADC interrupt has occurred or not.
  * @param  ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
  * @param  ADC_IT: specifies the ADC interrupt source to check. 
  *   This parameter can be one of the following values:
  *     @arg ADC_IT_EOC: End of conversion interrupt mask
  *     @arg ADC_IT_AWD: Analog watchdog interrupt mask
  *     @arg ADC_IT_JEOC: End of injected conversion interrupt mask
  * @retval The new state of ADC_IT (SET or RESET).
  */
ITStatus ADC_GetITStatus(ADC_TypeDef* ADCx, uint16_t ADC_IT)
{
  ITStatus bitstatus = RESET;
  uint32_t itmask = 0, enablestatus = 0;
  /* Check the parameters */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));
  assert_param(IS_ADC_GET_IT(ADC_IT));
  /* Get the ADC IT index */
  itmask = ADC_IT >> 8;
  /* Get the ADC_IT enable bit status */
  enablestatus = (ADCx->CR1 & (uint8_t)ADC_IT) ;
  /* Check the status of the specified ADC interrupt */
  if (((ADCx->SR & itmask) != (uint32_t)RESET) && enablestatus)
  {
    /* ADC_IT is set */
    bitstatus = SET;
  }
  else
  {
    /* ADC_IT is reset */
    bitstatus = RESET;
  }
  /* Return the ADC_IT status */
  return  bitstatus;
}

/**
  * @brief  Clears the ADCx's interrupt pending bits.
  * @param  ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
  * @param  ADC_IT: specifies the ADC interrupt pending bit to clear.
  *   This parameter can be any combination of the following values:
  *     @arg ADC_IT_EOC: End of conversion interrupt mask
  *     @arg ADC_IT_AWD: Analog watchdog interrupt mask
  *     @arg ADC_IT_JEOC: End of injected conversion interrupt mask
  * @retval None
  */
void ADC_ClearITPendingBit(ADC_TypeDef* ADCx, uint16_t ADC_IT)
{
  uint8_t itmask = 0;
  /* Check the parameters */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));
  assert_param(IS_ADC_IT(ADC_IT));
  /* Get the ADC IT index */
  itmask = (uint8_t)(ADC_IT >> 8);
  /* Clear the selected ADC interrupt pending bits */
  ADCx->SR = ~(uint32_t)itmask;
}

/**
  * @}
  */

/**
  * @}
  */

/**
  * @}
  */

/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一区二区三区小说| 国产福利一区在线| 精品久久久久久久一区二区蜜臀| 国产成人av电影免费在线观看| 一区精品在线播放| 精品免费视频.| 色天天综合色天天久久| 国产又粗又猛又爽又黄91精品| 一区二区免费在线播放| 国产欧美一区二区三区网站| 成人黄页在线观看| 亚洲婷婷在线视频| 中文字幕国产精品一区二区| 91久久精品一区二区三| 国产精品羞羞答答xxdd| 日本午夜精品一区二区三区电影| 亚洲日本在线天堂| 久久亚洲二区三区| 欧美一区二区日韩一区二区| 欧洲国内综合视频| 99久久精品免费看国产免费软件| 国产剧情在线观看一区二区| 美国一区二区三区在线播放| 亚洲尤物视频在线| 亚洲三级在线观看| 中文字幕成人av| 国产丝袜在线精品| 精品久久久久久综合日本欧美 | 一区二区三区资源| 久久蜜桃一区二区| 欧美va在线播放| 在线电影院国产精品| 91国偷自产一区二区使用方法| 成人听书哪个软件好| 国产毛片一区二区| 久久99精品久久久久久动态图 | 欧美aa在线视频| 亚洲高清中文字幕| 亚洲一卡二卡三卡四卡五卡| 亚洲人成7777| 亚洲三级久久久| 中文字幕一区二区视频| 国产精品色呦呦| 亚洲国产中文字幕在线视频综合 | 日韩电影在线观看网站| 午夜久久电影网| 午夜精品一区二区三区免费视频 | av一二三不卡影片| 成人午夜大片免费观看| 粉嫩aⅴ一区二区三区四区五区| 国产精品1024| 丁香激情综合五月| 99re6这里只有精品视频在线观看| 成人短视频下载| 91玉足脚交白嫩脚丫在线播放| 91免费在线看| 欧美一a一片一级一片| 欧美日韩精品欧美日韩精品一综合| 欧美日韩一区二区三区视频| 欧美日韩免费观看一区二区三区| 欧美日韩国产一区二区三区地区| 欧美美女一区二区三区| 欧美成人a∨高清免费观看| 欧美精品一区二| 亚洲国产高清不卡| 1024精品合集| 亚洲成av人**亚洲成av**| 蜜臀av在线播放一区二区三区| 国产成人亚洲综合色影视| 91在线免费视频观看| 欧美日韩第一区日日骚| 精品国产精品网麻豆系列 | 精品久久一区二区三区| 国产欧美综合在线观看第十页 | 一区二区成人在线视频 | 午夜电影网亚洲视频| 精品一区二区三区免费视频| 高清成人免费视频| 精品视频免费在线| 亚洲一区二区视频在线| 免费av网站大全久久| 成人国产在线观看| 91精品在线一区二区| 久久久久久久久久久99999| 成人欧美一区二区三区白人| 天堂午夜影视日韩欧美一区二区| 精彩视频一区二区| 色婷婷亚洲婷婷| 精品日产卡一卡二卡麻豆| 综合欧美一区二区三区| 蜜臀精品一区二区三区在线观看| 99久久99精品久久久久久| 欧美精品视频www在线观看| 国产亚洲成年网址在线观看| 亚洲福利电影网| 国产精品88888| 欧美图区在线视频| 欧美激情一区二区三区四区| 日韩国产精品久久| 99久久久精品| 久久综合精品国产一区二区三区 | 一区二区三区日韩欧美| 国产一区二区电影| 91精品免费在线| 亚洲女同一区二区| 国产精品18久久久久久vr| 欧美日韩国产首页在线观看| 国产精品久久久久久久岛一牛影视| 日韩精品色哟哟| 日本道免费精品一区二区三区| 精品国产一区二区国模嫣然| 亚洲国产中文字幕在线视频综合 | 欧美精品v国产精品v日韩精品| 国产精品美女久久久久aⅴ| 卡一卡二国产精品| 欧美日韩一区成人| 亚洲精品国产视频| 99精品偷自拍| 国产片一区二区三区| 精品一区二区三区免费观看| 欧美电影一区二区| 香蕉成人啪国产精品视频综合网| 91美女蜜桃在线| 国产精品久久久久一区| 成人精品一区二区三区中文字幕| 精品国产免费久久| 麻豆91精品91久久久的内涵| 欧美精品在线观看播放| 亚洲v中文字幕| 欧美中文一区二区三区| 亚洲自拍另类综合| 91福利视频网站| 一区二区三区视频在线看| 99久久免费国产| 亚洲欧美怡红院| 91亚洲精品久久久蜜桃网站| 国产精品久线在线观看| 成人黄色a**站在线观看| 国产精品拍天天在线| 成人黄色av网站在线| 中文字幕一区二区三区不卡在线 | 日韩欧美国产wwwww| 午夜电影网亚洲视频| 欧美老女人在线| 亚洲一本大道在线| 欧美日韩国产成人在线免费| 天堂影院一区二区| 日韩午夜在线影院| 国产精品自拍毛片| 欧美高清在线精品一区| eeuss鲁一区二区三区| 亚洲少妇中出一区| 久久精品网站免费观看| 国产麻豆成人传媒免费观看| 亚洲国产电影在线观看| 色系网站成人免费| 日韩电影免费在线观看网站| 日韩欧美专区在线| 国产91丝袜在线观看| 亚洲免费观看高清在线观看| 在线精品国精品国产尤物884a| 五月开心婷婷久久| 欧美精品一区视频| eeuss影院一区二区三区| 亚洲永久精品国产| 精品久久久久久久久久久院品网| 国产伦精品一区二区三区在线观看 | 久久亚洲私人国产精品va媚药| 国产大陆亚洲精品国产| 亚洲精品视频自拍| 欧美一区二区三区四区五区| 国产另类ts人妖一区二区| 亚洲欧美日韩成人高清在线一区| 欧美日韩在线直播| 精品影院一区二区久久久| 1024国产精品| 日韩三级视频在线观看| www.日本不卡| 视频一区中文字幕国产| 欧美激情中文不卡| 欧美福利视频一区| 丁香一区二区三区| 日韩精品乱码免费| 国产精品超碰97尤物18| 日韩色视频在线观看| 91视频精品在这里| 美女脱光内衣内裤视频久久影院| 欧美国产日产图区| 91精品国产色综合久久久蜜香臀| 国产高清无密码一区二区三区| 亚洲一区二区在线免费看| 欧美精品一区二区三区在线| 99精品在线免费| 国模套图日韩精品一区二区| 洋洋成人永久网站入口| 久久久久久久久久美女| 在线成人小视频| 色哟哟在线观看一区二区三区| 久久电影国产免费久久电影| 亚洲国产欧美在线|