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

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

?? stm32l1xx_tim.c

?? STM32+Grlib
?? C
?? 第 1 頁 / 共 5 頁
字號:
  tmpccer &= (uint16_t)~((uint16_t)TIM_CCER_CC3P);
  tmpccer |= (uint16_t)(TIM_OCPolarity << 8);
  /* Write to TIMx CCER register */
  TIMx->CCER = tmpccer;
}

/**
  * @brief  Configures the TIMx channel 4 polarity.
  * @param  TIMx: where x can be 2, 3 or 4 to select the TIM peripheral.
  * @param  TIM_OCPolarity: specifies the OC4 Polarity
  *   This parmeter can be one of the following values:
  *     @arg TIM_OCPolarity_High: Output Compare active high
  *     @arg TIM_OCPolarity_Low: Output Compare active low
  * @retval None
  */
void TIM_OC4PolarityConfig(TIM_TypeDef* TIMx, uint16_t TIM_OCPolarity)
{
  uint16_t tmpccer = 0;
  
  /* Check the parameters */
  assert_param(IS_TIM_LIST3_PERIPH(TIMx));
  assert_param(IS_TIM_OC_POLARITY(TIM_OCPolarity));
  
  tmpccer = TIMx->CCER;
  /* Set or Reset the CC4P Bit */
  tmpccer &= (uint16_t)~((uint16_t)TIM_CCER_CC4P);
  tmpccer |= (uint16_t)(TIM_OCPolarity << 12);
  /* Write to TIMx CCER register */
  TIMx->CCER = tmpccer;
}

/**
  * @brief  Selects the OCReference Clear source.
  * @param  TIMx: where x can be 2, 3 or 4 to select the TIM peripheral.
  * @param  TIM_OCReferenceClear: specifies the OCReference Clear source.
  *   This parameter can be one of the following values:
  *     @arg TIM_OCReferenceClear_ETRF: The internal OCreference clear input is connected to ETRF.
  *     @arg TIM_OCReferenceClear_OCREFCLR: The internal OCreference clear input is connected to OCREF_CLR input.  
  * @retval None
  */
void TIM_SelectOCREFClear(TIM_TypeDef* TIMx, uint16_t TIM_OCReferenceClear)
{
  /* Check the parameters */
  assert_param(IS_TIM_LIST3_PERIPH(TIMx));
  assert_param(TIM_OCREFERENCECECLEAR_SOURCE(TIM_OCReferenceClear));

  /* Set the TIM_OCReferenceClear source */
  TIMx->SMCR &=  (uint16_t)~((uint16_t)TIM_SMCR_OCCS);
  TIMx->SMCR |=  TIM_OCReferenceClear;
}

/**
  * @brief  Enables or disables the TIM Capture Compare Channel x.
  * @param  TIMx: where x can be 2, 3, 4, 9, 10 or 11 to select the TIM peripheral.
  * @param  TIM_Channel: specifies the TIM Channel
  *   This parameter can be one of the following values:
  *     @arg TIM_Channel_1: TIM Channel 1
  *     @arg TIM_Channel_2: TIM Channel 2
  *     @arg TIM_Channel_3: TIM Channel 3
  *     @arg TIM_Channel_4: TIM Channel 4
  * @param  TIM_CCx: specifies the TIM Channel CCxE bit new state.
  *   This parameter can be: TIM_CCx_Enable or TIM_CCx_Disable. 
  * @retval None
  */
void TIM_CCxCmd(TIM_TypeDef* TIMx, uint16_t TIM_Channel, uint16_t TIM_CCx)
{
  uint16_t tmp = 0;

  /* Check the parameters */
  assert_param(IS_TIM_LIST1_PERIPH(TIMx)); 
  assert_param(IS_TIM_CCX(TIM_CCx));

  tmp = CCER_CCE_SET << TIM_Channel;

  /* Reset the CCxE Bit */
  TIMx->CCER &= (uint16_t)~ tmp;

  /* Set or reset the CCxE Bit */ 
  TIMx->CCER |=  (uint16_t)(TIM_CCx << TIM_Channel);
}

