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

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

?? stm32f10x_adc.c

?? 基于STM32的數碼相冊.rar
?? C
?? 第 1 頁 / 共 4 頁
字號:
void ADC_ExternalTrigConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));
  assert_param(IS_FUNCTIONAL_STATE(NewState));

  if (NewState != DISABLE)
  {
    /* Enable the selected ADC conversion on external event */
    ADCx->CR2 |= CR2_EXTTRIG_Set;
  }
  else
  {
    /* Disable the selected ADC conversion on external event */
    ADCx->CR2 &= CR2_EXTTRIG_Reset;
  }
}

/*******************************************************************************
* Function Name  : ADC_GetConversionValue
* Description    : Returns the last ADCx conversion result data for regular channel.
* Input          : - ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
* Output         : None
* Return         : The Data conversion value.
*******************************************************************************/
u16 ADC_GetConversionValue(ADC_TypeDef* ADCx)
{
  /* Check the parameters */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));

  /* Return the selected ADC conversion value */
  return (u16) ADCx->DR;
}

/*******************************************************************************
* Function Name  : ADC_GetDualModeConversionValue
* Description    : Returns the last ADC1 and ADC2 conversion result data in dual mode.
* Output         : None
* Return         : The Data conversion value.
*******************************************************************************/
u32 ADC_GetDualModeConversionValue(void)
{
  /* Return the dual mode conversion value */
  return (*(vu32 *) DR_ADDRESS);
}

/*******************************************************************************
* Function Name  : ADC_AutoInjectedConvCmd
* Description    : Enables or disables the selected ADC automatic injected group
*                  conversion after regular one.
* Input          : - ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
*                  - NewState: new state of the selected ADC auto injected
*                    conversion
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : None
*******************************************************************************/
void ADC_AutoInjectedConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));
  assert_param(IS_FUNCTIONAL_STATE(NewState));

  if (NewState != DISABLE)
  {
    /* Enable the selected ADC automatic injected group conversion */
    ADCx->CR1 |= CR1_JAUTO_Set;
  }
  else
  {
    /* Disable the selected ADC automatic injected group conversion */
    ADCx->CR1 &= CR1_JAUTO_Reset;
  }
}

/*******************************************************************************
* Function Name  : ADC_InjectedDiscModeCmd
* Description    : Enables or disables the discontinuous mode for injected group
*                  channel for the specified ADC
* Input          : - ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
*                  - NewState: new state of the selected ADC discontinuous mode
*                    on injected group channel.
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : None
*******************************************************************************/
void ADC_InjectedDiscModeCmd(ADC_TypeDef* ADCx, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));
  assert_param(IS_FUNCTIONAL_STATE(NewState));

  if (NewState != DISABLE)
  {
    /* Enable the selected ADC injected discontinuous mode */
    ADCx->CR1 |= CR1_JDISCEN_Set;
  }
  else
  {
    /* Disable the selected ADC injected discontinuous mode */
    ADCx->CR1 &= CR1_JDISCEN_Reset;
  }
}

