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

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

?? stm32f10x_adc.c

?? 基于STM32 的IAP升級庫
?? 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一区二区三区免费野_久草精品视频
日韩精品亚洲专区| 在线观看一区二区视频| 色婷婷av一区二区三区软件| 日韩欧美一区二区不卡| 日韩毛片视频在线看| 国内精品国产三级国产a久久| 99视频精品免费视频| 精品国精品国产尤物美女| 尤物av一区二区| 成人黄色在线视频| 国产日韩视频一区二区三区| 日本不卡视频在线| 欧美三级日本三级少妇99| 亚洲欧洲日产国产综合网| 国产一区二区调教| 欧美成人在线直播| 日本va欧美va精品发布| 欧美精选一区二区| 亚洲五码中文字幕| 日本福利一区二区| 亚洲老妇xxxxxx| 一本一道综合狠狠老| 国产日韩欧美麻豆| 成人性生交大片免费看中文| 久久亚洲欧美国产精品乐播| 免费看精品久久片| 日韩欧美资源站| 毛片av中文字幕一区二区| 日韩欧美在线一区二区三区| 婷婷激情综合网| 欧美一区二区三区在线电影| 琪琪久久久久日韩精品| 日韩欧美一区二区在线视频| 毛片不卡一区二区| 精品成人一区二区三区四区| 国产在线不卡视频| 国产精品少妇自拍| 91伊人久久大香线蕉| 国产精品乱码妇女bbbb| a亚洲天堂av| 亚洲综合区在线| 欧美军同video69gay| 蜜桃视频免费观看一区| 国产午夜精品一区二区三区视频| 国产精品99久久久久久似苏梦涵| 国产精品毛片无遮挡高清| 国产v日产∨综合v精品视频| 综合电影一区二区三区 | 国产精品乡下勾搭老头1| 国产色综合一区| 一本色道久久综合狠狠躁的推荐 | 美脚の诱脚舐め脚责91| 日韩精品影音先锋| www.欧美.com| 亚洲va欧美va人人爽| 精品国产污污免费网站入口 | 国产一区二区三区免费观看| 国产精品美女久久久久久久| 欧美在线一区二区| 蜜桃av一区二区在线观看| 国产日韩v精品一区二区| 色婷婷精品久久二区二区蜜臂av| 天堂久久一区二区三区| 久久久久久久网| 欧美三级电影在线观看| 黄色日韩网站视频| 一区二区三区四区视频精品免费 | 亚洲视频一二区| 在线成人午夜影院| 成人亚洲精品久久久久软件| 香蕉影视欧美成人| 中文字幕高清不卡| 在线播放91灌醉迷j高跟美女 | 综合分类小说区另类春色亚洲小说欧美| 在线观看欧美黄色| 国产最新精品免费| 亚洲a一区二区| 国产免费成人在线视频| 91精品国产综合久久久久久久久久| 国产激情视频一区二区三区欧美| 亚洲一区二区三区在线看| 久久蜜臀精品av| 欧美一区二区三区思思人| 91丨porny丨在线| 国产呦精品一区二区三区网站| 亚洲一区电影777| 中文一区在线播放| 久久亚洲精精品中文字幕早川悠里| 91久久久免费一区二区| 成人晚上爱看视频| 久久成人免费网站| 日韩黄色免费电影| 亚洲精品中文在线影院| 国产精品免费丝袜| 久久久亚洲午夜电影| 日韩精品一区二区三区中文不卡 | 亚洲图片欧美一区| 亚洲色图制服诱惑| 中文字幕免费观看一区| 精品久久99ma| 日韩三级视频在线看| 91精品啪在线观看国产60岁| 日本高清视频一区二区| 94-欧美-setu| 99re视频这里只有精品| 成人一区在线看| 国产精品18久久久久久久久久久久| 成人免费精品视频| 久久精品国产精品亚洲综合| 日韩av电影天堂| 一二三区精品福利视频| 亚洲精品国产一区二区精华液 | 久久只精品国产| 欧美电视剧免费观看| 欧美精品xxxxbbbb| 日韩视频在线你懂得| 欧美v亚洲v综合ⅴ国产v| 日韩片之四级片| 久久伊人蜜桃av一区二区| 久久综合网色—综合色88| 欧美成人a视频| 久久精品人人做人人综合 | 不卡欧美aaaaa| 色综合网站在线| 91福利视频久久久久| 欧美日本国产视频| 在线电影一区二区三区| 精品理论电影在线观看| 国产校园另类小说区| 中文字幕一区二区三区在线播放 | 久久蜜臀精品av| 国产欧美1区2区3区| 中文字幕色av一区二区三区| 亚洲欧美激情视频在线观看一区二区三区| 亚洲欧美二区三区| 午夜不卡av免费| 国产曰批免费观看久久久| 懂色av一区二区三区蜜臀| 91色.com| 日韩欧美电影一二三| 亚洲国产精品传媒在线观看| 亚洲男女一区二区三区| 视频一区二区国产| 国产成都精品91一区二区三 | 国产91精品精华液一区二区三区| 波多野结衣中文一区| 欧美乱熟臀69xxxxxx| 国产欧美日韩精品在线| 亚洲aⅴ怡春院| 国产精品99久久久久久似苏梦涵 | 欧美二区三区91| 日本一区二区三区免费乱视频| 亚洲欧美电影院| 久久国产视频网| 99久久99久久综合| 日韩一级精品视频在线观看| 国产精品国产成人国产三级 | 日韩高清在线一区| 白白色 亚洲乱淫| 欧美xxxxxxxx| 亚洲丶国产丶欧美一区二区三区| 国产在线精品免费| 正在播放一区二区| 亚洲精品一二三四区| 国产福利视频一区二区三区| 欧美色网一区二区| 国产精品污污网站在线观看| 美女在线观看视频一区二区| 色综合色综合色综合| 国产日韩欧美麻豆| 奇米888四色在线精品| 在线中文字幕一区二区| 国产精品网曝门| 精品一区二区三区香蕉蜜桃 | 色综合久久天天| 国产香蕉久久精品综合网| 免费观看日韩av| 欧美日韩一级二级| 亚洲女厕所小便bbb| 国产99久久久国产精品潘金| 欧美一级电影网站| 亚洲图片欧美一区| 一本久久综合亚洲鲁鲁五月天 | 精品久久久久一区二区国产| 亚洲图片欧美色图| 在线区一区二视频| 亚洲精品亚洲人成人网在线播放| 国产伦精品一区二区三区视频青涩 | 亚洲男人都懂的| 国产白丝网站精品污在线入口| 欧美v亚洲v综合ⅴ国产v| 七七婷婷婷婷精品国产| 制服丝袜国产精品| 日韩成人精品视频| 欧美精品亚洲一区二区在线播放| 一区二区三区中文字幕电影 | 午夜久久久久久久久 | 色婷婷精品大视频在线蜜桃视频| 国产精品久久久久婷婷| 成人性视频免费网站|