/**
  * @}
  */

/** @defgroup TIM_Group3 Input Capture management functions
 *  @brief    Input Capture management functions 
 *
@verbatim   
 ===============================================================================
                      Input Capture management functions
 ===============================================================================  
   
       ===================================================================      
              TIM Driver: how to use it in Input Capture Mode
       =================================================================== 
       To use the Timer in Input Capture mode, the following steps are mandatory:
       
       1. Enable TIM clock using RCC_APBxPeriphClockCmd(RCC_APBxPeriph_TIMx, ENABLE) function
       
       2. Configure the TIM pins by configuring the corresponding GPIO pins
       
       2. Configure the Time base unit as described in the first part of this driver, if needed,
          else the Timer will run with the default configuration:
          - Autoreload value = 0xFFFF
          - Prescaler value = 0x0000
          - Counter mode = Up counting
          - Clock Division = TIM_CKD_DIV1
          
       3. Fill the TIM_ICInitStruct with the desired parameters including:
          - TIM Channel: TIM_Channel
          - TIM Input Capture polarity: TIM_ICPolarity
          - TIM Input Capture selection: TIM_ICSelection
          - TIM Input Capture Prescaler: TIM_ICPrescaler
          - TIM Input CApture filter value: TIM_ICFilter
       
       4. Call TIM_ICInit(TIMx, &TIM_ICInitStruct) to configure the desired channel with the 
          corresponding configuration and to measure only frequency or duty cycle of the input signal,
          or,
          Call TIM_PWMIConfig(TIMx, &TIM_ICInitStruct) to configure the desired channels with the 
          corresponding configuration and to measure the frequency and the duty cycle of the input signal
          
       5. Enable the NVIC or the DMA to read the measured frequency. 
          
       6. Enable the corresponding interrupt (or DMA request) to read the Captured value,
          using the function TIM_ITConfig(TIMx, TIM_IT_CCx) (or TIM_DMA_Cmd(TIMx, TIM_DMA_CCx)) 
       
       7. Call the TIM_Cmd(ENABLE) function to enable the TIM counter.
       
       8. Use TIM_GetCapturex(TIMx); to read the captured value.
       
       Note1: All other functions can be used seperatly to modify, if needed,
          a specific feature of the Timer. 

@endverbatim
  * @{
  */

/**
  * @brief  Initializes the TIM peripheral according to the specified
  *         parameters in the TIM_ICInitStruct.
  * @param  TIMx: where x can be 2, 3, 4, 9, 10 or 11 to select the TIM peripheral.
  * @param  TIM_ICInitStruct: pointer to a TIM_ICInitTypeDef structure
  *         that contains the configuration information for the specified TIM 
  *         peripheral.
  * @retval None
  */
