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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? stm32l1xx_tim.c

?? STM32+Grlib
?? C
?? 第 1 頁 / 共 5 頁
字號(hào):
}

/**
  * @brief  Sets the TIMx Autoreload Register value
  * @param  TIMx: where x can be 2 to 11 to select the TIM peripheral.
  * @param  Autoreload: specifies the Autoreload register new value.
  * @retval None
  */
void TIM_SetAutoreload(TIM_TypeDef* TIMx, uint32_t Autoreload)
{
  /* Check the parameters */
  assert_param(IS_TIM_ALL_PERIPH(TIMx));
  
  /* Set the Autoreload Register value */
  TIMx->ARR = Autoreload;
}

/**
  * @brief  Gets the TIMx Counter value.
  * @param  TIMx: where x can be 2 to 11 to select the TIM peripheral.
  * @retval Counter Register value.
  */
uint32_t TIM_GetCounter(TIM_TypeDef* TIMx)
{
  /* Check the parameters */
  assert_param(IS_TIM_ALL_PERIPH(TIMx));
  
  /* Get the Counter Register value */
  return TIMx->CNT;
}

/**
  * @brief  Gets the TIMx Prescaler value.
  * @param  TIMx: where x can be 2 to 11 to select the TIM peripheral.
  * @retval Prescaler Register value.
  */
uint16_t TIM_GetPrescaler(TIM_TypeDef* TIMx)
{
  /* Check the parameters */
  assert_param(IS_TIM_ALL_PERIPH(TIMx));
  
  /* Get the Prescaler Register value */
  return TIMx->PSC;
}

/**
  * @brief  Enables or Disables the TIMx Update event.
  * @param  TIMx: where x can be 2 to 11 to select the TIM peripheral.
  * @param  NewState: new state of the TIMx UDIS bit
  *   This parameter can be: ENABLE or DISABLE.
  * @retval None
  */
void TIM_UpdateDisableConfig(TIM_TypeDef* TIMx, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_TIM_ALL_PERIPH(TIMx));
  assert_param(IS_FUNCTIONAL_STATE(NewState));
  
  if (NewState != DISABLE)
  {
    /* Set the Update Disable Bit */
    TIMx->CR1 |= TIM_CR1_UDIS;
  }
  else
  {
    /* Reset the Update Disable Bit */
    TIMx->CR1 &= (uint16_t)~((uint16_t)TIM_CR1_UDIS);
  }
}

/**
  * @brief  Configures the TIMx Update Request Interrupt source.
  * @param  TIMx: where x can be 2 to 11 to select the TIM peripheral.
  * @param  TIM_UpdateSource: specifies the Update source.
  *   This parameter can be one of the following values:
  *     @arg TIM_UpdateSource_Regular: Source of update is the counter overflow/underflow
                                       or the setting of UG bit, or an update generation
                                       through the slave mode controller.
  *     @arg TIM_UpdateSource_Global: Source of update is counter overflow/underflow.
  * @retval None
  */
void TIM_UpdateRequestConfig(TIM_TypeDef* TIMx, uint16_t TIM_UpdateSource)
{
  /* Check the parameters */
  assert_param(IS_TIM_ALL_PERIPH(TIMx));
  assert_param(IS_TIM_UPDATE_SOURCE(TIM_UpdateSource));
  
  if (TIM_UpdateSource != TIM_UpdateSource_Global)
  {
    /* Set the URS Bit */
    TIMx->CR1 |= TIM_CR1_URS;
  }
  else
  {
    /* Reset the URS Bit */
    TIMx->CR1 &= (uint16_t)~((uint16_t)TIM_CR1_URS);
  }
}

/**
  * @brief  Enables or disables TIMx peripheral Preload register on ARR.
  * @param  TIMx: where x can be  2 to 11 to select the TIM peripheral.
  * @param  NewState: new state of the TIMx peripheral Preload register
  *   This parameter can be: ENABLE or DISABLE.
  * @retval None
  */
void TIM_ARRPreloadConfig(TIM_TypeDef* TIMx, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_TIM_ALL_PERIPH(TIMx));
  assert_param(IS_FUNCTIONAL_STATE(NewState));
  
  if (NewState != DISABLE)
  {
    /* Set the ARR Preload Bit */
    TIMx->CR1 |= TIM_CR1_ARPE;
  }
  else
  {
    /* Reset the ARR Preload Bit */
    TIMx->CR1 &= (uint16_t)~((uint16_t)TIM_CR1_ARPE);
  }
}