/*******************************************************************************
* Function Name  : ADC_ExternalTrigInjectedConvConfig
* Description    : Configures the ADCx external trigger for injected channels conversion.
* Input          : - ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
*                  - ADC_ExternalTrigInjecConv: specifies the ADC trigger to
*                    start injected conversion. 
*                    This parameter can be one of the following values:
*                       - ADC_ExternalTrigInjecConv_T1_TRGO: Timer1 TRGO event 
*                         selected (for ADC1, ADC2 and ADC3)
*                       - ADC_ExternalTrigInjecConv_T1_CC4: Timer1 capture
*                         compare4 selected (for ADC1, ADC2 and ADC3)
*                       - ADC_ExternalTrigInjecConv_T2_TRGO: Timer2 TRGO event
*                         selected (for ADC1 and ADC2)
*                       - ADC_External TrigInjecConv_T2_CC1: Timer2 capture
*                         compare1 selected (for ADC1 and ADC2)
*                       - ADC_ExternalTrigInjecConv_T3_CC4: Timer3 capture
*                         compare4 selected (for ADC1 and ADC2)
*                       - ADC_ExternalTrigInjecConv_T4_TRGO: Timer4 TRGO event
*                         selected (for ADC1 and ADC2)
*                       - ADC_ExternalTrigInjecConv_Ext_IT15_TIM8_CC4: External
*                         interrupt line 15 or Timer8 capture compare4 event selected
*                         (for ADC1 and ADC2)                       
*                       - ADC_External TrigInjecConv_T4_CC3: Timer4 capture
*                         compare3 selected (for ADC3 only)
*                       - ADC_External TrigInjecConv_T8_CC2: Timer8 capture
*                         compare2 selected (for ADC3 only)                         
*                       - ADC_External TrigInjecConv_T8_CC4: Timer8 capture
*                         compare4 selected (for ADC3 only)
*                       - ADC_ExternalTrigInjecConv_T5_TRGO: Timer5 TRGO event
*                         selected (for ADC3 only)                         
*                       - ADC_External TrigInjecConv_T5_CC4: Timer5 capture
*                         compare4 selected (for ADC3 only)                        
*                       - ADC_ExternalTrigInjecConv_None: Injected conversion
*                         started by software and not by external trigger (for 
*                         ADC1, ADC2 and ADC3)
* Output         : None
* Return         : None
*******************************************************************************/
void ADC_ExternalTrigInjectedConvConfig(ADC_TypeDef* ADCx, u32 ADC_ExternalTrigInjecConv)
{
  u32 tmpreg = 0;

  /* Check the parameters */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));
  assert_param(IS_ADC_EXT_INJEC_TRIG(ADC_ExternalTrigInjecConv));

  /* Get the old register value */
  tmpreg = ADCx->CR2;
  /* Clear the old external event selection for injected group */
  tmpreg &= CR2_JEXTSEL_Reset;
  /* Set the external event selection for injected group */
  tmpreg |= ADC_ExternalTrigInjecConv;
  /* Store the new register value */
  ADCx->CR2 = tmpreg;
}

/*******************************************************************************
* Function Name  : ADC_ExternalTrigInjectedConvCmd
* Description    : Enables or disables the ADCx injected channels conversion
*                  through external trigger
* Input          : - ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
*                  - NewState: new state of the selected ADC external trigger
*                    start of injected conversion.
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : None
*******************************************************************************/
void ADC_ExternalTrigInjectedConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));
  assert_param(IS_FUNCTIONAL_STATE(NewState));

  if (NewState != DISABLE)
  {
    /* Enable the selected ADC external event selection for injected group */
    ADCx->CR2 |= CR2_JEXTTRIG_Set;
  }
  else
  {
    /* Disable the selected ADC external event selection for injected group */
    ADCx->CR2 &= CR2_JEXTTRIG_Reset;
  }
}

/*******************************************************************************
* Function Name  : ADC_SoftwareStartInjectedConvCmd
* Description    : Enables or disables the selected ADC start of the injected 
*                  channels conversion.
* Input          : - ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
*                  - NewState: new state of the selected ADC software start
*                    injected conversion.
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : None
*******************************************************************************/
void ADC_SoftwareStartInjectedConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));
  assert_param(IS_FUNCTIONAL_STATE(NewState));

  if (NewState != DISABLE)
  {
    /* Enable the selected ADC conversion for injected group on external event and start the selected
       ADC injected conversion */
    ADCx->CR2 |= CR2_JEXTTRIG_JSWSTART_Set;
  }
  else
  {
    /* Disable the selected ADC conversion on external event for injected group and stop the selected
       ADC injected conversion */
    ADCx->CR2 &= CR2_JEXTTRIG_JSWSTART_Reset;
  }
}