void TIM_ICInit(TIM_TypeDef* TIMx, TIM_ICInitTypeDef* TIM_ICInitStruct)
{
  /* Check the parameters */
  assert_param(IS_TIM_LIST1_PERIPH(TIMx));
  assert_param(IS_TIM_IC_POLARITY(TIM_ICInitStruct->TIM_ICPolarity));
  assert_param(IS_TIM_IC_SELECTION(TIM_ICInitStruct->TIM_ICSelection));
  assert_param(IS_TIM_IC_PRESCALER(TIM_ICInitStruct->TIM_ICPrescaler));
  assert_param(IS_TIM_IC_FILTER(TIM_ICInitStruct->TIM_ICFilter));
  
  if (TIM_ICInitStruct->TIM_Channel == TIM_Channel_1)
  {
    /* TI1 Configuration */
    TI1_Config(TIMx, TIM_ICInitStruct->TIM_ICPolarity,
               TIM_ICInitStruct->TIM_ICSelection,
               TIM_ICInitStruct->TIM_ICFilter);
    /* Set the Input Capture Prescaler value */
    TIM_SetIC1Prescaler(TIMx, TIM_ICInitStruct->TIM_ICPrescaler);
  }
  else if (TIM_ICInitStruct->TIM_Channel == TIM_Channel_2)
  {
    /* TI2 Configuration */
    TI2_Config(TIMx, TIM_ICInitStruct->TIM_ICPolarity,
               TIM_ICInitStruct->TIM_ICSelection,
               TIM_ICInitStruct->TIM_ICFilter);
    /* Set the Input Capture Prescaler value */
    TIM_SetIC2Prescaler(TIMx, TIM_ICInitStruct->TIM_ICPrescaler);
  }
  else if (TIM_ICInitStruct->TIM_Channel == TIM_Channel_3)
  {
    /* TI3 Configuration */
    TI3_Config(TIMx,  TIM_ICInitStruct->TIM_ICPolarity,
               TIM_ICInitStruct->TIM_ICSelection,
               TIM_ICInitStruct->TIM_ICFilter);
    /* Set the Input Capture Prescaler value */
    TIM_SetIC3Prescaler(TIMx, TIM_ICInitStruct->TIM_ICPrescaler);
  }
  else
  {
    /* TI4 Configuration */
    TI4_Config(TIMx, TIM_ICInitStruct->TIM_ICPolarity,
               TIM_ICInitStruct->TIM_ICSelection,
               TIM_ICInitStruct->TIM_ICFilter);
    /* Set the Input Capture Prescaler value */
    TIM_SetIC4Prescaler(TIMx, TIM_ICInitStruct->TIM_ICPrescaler);
  }
}

/**
  * @brief  Fills each TIM_ICInitStruct member with its default value.
  * @param  TIM_ICInitStruct : pointer to a TIM_ICInitTypeDef structure which will
  *         be initialized.
  * @retval None
  */
void TIM_ICStructInit(TIM_ICInitTypeDef* TIM_ICInitStruct)
{
  /* Set the default configuration */
  TIM_ICInitStruct->TIM_Channel = TIM_Channel_1;
  TIM_ICInitStruct->TIM_ICPolarity = TIM_ICPolarity_Rising;
  TIM_ICInitStruct->TIM_ICSelection = TIM_ICSelection_DirectTI;
  TIM_ICInitStruct->TIM_ICPrescaler = TIM_ICPSC_DIV1;
  TIM_ICInitStruct->TIM_ICFilter = 0x00;
}

/**
  * @brief  Configures the TIM peripheral according to the specified
  *         parameters in the TIM_ICInitStruct to measure an external PWM signal.
  * @param  TIMx: where x can be 2, 3, 4 or 9 to select the TIM peripheral.
  * @param  TIM_ICInitStruct: pointer to a TIM_ICInitTypeDef structure
  *         that contains the configuration information for the specified TIM 
  *         peripheral.
  * @retval None
  */