/**
  * @brief  Selects the TIMx抯 One Pulse Mode.
  * @param  TIMx: where x can be 2 to 11 to select the TIM peripheral.
  * @param  TIM_OPMode: specifies the OPM Mode to be used.
  *   This parameter can be one of the following values:
  *     @arg TIM_OPMode_Single
  *     @arg TIM_OPMode_Repetitive
  * @retval None
  */
void TIM_SelectOnePulseMode(TIM_TypeDef* TIMx, uint16_t TIM_OPMode)
{
  /* Check the parameters */
  assert_param(IS_TIM_ALL_PERIPH(TIMx));
  assert_param(IS_TIM_OPM_MODE(TIM_OPMode));
  
  /* Reset the OPM Bit */
  TIMx->CR1 &= (uint16_t)~((uint16_t)TIM_CR1_OPM);
  /* Configure the OPM Mode */
  TIMx->CR1 |= TIM_OPMode;
}

/**
  * @brief  Sets the TIMx Clock Division value.
  * @param  TIMx: where x can be  2, 3, 4, 9, 10 or 11 to select the TIM peripheral.
  * @param  TIM_CKD: specifies the clock division value.
  *   This parameter can be one of the following value:
  *     @arg TIM_CKD_DIV1: TDTS = Tck_tim
  *     @arg TIM_CKD_DIV2: TDTS = 2*Tck_tim
  *     @arg TIM_CKD_DIV4: TDTS = 4*Tck_tim
  * @retval None
  */
void TIM_SetClockDivision(TIM_TypeDef* TIMx, uint16_t TIM_CKD)
{
  /* Check the parameters */
  assert_param(IS_TIM_LIST1_PERIPH(TIMx));
  assert_param(IS_TIM_CKD_DIV(TIM_CKD));
  
  /* Reset the CKD Bits */
  TIMx->CR1 &= (uint16_t)~((uint16_t)TIM_CR1_CKD);
  /* Set the CKD value */
  TIMx->CR1 |= TIM_CKD;
}

/**
  * @brief  Enables or disables the specified TIM peripheral.
  * @param  TIMx: where x can be 2 to 11 to select the TIMx peripheral.
  * @param  NewState: new state of the TIMx peripheral.
  *         This parameter can be: ENABLE or DISABLE.
  * @retval None
  */
void TIM_Cmd(TIM_TypeDef* TIMx, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_TIM_ALL_PERIPH(TIMx)); 
  assert_param(IS_FUNCTIONAL_STATE(NewState));
  
  if (NewState != DISABLE)
  {
    /* Enable the TIM Counter */
    TIMx->CR1 |= TIM_CR1_CEN;
  }
  else
  {
    /* Disable the TIM Counter */
    TIMx->CR1 &= (uint16_t)(~((uint16_t)TIM_CR1_CEN));
  }
}

/**
  * @}
  */

/** @defgroup TIM_Group2 Output Compare management functions
 *  @brief    Output Compare management functions 
 *
@verbatim   
 ===============================================================================
                        Output Compare management functions
 ===============================================================================  
   
       ===================================================================      
              TIM Driver: how to use it in Output Compare Mode
       =================================================================== 
       To use the Timer in Output Compare 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_OCInitStruct with the desired parameters including:
          - The TIM Output Compare mode: TIM_OCMode
          - TIM Output State: TIM_OutputState
          - TIM Pulse value: TIM_Pulse
          - TIM Output Compare Polarity : TIM_OCPolarity
       
       4. Call TIM_OCxInit(TIMx, &TIM_OCInitStruct) to configure the desired channel with the 
          corresponding configuration
       
       5. Call the TIM_Cmd(ENABLE) function to enable the TIM counter.
       
       Note1: All other functions can be used separately to modify, if needed,
          a specific feature of the Timer. 
          
       Note2: In case of PWM mode, this function is mandatory:
              TIM_OCxPreloadConfig(TIMx, TIM_OCPreload_ENABLE); 
              
       Note3: If the corresponding interrupt or DMA request are needed, the user should:
              1. Enable the NVIC (or the DMA) to use the TIM interrupts (or DMA requests). 
              2. Enable the corresponding interrupt (or DMA request) using the function 
              TIM_ITConfig(TIMx, TIM_IT_CCx) (or TIM_DMA_Cmd(TIMx, TIM_DMA_CCx))   

@endverbatim
  * @{
  */

