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

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

?? stm32f10x_tim.c

?? 基于STM32的 模擬時序
?? C
?? 第 1 頁 / 共 5 頁
字號:
*                  signal.
* 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_PWMIConfig(TIM_TypeDef* TIMx, TIM_ICInitTypeDef* TIM_ICInitStruct)
{
  u16 icoppositepolarity = TIM_ICPolarity_Rising;
  u16 icoppositeselection = TIM_ICSelection_DirectTI;

  /* Check the parameters */
  assert_param(IS_TIM_123458_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);
  }
}

/*******************************************************************************
* Function Name  : TIM_BDTRConfig
* Description    : Configures the: Break feature, dead time, Lock level, the OSSI,
*                  the OSSR State and the AOE(automatic output enable).
* Input          :- TIMx: where x can be  1 or 8 to select the TIM 
*                 - TIM_BDTRInitStruct: pointer to a TIM_BDTRInitTypeDef
*                    structure that contains the BDTR Register configuration
*                    information for the TIM peripheral.
* Output         : None
* Return         : None
*******************************************************************************/
void TIM_BDTRConfig(TIM_TypeDef* TIMx, TIM_BDTRInitTypeDef *TIM_BDTRInitStruct)
{
  /* Check the parameters */
  assert_param(IS_TIM_18_PERIPH(TIMx));
  assert_param(IS_TIM_OSSR_STATE(TIM_BDTRInitStruct->TIM_OSSRState));
  assert_param(IS_TIM_OSSI_STATE(TIM_BDTRInitStruct->TIM_OSSIState));
  assert_param(IS_TIM_LOCK_LEVEL(TIM_BDTRInitStruct->TIM_LOCKLevel));
  assert_param(IS_TIM_BREAK_STATE(TIM_BDTRInitStruct->TIM_Break));
  assert_param(IS_TIM_BREAK_POLARITY(TIM_BDTRInitStruct->TIM_BreakPolarity));
  assert_param(IS_TIM_AUTOMATIC_OUTPUT_STATE(TIM_BDTRInitStruct->TIM_AutomaticOutput));

  /* Set the Lock level, the Break enable Bit and the Ploarity, the OSSR State,
     the OSSI State, the dead time value and the Automatic Output Enable Bit */

  TIMx->BDTR = (u32)TIM_BDTRInitStruct->TIM_OSSRState | TIM_BDTRInitStruct->TIM_OSSIState |
             TIM_BDTRInitStruct->TIM_LOCKLevel | TIM_BDTRInitStruct->TIM_DeadTime |
             TIM_BDTRInitStruct->TIM_Break | TIM_BDTRInitStruct->TIM_BreakPolarity |
             TIM_BDTRInitStruct->TIM_AutomaticOutput;

}

/*******************************************************************************
* Function Name  : TIM_TimeBaseStructInit
* Description    : Fills each TIM_TimeBaseInitStruct member with its default value.
* Input          : - TIM_TimeBaseInitStruct : pointer to a TIM_TimeBaseInitTypeDef
*                    structure which will be initialized.
* Output         : None
* Return         : None
*******************************************************************************/
void TIM_TimeBaseStructInit(TIM_TimeBaseInitTypeDef* TIM_TimeBaseInitStruct)
{
  /* Set the default configuration */
  TIM_TimeBaseInitStruct->TIM_Period = 0xFFFF;
  TIM_TimeBaseInitStruct->TIM_Prescaler = 0x0000;
  TIM_TimeBaseInitStruct->TIM_ClockDivision = TIM_CKD_DIV1;
  TIM_TimeBaseInitStruct->TIM_CounterMode = TIM_CounterMode_Up;
  TIM_TimeBaseInitStruct->TIM_RepetitionCounter = 0x0000;
}

/*******************************************************************************
* Function Name  : TIM_OCStructInit
* Description    : Fills each TIM_OCInitStruct member with its default value.
* Input          : - TIM_OCInitStruct : pointer to a TIM_OCInitTypeDef structure
*                    which will be initialized.
* Output         : None
* Return         : None
*******************************************************************************/
void TIM_OCStructInit(TIM_OCInitTypeDef* TIM_OCInitStruct)
{
  /* Set the default configuration */
  TIM_OCInitStruct->TIM_OCMode = TIM_OCMode_Timing;
  TIM_OCInitStruct->TIM_OutputState = TIM_OutputState_Disable;
  TIM_OCInitStruct->TIM_OutputNState = TIM_OutputNState_Disable;
  TIM_OCInitStruct->TIM_Pulse = 0x0000;
  TIM_OCInitStruct->TIM_OCPolarity = TIM_OCPolarity_High;
  TIM_OCInitStruct->TIM_OCNPolarity = TIM_OCPolarity_High;
  TIM_OCInitStruct->TIM_OCIdleState = TIM_OCIdleState_Reset;
  TIM_OCInitStruct->TIM_OCNIdleState = TIM_OCNIdleState_Reset;
}