void TIM_PWMIConfig(TIM_TypeDef* TIMx, TIM_ICInitTypeDef* TIM_ICInitStruct)
{
  uint16_t icoppositepolarity = TIM_ICPolarity_Rising;
  uint16_t icoppositeselection = TIM_ICSelection_DirectTI;
  /* Check the parameters */
  assert_param(IS_TIM_LIST2_PERIPH(TIMx));
  /* Select the Opposite Input Polarity */
  if (TIM_ICInitStruct->TIM_ICPolarity == TIM_ICPolarity_Rising)
  {
    icoppositepolarity = TIM_ICPolarity_Falling;
  }
  else
  {
    icoppositepolarity = TIM_ICPolarity_Rising;
  }
  /* Select the Opposite Input */
  if (TIM_ICInitStruct->TIM_ICSelection == TIM_ICSelection_DirectTI)
  {
    icoppositeselection = TIM_ICSelection_IndirectTI;
  }
  else
  {
    icoppositeselection = TIM_ICSelection_DirectTI;
  }
  if (TIM_ICInitStruct->TIM_Channel == TIM_Channel_1)
  {
    /* TI1 Configuration */
    TI1_Config(TIMx, TIM_ICInitStruct->TIM_ICPolarity, TIM_ICInitStruct->TIM_ICSelection,
               TIM_ICInitStruct->TIM_ICFilter);
    /* Set the Input Capture Prescaler value */
    TIM_SetIC1Prescaler(TIMx, TIM_ICInitStruct->TIM_ICPrescaler);
    /* TI2 Configuration */
    TI2_Config(TIMx, icoppositepolarity, icoppositeselection, TIM_ICInitStruct->TIM_ICFilter);
    /* Set the Input Capture Prescaler value */
    TIM_SetIC2Prescaler(TIMx, TIM_ICInitStruct->TIM_ICPrescaler);
  }
  else
  { 
    /* TI2 Configuration */
    TI2_Config(TIMx, TIM_ICInitStruct->TIM_ICPolarity, TIM_ICInitStruct->TIM_ICSelection,
               TIM_ICInitStruct->TIM_ICFilter);
    /* Set the Input Capture Prescaler value */
    TIM_SetIC2Prescaler(TIMx, TIM_ICInitStruct->TIM_ICPrescaler);
    /* TI1 Configuration */
    TI1_Config(TIMx, icoppositepolarity, icoppositeselection, TIM_ICInitStruct->TIM_ICFilter);
    /* Set the Input Capture Prescaler value */
    TIM_SetIC1Prescaler(TIMx, TIM_ICInitStruct->TIM_ICPrescaler);
  }
}

/**
  * @brief  Gets the TIMx Input Capture 1 value.
  * @param  TIMx: where x can be 2, 3, 4, 9, 10 or 11 to select the TIM peripheral.
  * @retval Capture Compare 1 Register value.

  */
uint32_t TIM_GetCapture1(TIM_TypeDef* TIMx)
{
  /* Check the parameters */
  assert_param(IS_TIM_LIST1_PERIPH(TIMx));
  
  /* Get the Capture 1 Register value */
  return TIMx->CCR1;
}

/**
  * @brief  Gets the TIMx Input Capture 2 value.
  * @param  TIMx: where x can be 2, 3, 4 or 9 to select the TIM peripheral.
  * @retval Capture Compare 2 Register value.

  */
uint32_t TIM_GetCapture2(TIM_TypeDef* TIMx)
{
  /* Check the parameters */
  assert_param(IS_TIM_LIST2_PERIPH(TIMx));
  
  /* Get the Capture 2 Register value */
  return TIMx->CCR2;
}

/**
  * @brief  Gets the TIMx Input Capture 3 value.
  * @param  TIMx: where x can be 2, 3 or 4 to select the TIM peripheral.
  * @retval Capture Compare 3 Register value.
  */
uint32_t TIM_GetCapture3(TIM_TypeDef* TIMx)
{
  /* Check the parameters */
  assert_param(IS_TIM_LIST3_PERIPH(TIMx)); 
  
  /* Get the Capture 3 Register value */
  return TIMx->CCR3;
}

/**
  * @brief  Gets the TIMx Input Capture 4 value.
  * @param  TIMx: where x can be 2, 3 or 4 to select the TIM peripheral.
  * @retval Capture Compare 4 Register value.
  */
uint32_t TIM_GetCapture4(TIM_TypeDef* TIMx)
{
  /* Check the parameters */
  assert_param(IS_TIM_LIST3_PERIPH(TIMx));
  
  /* Get the Capture 4 Register value */
  return TIMx->CCR4;
}

/**
  * @brief  Sets the TIMx Input Capture 1 prescaler.
  * @param  TIMx: where x can be 2, 3, 4, 9, 10 or 11 to select the TIM peripheral.
  * @param  TIM_ICPSC: specifies the Input Capture1 prescaler new value.
  *   This parameter can be one of the following values:
  *     @arg TIM_ICPSC_DIV1: no prescaler
  *     @arg TIM_ICPSC_DIV2: capture is done once every 2 events
  *     @arg TIM_ICPSC_DIV4: capture is done once every 4 events
  *     @arg TIM_ICPSC_DIV8: capture is done once every 8 events
  * @retval None
  */
