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

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

?? stm32f10x_adc.c

?? 英倍特公司的STM32V100開發板配套庫函數及例程源代碼
?? 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一区二区三区免费野_久草精品视频
欧美zozozo| 成人听书哪个软件好| 成人教育av在线| 久久综合九色综合欧美98| 亚洲成a人v欧美综合天堂下载| 92国产精品观看| 国产欧美日韩精品在线| 久久99精品久久久久| 91精品视频网| 亚洲444eee在线观看| 欧美丝袜丝交足nylons| 亚洲午夜一区二区三区| 欧美无砖砖区免费| 天天爽夜夜爽夜夜爽精品视频| 欧美日本不卡视频| 亚洲成av人片在www色猫咪| 欧美精品在线视频| 蜜桃视频第一区免费观看| 欧美xxx久久| 国产盗摄视频一区二区三区| 国产欧美精品在线观看| 国产69精品久久久久毛片| 亚洲国产成人一区二区三区| 成人动漫一区二区三区| 亚洲美腿欧美偷拍| 91国在线观看| 免费看日韩精品| www国产精品av| 国产盗摄视频一区二区三区| 中文字幕一区二区三区在线播放| 99免费精品视频| 亚洲精品你懂的| 欧美精品xxxxbbbb| 精东粉嫩av免费一区二区三区| 国产欧美一区二区三区鸳鸯浴| 成人免费av在线| 亚洲国产中文字幕在线视频综合| 制服丝袜亚洲色图| 国产一区二区视频在线| 国产精品色哟哟网站| 91国偷自产一区二区三区观看| 亚洲大型综合色站| 久久色.com| 色婷婷国产精品久久包臀| 亚洲国产成人精品视频| 欧美一区二区三区公司| 国产黄色精品网站| 有码一区二区三区| 欧美一级高清片| 91一区二区在线| 亚洲成av人片www| 久久中文娱乐网| 色欲综合视频天天天| 日本欧美一区二区| 国产精品全国免费观看高清| 欧美亚洲图片小说| 国产在线看一区| 亚洲一区二区美女| 久久久久久久网| 色婷婷一区二区| 国产精品69久久久久水密桃| 一区二区日韩电影| 久久嫩草精品久久久精品| 91精彩视频在线观看| 国产经典欧美精品| 日韩国产欧美在线观看| 亚洲欧洲99久久| 精品国产免费一区二区三区四区 | 亚洲男人的天堂av| 日韩午夜激情av| 欧美日韩mp4| 成人一区在线看| 麻豆精品视频在线| 一区二区三区四区中文字幕| 精品久久国产老人久久综合| 在线亚洲一区二区| 国产又黄又大久久| 国产精品视频观看| 国产裸体歌舞团一区二区| 99久久er热在这里只有精品15| 国产精品全国免费观看高清| 日韩欧美另类在线| 欧美久久久久免费| 欧美亚洲国产一卡| 99r国产精品| 国产成人免费视频一区| 免费观看在线色综合| 亚洲成人激情综合网| 亚洲综合色在线| ㊣最新国产の精品bt伙计久久| 久久九九99视频| 久久网这里都是精品| 日韩欧美色电影| 91精品国产全国免费观看| 欧美亚洲日本国产| 色噜噜狠狠成人中文综合| 成人av电影在线观看| 成人综合在线网站| 成人一区二区三区视频在线观看| 国产宾馆实践打屁股91| 国产精品一区二区三区网站| 精品写真视频在线观看| 韩国成人在线视频| 国产一区亚洲一区| 国产麻豆精品视频| 成人免费av资源| av电影在线观看完整版一区二区| 成人黄色777网| 成人免费视频视频在线观看免费| 国产成人一区在线| www.一区二区| 91久久精品国产91性色tv| 色88888久久久久久影院野外| 色天天综合色天天久久| 欧美中文字幕亚洲一区二区va在线| 91免费在线看| 欧美丝袜自拍制服另类| 欧美人体做爰大胆视频| 日韩三级在线观看| 国产欧美精品一区二区色综合朱莉| 国产精品高潮久久久久无| 国产精品成人在线观看| 亚洲三级在线免费| 亚洲一区二区三区视频在线 | 26uuu亚洲| 久久精品这里都是精品| 中文字幕一区二区三| 亚洲精品免费视频| 日本不卡不码高清免费观看| 国产一区二区免费看| 成人精品视频一区二区三区尤物| 91在线高清观看| 欧美亚洲国产一区二区三区va | 国产精品欧美综合在线| 亚洲欧洲精品一区二区三区不卡| 亚洲一区免费在线观看| 蜜臀av性久久久久蜜臀aⅴ流畅| 国产一区二区三区久久久| 91丨porny丨国产| 欧美精选一区二区| 久久精品欧美一区二区三区麻豆 | 亚洲婷婷国产精品电影人久久| 一区二区成人在线| 麻豆精品视频在线观看视频| 99久久99久久久精品齐齐| 欧美久久久一区| 中文字幕一区二区三区色视频| 亚洲成a人v欧美综合天堂| 国产精品综合一区二区| 欧美四级电影在线观看| 久久久久久电影| 日韩精品视频网| 成人app下载| 欧美电影精品一区二区 | 亚洲视频 欧洲视频| 日本欧美在线观看| 99久久综合国产精品| 日韩精品自拍偷拍| 亚洲老司机在线| 国产91精品免费| 8x8x8国产精品| 最好看的中文字幕久久| 国模少妇一区二区三区| 欧美三级视频在线观看| 亚洲国产电影在线观看| 麻豆成人综合网| 欧美日韩第一区日日骚| 国产精品国产三级国产aⅴ中文| 蜜桃精品视频在线| 在线观看日韩高清av| 国产精品视频看| 国产一区二区三区在线看麻豆| 欧美午夜视频网站| 亚洲视频一区二区免费在线观看| 另类调教123区| 欧美日韩免费不卡视频一区二区三区| 国产精品视频你懂的| 久色婷婷小香蕉久久| 精品视频999| 亚洲精品成人悠悠色影视| 国产福利一区二区三区| 欧美一个色资源| 亚洲高清视频的网址| 色婷婷综合久久| 亚洲欧美日韩电影| 成人精品免费网站| 国产清纯白嫩初高生在线观看91| 久久99深爱久久99精品| 制服.丝袜.亚洲.另类.中文| 亚洲国产精品视频| 欧美中文字幕一区二区三区 | 日本韩国精品一区二区在线观看| 中文字幕成人在线观看| 国产一区二区中文字幕| 26uuu国产电影一区二区| 乱一区二区av| www激情久久| 成人免费视频免费观看| 亚洲天堂久久久久久久| av午夜一区麻豆|