/*******************************************************************************
* Function Name  : TIM_ICStructInit
* Description    : Fills each TIM_ICInitStruct member with its default value.
* Input          : - TIM_ICInitStruct : pointer to a TIM_ICInitTypeDef structure
*                    which will be initialized.
* Output         : None
* Return         : 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;
}

/*******************************************************************************
* Function Name  : TIM_BDTRStructInit
* Description    : Fills each TIM_BDTRInitStruct member with its default value.
* Input          : - TIM_BDTRInitStruct : pointer to a TIM_BDTRInitTypeDef
*                    structure which will be initialized.
* Output         : None
* Return         : None
*******************************************************************************/
void TIM_BDTRStructInit(TIM_BDTRInitTypeDef* TIM_BDTRInitStruct)
{
  /* Set the default configuration */
  TIM_BDTRInitStruct->TIM_OSSRState = TIM_OSSRState_Disable;
  TIM_BDTRInitStruct->TIM_OSSIState = TIM_OSSIState_Disable;
  TIM_BDTRInitStruct->TIM_LOCKLevel = TIM_LOCKLevel_OFF;
  TIM_BDTRInitStruct->TIM_DeadTime = 0x00;
  TIM_BDTRInitStruct->TIM_Break = TIM_Break_Disable;
  TIM_BDTRInitStruct->TIM_BreakPolarity = TIM_BreakPolarity_Low;
  TIM_BDTRInitStruct->TIM_AutomaticOutput = TIM_AutomaticOutput_Disable;
}

/*******************************************************************************
* Function Name  : TIM_Cmd
* Description    : Enables or disables the specified TIM peripheral.
* Input          : - TIMx: where x can be 1 to 8 to select the TIMx peripheral.
*                  - NewState: new state of the TIMx peripheral.
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : 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 |= CR1_CEN_Set;
  }
  else
  {
    /* Disable the TIM Counter */
    TIMx->CR1 &= CR1_CEN_Reset;
  }
}

/*******************************************************************************
* Function Name  : TIM_CtrlPWMOutputs
* Description    : Enables or disables the TIM peripheral Main Outputs.
* Input          :- TIMx: where x can be 1 or 8 to select the TIMx peripheral.
*                 - NewState: new state of the TIM peripheral Main Outputs.
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : None
*******************************************************************************/
void TIM_CtrlPWMOutputs(TIM_TypeDef* TIMx, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_TIM_18_PERIPH(TIMx));
  assert_param(IS_FUNCTIONAL_STATE(NewState));

  if (NewState != DISABLE)
  {
    /* Enable the TIM Main Output */
    TIMx->BDTR |= BDTR_MOE_Set;
  }
  else
  {
    /* Disable the TIM Main Output */
    TIMx->BDTR &= BDTR_MOE_Reset;
  }  
}

/*******************************************************************************
* Function Name  : TIM_ITConfig
* Description    : Enables or disables the specified TIM interrupts.
* Input          : - TIMx: where x can be 1 to 8 to select the TIMx peripheral.
*                  - TIM_IT: specifies the TIM interrupts sources to be enabled
*                    or disabled.
*                    This parameter can be any combination of the following values:
*                       - TIM_IT_Update: TIM update Interrupt source
*                       - TIM_IT_CC1: TIM Capture Compare 1 Interrupt source
*                       - TIM_IT_CC2: TIM Capture Compare 2 Interrupt source
*                       - TIM_IT_CC3: TIM Capture Compare 3 Interrupt source
*                       - TIM_IT_CC4: TIM Capture Compare 4 Interrupt source
*                       - TIM_IT_COM: TIM Commutation Interrupt source
*                       - TIM_IT_Trigger: TIM Trigger Interrupt source
*                       - TIM_IT_Break: TIM Break Interrupt source
*                  - NewState: new state of the TIM interrupts.
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : None
*******************************************************************************/
void TIM_ITConfig(TIM_TypeDef* TIMx, u16 TIM_IT, FunctionalState NewState)
{  
  /* Check the parameters */
  assert_param(IS_TIM_ALL_PERIPH(TIMx));
  assert_param(IS_TIM_IT(TIM_IT));
  assert_param(IS_TIM_PERIPH_IT((TIMx), (TIM_IT)));
  assert_param(IS_FUNCTIONAL_STATE(NewState));
  
  if (NewState != DISABLE)
  {
    /* Enable the Interrupt sources */
    TIMx->DIER |= TIM_IT;
  }
  else
  {
    /* Disable the Interrupt sources */
    TIMx->DIER &= (u16)~TIM_IT;
  }
}