void TIM_SetIC1Prescaler(TIM_TypeDef* TIMx, uint16_t TIM_ICPSC)
{
  /* Check the parameters */
  assert_param(IS_TIM_LIST1_PERIPH(TIMx));
  assert_param(IS_TIM_IC_PRESCALER(TIM_ICPSC));
  
  /* Reset the IC1PSC Bits */
  TIMx->CCMR1 &= (uint16_t)~((uint16_t)TIM_CCMR1_IC1PSC);
  /* Set the IC1PSC value */
  TIMx->CCMR1 |= TIM_ICPSC;
}

/**
  * @brief  Sets the TIMx Input Capture 2 prescaler.
  * @param  TIMx: where x can be 2, 3, 4 or 9 to select the TIM peripheral.
  * @param  TIM_ICPSC: specifies the Input Capture2 prescaler new value.
  *   This parameter can be one of the following values:
  *     @arg TIM_ICPSC_DIV1: no prescaler
  *     @arg TIM_ICPSC_DIV2: capture is done once every 2 events
  *     @arg TIM_ICPSC_DIV4: capture is done once every 4 events
  *     @arg TIM_ICPSC_DIV8:

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91成人在线精品| 日韩视频永久免费| 欧美精品丝袜中出| 国产丝袜在线精品| 无码av中文一区二区三区桃花岛| 国产麻豆视频一区二区| 欧美日韩精品欧美日韩精品一综合| 久久亚洲一区二区三区四区| 亚洲福中文字幕伊人影院| 成人免费毛片片v| 久久精品一区二区三区av| 丝袜亚洲另类欧美| 在线免费精品视频| 亚洲视频 欧洲视频| 国产jizzjizz一区二区| 日韩一二三区视频| 美女在线视频一区| 91精品麻豆日日躁夜夜躁| 亚洲一区二区偷拍精品| 91成人看片片| 亚洲欧美日韩国产一区二区三区| 成人综合婷婷国产精品久久蜜臀| 久久伊人蜜桃av一区二区| 麻豆精品精品国产自在97香蕉| 欧美久久婷婷综合色| 亚洲永久精品大片| 在线亚洲欧美专区二区| 亚洲天堂成人网| www.亚洲精品| 亚洲欧美日韩一区| 日本乱人伦aⅴ精品| 一区二区三区四区国产精品| 99re8在线精品视频免费播放| 中文字幕二三区不卡| 成人av网站免费| 国产精品天天看| 色综合天天综合网天天看片| 亚洲精品成a人| 欧美色图天堂网| 日本怡春院一区二区| 欧美大片在线观看一区| 精品综合免费视频观看| 国产视频一区二区在线| 成人h精品动漫一区二区三区| 国产精品视频yy9299一区| 成人97人人超碰人人99| 亚洲精品中文字幕乱码三区| 欧美日韩中文一区| 日本网站在线观看一区二区三区 | 成人性生交大片免费看视频在线| 日本一区二区三区四区| 成+人+亚洲+综合天堂| 亚洲久草在线视频| 欧美日本韩国一区二区三区视频| 麻豆成人av在线| 久久精品综合网| 91高清在线观看| 久久99久久久欧美国产| 中文字幕一区二区三区色视频| 欧美午夜片在线看| 极品少妇一区二区三区精品视频| 中文在线资源观看网站视频免费不卡| 色噜噜久久综合| 久久精品国产秦先生| 专区另类欧美日韩| 欧美一区二区精品在线| 国产91对白在线观看九色| 亚洲妇女屁股眼交7| 国产亚洲一区二区三区四区| 色狠狠一区二区| 国产一区二区三区在线观看免费| 中文字幕亚洲欧美在线不卡| 日韩亚洲欧美在线观看| 色悠悠亚洲一区二区| 国产一区二区三区四 | 久久久午夜精品理论片中文字幕| 91丝袜高跟美女视频| 免费的成人av| 亚洲美女屁股眼交| 欧美精品一区二区在线播放| 91成人免费在线视频| 成人一区二区在线观看| 免费在线观看一区二区三区| 日韩伦理av电影| xnxx国产精品| 欧美日韩国产高清一区| 成人福利视频在线看| 韩国成人精品a∨在线观看| 婷婷开心激情综合| 中文字幕在线不卡视频| 精品免费一区二区三区| 欧美日韩免费电影| 色综合久久久久综合99| 国产成人日日夜夜| 麻豆国产精品视频| 午夜天堂影视香蕉久久| 亚洲精品网站在线观看| 国产精品萝li| 国产精品色在线观看| 久久女同互慰一区二区三区| 欧美精品一二三四| 在线观看视频一区二区| 色菇凉天天综合网| yourporn久久国产精品| 丁香啪啪综合成人亚洲小说| 国产精品一区免费视频| 国产精品正在播放| 国产精品99久久久久久久vr| 国产综合成人久久大片91| 日本人妖一区二区| 大白屁股一区二区视频| 国产99精品国产| 国产成人综合自拍| 国产91对白在线观看九色| 国产高清无密码一区二区三区| 国内精品久久久久影院薰衣草| 精品中文av资源站在线观看| 久久99国产精品免费网站| 另类的小说在线视频另类成人小视频在线| 亚洲国产综合人成综合网站| 石原莉奈在线亚洲三区| 日韩在线一二三区| 免费观看在线综合色| 九色porny丨国产精品| 国产美女精品一区二区三区| 国产乱码精品1区2区3区| 处破女av一区二区| 色综合久久久久久久久| 欧美乱妇15p| 欧美xxxx老人做受| 欧美国产成人在线| 亚洲欧美日韩人成在线播放| 午夜国产精品一区| 精品一区精品二区高清| 丁香桃色午夜亚洲一区二区三区| av激情成人网| 欧美日韩在线三区| 日韩精品专区在线影院观看| 国产欧美日韩视频一区二区| 亚洲精品乱码久久久久久黑人| 五月激情六月综合| 国产乱人伦偷精品视频免下载| 成人激情小说网站| 欧美三级中文字幕| 国产日韩欧美麻豆| 亚洲欧美区自拍先锋| 免费观看一级欧美片| 国产宾馆实践打屁股91| 91丨九色丨尤物| 欧美mv和日韩mv国产网站| 国产精品激情偷乱一区二区∴| 亚洲亚洲精品在线观看| 国产精品一区二区三区四区| 欧日韩精品视频| 精品国产乱码久久久久久影片| 国产精品九色蝌蚪自拍| 毛片av一区二区| 成人99免费视频| 精品日韩一区二区三区免费视频| 亚洲美女免费在线| 国产一区二区三区在线看麻豆| 色悠久久久久综合欧美99| 精品国产免费一区二区三区香蕉| 亚洲免费电影在线| 豆国产96在线|亚洲| 欧美伦理影视网| 1区2区3区欧美| 国产成人精品亚洲777人妖| 欧美精品v国产精品v日韩精品| 亚洲国产经典视频| 久久国产精品99精品国产| 欧美色视频在线| 亚洲精品福利视频网站| voyeur盗摄精品| 国产区在线观看成人精品| 免费成人小视频| 欧美顶级少妇做爰| 亚洲综合免费观看高清完整版| 国产一区二区三区香蕉| 欧美一区二区三区在线看| 亚洲国产精品一区二区www在线 | 国产日韩三级在线| 久草中文综合在线| 欧美一级xxx| 五月婷婷久久丁香| 欧美在线你懂得| 自拍偷拍亚洲激情| gogogo免费视频观看亚洲一| 国产三级欧美三级日产三级99| 精品亚洲国内自在自线福利| 91精品国产综合久久蜜臀| 亚洲国产视频在线| 欧洲一区二区av| 亚洲国产精品一区二区www| 色av一区二区| 亚洲一区二区三区不卡国产欧美 | 欧美一区二区三区视频免费| 亚洲最大色网站| 欧美日韩一区二区三区四区五区| 一区二区免费在线播放|