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

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

?? stm32f10x_adc.c

?? 基于Cortex-M3的STM32的IAR EWARM的工程模塊
?? C
?? 第 1 頁 / 共 4 頁
字號:
* Description    : Configures the sequencer length for injected channels
* Input          : - ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
*                  - Length: The sequencer length. 
*                    This parameter must be a number between 1 to 4.
* Output         : None
* Return         : None
*******************************************************************************/
void ADC_InjectedSequencerLengthConfig(ADC_TypeDef* ADCx, u8 Length)
{
  u32 tmpreg1 = 0;
  u32 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;
}

/*******************************************************************************
* Function Name  : ADC_SetInjectedOffset
* Description    : Set the injected channels conversion value offset
* Input          : - ADCx: where x can be 1, 2 or 3 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_ALL_PERIPH(ADCx));
  assert_param(IS_ADC_INJECTED_CHANNEL(ADC_InjectedChannel));
  assert_param(IS_ADC_OFFSET(Offset));  

  /* Set the selected injected channel data offset */
  *((vu32 *)((*(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, 2 or 3 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_ALL_PERIPH(ADCx));
  assert_param(IS_ADC_INJECTED_CHANNEL(ADC_InjectedChannel));

  /* Returns the selected injected channel conversion data value */
  return (u16) (*(vu32*) (((*(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, 2 or 3 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_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;
}

/*******************************************************************************
* Function Name  : ADC_AnalogWatchdogThresholdsConfig
* Description    : Configures the high and low thresholds of the analog watchdog.
* Input          : - ADCx: where x can be 1, 2 or 3 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_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;
}

/*******************************************************************************
* Function Name  : ADC_AnalogWatchdogSingleChannelConfig
* Description    : Configures the analog watchdog guarded single channel
* Input          : - ADCx: where x can be 1, 2 or 3 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_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;
}

/*******************************************************************************
* 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, 2 or 3 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_ALL_PERIPH(ADCx));
  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, 2 or 3 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_ALL_PERIPH(ADCx));
  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, 2 or 3 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;
  u32 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 & (u8)ADC_IT) ;

  /* Check the status of the specified ADC interrupt */
  if (((ADCx->SR & itmask) != (u32)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          : - ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
*                  - 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_ALL_PERIPH(ADCx));
  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 2008 STMicroelectronics *****END OF FILE****/

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一本一道波多野结衣一区二区| 亚洲图片欧美视频| 精品在线一区二区三区| 91精品国产乱| 中文字幕日本不卡| 日韩成人精品在线观看| 成人免费黄色大片| 国产日产欧美一区| 国产激情视频一区二区三区欧美 | 成人一级黄色片| 欧美精品一级二级三级| 亚洲国产一二三| 欧美最新大片在线看| 一区二区三区成人| 欧美自拍偷拍一区| 亚洲高清不卡在线观看| 91精品欧美福利在线观看| 日韩精品一卡二卡三卡四卡无卡| 欧美精品免费视频| 日韩精品五月天| 欧美videos中文字幕| 国产在线精品一区二区不卡了| 337p日本欧洲亚洲大胆精品| 免费视频最近日韩| 日韩久久免费av| 国产精一品亚洲二区在线视频| 国产亚洲综合在线| av电影一区二区| 亚洲日韩欧美一区二区在线| 国产**成人网毛片九色| 亚洲情趣在线观看| 欧美色视频在线观看| 男男gaygay亚洲| 中文av字幕一区| 色偷偷一区二区三区| 五月天中文字幕一区二区| 精品少妇一区二区三区免费观看| 成人免费av资源| 亚洲福利一区二区| 国产亚洲精品7777| 欧美剧在线免费观看网站| 国产精品一卡二卡在线观看| 亚洲免费电影在线| 亚洲国产岛国毛片在线| 欧美性xxxxx极品少妇| 国产成人免费9x9x人网站视频| 一区二区三区中文字幕| 精品日韩一区二区三区免费视频| 欧洲av在线精品| 国产米奇在线777精品观看| 亚洲男人都懂的| 中文字幕成人av| 69堂国产成人免费视频| 激情综合网天天干| 丝袜亚洲另类丝袜在线| 国产精品视频一区二区三区不卡| 日韩午夜在线观看视频| 日本高清不卡在线观看| 国产乱人伦偷精品视频不卡| 亚洲aⅴ怡春院| 亚洲精品视频在线观看网站| 中文在线资源观看网站视频免费不卡| 欧美高清精品3d| 91免费看`日韩一区二区| 国产激情视频一区二区三区欧美| 手机精品视频在线观看| 国产精品美女久久久久久久久| 久久网站最新地址| 欧美一级一区二区| 91毛片在线观看| 色伊人久久综合中文字幕| 成人一区二区三区中文字幕| 奇米四色…亚洲| 久久精品av麻豆的观看方式| 天堂久久一区二区三区| 水野朝阳av一区二区三区| 亚洲最大色网站| 亚洲成人在线免费| 亚洲一区二区欧美日韩| 亚洲私人影院在线观看| 亚洲精品乱码久久久久久| 综合中文字幕亚洲| 中文字幕一区二区三区不卡在线| 1区2区3区欧美| 欧美高清在线一区| 中文字幕精品一区二区精品绿巨人 | 国产专区欧美精品| 日韩不卡一二三区| 日本成人在线电影网| 美日韩一级片在线观看| 天堂一区二区在线| 午夜激情一区二区| 一个色妞综合视频在线观看| 亚洲精选视频在线| 久久一区二区视频| 久久香蕉国产线看观看99| 欧美成人乱码一区二区三区| 精品国产一区二区三区忘忧草| 日韩一区二区三区视频在线观看| 日韩一区二区免费在线观看| 欧美一区二区三区免费视频| 欧美电影精品一区二区 | 日韩一区二区精品| 欧美成人a视频| 2014亚洲片线观看视频免费| 欧美日韩aaaaa| 亚洲久本草在线中文字幕| 色婷婷综合久久久中文字幕| 成人黄色一级视频| 色综合视频一区二区三区高清| 色综合天天做天天爱| 欧洲激情一区二区| 777欧美精品| 欧美三级欧美一级| 欧美一级精品大片| 国产人久久人人人人爽| 国产精品午夜在线观看| 亚洲日本在线天堂| 欧美精品一区二区不卡| 国产女主播一区| 亚洲线精品一区二区三区八戒| 亚洲v日本v欧美v久久精品| 久久精品免费观看| 日本三级亚洲精品| 国产成人在线观看| 色综合久久久久综合99| 久久综合色之久久综合| 亚洲精品菠萝久久久久久久| 奇米一区二区三区av| 丁香婷婷综合色啪| 欧美在线三级电影| 中文字幕av不卡| 日韩av在线免费观看不卡| 日韩精品视频网站| 色吧成人激情小说| 亚洲乱码中文字幕| 欧美欧美午夜aⅴ在线观看| 国产成人在线看| 成人激情免费电影网址| 欧美自拍偷拍午夜视频| 亚洲一区二区三区小说| 91小视频在线免费看| 粉嫩一区二区三区在线看| 日本精品一区二区三区高清| 欧美一区二区视频在线观看2022| 亚洲精品视频一区二区| 蜜臀av亚洲一区中文字幕| 欧美日韩国产综合一区二区| 久久久精品国产免费观看同学| 亚洲精品国产a| 国产在线国偷精品免费看| 欧美无乱码久久久免费午夜一区| 亚洲欧洲日产国码二区| 蜜臀av性久久久久蜜臀aⅴ四虎| 欧美性生交片4| 国产精品网曝门| 国产一区二区主播在线| 日韩欧美国产一区二区三区| 亚洲免费电影在线| 99久久精品99国产精品| 欧美国产成人精品| 国产一区欧美二区| 91一区二区三区在线播放| 国产亚洲一区二区三区| 久久超碰97人人做人人爱| 7777精品伊人久久久大香线蕉 | 国产麻豆精品在线| 制服丝袜日韩国产| 亚洲一区在线观看视频| 色老头久久综合| 成人欧美一区二区三区视频网页 | 国产高清亚洲一区| 精品视频一区三区九区| 亚洲免费在线观看| 91免费观看在线| 亚洲同性同志一二三专区| 高清在线观看日韩| 亚洲区小说区图片区qvod| 99re8在线精品视频免费播放| 3d成人h动漫网站入口| 午夜伦欧美伦电影理论片| 欧美日韩中文字幕一区二区| 亚洲制服丝袜av| 色偷偷久久一区二区三区| 亚洲男人天堂一区| 欧美久久久久久久久中文字幕| 亚洲成人资源网| 成人av动漫在线| 亚洲成av人片在线| 欧美一区午夜精品| 国产福利一区二区| 日本一二三不卡| 91网站在线播放| 天天免费综合色| 欧美电影免费观看高清完整版 | 成人爽a毛片一区二区免费| 久久久久久一二三区| 91在线播放网址| 亚洲制服欧美中文字幕中文字幕| 欧美一区二区在线播放|