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

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

?? stm32f10x_adc.c

?? STM32F10x USB Library V1.0
?? C
?? 第 1 頁 / 共 4 頁
字號:
*******************************************************************************/
void ADC_InjectedSequencerLengthConfig(ADC_TypeDef* ADCx, u8 Length)
{
  u32 tmpreg1 = 0;
  u8 tmpreg2 = 0;

  /* Check the parameters */
  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 |= (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_param(IS_ADC_INJECTED_CHANNEL(ADC_InjectedChannel));
  assert_param(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_param(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_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;
}

/*******************************************************************************
* 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_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;
}

/*******************************************************************************
* 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_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;
}

/*******************************************************************************
* 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_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;
  }
}

/*******************************************************************************
* 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_param(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_param(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_param(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_param(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一区二区三区免费野_久草精品视频
日韩情涩欧美日韩视频| 精品国产一二三| 337p日本欧洲亚洲大胆色噜噜| 欧美国产精品专区| 麻豆一区二区在线| 97se亚洲国产综合自在线不卡| 日韩一区二区在线观看视频播放| 亚洲欧洲日韩在线| 国产成人综合网| 日韩免费视频一区二区| 亚洲香蕉伊在人在线观| 99re在线视频这里只有精品| 久久色中文字幕| 久久99精品久久久久婷婷| 欧美日韩三级一区| 亚洲精品中文字幕在线观看| 不卡免费追剧大全电视剧网站| 精品成人一区二区三区四区| 日韩国产高清在线| 欧美一区二区三区爱爱| 亚洲国产精品一区二区久久 | 成人午夜短视频| 日韩精品中文字幕一区| 国产成人夜色高潮福利影视| 日韩欧美一区二区视频| 日本成人中文字幕| 欧美一级国产精品| 美女视频黄久久| 日韩午夜激情电影| 六月丁香综合在线视频| 欧美zozo另类异族| 国产一区二区视频在线播放| 久久影院午夜论| 国产成人精品影视| 国产精品看片你懂得 | 免费在线看一区| 欧美一区二区三区啪啪| 成人免费在线视频| 一本大道久久精品懂色aⅴ| 麻豆国产精品一区二区三区| 国产精品888| 久久综合999| 国产精品一二三区在线| 国产精品久久网站| 色哟哟精品一区| 亚洲自拍偷拍av| 欧美欧美午夜aⅴ在线观看| 爽爽淫人综合网网站| 欧美v亚洲v综合ⅴ国产v| 国产在线视视频有精品| 欧美国产日产图区| 欧美亚洲自拍偷拍| 国精产品一区一区三区mba桃花| 国产亚洲欧美一区在线观看| 色综合久久99| 美女国产一区二区三区| 久久精品一区二区三区不卡牛牛| a在线欧美一区| 国产欧美一区视频| 亚洲欧美在线视频观看| 国产一区二区精品久久| 亚洲欧美日韩在线不卡| 欧美精品欧美精品系列| 国产美女久久久久| 欧美成人午夜电影| 欧美视频在线观看一区二区| 成人高清av在线| 欧美日韩在线免费视频| 极品少妇xxxx精品少妇| 亚洲蜜臀av乱码久久精品| 91精品国产91久久综合桃花| 国产福利91精品一区二区三区| 亚洲欧美视频在线观看| 日韩小视频在线观看专区| 国产成人精品免费| 午夜久久久影院| 国产精品乱人伦中文| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 欧美精品123区| 久久蜜桃av一区二区天堂| 久久爱www久久做| 自拍偷在线精品自拍偷无码专区| 制服丝袜亚洲网站| 91丨porny丨中文| 经典三级视频一区| 日韩激情视频在线观看| 亚洲欧美怡红院| 久久亚洲私人国产精品va媚药| 欧洲另类一二三四区| 国产精品自产自拍| 美女视频黄久久| 一区二区三区小说| 久久久久久久久久久久电影 | 尤物av一区二区| 国产精品视频一区二区三区不卡| 欧美一级高清片| 欧美日韩亚州综合| 成人黄色一级视频| 亚洲免费观看高清完整版在线观看熊| 国内精品第一页| 国产欧美精品一区| 精品国产免费人成电影在线观看四季| 欧美色视频在线| 欧美亚日韩国产aⅴ精品中极品| 成人精品免费视频| 懂色av一区二区在线播放| 国产在线日韩欧美| 国产在线精品一区二区| 久久成人久久爱| 久久成人18免费观看| 久久国产精品一区二区| 久久精品二区亚洲w码| 久久99久久精品欧美| 久久国产精品第一页| 老司机精品视频线观看86 | 精品一二线国产| 蜜桃视频在线观看一区二区| 五月婷婷综合在线| 日本免费在线视频不卡一不卡二 | 亚洲综合小说图片| 日韩毛片一二三区| 欧美日韩精品高清| 7878成人国产在线观看| 7777精品久久久大香线蕉| 欧美一区二区久久久| 精品久久久久99| 国产日产欧美一区| 亚洲色图欧美激情| 婷婷开心久久网| 开心九九激情九九欧美日韩精美视频电影 | 91福利国产精品| 在线免费观看视频一区| 7799精品视频| 久久综合色8888| 欧美国产日产图区| 亚洲精品成人悠悠色影视| 亚洲成人免费av| 久久99国产精品久久99| 丁香婷婷综合色啪| 精品视频在线视频| 26uuu色噜噜精品一区二区| 婷婷开心久久网| 夜夜嗨av一区二区三区网页| 亚洲第一成人在线| 欧美日韩国产另类不卡| 日韩免费成人网| 中文字幕一区二区三区精华液| 亚洲综合免费观看高清完整版| 日本成人在线一区| 99视频有精品| 日韩三级免费观看| 国产精品久久久久久久久久免费看| 亚洲激情五月婷婷| 精品一区二区三区免费观看| 成人久久久精品乱码一区二区三区 | 日本一区二区高清| 亚洲电影中文字幕在线观看| 国产美女一区二区三区| 欧美亚洲综合一区| 国产亚洲一本大道中文在线| 亚洲成a人v欧美综合天堂下载| 精品在线你懂的| 欧美日免费三级在线| 日本一区二区三区高清不卡| 日韩在线一区二区三区| 国产精品乱码人人做人人爱| 欧美日韩国产片| 91麻豆产精品久久久久久| 欧美剧在线免费观看网站 | 亚洲蜜臀av乱码久久精品| 国产专区综合网| 777亚洲妇女| 伊人夜夜躁av伊人久久| 国产91精品久久久久久久网曝门| 欧美日本一道本| 一区二区三区日韩欧美精品 | 欧美a一区二区| 欧美午夜宅男影院| 亚洲视频在线一区| 成人国产亚洲欧美成人综合网| 精品国产一区二区三区不卡| 日韩综合在线视频| 在线观看一区日韩| 亚洲欧美成aⅴ人在线观看| 国产白丝精品91爽爽久久| 精品处破学生在线二十三| 喷白浆一区二区| 日韩欧美激情四射| 蜜臀av亚洲一区中文字幕| 欧美日韩国产精品自在自线| 亚洲国产一区二区三区 | 香蕉成人啪国产精品视频综合网| 99久久国产免费看| 亚洲欧洲国产专区| 成人a区在线观看| 亚洲日本在线天堂| 91丨porny丨中文| 一区二区三区在线视频免费 | 成人av在线一区二区| 欧美国产成人精品|