/**
  * @brief  Initializes the TIMx Channel1 according to the specified
  *         parameters in the TIM_OCInitStruct.
  * @param  TIMx: where x can be 2, 3, 4, 9, 10 or 11 to select the TIM peripheral.
  * @param  TIM_OCInitStruct: pointer to a TIM_OCInitTypeDef structure
  *         that contains the configuration information for the specified TIM 
  *         peripheral.
  * @retval None
  */
void TIM_OC1Init(TIM_TypeDef* TIMx, TIM_OCInitTypeDef* TIM_OCInitStruct)
{
  uint16_t tmpccmrx = 0, tmpccer = 0;
   
  /* Check the parameters */
  assert_param(IS_TIM_LIST1_PERIPH(TIMx));
  assert_param(IS_TIM_OC_MODE(TIM_OCInitStruct->TIM_OCMode));
  assert_param(IS_TIM_OUTPUT_STATE(TIM_OCInitStruct->TIM_OutputState));
  assert_param(IS_TIM_OC_POLARITY(TIM_OCInitStruct->TIM_OCPolarity));   
  /* Disable the Channel 1: Reset the CC1E Bit */
  TIMx->CCER &= (uint16_t)(~(uint16_t)TIM_CCER_CC1E);
  
  /* Get the TIMx CCER register value */
  tmpccer = TIMx->CCER;
  
  /* Get the TIMx CCMR1 register value */
  tmpccmrx = TIMx->CCMR1;
    
  /* Reset the Output Compare Mode Bits */
  tmpccmrx &= (uint16_t)(~((uint16_t)TIM_CCMR1_OC1M));
  tmpccmrx &= (uint16_t)(~((uint16_t)TIM_CCMR1_CC1S));
  
  /* Select the Output Compare Mode */
  tmpccmrx |= TIM_OCInitStruct->TIM_OCMode;
  
  /* Reset the Output Polarity level */
  tmpccer &= (uint16_t)(~((uint16_t)TIM_CCER_CC1P));
  /* Set the Output Compare Polarity */
  tmpccer |= TIM_OCInitStruct->TIM_OCPolarity;
  
  /* Set the Output State */
  tmpccer |= TIM_OCInitStruct->TIM_OutputState;
  
  /* Set the Capture Compare Register value */
  TIMx->CCR1 = TIM_OCInitStruct->TIM_Pulse;
  
  /* Write to TIMx CCMR1 */
  TIMx->CCMR1 = tmpccmrx;
  
  /* Write to TIMx CCER */
  TIMx->CCER = tmpccer;
}

/**
  * @brief  Initializes the TIMx Channel2 according to the specified
  *         parameters in the TIM_OCInitStruct.
  * @param  TIMx: where x can be 2, 3, 4 or 9 to select the TIM peripheral.
  * @param  TIM_OCInitStruct: pointer to a TIM_OCInitTypeDef structure
  *         that contains the configuration information for the specified TIM 
  *         peripheral.
  * @retval None
  */