/*******************************************************************************
* Function Name  : ADC_GetSoftwareStartInjectedConvCmdStatus
* Description    : Gets the selected ADC Software start injected conversion Status.
* Input          : - ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
* Output         : None
* Return         : The new state of ADC software start injected conversion (SET or RESET).
*******************************************************************************/
FlagStatus ADC_GetSoftwareStartInjectedConvCmdStatus(ADC_TypeDef* ADCx)
{
  FlagStatus bitstatus = RESET;

  /* Check the parameters */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));

  /* Check the status of JSWSTART bit */
  if ((ADCx->CR2 & CR2_JSWSTART_Set) != (u32)RESET)
  {
    /* JSWSTART bit is set */
    bitstatus = SET;
  }
  else
  {
    /* JSWSTART bit is reset */
    bitstatus = RESET;
  }

  /* Return the JSWSTART bit status */
  return  bitstatus;
}

/*******************************************************************************
* Function Name  : ADC_InjectedChannelConfig
* Description    : Configures for the selected ADC injected channel its corresponding
*                  rank in the sequencer and its sample time.
* Input          : - ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
*                  - ADC_Channel: the ADC channel to configure. 
*                    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
*                  - Rank: The rank in the injected group sequencer. This parameter
*                    must be between 1 to 4.
*                  - ADC_SampleTime: The sample time value to be set for the
*                    selected channel. 
*                    This parameter can be one of the following values:
*                       - ADC_SampleTime_1Cycles5: Sample time equal to 1.5 cycles
*                       - ADC_SampleTime_7Cycles5: Sample time equal to 7.5 cycles
*                       - ADC_SampleTime_13Cycles5: Sample time equal to 13.5 cycles
*                       - ADC_SampleTime_28Cycles5: Sample time equal to 28.5 cycles	
*                       - ADC_SampleTime_41Cycles5: Sample time equal to 41.5 cycles	
*                       - ADC_SampleTime_55Cycles5: Sample time equal to 55.5 cycles	
*                       - ADC_SampleTime_71Cycles5: Sample time equal to 71.5 cycles	
*                       - ADC_SampleTime_239Cycles5: Sample time equal to 239.5 cycles	
* Output         : None
* Return         : None
*******************************************************************************/
void ADC_InjectedChannelConfig(ADC_TypeDef* ADCx, u8 ADC_Channel, u8 Rank, u8 ADC_SampleTime)
{
  u32 tmpreg1 = 0, tmpreg2 = 0, tmpreg3 = 0;

  /* Check the parameters */
  assert_param(IS_ADC_ALL_PERIPH(ADCx));
  assert_param(IS_ADC_CHANNEL(ADC_Channel));
  assert_param(IS_ADC_INJECTED_RANK(Rank));
  assert_param(IS_ADC_SAMPLE_TIME(ADC_SampleTime));

  /* if ADC_Channel_10 ... ADC_Channel_17 is selected */
  if (ADC_Channel > ADC_Channel_9)
  {
    /* Get the old register value */
    tmpreg1 = ADCx->SMPR1;
    /* Calculate the mask to clear */
    tmpreg2 = SMPR1_SMP_Set << (3*(ADC_Channel - 10));
    /* Clear the old discontinuous mode channel count */
    tmpreg1 &= ~tmpreg2;
    /* Calculate the mask to set */
    tmpreg2 = (u32)ADC_SampleTime << (3*(ADC_Channel - 10));
    /* Set the discontinuous mode channel count */
    tmpreg1 |= tmpreg2;
    /* Store the new register value */
    ADCx->SMPR1 = tmpreg1;
  }
  else /* ADC_Channel include in ADC_Channel_[0..9] */
  {
    /* Get the old register value */
    tmpreg1 = ADCx->SMPR2;
    /* Calculate the mask to clear */
    tmpreg2 = SMPR2_SMP_Set << (3 * ADC_Channel);
    /* Clear the old discontinuous mode channel count */
    tmpreg1 &= ~tmpreg2;
    /* Calculate the mask to set */
    tmpreg2 = (u32)ADC_SampleTime << (3 * ADC_Channel);
    /* Set the discontinuous mode channel count */
    tmpreg1 |= tmpreg2;
    /* Store the new register value */
    ADCx->SMPR2 = tmpreg1;
  }

  /* Rank configuration */
  /* Get the old register value */
  tmpreg1 = ADCx->JSQR;
  /* Get JL value: Number = JL+1 */
  tmpreg3 =  (tmpreg1 & JSQR_JL_Set)>> 20;
  /* Calculate the mask to clear: ((Rank-1)+(4-JL-1)) */
  tmpreg2 = JSQR_JSQ_Set << (5 * (u8)((Rank + 3) - (tmpreg3 + 1)));
  /* Clear the old JSQx bits for the selected rank */
  tmpreg1 &= ~tmpreg2;
  /* Calculate the mask to set: ((Rank-1)+(4-JL-1)) */
  tmpreg2 = (u32)ADC_Channel << (5 * (u8)((Rank + 3) - (tmpreg3 + 1)));
  /* Set the JSQx bits for the selected rank */
  tmpreg1 |= tmpreg2;
  /* Store the new register value */
  ADCx->JSQR = tmpreg1;
}

