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

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

?? stm32f10x_adc.c

?? STM32USART1串口接收程序(中斷方式)
?? C
?? 第 1 頁 / 共 4 頁
字號:
  /* Check the parameters */
  assert(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 or 2 to select the ADC peripheral.
* Output         : None
* Return         : The Data conversion value.
*******************************************************************************/
u16 ADC_GetConversionValue(ADC_TypeDef* ADCx)
{
  /* Return the selected ADC conversion value */
  return (u16) ADCx->DR;
}

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

/*******************************************************************************
* 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 or 2 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(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 or 2 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(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 or 2 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
*                       - ADC_ExternalTrigInjecConv_T1_CC4: Timer1 capture
*                         compare4 selected
*                       - ADC_ExternalTrigInjecConv_T2_TRGO: Timer2 TRGO event
*                         selected
*                       - ADC_External TrigInjecConv_T2_CC1: Timer2 capture
*                         compare1 selected
*                       - ADC_ExternalTrigInjecConv_T3_CC4: Timer3 capture
*                         compare4 selected
*                       - ADC_ExternalTrigInjecConv_T4_TRGO: Timer4 TRGO event
*                         selected 
*                       - ADC_ExternalTrigInjecConv_Ext_Interrupt15: External
*                         interrupt 15 event selected
*                       - ADC_ExternalTrigInjecConv_None: Injected conversion
*                         started by software and not by external trigger
* Output         : None
* Return         : None
*******************************************************************************/
void ADC_ExternalTrigInjectedConvConfig(ADC_TypeDef* ADCx, u32 ADC_ExternalTrigInjecConv)
{
  u32 tmpreg = 0;

  /* Check the parameters */
  assert(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 or 2 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(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 or 2 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(IS_FUNCTIONAL_STATE(NewState));

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

/*******************************************************************************
* Function Name  : ADC_GetSoftwareStartInjectedConvCmdStatus
* Description    : Gets the selected ADC Software start injected conversion Status.
* Input          : - ADCx: where x can be 1 or 2 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 status of JSWSTRT bit */
  if ((ADCx->CR2 & CR2_JSWSTRT_Set) != (u32)RESET)
  {
    /* JSWSTRT bit is set */
    bitstatus = SET;
  }
  else
  {
    /* JSWSTRT bit is reset */
    bitstatus = RESET;
  }
  /* Return the JSWSTRT 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 or 2 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;
  u8 tmpreg3 = 0;

  /* Check the parameters */
  assert(IS_ADC_CHANNEL(ADC_Channel));
  assert(IS_ADC_INJECTED_RANK(Rank));
  assert(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 = (u32)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 = (u32)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 =  (u8)((tmpreg1 & (u32)~JSQR_JL_Reset)>> 20);
  /* Calculate the mask to clear: ((Rank-1)+(4-JL-1)) */
  tmpreg2 = (u32)JSQR_JSQ_Set << (5 * ((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 * ((Rank + 3) - (tmpreg3 + 1)));
  /* Set the JSQx bits for the selected rank */
  tmpreg1 |= tmpreg2;
  /* Store the new register value */
  ADCx->JSQR = tmpreg1;
}

/*******************************************************************************
* Function Name  : ADC_InjectedSequencerLengthConfig
* Description    : Configures the sequencer length for injected channels
* Input          : - ADCx: where x can be 1 or 2 to select the ADC peripheral.
*                  - Length: The sequencer length. 
*                    This parameter must be a number between 1 to 4.
* Output         : None
* Return         : None
*******************************************************************************/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人综合自拍| 亚洲高清免费观看高清完整版在线观看| 免费看欧美女人艹b| 欧美精品1区2区3区| 青青青伊人色综合久久| 日韩一区二区三区在线观看| 久久99精品国产麻豆婷婷洗澡| 久久久一区二区三区| 国产高清在线精品| 亚洲区小说区图片区qvod| 欧美日韩精品一区二区在线播放| 五月婷婷综合激情| 久久综合中文字幕| 91蝌蚪porny| 日韩精品亚洲一区| 国产日韩欧美不卡在线| 99国产精品久久久久| 亚洲高清免费观看| 久久色在线视频| 一本色道久久加勒比精品 | 国产精品一区三区| 亚洲日本护士毛茸茸| 制服丝袜中文字幕一区| 国产精品香蕉一区二区三区| 亚洲欧美成人一区二区三区| 日韩一级片网站| 9l国产精品久久久久麻豆| 日韩精品高清不卡| 亚洲图片另类小说| 精品999在线播放| 91国偷自产一区二区开放时间 | 久久国产夜色精品鲁鲁99| 国产精品素人视频| 91精品欧美福利在线观看| 国产69精品久久久久777| 亚洲一区二区三区小说| 日本一区二区三区在线不卡| 欧美怡红院视频| 国产成人精品影院| 三级久久三级久久| 亚洲人成网站色在线观看| 欧美大尺度电影在线| 欧美日韩在线亚洲一区蜜芽| 国产精品99久久久久久久vr| 天天av天天翘天天综合网色鬼国产| 国产精品久久久一本精品| 日韩欧美专区在线| 欧美日韩一级二级| 色综合久久88色综合天天免费| 久久不见久久见免费视频7| 亚洲图片自拍偷拍| 亚洲三级在线免费| 中文字幕欧美日韩一区| 精品久久久久久久久久久久久久久久久| 91麻豆swag| av电影天堂一区二区在线观看| 精品一区二区在线视频| 日韩高清不卡一区二区| 亚洲一二三四久久| 亚洲欧美在线视频| 日本一区二区三区dvd视频在线| 精品国产乱码久久久久久夜甘婷婷| 欧美在线不卡一区| 欧美四级电影在线观看| 91在线观看免费视频| 成人ar影院免费观看视频| 国产91精品一区二区麻豆亚洲| 国产一区二区免费视频| 蜜桃视频一区二区| 美女久久久精品| 九九视频精品免费| 麻豆freexxxx性91精品| 久久国产综合精品| 韩日av一区二区| 久久99热这里只有精品| 紧缚奴在线一区二区三区| 精品一区免费av| 国产精品18久久久久久vr| 国产精一品亚洲二区在线视频| 国产在线播放一区三区四| 久久精品国产一区二区三| 激情图片小说一区| 国产成a人亚洲精品| 国产成人亚洲综合a∨婷婷图片 | 国产精品精品国产色婷婷| 国产精品美女久久久久av爽李琼 | 亚洲欧美激情视频在线观看一区二区三区| 亚洲国产精品99久久久久久久久| 国产调教视频一区| 最新不卡av在线| 亚洲麻豆国产自偷在线| 亚洲国产日产av| 捆绑变态av一区二区三区| 国产精品一区在线| 99久久婷婷国产综合精品电影| 一本色道久久综合亚洲aⅴ蜜桃 | 精品国产91乱码一区二区三区 | 成人在线一区二区三区| 国产成人在线免费观看| 色综合一区二区| 欧美男男青年gay1069videost| 欧美不卡123| 亚洲人123区| 美脚の诱脚舐め脚责91| 国产不卡在线播放| 欧美日韩夫妻久久| 国产亚洲一区二区三区四区 | 久久精品噜噜噜成人av农村| 国产成人午夜精品影院观看视频 | 国产美女在线观看一区| 99r国产精品| 欧美一区二区美女| 国产欧美一区二区精品忘忧草| 亚洲精品国产无天堂网2021| 亚洲最快最全在线视频| 久久福利视频一区二区| 91浏览器在线视频| 亚洲精品一区在线观看| 国产精品九色蝌蚪自拍| 免费人成黄页网站在线一区二区| 国产成人午夜精品影院观看视频| 欧美性色黄大片| 中文在线一区二区| 日本伊人色综合网| 91丨porny丨国产入口| 日韩午夜在线观看| 亚洲尤物在线视频观看| 国产伦精品一区二区三区在线观看| 欧美综合天天夜夜久久| 亚洲国产精品黑人久久久| 久久精品久久综合| 欧美裸体一区二区三区| 国产精品久久久久一区二区三区 | 国产一区二区免费在线| 欧美日本视频在线| 一区在线播放视频| 国产麻豆视频精品| 欧美一级高清大全免费观看| 亚洲精品视频自拍| 成人免费电影视频| 欧美精品一区二区三区高清aⅴ | 国产精品家庭影院| 国产中文一区二区三区| 欧美区视频在线观看| 亚洲黄色尤物视频| 成人av在线资源网| 国产亚洲人成网站| 国产麻豆一精品一av一免费| 91精品国产手机| 视频一区欧美精品| 欧美日韩的一区二区| 亚洲精品精品亚洲| 91免费版在线| 亚洲日本成人在线观看| eeuss鲁一区二区三区| 久久久久88色偷偷免费| 国产在线不卡视频| 精品久久一区二区三区| 美女国产一区二区三区| 日韩三级高清在线| 日本不卡免费在线视频| 91精品国产91久久综合桃花| 亚洲国产精品一区二区www| 在线观看精品一区| 亚洲一区二区精品久久av| 日本高清不卡aⅴ免费网站| 成人欧美一区二区三区在线播放| 成人精品免费看| 国产精品丝袜在线| 91在线观看美女| 亚洲综合在线免费观看| 欧美日韩在线精品一区二区三区激情| 尤物在线观看一区| 欧美肥妇free| 另类小说色综合网站| 久久久久久久久97黄色工厂| 国产成人亚洲综合a∨猫咪| 中文字幕国产一区二区| 91麻豆免费观看| 亚洲午夜一区二区| 欧美成人综合网站| 国产精品一级在线| 国产精品久久午夜夜伦鲁鲁| 94-欧美-setu| 午夜久久电影网| 2017欧美狠狠色| 99精品国产热久久91蜜凸| 亚洲私人影院在线观看| 欧美日韩国产不卡| 国产麻豆91精品| 亚洲美女一区二区三区| 欧美一区二区三区日韩视频| 九九九久久久精品| 亚洲欧洲三级电影| 91.com视频| 成人亚洲精品久久久久软件| 夜夜嗨av一区二区三区中文字幕 | 久久亚洲二区三区| 99久久99久久精品国产片果冻| 亚洲专区一二三|