void TIM_OC2Init(TIM_TypeDef* TIMx, TIM_OCInitTypeDef* TIM_OCInitStruct)
{
  uint16_t tmpccmrx = 0, tmpccer = 0;
   
  /* Check the parameters */
  assert_param(IS_TIM_LIST2_PERIPH(TIMx)); 
  assert_param(IS_TIM_OC_MODE(TIM_OCInitStruct->TIM_OCMode));
  assert_param(IS_TIM_OUTPUT_STATE(TIM_OCInitStruct->TIM_OutputState));
  assert_param(IS_TIM_OC_POLARITY(TIM_OCInitStruct->TIM_OCPolarity));   
  /* Disable the Channel 2: Reset the CC2E Bit */
  TIMx->CCER &= (uint16_t)(~((uint16_t)TIM_CCER_CC2E));
  
  /* Get the TIMx CCER register value */  
  tmpccer = TIMx->CCER;
  
  /* Get the TIMx CCMR1 register value */
  tmpccmrx = TIMx->CCMR1;
    
  /* Reset the Output Compare Mode Bits */
  tmpccmrx &= (uint16_t)(~((uint16_t)TIM_CCMR1_OC2M));
  
  /* Select the Output Compare Mode */
  tmpccmrx |= (uint16_t)(TIM_OCInitStruct->TIM_OCMode << 8);
  
  /* Reset the Output Polarity level */
  tmpccer &= (uint16_t)(~((uint16_t)TIM_CCER_CC2P));
  /* Set the Output Compare Polarity */
  tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OCPolarity << 4);
  
  /* Set the Output State */
  tmpccer |= (uint16_t)(TIM_OCInitStruct->TIM_OutputState << 4);
  
  /* Set the Capture Compare Register value */
  TIMx->CCR2 = TIM_OCInitStruct->TIM_Pulse;
    
  /* Write to TIMx CCMR1 */
  TIMx->CCMR1 = tmpccmrx;
  
  /* Write to TIMx CCER */
  TIMx->CCER = tmpccer;
}

/**
  * @brief  Initializes the TIMx Channel3 according to the specified
  *         parameters in the TIM_OCInitStruct.
  * @param  TIMx: where x can be  2, 3 or 4 to select the TIM peripheral.
  * @param  TIM_OCInitStruct: pointer to a TIM_OCInitTypeDef structure
  *         that contains the configuration information for the specified TIM 
  *         peripheral.
  * @retval None
  */