/*******************************************************************************
* Function Name  : TIM_GenerateEvent
* Description    : Configures the TIMx event to be generate by software.
* Input          : - TIMx: where x can be 1 to 8 to select the TIM peripheral.
*                  - TIM_EventSource: specifies the event source.
*                    This parameter can be one or more of the following values:	   
*                       - TIM_EventSource_Update: Timer update Event source
*                       - TIM_EventSource_CC1: Timer Capture Compare 1 Event source
*                       - TIM_EventSource_CC2: Timer Capture Compare 2 Event source
*                       - TIM_EventSource_CC3: Timer Capture Compare 3 Event source
*                       - TIM_EventSource_CC4: Timer Capture Compare 4 Event source
*                       - TIM_EventSource_Trigger: Timer Trigger Event source
* Output         : None
* Return         : None
*******************************************************************************/
void TIM_GenerateEvent(TIM_TypeDef* TIMx, u16 TIM_EventSource)
{ 
  /* Check the parameters */
  assert_param(IS_TIM_ALL_PERIPH(TIMx));
  assert_param(IS_TIM_EVENT_SOURCE(TIM_EventSource));
  assert_param(IS_TIM_PERIPH_EVENT((TIMx), (TIM_EventSource)));

  /* Set the event sources */
  TIMx->EGR = TIM_EventSource;
}

