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

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

?? stm32f10x_adc.c

?? 用于STM32實時時鐘程序,可以代PC8563使用.
?? C
?? 第 1 頁 / 共 4 頁
字號:
void ADC_InjectedSequencerLengthConfig(ADC_TypeDef* ADCx, u8 Length)
{
  u32 tmpreg1 = 0;
  u8 tmpreg2 = 0;

  /* Check the parameters */
  assert(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 |= (u32)tmpreg2 << 20;
  /* Store the new register value */
  ADCx->JSQR = tmpreg1;
}

/*******************************************************************************
* Function Name  : ADC_SetInjectedOffset
* Description    : Set the injected channels conversion value offset
* Input          : - ADCx: where x can be 1 or 2 to select the ADC peripheral.
*                  - ADC_InjectedChannel: the ADC injected channel to set its
*                    offset. 
*                    This parameter can be one of the following values:
*                       - ADC_InjectedChannel_1: Injected Channel1 selected
*                       - ADC_InjectedChannel_2: Injected Channel2 selected
*                       - ADC_InjectedChannel_3: Injected Channel3 selected
*                       - ADC_InjectedChannel_4: Injected Channel4 selected
*                  - Offset: the offset value for the selected ADC injected channel
*                    This parameter must be a 12bit value.
* Output         : None
* Return         : None
*******************************************************************************/
void ADC_SetInjectedOffset(ADC_TypeDef* ADCx, u8 ADC_InjectedChannel, u16 Offset)
{
  /* Check the parameters */
  assert(IS_ADC_INJECTED_CHANNEL(ADC_InjectedChannel));
  assert(IS_ADC_OFFSET(Offset));  

  /* Set the selected injected channel data offset */
  *((u32 *)((*(u32*)&ADCx) + ADC_InjectedChannel)) = (u32)Offset;
}

/*******************************************************************************
* Function Name  : ADC_GetInjectedConversionValue
* Description    : Returns the ADC injected channel conversion result
* Input          : - ADCx: where x can be 1 or 2 to select the ADC peripheral.
*                  - ADC_InjectedChannel: the converted ADC injected channel.
*                    This parameter can be one of the following values:
*                       - ADC_InjectedChannel_1: Injected Channel1 selected
*                       - ADC_InjectedChannel_2: Injected Channel2 selected
*                       - ADC_InjectedChannel_3: Injected Channel3 selected
*                       - ADC_InjectedChannel_4: Injected Channel4 selected
* Output         : None
* Return         : The Data conversion value.
*******************************************************************************/
u16 ADC_GetInjectedConversionValue(ADC_TypeDef* ADCx, u8 ADC_InjectedChannel)
{
  /* Check the parameters */
  assert(IS_ADC_INJECTED_CHANNEL(ADC_InjectedChannel));

  /* Returns the selected injected channel conversion data value */
  return (u16) (*(u32*) (((*(u32*)&ADCx) + ADC_InjectedChannel + JDR_Offset)));
}

/*******************************************************************************
* Function Name  : ADC_AnalogWatchdogCmd
* Description    : Enables or disables the analog watchdog on single/all regular
*                  or injected channels
* Input          : - ADCx: where x can be 1 or 2 to select the ADC peripheral.
*                  - ADC_AnalogWatchdog: the ADC analog watchdog configuration.
*                    This parameter can be one of the following values:
*                       - ADC_AnalogWatchdog_SingleRegEnable: Analog watchdog on
*                         a single regular channel
*                       - ADC_AnalogWatchdog_SingleInjecEnable: Analog watchdog on
*                         a single injected channel
*                       - ADC_AnalogWatchdog_SingleRegOrInjecEnable: Analog 
*                         watchdog on a single regular or injected channel
*                       - ADC_AnalogWatchdog_AllRegEnable: Analog watchdog on
*                         all regular channel
*                       - ADC_AnalogWatchdog_AllInjecEnable: Analog watchdog on
*                         all injected channel
*                       - ADC_AnalogWatchdog_AllRegAllInjecEnable: Analog watchdog
*                         on all regular and injected channels
*                       - ADC_AnalogWatchdog_None: No channel guarded by the
*                         analog watchdog
* Output         : None
* Return         : None	  
*******************************************************************************/
void ADC_AnalogWatchdogCmd(ADC_TypeDef* ADCx, u32 ADC_AnalogWatchdog)
{
  u32 tmpreg = 0;

  /* Check the parameters */
  assert(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;
}

/*******************************************************************************
* Function Name  : ADC_AnalogWatchdogThresholdsConfig
* Description    : Configures the high and low thresholds of the analog watchdog.
* Input          : - ADCx: where x can be 1 or 2 to select the ADC peripheral.
*                  - HighThreshold: the ADC analog watchdog High threshold value.
*                    This parameter must be a 12bit value.
*                  - LowThreshold: the ADC analog watchdog Low threshold value.
*                    This parameter must be a 12bit value.
* Output         : None
* Return         : None
*******************************************************************************/
void ADC_AnalogWatchdogThresholdsConfig(ADC_TypeDef* ADCx, u16 HighThreshold,
                                        u16 LowThreshold)
{
  /* Check the parameters */
  assert(IS_ADC_THRESHOLD(HighThreshold));
  assert(IS_ADC_THRESHOLD(LowThreshold));

  /* Set the ADCx high threshold */
  ADCx->HTR = HighThreshold;
  /* Set the ADCx low threshold */
  ADCx->LTR = LowThreshold;
}

/*******************************************************************************
* Function Name  : ADC_AnalogWatchdogSingleChannelConfig
* Description    : Configures the analog watchdog guarded single channel
* Input          : - ADCx: where x can be 1 or 2 to select the ADC peripheral.
*                  - ADC_Channel: the ADC channel to configure for the analog
*                    watchdog. 
*                    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
* Output         : None
* Return         : None
*******************************************************************************/
void ADC_AnalogWatchdogSingleChannelConfig(ADC_TypeDef* ADCx, u8 ADC_Channel)
{
  u32 tmpreg = 0;

  /* Check the parameters */
  assert(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;
}

/*******************************************************************************
* Function Name  : ADC_TempSensorVrefintCmd
* Description    : Enables or disables the temperature sensor and Vrefint channel.
* Input          : - NewState: new state of the temperature sensor.
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : None
*******************************************************************************/
void ADC_TempSensorVrefintCmd(FunctionalState NewState)
{
  /* Check the parameters */
  assert(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;
  }
}

/*******************************************************************************
* Function Name  : ADC_GetFlagStatus
* Description    : Checks whether the specified ADC flag is set or not.
* Input          : - ADCx: where x can be 1 or 2 to select the ADC peripheral.
*                  - ADC_FLAG: specifies the flag to check. 
*                    This parameter can be one of the following values:
*                       - ADC_FLAG_AWD: Analog watchdog flag
*                       - ADC_FLAG_EOC: End of conversion flag
*                       - ADC_FLAG_JEOC: End of injected group conversion flag
*                       - ADC_FLAG_JSTRT: Start of injected group conversion flag
*                       - ADC_FLAG_STRT: Start of regular group conversion flag
* Output         : None
* Return         : The new state of ADC_FLAG (SET or RESET).
*******************************************************************************/
FlagStatus ADC_GetFlagStatus(ADC_TypeDef* ADCx, u8 ADC_FLAG)
{
  FlagStatus bitstatus = RESET;

  /* Check the parameters */
  assert(IS_ADC_GET_FLAG(ADC_FLAG));

  /* Check the status of the specified ADC flag */
  if ((ADCx->SR & ADC_FLAG) != (u8)RESET)
  {
    /* ADC_FLAG is set */
    bitstatus = SET;
  }
  else
  {
    /* ADC_FLAG is reset */
    bitstatus = RESET;
  }
  /* Return the ADC_FLAG status */
  return  bitstatus;
}

/*******************************************************************************
* Function Name  : ADC_ClearFlag
* Description    : Clears the ADCx's pending flags.
* Input          : - ADCx: where x can be 1 or 2 to select the ADC peripheral.
*                  - ADC_FLAG: specifies the flag to clear. 
*                    This parameter can be any combination of the following values:
*                       - ADC_FLAG_AWD: Analog watchdog flag
*                       - ADC_FLAG_EOC: End of conversion flag
*                       - ADC_FLAG_JEOC: End of injected group conversion flag
*                       - ADC_FLAG_JSTRT: Start of injected group conversion flag
*                       - ADC_FLAG_STRT: Start of regular group conversion flag
* Output         : None
* Return         : None
*******************************************************************************/
void ADC_ClearFlag(ADC_TypeDef* ADCx, u8 ADC_FLAG)
{
  /* Check the parameters */
  assert(IS_ADC_CLEAR_FLAG(ADC_FLAG));

  /* Clear the selected ADC flags */
  ADCx->SR &= ~(u32)ADC_FLAG;
}

/*******************************************************************************
* Function Name  : ADC_GetITStatus
* Description    : Checks whether the specified ADC interrupt has occurred or not.
* Input          : - ADCx: where x can be 1 or 2 to select the ADC peripheral.
*                  - ADC_IT: specifies the ADC interrupt source to check. 
*                    This parameter can be one of the following values:
*                       - ADC_IT_EOC: End of conversion interrupt mask
*                       - ADC_IT_AWD: Analog watchdog interrupt mask
*                       - ADC_IT_JEOC: End of injected conversion interrupt mask
* Output         : None
* Return         : The new state of ADC_IT (SET or RESET).
*******************************************************************************/
ITStatus ADC_GetITStatus(ADC_TypeDef* ADCx, u16 ADC_IT)
{
  ITStatus bitstatus = RESET;
  u8 itmask = 0, enablestatus;

  /* Check the parameters */
  assert(IS_ADC_GET_IT(ADC_IT));

  /* Get the ADC IT index */
  itmask = (u8)(ADC_IT >> 8);

  /* Get the ADC_IT enable bit status */
  enablestatus = (ADCx->CR1 & (u8)ADC_IT) ;

  /* Check the status of the specified ADC interrupt */
  if (((ADCx->SR & itmask) != (u8)RESET) && enablestatus)
  {
    /* ADC_IT is set */
    bitstatus = SET;
  }
  else
  {
    /* ADC_IT is reset */
    bitstatus = RESET;
  }
  /* Return the ADC_IT status */
  return  bitstatus;
}

/*******************************************************************************
* Function Name  : ADC_ClearITPendingBit
* Description    : Clears the ADCx抯 interrupt pending bits.
* Input          : - ADC_IT: specifies the ADC interrupt pending bit to clear.
*                    This parameter can be any combination of the following values:
*                       - ADC_IT_EOC: End of conversion interrupt mask
*                       - ADC_IT_AWD: Analog watchdog interrupt mask
*                       - ADC_IT_JEOC: End of injected conversion interrupt mask
* Output         : None
* Return         : None
*******************************************************************************/
void ADC_ClearITPendingBit(ADC_TypeDef* ADCx, u16 ADC_IT)
{
  u8 itmask = 0;

  /* Check the parameters */
  assert(IS_ADC_IT(ADC_IT));

  /* Get the ADC IT index */
  itmask = (u8)(ADC_IT >> 8);

  /* Clear the selected ADC interrupt pending bits */
  ADCx->SR &= ~(u32)itmask;
}

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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本一二三不卡| 欧美久久婷婷综合色| 成人av集中营| 激情文学综合插| 精品亚洲aⅴ乱码一区二区三区| 色菇凉天天综合网| 一区二区三区不卡视频| 91视频你懂的| 亚洲成人午夜电影| 这里只有精品免费| 老司机精品视频一区二区三区| 99精品久久99久久久久| 欧美日韩一区精品| 亚洲综合图片区| 欧美综合久久久| 亚洲一区二区综合| 欧美一级理论性理论a| 国产综合色视频| 欧美大片一区二区| 国产成人精品网址| 亚洲va天堂va国产va久| 26uuu色噜噜精品一区| 精品一区二区三区免费视频| 久久影音资源网| 在线播放/欧美激情| 国产精品一区二区在线播放| 欧美激情一区二区三区不卡| 91麻豆精品国产91久久久资源速度| 九九久久精品视频| 午夜精品在线视频一区| 中文字幕精品一区| 欧美一区二区精美| 色八戒一区二区三区| 国产在线精品免费| 日韩高清一区在线| 亚洲精品一卡二卡| 中文字幕乱码日本亚洲一区二区| 欧美视频一区二区| 国产在线精品一区二区夜色| 亚洲高清一区二区三区| 亚洲欧洲另类国产综合| 久久久久久久精| 一本在线高清不卡dvd| 喷白浆一区二区| 一区二区三区91| 日韩精品成人一区二区三区| 亚洲一区二区三区三| 一区二区欧美精品| 亚洲va欧美va人人爽午夜| 亚洲一区二区三区三| 美女爽到高潮91| 精品中文字幕一区二区| 亚洲激情av在线| 午夜一区二区三区视频| 欧美a一区二区| 欧美精品一区二区三区高清aⅴ| 欧美日韩视频第一区| 欧美一级淫片007| 国产日韩在线不卡| 丝袜亚洲精品中文字幕一区| 欧美精品一区男女天堂| 91久久一区二区| 正在播放一区二区| 中文字幕在线不卡视频| 日本系列欧美系列| 国产麻豆视频一区二区| 高清不卡在线观看| 日韩一级大片在线| 亚洲免费电影在线| 久久99精品国产麻豆婷婷 | 亚洲欧洲精品一区二区精品久久久 | 欧美在线一区二区三区| 国产喂奶挤奶一区二区三区| 久久九九影视网| 久久嫩草精品久久久精品| 精品成人一区二区三区| 亚洲国产成人av好男人在线观看| 国产一区二区精品久久99| 一区二区三区资源| 久久精品72免费观看| 成人免费视频app| 91精品一区二区三区在线观看| 日韩码欧中文字| 国产精品综合二区| 日韩视频一区二区| 中文字幕亚洲视频| 成人污视频在线观看| 在线综合视频播放| 亚洲国产日韩在线一区模特| 高清久久久久久| 久久夜色精品国产欧美乱极品| 天天影视网天天综合色在线播放 | 日韩久久免费av| 精品国产乱码久久久久久老虎| 日韩欧美国产电影| 日韩电影在线看| 精品国产一区二区三区不卡 | av在线播放成人| 91精品国产综合久久香蕉的特点 | 久久99精品国产91久久来源| 欧美电影精品一区二区| 国产精品主播直播| 欧美视频一区二区三区四区| 国产亚洲污的网站| 一区二区在线观看免费 | 久久 天天综合| 欧美日韩高清一区二区不卡| 国产原创一区二区三区| 亚洲一区二区三区小说| 国产欧美日韩三区| 欧美精品日日鲁夜夜添| 丁香五精品蜜臀久久久久99网站| 1区2区3区欧美| 欧美视频一区二区三区在线观看| 青青草精品视频| 国产精品久久久久影院老司| 91亚洲午夜精品久久久久久| 五月婷婷色综合| 欧美影院精品一区| 成人激情免费电影网址| 精品一区二区三区在线视频| 亚洲二区视频在线| 国产精品久久久久久久久果冻传媒| 91精品午夜视频| 91精品在线观看入口| 日韩视频永久免费| 色偷偷成人一区二区三区91 | 天堂成人免费av电影一区| 中文字幕一区二区三区蜜月| 国产亚洲欧美色| 精品国产免费久久| 欧美一区二区在线看| 欧美日韩一级片网站| 一本大道久久a久久综合| 国产激情一区二区三区| 99久久综合国产精品| 91黄色激情网站| 欧美少妇一区二区| 久久久久久久久免费| 国产精品欧美经典| 一区二区三区四区亚洲| 亚洲黄色av一区| 欧美aⅴ一区二区三区视频| 日日夜夜免费精品视频| 懂色av一区二区三区免费观看| 成人国产精品免费观看| 国产在线精品一区在线观看麻豆| 久久精品二区亚洲w码| 三级不卡在线观看| 紧缚捆绑精品一区二区| 欧美专区亚洲专区| 中文字幕免费在线观看视频一区| 亚洲一区在线观看免费观看电影高清| 免费人成黄页网站在线一区二区| 国产91富婆露脸刺激对白| 91丨porny丨国产入口| 日韩精品一区二区三区视频 | 中文字幕乱码日本亚洲一区二区| 亚洲视频一区二区免费在线观看| 日韩精品每日更新| 91在线视频18| 精品国产伦一区二区三区免费| 亚洲综合在线电影| 久久精品av麻豆的观看方式| 另类小说一区二区三区| 欧美在线色视频| 五月婷婷另类国产| 欧美午夜免费电影| 日韩影院在线观看| 欧美日韩一级黄| 亚洲电影第三页| 欧美日韩精品久久久| 亚洲欧美国产三级| 成人午夜视频在线| 一区二区三区蜜桃| 欧美酷刑日本凌虐凌虐| 久久99国产精品麻豆| 国产亚洲综合在线| 国产黄人亚洲片| 亚洲欧美日韩小说| 色偷偷久久一区二区三区| 一区二区三区免费在线观看| 精品视频一区二区不卡| 亚洲高清免费在线| 日韩欧美国产综合| 欧美中文字幕一区二区三区亚洲| 亚洲免费观看高清完整| 一本色道久久加勒比精品 | 天堂午夜影视日韩欧美一区二区| 色婷婷av一区| 视频在线观看国产精品| 欧美精品一区二区久久久| 国产成人免费网站| 日韩影院免费视频| 日本网站在线观看一区二区三区| 国产欧美日韩三区| 91精品国产麻豆国产自产在线| 成人美女视频在线观看| 久草在线在线精品观看| 日本vs亚洲vs韩国一区三区|