void TIM_OC3Init(TIM_TypeDef* TIMx, TIM_OCInitTypeDef* TIM_OCInitStruct)
{

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美经典三级视频一区二区三区| 亚洲欧美日韩国产综合| 色婷婷亚洲一区二区三区| 久久成人羞羞网站| 亚洲男人都懂的| 国产调教视频一区| 日韩一级免费观看| 精品视频全国免费看| 91香蕉视频污| 国产精品一区二区在线观看网站| 三级在线观看一区二区| 亚洲欧美视频在线观看视频| 久久精品日韩一区二区三区| 欧美成va人片在线观看| 欧美日韩成人综合天天影院 | 成人丝袜18视频在线观看| 日本大胆欧美人术艺术动态| 一区二区三区四区精品在线视频| 国产日韩欧美高清在线| 日韩午夜精品电影| 欧美高清性hdvideosex| 在线观看网站黄不卡| 91女人视频在线观看| 99久久精品国产一区二区三区| 国产乱理伦片在线观看夜一区| 美国十次综合导航| 日韩高清一级片| 无吗不卡中文字幕| 亚洲成人一二三| 亚洲国产裸拍裸体视频在线观看乱了| 中文字幕亚洲电影| 国产精品免费人成网站| 国产精品久久夜| 欧美国产激情一区二区三区蜜月| 久久久久亚洲综合| 国产丝袜在线精品| 国产精品拍天天在线| 国产精品美女视频| 国产精品久久久久久久久动漫| 国产精品理伦片| 亚洲色图欧美在线| 亚洲精品自拍动漫在线| 亚洲午夜在线观看视频在线| 亚洲www啪成人一区二区麻豆| 亚洲成av人片在线| 麻豆精品在线看| 九色综合狠狠综合久久| 国产一区二区电影| www.亚洲人| 色综合久久天天| 欧美午夜不卡在线观看免费| 欧美丰满美乳xxx高潮www| 欧美一区二区三区免费大片| 欧美不卡激情三级在线观看| 久久精品一区二区三区不卡| 亚洲欧洲无码一区二区三区| 亚洲欧美国产77777| 亚洲第一成人在线| 美女在线观看视频一区二区| 国产一区在线精品| 99国产一区二区三精品乱码| 欧美午夜片在线看| 精品久久久久久亚洲综合网| 欧美极品xxx| 亚洲高清一区二区三区| 免费成人在线观看| 成人精品小蝌蚪| 欧美日韩1区2区| 久久久午夜精品| 亚洲影院理伦片| 激情欧美一区二区| 色婷婷久久综合| 精品精品欲导航| 亚洲男同性视频| 久久99精品久久久久久久久久久久 | 国产91精品久久久久久久网曝门| 91女人视频在线观看| 日韩网站在线看片你懂的| 国产日韩欧美制服另类| 亚洲一区二区在线视频| 紧缚奴在线一区二区三区| 91网站在线播放| 日韩一区二区在线观看视频 | 蜜臀99久久精品久久久久久软件| 成人黄色大片在线观看| 欧美放荡的少妇| 国产精品国产三级国产普通话三级 | 日本精品一级二级| 久久综合国产精品| 亚洲一区二区三区四区的 | 在线电影欧美成精品| 国产精品视频一二三| 日本v片在线高清不卡在线观看| 99久久精品国产观看| 日韩视频一区二区在线观看| 一区二区三区免费在线观看| 国产盗摄一区二区三区| 欧美高清激情brazzers| 国产精品久久久久aaaa| 国产美女在线观看一区| 91精品综合久久久久久| 亚洲激情综合网| 成人动漫一区二区| 久久―日本道色综合久久| 五月婷婷激情综合网| 91麻豆免费看| 中文字幕欧美区| 国内精品视频一区二区三区八戒| 欧美日韩电影在线| 亚洲美女屁股眼交3| 成人黄色一级视频| 久久精品人人做人人爽人人| 久久国产生活片100| 欧美麻豆精品久久久久久| 一区二区三区视频在线观看| 成人综合在线观看| 国产偷国产偷精品高清尤物| 久久超碰97人人做人人爱| 日韩一卡二卡三卡四卡| 午夜视频在线观看一区| 欧美色中文字幕| 亚洲国产成人91porn| 欧美自拍偷拍午夜视频| 亚洲另类春色校园小说| 91麻豆国产精品久久| 国产精品毛片a∨一区二区三区 | 欧美日本免费一区二区三区| 亚洲欧美日韩国产成人精品影院 | av资源网一区| 亚洲欧美自拍偷拍色图| av在线不卡网| 亚洲啪啪综合av一区二区三区| 99这里只有精品| 国产精品国产自产拍高清av王其| 成人精品国产免费网站| 中文字幕中文乱码欧美一区二区| 成人一区二区三区中文字幕| 国产精品看片你懂得 | 精品伦理精品一区| 国产精品中文有码| 国产偷国产偷亚洲高清人白洁| 成人免费观看av| 亚洲欧洲综合另类| 欧美日韩亚州综合| 免费精品视频最新在线| 久久亚洲精精品中文字幕早川悠里| 久久精品72免费观看| 久久久国产综合精品女国产盗摄| 成人午夜视频免费看| 中文欧美字幕免费| 91高清视频在线| 日本最新不卡在线| 亚洲精品一区在线观看| 国产xxx精品视频大全| 亚洲欧美另类在线| 欧美一区二区三区视频在线 | 在线亚洲人成电影网站色www| 亚洲一区二区三区自拍| 日韩欧美成人激情| 粉嫩av一区二区三区| 亚洲精品欧美在线| 91精品国产福利在线观看| 国产美女精品在线| 一区二区三区美女视频| 日韩欧美在线网站| 成人一二三区视频| 亚洲1区2区3区4区| 久久精品男人的天堂| 日本韩国欧美在线| 国精产品一区一区三区mba桃花 | 麻豆91免费观看| 国产精品久久午夜| 777久久久精品| 成人一区在线看| 天天操天天综合网| 亚洲国产高清在线| 69成人精品免费视频| 丁香亚洲综合激情啪啪综合| 五月婷婷色综合| 国产精品欧美一区二区三区| 7777女厕盗摄久久久| 成人的网站免费观看| 美国av一区二区| 一区二区三区久久| 国产午夜精品久久久久久免费视 | 日韩一区国产二区欧美三区| 成人av在线一区二区三区| 日日摸夜夜添夜夜添精品视频| 日本一区二区视频在线| 欧美日韩不卡在线| 97久久精品人人爽人人爽蜜臀| 久久国产日韩欧美精品| 亚洲国产精品视频| 国产精品美日韩| 久久久久久久久久久久久久久99 | 色视频成人在线观看免| 国产精品一区二区视频| 男女性色大片免费观看一区二区| 亚洲精品国产一区二区精华液| 亚洲精品在线电影|