/*******************************************************************************
* Function Name  : TIM_DMAConfig
* Description    : Configures the TIMx抯 DMA interface.
* Input          : - TIMx: where x can be  1, 2, 3, 4, 5 or 8 to select the TIM 
*                    peripheral.
*                  - TIM_DMABase: DMA Base address.
*                    This parameter can be one of the following values:
*                       - TIM_DMABase_CR, TIM_DMABase_CR2, TIM_DMABase_SMCR,
*                         TIM_DMABase_DIER, TIM1_DMABase_SR, TIM_DMABase_EGR,
*                         TIM_DMABase_CCMR1, TIM_DMABase_CCMR2, TIM_DMABase_CCER,
*                         TIM_DMABase_CNT, TIM_DMABase_PSC, TIM_DMABase_ARR,
*                         TIM_DMABase_RCR, TIM_DMABase_CCR1, TIM_DMABase_CCR2,
*                         TIM_DMABase_CCR3, TIM_DMABase_CCR4, TIM_DMABase_BDTR,
*                         TIM_DMABase_DCR.
*                   - TIM_DMABurstLength: DMA Burst length.
*                     This parameter can be one value between:
*                     TIM_DMABurstLength_1Byte and TIM_DMABurstLength_18Bytes.
* Output         : None
* Return         : None
*******************************************************************************/
void TIM_DMAConfig(TIM_TypeDef* TIMx, u16 TIM_DMABase, u16 TIM_DMABurstLength)
{

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩日日骚| 精品视频在线免费看| 日韩免费高清av| 一区二区三区资源| 在线视频中文字幕一区二区| 专区另类欧美日韩| 欧美午夜在线观看| 奇米影视7777精品一区二区| 久久久一区二区| 91在线观看一区二区| 一区二区三区欧美在线观看| 欧美久久久久久久久中文字幕| 日日欢夜夜爽一区| 久久婷婷久久一区二区三区| 国产a级毛片一区| 亚洲亚洲人成综合网络| 欧美第一区第二区| 91色在线porny| 免费在线观看一区二区三区| 中文字幕av在线一区二区三区| 日本高清无吗v一区| 激情综合网激情| 亚洲精品国产无天堂网2021| 日韩欧美一二区| 色综合视频在线观看| 日本欧美一区二区三区乱码| 国产精品美女一区二区三区| 555www色欧美视频| 一本到不卡免费一区二区| 美女视频黄a大片欧美| 亚洲视频一区二区在线| 精品美女在线观看| 欧美性videosxxxxx| 成人一道本在线| 老司机精品视频一区二区三区| 亚洲精品欧美在线| 久久久精品国产免大香伊| 欧美日韩一区二区三区在线看| 粉嫩aⅴ一区二区三区四区| 婷婷中文字幕综合| 亚洲欧美日韩精品久久久久| 久久一二三国产| 欧美一三区三区四区免费在线看| 91免费看视频| av一区二区三区黑人| 美日韩黄色大片| 亚洲成人在线网站| 亚洲色图制服丝袜| 国产精品久久久久久久久免费相片| 在线综合+亚洲+欧美中文字幕| 日本久久一区二区三区| caoporn国产精品| 丁香啪啪综合成人亚洲小说| 国产精品资源网站| 国产精品一区二区三区四区| 国产在线精品视频| 国产综合色精品一区二区三区| 免费高清在线视频一区·| 日韩国产在线观看| 偷拍日韩校园综合在线| 日韩vs国产vs欧美| 老司机精品视频一区二区三区| 日欧美一区二区| 久久99久国产精品黄毛片色诱| 免费在线欧美视频| 国产乱码精品一区二区三区av| 国产在线精品一区二区三区不卡| 久久99这里只有精品| 国产一区二区三区精品视频| 国产精品一二三在| av不卡一区二区三区| 一本色道a无线码一区v| 精品三级在线观看| 欧美不卡视频一区| 国产日本一区二区| 亚洲人午夜精品天堂一二香蕉| 亚洲精品ww久久久久久p站| 亚洲第一精品在线| 精品综合久久久久久8888| 国产成人在线视频网站| 99re8在线精品视频免费播放| 色婷婷亚洲综合| 666欧美在线视频| 中文一区在线播放| 亚洲黄色av一区| 秋霞av亚洲一区二区三| 精品一二线国产| 成人黄色av电影| 欧美日韩精品欧美日韩精品一 | 美国三级日本三级久久99| 韩国成人在线视频| 色综合久久88色综合天天6| 91精品国产日韩91久久久久久| 久久亚洲二区三区| 亚洲一区免费在线观看| 久久国内精品视频| 色综合久久天天| 日韩精品一区二区三区在线 | 奇米影视一区二区三区| 国产.精品.日韩.另类.中文.在线.播放| 色综合网站在线| 欧美撒尿777hd撒尿| 精品va天堂亚洲国产| 成人免费在线视频| 久久99这里只有精品| 欧美日韩中文字幕一区二区| 国产欧美久久久精品影院| 偷偷要91色婷婷| jizzjizzjizz欧美| 国产夜色精品一区二区av| 五月天精品一区二区三区| 国产91丝袜在线观看| 欧美一区二区三区人| 亚洲欧美日韩综合aⅴ视频| 蜜桃久久久久久久| 欧美日韩精品欧美日韩精品| 亚洲免费在线视频| 不卡一区二区中文字幕| 2020日本不卡一区二区视频| 五月天激情综合| 欧美日韩一级二级| 亚洲精品国产a久久久久久| 国产成人精品一区二区三区网站观看| 欧美日韩亚洲综合一区| 亚洲激情欧美激情| 91美女视频网站| 亚洲人精品午夜| 99re8在线精品视频免费播放| 欧美国产精品v| 粉嫩av一区二区三区在线播放| 久久久精品黄色| 国产91精品精华液一区二区三区| 亚洲精品午夜久久久| 99热在这里有精品免费| 国产精品网曝门| 99国产精品久久久久久久久久 | 亚洲欧洲99久久| 午夜在线成人av| 亚洲色图在线看| 91精品国产色综合久久久蜜香臀| 大胆欧美人体老妇| 欧美zozozo| 精品噜噜噜噜久久久久久久久试看| 亚洲欧洲精品天堂一级| 亚洲人亚洲人成电影网站色| 成人教育av在线| 美国三级日本三级久久99 | 欧美浪妇xxxx高跟鞋交| 国产盗摄视频一区二区三区| 亚洲一区二区五区| 国产精品免费久久久久| 欧美成人一区二区| 欧美乱妇一区二区三区不卡视频| 国产91在线观看丝袜| 久久精品国产成人一区二区三区| 亚洲精品免费看| 国产免费成人在线视频| 欧美一区二区三区精品| 91成人看片片| 97久久超碰国产精品电影| 国产精品一二三在| 国产美女精品在线| 麻豆91在线看| 麻豆精品一二三| 日韩国产在线观看一区| 五月婷婷欧美视频| 亚洲男帅同性gay1069| 欧美激情资源网| 国产拍欧美日韩视频二区| 欧美不卡一二三| 日韩精品一区二区三区四区视频| 欧美日韩国产在线播放网站| 色噜噜夜夜夜综合网| 97成人超碰视| 色综合久久久久| 91久久精品一区二区| 在线观看视频一区| 欧美性欧美巨大黑白大战| 欧美做爰猛烈大尺度电影无法无天| 99精品国产视频| 色久综合一二码| 欧美视频第二页| 制服.丝袜.亚洲.中文.综合| 欧美一区二区女人| 精品国产乱码久久久久久影片| 精品国产一区二区三区四区四 | 欧美日韩一区成人| 欧美麻豆精品久久久久久| 欧美日韩亚洲综合在线 | 91在线你懂得| 国产精品国产自产拍高清av王其 | 亚洲欧美日韩中文播放| 亚洲视频每日更新| 亚洲国产日日夜夜| 喷水一区二区三区| 国产中文字幕精品| 99免费精品视频| 欧美做爰猛烈大尺度电影无法无天| 欧美乱妇一区二区三区不卡视频| 日韩欧美一二三四区|