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

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

?? stm32f10x_adc.c

?? 基于Cortex-M3的STM32的IAR EWARM的工程模塊
?? 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;
}

/*******************************************************************************
* Function Name  : ADC_InjectedSequencerLengthConfig

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
波波电影院一区二区三区| 午夜精品久久久久久久99水蜜桃 | 丰满少妇久久久久久久| 久久影院视频免费| 国产一区在线精品| 欧美一区二区三区婷婷月色| 日本不卡在线视频| 欧美电视剧在线看免费| 国内精品免费**视频| 国产亚洲成av人在线观看导航 | 欧美日韩国产电影| 奇米一区二区三区av| 久久日韩粉嫩一区二区三区| 国产九色sp调教91| 专区另类欧美日韩| 777奇米四色成人影色区| 久久国产剧场电影| 国产精品国产精品国产专区不片| 91片黄在线观看| 免费看日韩a级影片| 国产日韩欧美在线一区| 色婷婷一区二区三区四区| 青青草国产精品亚洲专区无| 国产亚洲欧洲997久久综合| 99精品视频一区二区| 婷婷成人综合网| 2021中文字幕一区亚洲| 色婷婷综合久久久久中文 | 一区二区三区国产精品| 91麻豆精品国产91久久久| 国产九九视频一区二区三区| 亚洲精品日韩综合观看成人91| 欧美一区二区三区喷汁尤物| 高清在线不卡av| 午夜视频一区在线观看| 久久久久久久久久久黄色| 欧美视频一区二区| 成人黄色av网站在线| 日韩精品福利网| 最新成人av在线| 精品电影一区二区| 欧美日韩一卡二卡| 不卡免费追剧大全电视剧网站| 免费在线看一区| 一区二区免费在线播放| 国产偷国产偷精品高清尤物| 欧美视频日韩视频在线观看| 成人app网站| 韩国一区二区视频| 日日摸夜夜添夜夜添国产精品| 国产精品日产欧美久久久久| 欧美一区二区三区日韩视频| 在线视频你懂得一区| 成人av电影免费在线播放| 免费成人美女在线观看| 亚洲sss视频在线视频| 国产精品毛片久久久久久| 日韩三级视频在线观看| 欧美性猛片aaaaaaa做受| 成人午夜视频福利| 国产一区欧美日韩| 激情文学综合插| 美腿丝袜一区二区三区| 偷拍一区二区三区四区| 亚洲精品高清在线观看| 国产精品视频一二三区| 国产夜色精品一区二区av| 欧美一区二区三区白人| 欧美日韩国产成人在线91| 在线一区二区视频| 欧美午夜精品久久久久久孕妇 | 久久久不卡网国产精品一区| 欧美日韩一级视频| 欧美日韩一区久久| 欧美丝袜自拍制服另类| 欧美丝袜丝交足nylons图片| 91视频国产资源| 色综合久久久久网| 在线亚洲高清视频| 欧美日韩三级一区二区| 欧美日韩在线免费视频| 欧美精品一二三区| 欧美一区二区三区四区视频| 欧美一区二区网站| 日韩精品中文字幕在线一区| 欧美成人猛片aaaaaaa| 日韩欧美亚洲另类制服综合在线 | 久久久一区二区三区捆绑**| 久久久天堂av| 国产精品久久看| 中文字幕亚洲一区二区av在线| 中文字幕在线不卡一区二区三区| 国产精品高潮呻吟| 亚洲日本一区二区| 亚洲一级不卡视频| 五月激情综合网| 激情小说亚洲一区| 成人精品鲁一区一区二区| 不卡一区在线观看| 精品视频资源站| 欧美一级欧美三级在线观看| 欧美一区二区三区喷汁尤物| 久久婷婷国产综合国色天香| 国产日韩欧美不卡在线| 亚洲精品少妇30p| 欧美aⅴ一区二区三区视频| 国产精品综合二区| 97精品久久久午夜一区二区三区 | 亚洲免费在线观看视频| 天堂在线亚洲视频| 国产成人在线视频网址| 色综合天天性综合| 欧美美女激情18p| 久久久久久久国产精品影院| 国产精品国产三级国产普通话蜜臀| 亚洲女同一区二区| 久久国产精品99久久人人澡| 成人午夜私人影院| 91精品免费在线观看| 久久夜色精品一区| 亚洲欧洲综合另类在线| 免费成人av在线| 91热门视频在线观看| 欧美一区二区三区人| 国产精品久久毛片| 蜜桃av一区二区在线观看| 成人av小说网| 日韩欧美国产三级| 亚洲欧美日韩国产综合在线| 久久精品国产精品亚洲红杏| 91麻豆国产精品久久| 精品国产人成亚洲区| 亚洲精品精品亚洲| 国产很黄免费观看久久| 欧美日韩在线精品一区二区三区激情| 久久美女艺术照精彩视频福利播放| 亚洲综合色网站| 成人av免费在线观看| 久久亚洲私人国产精品va媚药| 亚洲理论在线观看| 国产99久久久久| 26uuu国产电影一区二区| 亚洲国产精品一区二区久久恐怖片| 国产精一区二区三区| 欧美精品成人一区二区三区四区| 国产精品久久久久久久蜜臀| 老司机精品视频在线| 欧美色手机在线观看| 国产精品成人免费| 国产夫妻精品视频| 欧美刺激脚交jootjob| 首页国产丝袜综合| 欧美性受xxxx黑人xyx| 五月天中文字幕一区二区| 懂色av一区二区三区免费观看| 91精品国产aⅴ一区二区| 亚洲国产欧美在线人成| 色噜噜狠狠成人中文综合| 欧美激情在线一区二区| 国产一区二区三区在线观看免费 | 国产亚洲成aⅴ人片在线观看 | 欧美激情在线一区二区| 国产一区二区在线电影| 日韩精品一区二区三区蜜臀| 日韩电影一区二区三区四区| 欧美日韩免费观看一区二区三区| 亚洲黄色尤物视频| 93久久精品日日躁夜夜躁欧美| 国产精品网站在线| 成人一级黄色片| 中文久久乱码一区二区| 国产1区2区3区精品美女| 国产午夜精品久久久久久免费视| 精品亚洲aⅴ乱码一区二区三区| 日韩亚洲欧美综合| 久久精品国产在热久久| www国产精品av| 成人一区二区三区视频| 日韩码欧中文字| 在线观看国产91| 日韩二区在线观看| 久久综合色综合88| 粉嫩一区二区三区在线看| 中文字幕人成不卡一区| 一本久道中文字幕精品亚洲嫩| 一区二区三区小说| 在线播放中文一区| 国产麻豆精品在线| 亚洲欧洲日韩综合一区二区| 色94色欧美sute亚洲线路二 | 欧美一区二区播放| 激情图区综合网| 中文字幕一区二区三区在线观看 | 国产精品视频观看| 色一情一乱一乱一91av| 亚洲gay无套男同| 久久美女艺术照精彩视频福利播放| 夫妻av一区二区| 亚洲愉拍自拍另类高清精品| 日韩欧美中文字幕公布|