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

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

?? stm32f10x_tim.c

?? 基于Cortex-M3的STM32的IAR EWARM的工程模塊
?? C
?? 第 1 頁 / 共 5 頁
字號:
* Description    : Initializes the TIMx Channel2 according to the specified
*                  parameters in the TIM_OCInitStruct.
* Input          : - TIMx: where x can be  1, 2, 3, 4, 5 or 8 to select the TIM 
*                    peripheral.
*                  - TIM_OCInitStruct: pointer to a TIM_OCInitTypeDef structure
*                    that contains the configuration information for the specified
*                    TIM peripheral.
* Output         : None
* Return         : None
*******************************************************************************/
void TIM_OC2Init(TIM_TypeDef* TIMx, TIM_OCInitTypeDef* TIM_OCInitStruct)
{
  u16 tmpccmrx = 0, tmpccer = 0, tmpcr2 = 0;
   
  /* Check the parameters */
  assert_param(IS_TIM_123458_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 &= CCER_CC2E_Reset;
  
  /* Get the TIMx CCER register value */  
  tmpccer = TIMx->CCER;

  /* Get the TIMx CR2 register value */
  tmpcr2 =  TIMx->CR2;
  
  /* Get the TIMx CCMR1 register value */
  tmpccmrx = TIMx->CCMR1;
    
  /* Reset the Output Compare Mode Bits */
  tmpccmrx &= CCMR_OC24M_Mask;
  
  /* Select the Output Compare Mode */
  tmpccmrx |= (u16)(TIM_OCInitStruct->TIM_OCMode << 8);
  
  /* Reset the Output Polarity level */
  tmpccer &= CCER_CC2P_Reset;

  /* Set the Output Compare Polarity */
  tmpccer |= (u16)(TIM_OCInitStruct->TIM_OCPolarity << 4);
  
  /* Set the Output State */
  tmpccer |= (u16)(TIM_OCInitStruct->TIM_OutputState << 4);
  
  /* Set the Capture Compare Register value */
  TIMx->CCR2 = TIM_OCInitStruct->TIM_Pulse;
  
  if((*(u32*)&TIMx == TIM1_BASE) || (*(u32*)&TIMx == TIM8_BASE))
  {
    assert_param(IS_TIM_OUTPUTN_STATE(TIM_OCInitStruct->TIM_OutputNState));
    assert_param(IS_TIM_OCN_POLARITY(TIM_OCInitStruct->TIM_OCNPolarity));
    assert_param(IS_TIM_OCNIDLE_STATE(TIM_OCInitStruct->TIM_OCNIdleState));
    assert_param(IS_TIM_OCIDLE_STATE(TIM_OCInitStruct->TIM_OCIdleState));
    
    /* Reset the Output N Polarity level */
    tmpccer &= CCER_CC2NP_Reset;

    /* Set the Output N Polarity */
    tmpccer |= (u16)(TIM_OCInitStruct->TIM_OCNPolarity << 4);

    /* Reset the Output N State */
    tmpccer &= CCER_CC2NE_Reset;
    
    /* Set the Output N State */
    tmpccer |= (u16)(TIM_OCInitStruct->TIM_OutputNState << 4);

    /* Reset the Ouput Compare and Output Compare N IDLE State */
    tmpcr2 &= CR2_OIS2_Reset;
    tmpcr2 &= CR2_OIS2N_Reset;

    /* Set the Output Idle state */
    tmpcr2 |= (u16)(TIM_OCInitStruct->TIM_OCIdleState << 2);

    /* Set the Output N Idle state */
    tmpcr2 |= (u16)(TIM_OCInitStruct->TIM_OCNIdleState << 2);
  }

  /* Write to TIMx CR2 */
  TIMx->CR2 = tmpcr2;
  
  /* Write to TIMx CCMR1 */
  TIMx->CCMR1 = tmpccmrx;
  
  /* Write to TIMx CCER */
  TIMx->CCER = tmpccer;
}

/*******************************************************************************
* Function Name  : TIM_OC3Init
* Description    : Initializes the TIMx Channel3 according to the specified
*                  parameters in the TIM_OCInitStruct.
* Input          : - TIMx: where x can be  1, 2, 3, 4, 5 or 8 to select the TIM 
*                    peripheral.
*                  - TIM_OCInitStruct: pointer to a TIM_OCInitTypeDef structure
*                    that contains the configuration information for the specified
*                    TIM peripheral.
* Output         : None
* Return         : None
*******************************************************************************/
void TIM_OC3Init(TIM_TypeDef* TIMx, TIM_OCInitTypeDef* TIM_OCInitStruct)
{
  u16 tmpccmrx = 0, tmpccer = 0, tmpcr2 = 0;
   
  /* Check the parameters */
  assert_param(IS_TIM_123458_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 &= CCER_CC3E_Reset;
  
  /* Get the TIMx CCER register value */
  tmpccer = TIMx->CCER;

  /* Get the TIMx CR2 register value */
  tmpcr2 =  TIMx->CR2;
  
  /* Get the TIMx CCMR2 register value */
  tmpccmrx = TIMx->CCMR2;
    
  /* Reset the Output Compare Mode Bits */
  tmpccmrx &= CCMR_OC13M_Mask;
  
  /* Select the Output Compare Mode */
  tmpccmrx |= TIM_OCInitStruct->TIM_OCMode;
  
  /* Reset the Output Polarity level */
  tmpccer &= CCER_CC3P_Reset;

  /* Set the Output Compare Polarity */
  tmpccer |= (u16)(TIM_OCInitStruct->TIM_OCPolarity << 8);
  
  /* Set the Output State */
  tmpccer |= (u16)(TIM_OCInitStruct->TIM_OutputState << 8);
  
  /* Set the Capture Compare Register value */
  TIMx->CCR3 = TIM_OCInitStruct->TIM_Pulse;
  
  if((*(u32*)&TIMx == TIM1_BASE) || (*(u32*)&TIMx == TIM8_BASE))
  {
    assert_param(IS_TIM_OUTPUTN_STATE(TIM_OCInitStruct->TIM_OutputNState));
    assert_param(IS_TIM_OCN_POLARITY(TIM_OCInitStruct->TIM_OCNPolarity));
    assert_param(IS_TIM_OCNIDLE_STATE(TIM_OCInitStruct->TIM_OCNIdleState));
    assert_param(IS_TIM_OCIDLE_STATE(TIM_OCInitStruct->TIM_OCIdleState));
    
    /* Reset the Output N Polarity level */
    tmpccer &= CCER_CC3NP_Reset;

    /* Set the Output N Polarity */
    tmpccer |= (u16)(TIM_OCInitStruct->TIM_OCNPolarity << 8);

    /* Reset the Output N State */
    tmpccer &= CCER_CC3NE_Reset;
    
    /* Set the Output N State */
    tmpccer |= (u16)(TIM_OCInitStruct->TIM_OutputNState << 8);

    /* Reset the Ouput Compare and Output Compare N IDLE State */
    tmpcr2 &= CR2_OIS3_Reset;
    tmpcr2 &= CR2_OIS3N_Reset;

    /* Set the Output Idle state */
    tmpcr2 |= (u16)(TIM_OCInitStruct->TIM_OCIdleState << 4);

    /* Set the Output N Idle state */
    tmpcr2 |= (u16)(TIM_OCInitStruct->TIM_OCNIdleState << 4);
  }

  /* Write to TIMx CR2 */
  TIMx->CR2 = tmpcr2;
  
  /* Write to TIMx CCMR2 */
  TIMx->CCMR2 = tmpccmrx;
  
  /* Write to TIMx CCER */
  TIMx->CCER = tmpccer;
}

/*******************************************************************************
* Function Name  : TIM_OC4Init
* Description    : Initializes the TIMx Channel4 according to the specified
*                  parameters in the TIM_OCInitStruct.
* Input          : - TIMx: where x can be  1, 2, 3, 4, 5 or 8 to select the TIM 
*                    peripheral.
*                  - TIM_OCInitStruct: pointer to a TIM_OCInitTypeDef structure
*                    that contains the configuration information for the specified
*                    TIM peripheral.
* Output         : None
* Return         : None
*******************************************************************************/
void TIM_OC4Init(TIM_TypeDef* TIMx, TIM_OCInitTypeDef* TIM_OCInitStruct)
{
  u16 tmpccmrx = 0, tmpccer = 0, tmpcr2 = 0;
   
  /* Check the parameters */
  assert_param(IS_TIM_123458_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 CC4E Bit */
  TIMx->CCER &= CCER_CC4E_Reset;
  
  /* Get the TIMx CCER register value */
  tmpccer = TIMx->CCER;

  /* Get the TIMx CR2 register value */
  tmpcr2 =  TIMx->CR2;
  
  /* Get the TIMx CCMR2 register value */
  tmpccmrx = TIMx->CCMR2;
    
  /* Reset the Output Compare Mode Bits */
  tmpccmrx &= CCMR_OC24M_Mask;
  
  /* Select the Output Compare Mode */
  tmpccmrx |= (u16)(TIM_OCInitStruct->TIM_OCMode << 8);
  
  /* Reset the Output Polarity level */
  tmpccer &= CCER_CC4P_Reset;

  /* Set the Output Compare Polarity */
  tmpccer |= (u16)(TIM_OCInitStruct->TIM_OCPolarity << 12);
  
  /* Set the Output State */
  tmpccer |= (u16)(TIM_OCInitStruct->TIM_OutputState << 12);
  
  /* Set the Capture Compare Register value */
  TIMx->CCR4 = TIM_OCInitStruct->TIM_Pulse;
  
  if((*(u32*)&TIMx == TIM1_BASE) || (*(u32*)&TIMx == TIM8_BASE))
  {
    assert_param(IS_TIM_OCIDLE_STATE(TIM_OCInitStruct->TIM_OCIdleState));

    /* Reset the Ouput Compare IDLE State */
    tmpcr2 &= CR2_OIS4_Reset;

    /* Set the Output Idle state */
    tmpcr2 |= (u16)(TIM_OCInitStruct->TIM_OCIdleState << 6);
  }

  /* Write to TIMx CR2 */
  TIMx->CR2 = tmpcr2;
  
  /* Write to TIMx CCMR2 */  
  TIMx->CCMR2 = tmpccmrx;
  
  /* Write to TIMx CCER */
  TIMx->CCER = tmpccer;
}

/*******************************************************************************
* Function Name  : TIM_ICInit
* Description    : Initializes the TIM peripheral according to the specified
*                  parameters in the TIM_ICInitStruct.
* Input          : - TIMx: where x can be  1, 2, 3, 4, 5 or 8 to select the TIM 
*                    peripheral.
*                  - TIM_ICInitStruct: pointer to a TIM_ICInitTypeDef structure
*                    that contains the configuration information for the specified
*                    TIM peripheral.
* Output         : None
* Return         : None
*******************************************************************************/
void TIM_ICInit(TIM_TypeDef* TIMx, TIM_ICInitTypeDef* TIM_ICInitStruct)
{
  /* Check the parameters */
  assert_param(IS_TIM_123458_PERIPH(TIMx));
  assert_param(IS_TIM_CHANNEL(TIM_ICInitStruct->TIM_Channel));
  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);
  }
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久国产麻豆精品| 亚洲国产va精品久久久不卡综合| 另类的小说在线视频另类成人小视频在线 | 91.com视频| 日本欧美在线看| 久久夜色精品国产噜噜av| 国产一区二区三区不卡在线观看 | 专区另类欧美日韩| 日本福利一区二区| 亚洲18女电影在线观看| 日韩一级免费观看| 豆国产96在线|亚洲| 亚洲视频网在线直播| 51精品久久久久久久蜜臀| 男女激情视频一区| 久久嫩草精品久久久精品一| 99麻豆久久久国产精品免费优播| 亚洲一级不卡视频| 精品国产乱码久久久久久久久| 成人免费看的视频| 午夜精品久久久久影视| 欧美精品一区二区三区在线播放| av成人老司机| 蜜桃久久精品一区二区| 国产精品私房写真福利视频| 在线观看91精品国产入口| 久久精品国产久精国产| 亚洲图片激情小说| 久久综合狠狠综合久久综合88| 99精品国产一区二区三区不卡| 日本成人在线看| 18欧美乱大交hd1984| 91精品国产一区二区| 成人国产精品免费观看动漫| 视频一区二区中文字幕| 国产精品久久影院| 欧美不卡一区二区三区| 色哟哟国产精品| 国产盗摄一区二区三区| 日韩黄色片在线观看| 亚洲日本在线a| 久久精品视频网| 538在线一区二区精品国产| 97精品国产露脸对白| 国产主播一区二区三区| 日韩电影在线观看一区| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆 | 欧美aaaaaa午夜精品| 一区二区三区国产精品| 日本一区二区三区免费乱视频| 欧美体内she精高潮| 99久久99久久精品国产片果冻| 久久国内精品自在自线400部| 亚洲国产一区二区三区| 国产精品久久久久影院亚瑟 | 在线一区二区观看| 国产精品一二三四五| 麻豆91精品视频| 日韩成人精品视频| 丝袜美腿亚洲一区二区图片| 一区二区三区日韩在线观看| 国产欧美日韩综合精品一区二区 | 欧美精品丝袜中出| 色老汉一区二区三区| av电影一区二区| 成人免费不卡视频| 成人动漫一区二区三区| 国产精品影视网| 国产麻豆欧美日韩一区| 激情欧美日韩一区二区| 毛片一区二区三区| 精品一区免费av| 韩国女主播一区| 国产一区二区女| 国产电影一区二区三区| 国产aⅴ综合色| 成人看片黄a免费看在线| 国模套图日韩精品一区二区 | 蜜臀99久久精品久久久久久软件| 日韩高清在线电影| 精品在线你懂的| 国产高清不卡二三区| 成人免费毛片片v| 91麻豆高清视频| 欧美日韩中字一区| 欧美一区二区精品| 欧美成人一区二区| 久久久久久**毛片大全| 国产精品黄色在线观看| 亚洲欧美激情一区二区| 亚洲国产日产av| 热久久久久久久| 韩国av一区二区三区在线观看| 国产美女精品人人做人人爽| 成人sese在线| 欧美日韩一卡二卡| 久久久久久久免费视频了| 中文字幕精品一区二区三区精品| 亚洲视频一二三| 日本在线观看不卡视频| 国产伦精品一区二区三区在线观看| 懂色av一区二区三区蜜臀| 91香蕉视频mp4| 欧美一区二区成人| 欧美国产欧美综合| 亚洲永久免费视频| 久久精品国产精品亚洲精品| 岛国av在线一区| 欧美日韩视频第一区| 久久男人中文字幕资源站| 亚洲三级在线观看| 美腿丝袜亚洲综合| 99视频在线观看一区三区| 欧美日韩不卡一区| 国产精品热久久久久夜色精品三区| 亚洲精品网站在线观看| 国内精品在线播放| 在线观看欧美精品| 久久免费看少妇高潮| 亚洲五月六月丁香激情| 国产乱一区二区| 欧美日韩免费一区二区三区视频| 2023国产一二三区日本精品2022| 亚洲欧美视频在线观看| 国产精品自产自拍| 欧美乱妇23p| 国产精品久久综合| 国产一区二区三区免费在线观看| 91福利国产成人精品照片| 国产视频在线观看一区二区三区| 亚洲一区二区在线播放相泽| 国产aⅴ精品一区二区三区色成熟| 欧美喷水一区二区| 一区二区激情视频| 成人综合日日夜夜| 日韩欧美国产不卡| 亚洲国产成人精品视频| 99久免费精品视频在线观看| 精品久久一二三区| 日本成人中文字幕在线视频| 色女孩综合影院| 亚洲欧洲精品一区二区三区不卡| 经典三级一区二区| 日韩欧美一二三区| 天堂蜜桃一区二区三区| 色国产综合视频| 日韩毛片一二三区| 国产高清成人在线| 久久婷婷综合激情| 精品一区二区三区不卡| 制服丝袜国产精品| 亚洲成人av中文| 欧美日韩一区二区欧美激情 | 国产精品夫妻自拍| 成人激情午夜影院| 国产欧美日韩另类一区| 国产精品一二三区| 久久综合色8888| 韩国成人福利片在线播放| 亚洲精品在线免费观看视频| 蜜桃在线一区二区三区| 日韩视频免费直播| 免费不卡在线观看| 亚洲精品一线二线三线无人区| 美女网站色91| 欧美一三区三区四区免费在线看| 亚洲综合视频在线观看| 欧美三区在线视频| 亚洲一二三区不卡| 欧美男同性恋视频网站| 日韩二区在线观看| 日韩欧美一区中文| 国产揄拍国内精品对白| 国产喂奶挤奶一区二区三区| 国产精品一区二区三区四区| 久久久久综合网| 播五月开心婷婷综合| 亚洲免费资源在线播放| 欧美在线免费视屏| 青青草国产精品亚洲专区无| 欧美mv和日韩mv国产网站| 国产尤物一区二区| 国产精品成人网| 色哦色哦哦色天天综合| 亚洲18影院在线观看| 日韩免费一区二区| 成人免费毛片高清视频| 一区二区三区不卡视频在线观看| 欧美日韩国产bt| 极品尤物av久久免费看| 国产精品久久久99| 欧美日韩成人综合| 国产精品一区二区在线观看网站| 综合久久综合久久| 欧美美女直播网站| 美日韩黄色大片| 国产精品每日更新在线播放网址| 91国偷自产一区二区开放时间| 青青草97国产精品免费观看无弹窗版| 久久嫩草精品久久久精品|