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

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

?? stm32f10x_adc.c

?? 英倍特公司的STM32V100開發(fā)板配套庫(kù)函數(shù)及例程源代碼
?? C
?? 第 1 頁(yè) / 共 4 頁(yè)
字號(hào):
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****/

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美成人aa大片| 日本韩国欧美三级| 国产精品不卡一区| 国产成人三级在线观看| 久久老女人爱爱| 欧美吻胸吃奶大尺度电影| 亚洲一区二区三区自拍| 久久综合成人精品亚洲另类欧美 | 国产精品白丝在线| 91精品国产欧美一区二区18 | 在线看日本不卡| 国产成人福利片| 人禽交欧美网站| 精品日本一线二线三线不卡| 捆绑紧缚一区二区三区视频 | 精品写真视频在线观看| 日韩欧美www| 国产一区二区三区免费| 亚洲一区二区视频| 欧美视频日韩视频在线观看| 懂色一区二区三区免费观看| 免费成人在线视频观看| 亚洲国产日韩综合久久精品| 欧美日韩mp4| 色综合一个色综合亚洲| 国产成人av一区| 九九久久精品视频| 日韩av二区在线播放| 亚洲va欧美va国产va天堂影院| 国产精品免费视频网站| 久久久久久久综合狠狠综合| 欧美成va人片在线观看| 国产不卡在线播放| 国产专区综合网| 一区二区三区欧美亚洲| 中文字幕一区二区三区在线播放 | 一二三区精品福利视频| 日韩视频在线你懂得| 欧美午夜片在线观看| 色婷婷久久一区二区三区麻豆| 日欧美一区二区| 亚洲18影院在线观看| 久久久久9999亚洲精品| 2019国产精品| 在线免费观看一区| 91色porny蝌蚪| 91免费视频大全| 色综合天天综合狠狠| 久久国产尿小便嘘嘘尿| 男男成人高潮片免费网站| 婷婷夜色潮精品综合在线| 亚洲成人资源在线| 亚洲成人动漫在线免费观看| 亚洲成a人在线观看| 亚洲电影一级片| 国产精品日韩精品欧美在线| 国产精品视频一二三| 国产欧美中文在线| 国产精品久久久久久久久图文区| 国产精品久久免费看| 日韩视频免费直播| 日韩欧美另类在线| 久久精品视频免费| 国产精品天美传媒| 亚洲影院在线观看| 国产精品成人一区二区艾草 | 成人精品国产福利| 青青草97国产精品免费观看| 久久精品国产在热久久| 国产久卡久卡久卡久卡视频精品| 日本免费新一区视频| 激情图区综合网| voyeur盗摄精品| 国产成人精品免费网站| a亚洲天堂av| 欧美日本高清视频在线观看| 精品久久免费看| 精品国产成人在线影院| 国产日韩精品一区二区三区在线| 亚洲精品写真福利| 美腿丝袜亚洲三区| 99精品1区2区| 日韩视频一区二区在线观看| 国产精品蜜臀在线观看| 国产精品视频一二三区| 国产欧美日韩在线观看| 久久精品视频一区二区| 欧美精品一区二区三区在线| 日韩欧美中文字幕公布| 欧美精品一卡二卡| 久久久五月婷婷| 亚洲美女淫视频| 国产乱淫av一区二区三区 | 成人免费视频播放| 国产激情91久久精品导航| 国产精品一区二区三区四区| 欧美少妇xxx| 欧美日韩在线播放| 国产欧美精品一区| 中文字幕一区日韩精品欧美| 奇米影视在线99精品| av在线一区二区| 精品国内二区三区| 亚洲一区二区三区国产| 国产成人精品一区二| 波多野结衣中文字幕一区二区三区 | 美女视频黄a大片欧美| 天天操天天色综合| 蜜臀av性久久久久蜜臀av麻豆| 国产成人午夜视频| 91精品国产91久久综合桃花| 中文字幕视频一区二区三区久| 免费成人小视频| 欧美日韩在线一区二区| 国产蜜臀97一区二区三区| 另类欧美日韩国产在线| 国产一区在线观看麻豆| 91精品国产91综合久久蜜臀| 一区二区三区在线视频免费| 国产成人av一区| 欧美体内she精高潮| 欧美一卡二卡在线观看| 一区二区不卡在线视频 午夜欧美不卡在 | 精品日韩一区二区三区免费视频| 精品国产百合女同互慰| 日本欧美在线看| 粉嫩av一区二区三区| 欧美视频在线一区二区三区| 精品国产一区久久| 日韩极品在线观看| 在线成人免费观看| 日本一区二区三区在线不卡 | 99久免费精品视频在线观看| 欧美电视剧在线看免费| 欧美国产激情一区二区三区蜜月| 蜜臀久久久99精品久久久久久| 国产91精品久久久久久久网曝门| 日本电影欧美片| 亚洲精品久久7777| 老司机免费视频一区二区| av资源网一区| 日韩视频中午一区| 免费观看一级欧美片| 91精品国产综合久久婷婷香蕉| 国产喷白浆一区二区三区| 亚洲1区2区3区4区| 欧美日本不卡视频| 亚洲123区在线观看| 欧美美女一区二区三区| 舔着乳尖日韩一区| 91精品国产综合久久久久久| 日本中文字幕不卡| 99re热这里只有精品视频| 中文字幕第一区综合| 日韩精品久久理论片| 成人黄色小视频| 日韩精品一区二区三区在线播放| 国产精品家庭影院| 99国产精品久久久| 久久亚洲精品小早川怜子| 国产精品一线二线三线精华| 中文字幕av不卡| 久久草av在线| 欧美一区二区三区视频免费| 麻豆精品视频在线观看免费 | 久久久三级国产网站| 国产呦萝稀缺另类资源| 国产精品污www在线观看| 激情亚洲综合在线| 在线综合亚洲欧美在线视频| 国内成人免费视频| 欧美一区二区三区思思人| 亚洲狠狠爱一区二区三区| hitomi一区二区三区精品| 国产日韩欧美麻豆| 一本色道久久综合精品竹菊| 亚洲成人福利片| 精品1区2区3区| 国产精品一卡二卡| 亚洲三级免费电影| 99免费精品视频| 强制捆绑调教一区二区| 欧美激情一区二区三区| 国产成人高清视频| 亚洲最大色网站| 91官网在线免费观看| 亚洲精品日韩一| 欧美一级欧美三级在线观看| 国产成人在线网站| 日本一区二区成人在线| 国产成人av电影免费在线观看| 亚洲成人av电影在线| 欧美精品国产精品| 三级不卡在线观看| 国产精品视频yy9299一区| 成人av网站大全| 亚洲天堂成人在线观看| 色偷偷久久人人79超碰人人澡| 免费成人深夜小野草| 亚洲精品国产精品乱码不99|