/*******************************************************************************

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区视频免费在线观看| 欧美伊人久久久久久久久影院 | 亚洲第一狼人社区| 国产精品自拍在线| 欧美一二三区在线观看| 亚洲bt欧美bt精品777| 色综合天天综合网国产成人综合天 | 国产在线不卡视频| 欧美一级片在线观看| 午夜精品久久久久久久99樱桃| 色老汉一区二区三区| 亚洲精品成人精品456| 色综合天天综合狠狠| 亚洲女性喷水在线观看一区| 日韩欧美国产综合一区| 日日欢夜夜爽一区| 91精品国产一区二区三区香蕉| 日韩成人一区二区三区在线观看| 欧美日本一区二区在线观看| 亚洲第一狼人社区| 欧美一区二区三区日韩| 美女脱光内衣内裤视频久久影院| 日韩欧美国产三级| 国内精品写真在线观看| 国产人成一区二区三区影院| 成人在线综合网站| 一区在线观看视频| 在线免费观看日韩欧美| 亚洲成av人片在线观看无码| 欧美一区二区三区免费在线看| 久99久精品视频免费观看| 久久久久久免费网| 97超碰欧美中文字幕| 亚洲另类中文字| 欧美日韩精品免费观看视频 | 毛片av一区二区| 久久精品亚洲麻豆av一区二区| 国产91富婆露脸刺激对白| 亚洲美女淫视频| 欧美调教femdomvk| 久久91精品国产91久久小草| 国产欧美日韩在线看| 欧美三级韩国三级日本三斤| 精品在线播放午夜| 亚洲欧洲精品天堂一级| 欧美图区在线视频| 国模少妇一区二区三区| 综合久久一区二区三区| 91精品国产乱码久久蜜臀| 国产精品456露脸| 一区二区三区在线观看网站| 精品入口麻豆88视频| 99re这里只有精品首页| 日本不卡的三区四区五区| 亚洲va欧美va天堂v国产综合| 日韩一区二区精品| 99免费精品在线| 日韩在线观看一区二区| 国产精品美女一区二区三区| 欧美日韩精品一区二区三区四区| 国产成人啪午夜精品网站男同| 亚洲最大色网站| 久久久久久一二三区| 国产不卡视频在线播放| 日韩亚洲欧美成人一区| 亚洲欧洲国产专区| 狠狠色狠狠色合久久伊人| 91麻豆产精品久久久久久| 国产三级精品三级| 亚洲一区二区不卡免费| 国产高清不卡二三区| 欧美本精品男人aⅴ天堂| 狂野欧美性猛交blacked| 91精品国产欧美一区二区18 | 日本vs亚洲vs韩国一区三区二区| 国产精品中文字幕一区二区三区| 色婷婷久久久综合中文字幕 | 成人福利视频网站| 日本一区二区三区电影| 美洲天堂一区二卡三卡四卡视频| 久久爱另类一区二区小说| 成人ar影院免费观看视频| 色综合久久中文综合久久牛| 欧美不卡视频一区| 欧美日韩中字一区| 精品国产一区二区在线观看| 韩国毛片一区二区三区| 中文字幕乱码久久午夜不卡| 日韩三区在线观看| 9191国产精品| 欧美视频一区在线| 91丨九色丨国产丨porny| 成人一区在线看| 国产成人自拍高清视频在线免费播放| 麻豆91精品91久久久的内涵| 亚洲综合精品自拍| 91香蕉视频mp4| 奇米精品一区二区三区四区 | 国产亚洲制服色| 国产麻豆视频精品| 国产女人18毛片水真多成人如厕| 99久久精品国产麻豆演员表| 国模大尺度一区二区三区| 色综合久久久网| 日韩三级高清在线| 麻豆极品一区二区三区| 日本午夜一区二区| 免费成人在线视频观看| 琪琪久久久久日韩精品| 蜜臀久久99精品久久久画质超高清 | 国产女人水真多18毛片18精品视频| 久久综合中文字幕| 国产香蕉久久精品综合网| 国产亚洲一区二区在线观看| 日韩精品一区二区三区四区视频| 日韩一区二区三| 日韩伦理电影网| 亚洲色欲色欲www| 玉米视频成人免费看| 亚洲影视在线播放| 亚洲国产一区二区三区| 丝袜诱惑制服诱惑色一区在线观看 | 一本久久综合亚洲鲁鲁五月天| 91黄色小视频| 这里只有精品电影| 精品国产伦一区二区三区免费 | 综合欧美一区二区三区| 亚洲精品国久久99热| 午夜精品久久久久久久蜜桃app| 蜜臀av性久久久久蜜臀av麻豆| 韩国三级电影一区二区| av网站免费线看精品| 欧美三级在线看| 日韩欧美国产综合| 国产精品伦一区| 亚洲成a人片在线不卡一二三区| 久久草av在线| 一本大道综合伊人精品热热| 91精品欧美综合在线观看最新| 国产亚洲视频系列| 一区二区三区免费看视频| 美女视频黄免费的久久| 成人一级黄色片| 欧美日韩国产中文| 久久精品夜色噜噜亚洲aⅴ| 亚洲精品成a人| 蜜桃一区二区三区在线观看| 国产福利电影一区二区三区| 久久精品国产一区二区三区免费看| 中文字幕一区二区三区蜜月| 综合激情成人伊人| 麻豆精品久久久| 青娱乐精品在线视频| 成人精品免费看| 色狠狠色噜噜噜综合网| 日韩一区二区不卡| 亚洲欧美日韩综合aⅴ视频| 日韩国产精品久久| www.日韩av| 日韩精品一区二区三区视频在线观看 | 精品欧美黑人一区二区三区| 亚洲视频免费看| 久久国产精品无码网站| 欧美xxxx老人做受| 玉足女爽爽91| 国产精品久久久99| 麻豆精品一区二区综合av| 色呦呦国产精品| 欧洲精品在线观看| 国产午夜精品久久久久久久 | 国产精品免费人成网站| 亚洲国产裸拍裸体视频在线观看乱了 | 色先锋资源久久综合| 日韩视频免费观看高清完整版在线观看 | 91免费版在线看| 精品久久99ma| 亚洲成人动漫av| 91麻豆swag| 国产片一区二区| 激情图片小说一区| 欧美日韩高清一区| 亚洲人亚洲人成电影网站色| 国产成人av电影免费在线观看| 欧美一区二区三区精品| 午夜精品一区二区三区三上悠亚| 97久久精品人人做人人爽50路| 国产亚洲女人久久久久毛片| 精品中文字幕一区二区| 日韩视频永久免费| 日韩av一区二| 欧美精品粉嫩高潮一区二区| 亚洲国产成人精品视频| 日本乱人伦aⅴ精品| 亚洲日本中文字幕区| 99久久精品费精品国产一区二区| 中国色在线观看另类| 国产成a人无v码亚洲福利| 国产人成一区二区三区影院| 国产精品香蕉一区二区三区| 精品国产免费一区二区三区香蕉|