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

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

?? stm32f10x_tim.c

?? 用于STM32實時時鐘程序,可以代PC8563使用.
?? C
?? 第 1 頁 / 共 5 頁
字號:
/*******************************************************************************
* Function Name  : TIM_ClearOC3Ref
* Description    : Clears or safeguards the OCREF3 signal on an external event
* Input          : - TIMx: where x can be 2, 3 or 4 to select the TIM peripheral.
*                  - TIM_OCClear: new state of the Output Compare Clear Enable Bit.
*                    This parameter can be one of the following values:
*                       - TIM_OCClear_Enable
*                       - TIM_OCClear_Disable
* Output         : None
* Return         : None
*******************************************************************************/
void TIM_ClearOC3Ref(TIM_TypeDef* TIMx, u16 TIM_OCClear)
{
  u32 tmpccmr2 = 0;

  /* Check the parameters */
  assert(IS_TIM_OCCLEAR_STATE(TIM_OCClear));

  tmpccmr2 = TIMx->CCMR2;

  /* Reset the OCFE Bit */
  tmpccmr2 &= CCMR_OC13CE_Mask;

  /* Enable or Disable the Output Compare Clear Bit */
  tmpccmr2 |= (u16)(TIM_OCClear);

  TIMx->CCMR2 = (u16)tmpccmr2;
}

/*******************************************************************************
* Function Name  : TIM_ClearOC4Ref
* Description    : Clears or safeguards the OCREF4 signal on an external event
* Input          : - TIMx: where x can be 2, 3 or 4 to select the TIM peripheral.
*                  - TIM_OCClear: new state of the Output Compare Clear Enable Bit.
*                    This parameter can be one of the following values:
*                       - TIM_OCClear_Enable
*                       - TIM_OCClear_Disable
* Output         : None
* Return         : None
*******************************************************************************/
void TIM_ClearOC4Ref(TIM_TypeDef* TIMx, u16 TIM_OCClear)
{
  u32 tmpccmr2 = 0;

  /* Check the parameters */
  assert(IS_TIM_OCCLEAR_STATE(TIM_OCClear));

  tmpccmr2 = TIMx->CCMR2;

  /* Reset the OCFE Bit */
  tmpccmr2 &= CCMR_OC24CE_Mask;

  /* Enable or Disable the Output Compare Clear Bit */
  tmpccmr2 |= (u16)(TIM_OCClear << 8);

  TIMx->CCMR2 = (u16)tmpccmr2;
}

/*******************************************************************************
* Function Name  : TIM_UpdateDisableConfig
* Description    : Enables or Disables the TIMx Update event.
* Input          : - TIMx: where x can be 2, 3 or 4 to select the TIM peripheral.
*                  - Newstate: new state of the TIMx peripheral Preload register
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : None
*******************************************************************************/
void TIM_UpdateDisableConfig(TIM_TypeDef* TIMx, FunctionalState Newstate)
{
  u32 tmpcr1 = 0;

  /* Check the parameters */
  assert(IS_FUNCTIONAL_STATE(Newstate));

  tmpcr1 = TIMx->CR1;

  if (Newstate != DISABLE)
  {
    /* Set the Update Disable Bit */
    tmpcr1 |= CR1_UDIS_Set;
  }
  else
  {
    /* Reset the Update Disable Bit */
    tmpcr1 &= CR1_UDIS_Reset;
  }

  TIMx->CR1 = (u16)tmpcr1;
}

/*******************************************************************************
* Function Name  : TIM_EncoderInterfaceConfig
* Description    : Configures the TIMx Encoder Interface.
* Input          : - TIMx: where x can be 2, 3 or 4 to select the TIM peripheral.
*                  - TIM_EncoderMode: specifies the TIMx Encoder Mode.
*                    This parameter can be one of the following values:
*                       - TIM_EncoderMode_TI1: Counter counts on TI1FP1 edge
*                         depending on TI2FP2 level.
*                       - TIM_EncoderMode_TI2: Counter counts on TI2FP2 edge
*                         depending on TI1FP1 level.
*                       - TIM_EncoderMode_TI12: Counter counts on both TI1FP1 and
*                         TI2FP2 edges depending on the level of the other input.
*                  - TIM_IC1Polarity: specifies the IC1 Polarity
*                    This parmeter can be one of the following values:
*                        - TIM_ICPolarity_Falling
*                        - TIM_ICPolarity_Rising
*                  - TIM_IC2Polarity: specifies the IC2 Polarity
*                    This parmeter can be one of the following values:
*                       - TIM_ICPolarity_Falling
*                       - TIM_ICPolarity_Rising
* Output         : None
* Return         : None
*******************************************************************************/
void TIM_EncoderInterfaceConfig(TIM_TypeDef* TIMx, u16 TIM_EncoderMode,
                                u16 TIM_IC1Polarity, u16 TIM_IC2Polarity)
{
  u32 tmpsmcr = 0;
  u32 tmpccmr1 = 0;
  u32 tmpccer = 0;
    
  /* Check the parameters */
  assert(IS_TIM_ENCODER_MODE(TIM_EncoderMode));
  assert(IS_TIM_IC_POLARITY(TIM_IC1Polarity));
  assert(IS_TIM_IC_POLARITY(TIM_IC2Polarity));

  tmpsmcr = TIMx->SMCR;
  tmpccmr1 = TIMx->CCMR1;
  tmpccer = TIMx->CCER;

  /* Set the encoder Mode */
  tmpsmcr &= SMCR_SMS_Mask;
  tmpsmcr |= TIM_EncoderMode;

  /* Select the Capture Compare 1 and the Capture Compare 2 as input */
  tmpccmr1 &= CCMR_CC13S_Mask & CCMR_CC24S_Mask;
  tmpccmr1 |= CCMR_TI13Direct_Set | CCMR_TI24Direct_Set;

  /* Set the TI1 and the TI2 Polarities */
  tmpccer &= CCER_CC1P_Mask & CCER_CC2P_Mask;
  tmpccer |= (TIM_IC1Polarity | (u16)((u16)TIM_IC2Polarity << 4));

  TIMx->SMCR = (u16)tmpsmcr;

  TIMx->CCMR1 = (u16)tmpccmr1;

  TIMx->CCER = (u16)tmpccer;
}

/*******************************************************************************
* Function Name  : TIM_GenerateEvent
* Description    : Configures the TIMx event to be generate by software.
* Input          : - TIMx: where x can be 2, 3 or 4 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(IS_TIM_EVENT_SOURCE(TIM_EventSource));

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

/*******************************************************************************
* Function Name  : TIM_OC1PolarityConfig
* Description    : Configures the TIMx channel 1 polarity.
* Input          : - TIMx: where x can be 2, 3 or 4 to select the TIM peripheral.
*                  - TIM_OCPolarity: specifies the OC1 Polarity
*                    This parmeter can be one of the following values:
*                       - TIM_OCPolarity_High: Output Compare active high
*                       - TIM_OCPolarity_Low: Output Compare active low
* Output         : None
* Return         : None
*******************************************************************************/
void TIM_OC1PolarityConfig(TIM_TypeDef* TIMx, u16 TIM_OCPolarity)
{
  u32 tmpccer = 0;

  /* Check the parameters */
  assert(IS_TIM_OC_POLARITY(TIM_OCPolarity));

  tmpccer = TIMx->CCER;

  /* Set or Reset the CC1P Bit */
  tmpccer &= CCER_CC1P_Mask;
  tmpccer |= TIM_OCPolarity;

  TIMx->CCER = (u16)tmpccer;
}

/*******************************************************************************
* Function Name  : TIM_OC2PolarityConfig
* Description    : Configures the TIMx channel 2 polarity.
* Input          : - TIMx: where x can be 2, 3 or 4 to select the TIM peripheral.
*                  - TIM_OCPolarity: specifies the OC2 Polarity
*                    This parmeter can be one of the following values:
*                       - TIM_OCPolarity_High: Output Compare active high
*                       - TIM_OCPolarity_Low: Output Compare active low
* Output         : None
* Return         : None
*******************************************************************************/
void TIM_OC2PolarityConfig(TIM_TypeDef* TIMx, u16 TIM_OCPolarity)
{
  u32 tmpccer = 0;

  /* Check the parameters */
  assert(IS_TIM_OC_POLARITY(TIM_OCPolarity));

  tmpccer = TIMx->CCER;

  /* Set or Reset the CC2P Bit */
  tmpccer &= CCER_CC2P_Mask;
  tmpccer |= (u16)((u16)TIM_OCPolarity << 4);

  TIMx->CCER = (u16)tmpccer;
}

/*******************************************************************************
* Function Name  : TIM_OC3PolarityConfig
* Description    : Configures the TIMx channel 3 polarity.
* Input          : - TIMx: where x can be 2, 3 or 4 to select the TIM peripheral.
*                  - TIM_OCPolarity: specifies the OC3 Polarity
*                    This parmeter can be one of the following values:
*                       - TIM_OCPolarity_High: Output Compare active high
*                       - TIM_OCPolarity_Low: Output Compare active low
* Output         : None
* Return         : None
*******************************************************************************/
void TIM_OC3PolarityConfig(TIM_TypeDef* TIMx, u16 TIM_OCPolarity)
{
  u32 tmpccer = 0;

  /* Check the parameters */
  assert(IS_TIM_OC_POLARITY(TIM_OCPolarity));

  tmpccer = TIMx->CCER;

  /* Set or Reset the CC3P Bit */
  tmpccer &= CCER_CC3P_Mask;
  tmpccer |= (u16)((u16)TIM_OCPolarity << 8);

  TIMx->CCER = (u16)tmpccer;
}

/*******************************************************************************
* Function Name  : TIM_OC4PolarityConfig
* Description    : Configures the TIMx channel 4 polarity.
* Input          : - TIMx: where x can be 2, 3 or 4 to select the TIM peripheral.
*                  - TIM_OCPolarity: specifies the OC4 Polarity
*                    This parmeter can be one of the following values:
*                       - TIM_OCPolarity_High: Output Compare active high
*                       - TIM_OCPolarity_Low: Output Compare active low
* Output         : None
* Return         : None
*******************************************************************************/
void TIM_OC4PolarityConfig(TIM_TypeDef* TIMx, u16 TIM_OCPolarity)
{
  u32 tmpccer = 0;

  /* Check the parameters */
  assert(IS_TIM_OC_POLARITY(TIM_OCPolarity));

  tmpccer = TIMx->CCER;

  /* Set or Reset the CC4P Bit */
  tmpccer &= CCER_CC4P_Mask;
  tmpccer |= (u16)((u16)TIM_OCPolarity << 12);

  TIMx->CCER = (u16)tmpccer;
}

/*******************************************************************************
* Function Name  : TIM_UpdateRequestConfig
* Description    : Configures the TIMx Update Request Interrupt source.
* Input          : - TIMx: where x can be 2, 3 or 4 to select the TIM peripheral.
*                  - TIM_UpdateSource: specifies the Update source.
*                    This parameter can be one of the following values:
*                       - TIM_UpdateSource_Regular
*                       - TIM_UpdateSource_Global
* Output         : None
* Return         : None
*******************************************************************************/
void TIM_UpdateRequestConfig(TIM_TypeDef* TIMx, u16 TIM_UpdateSource)
{
  u32 tmpcr1 = 0;

  /* Check the parameters */
  assert(IS_TIM_UPDATE_SOURCE(TIM_UpdateSource));

  tmpcr1 = TIMx->CR1;

  if (TIM_UpdateSource == TIM_UpdateSource_Regular)
  {
    /* Set the URS Bit */
    tmpcr1 |= CR1_URS_Set;
  }
  else
  {
    /* Reset the URS Bit */
    tmpcr1 &= CR1_URS_Reset;
  }
  TIMx->CR1 = (u16)tmpcr1;
}

/*******************************************************************************
* Function Name  : TIM_SelectHallSensor
* Description    : Enables or disables the TIMx抯 Hall sensor interface.
* Input          : - TIMx: where x can be 2, 3 or 4 to select the TIM peripheral.
*                  - Newstate: new state of the TIMx Hall sensor interface.
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : None
*******************************************************************************/
void TIM_SelectHallSensor(TIM_TypeDef* TIMx, FunctionalState Newstate)
{
  /* Check the parameters */
  assert(IS_FUNCTIONAL_STATE(Newstate));

  if (Newstate != DISABLE)
  {
   

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩视频一区在线观看| 亚洲成人免费在线| 亚洲国产精品久久不卡毛片 | 精品sm捆绑视频| 亚洲欧美区自拍先锋| 国产69精品久久久久毛片| 日韩一区二区三区电影在线观看| 亚洲品质自拍视频网站| 国产在线精品免费av| 91麻豆精品国产91久久久久久| 国产精品网站在线观看| 久久精品二区亚洲w码| 欧美日韩国产一级二级| 亚洲女子a中天字幕| 成人美女视频在线观看18| 欧美精品一区二区三| 水蜜桃久久夜色精品一区的特点 | 国产精品国产三级国产a| 久久成人免费电影| 欧美一区二区福利在线| 夜夜嗨av一区二区三区网页| av高清不卡在线| 国产精品国产自产拍在线| 国产毛片精品国产一区二区三区| 日韩区在线观看| 奇米影视一区二区三区小说| 337p亚洲精品色噜噜| 午夜国产精品一区| 欧美精品在线一区二区三区| 亚洲综合网站在线观看| 欧美日韩精品一二三区| 午夜精品久久久久影视| 欧美一区二区三级| 麻豆91精品视频| 精品盗摄一区二区三区| 国内精品免费在线观看| 国产视频911| 91在线国产观看| 亚洲激情欧美激情| 欧美女孩性生活视频| 日本中文字幕一区| 欧美精品一区二区三区四区| 国产精品亚洲一区二区三区在线| 国产日韩欧美精品一区| 91视频一区二区| 亚洲午夜精品在线| 欧美一区二区三区电影| 国产一区三区三区| 亚洲欧洲国产日韩| 欧美性猛交一区二区三区精品| 日韩国产欧美在线视频| 久久久777精品电影网影网| 99在线精品观看| 日本aⅴ亚洲精品中文乱码| 精品国产伦理网| caoporn国产一区二区| 亚洲主播在线观看| 欧美成人精品1314www| www.亚洲在线| 三级欧美在线一区| 久久精品夜夜夜夜久久| 色综合婷婷久久| 麻豆精品久久精品色综合| 国产欧美日韩另类视频免费观看| 91久久精品网| 国产又黄又大久久| 亚洲精品视频在线观看网站| 日韩天堂在线观看| 97国产精品videossex| 蜜臀精品久久久久久蜜臀| 国产精品美女一区二区三区| 欧美久久久一区| 91亚洲精品一区二区乱码| 日韩高清一区二区| 最新国产精品久久精品| 精品日韩一区二区三区| 在线观看一区二区视频| 国产suv精品一区二区883| 亚洲成人免费观看| 中文字幕一区不卡| 精品成人佐山爱一区二区| 欧美日韩中文字幕精品| 9i看片成人免费高清| 韩国精品在线观看| 日韩电影在线观看电影| 亚洲精品视频一区| 国产精品视频一二三区| 欧美va亚洲va| 91精品国产欧美一区二区| 色婷婷香蕉在线一区二区| 国产乱子伦一区二区三区国色天香| 亚洲chinese男男1069| 亚洲色图在线看| 国产精品五月天| 久久男人中文字幕资源站| 日韩欧美亚洲国产精品字幕久久久 | 久久精品国产精品青草| 午夜精品久久久久久久99樱桃| 亚洲美腿欧美偷拍| 国产精品卡一卡二| 国产欧美一区二区在线| 亚洲精品一区二区三区影院| 91精品在线免费观看| 欧美在线视频日韩| 欧美亚洲国产怡红院影院| 99国产精品久久久| 91毛片在线观看| 91蝌蚪porny| 色哟哟一区二区在线观看| yourporn久久国产精品| 99久久伊人精品| 91在线视频免费观看| 99久久精品国产一区| 播五月开心婷婷综合| 99久久亚洲一区二区三区青草| av一区二区久久| 一本大道久久a久久精品综合| 色婷婷久久久亚洲一区二区三区| 99久久婷婷国产精品综合| 91色在线porny| 欧美自拍丝袜亚洲| 欧美电影在线免费观看| 日韩视频一区在线观看| 久久久蜜臀国产一区二区| 国产亚洲福利社区一区| ㊣最新国产の精品bt伙计久久| 亚洲人午夜精品天堂一二香蕉| 一区二区三区免费网站| 亚洲国产裸拍裸体视频在线观看乱了| 亚洲最快最全在线视频| 奇米精品一区二区三区四区 | 欧美三级午夜理伦三级中视频| 欧美性猛交xxxx乱大交退制版 | 美女视频黄 久久| 国产自产v一区二区三区c| 成人国产精品视频| 在线视频一区二区免费| 欧美一级一区二区| 国产欧美日韩中文久久| 亚洲最大成人网4388xx| 久久99国产精品免费| 99国产精品视频免费观看| 在线播放日韩导航| 国产亚洲欧美日韩在线一区| 亚洲嫩草精品久久| 久久成人免费电影| 一本一本大道香蕉久在线精品 | 国产精品影视在线| 色域天天综合网| 欧美videos大乳护士334| 中文字幕字幕中文在线中不卡视频| 天堂一区二区在线免费观看| 国产一区二区三区在线观看精品| 91丨porny丨户外露出| 日韩欧美国产综合在线一区二区三区| 国产精品美女一区二区| 日本aⅴ免费视频一区二区三区| 北岛玲一区二区三区四区| 欧美一级免费大片| 综合分类小说区另类春色亚洲小说欧美| 亚洲午夜一区二区三区| 成人app下载| 日韩一本二本av| 亚洲综合无码一区二区| 成人激情黄色小说| 欧美大片拔萝卜| 亚洲国产精品综合小说图片区| 国产91丝袜在线18| 日韩欧美www| 亚洲午夜久久久久久久久久久| 国产成人亚洲综合色影视| 日韩三级精品电影久久久| 亚洲主播在线播放| 91麻豆国产自产在线观看| 久久久不卡影院| 韩国成人在线视频| 日韩精品一区二区三区老鸭窝| 亚洲国产精品自拍| 在线观看亚洲a| 日韩理论片中文av| 成人精品电影在线观看| 欧美精品一区二区不卡| 免费观看在线综合色| 91麻豆精品国产91久久久更新时间| 亚洲精品高清视频在线观看| 成人国产精品免费观看动漫| 久久久99久久| 国产69精品一区二区亚洲孕妇 | 亚洲一区在线播放| 欧美在线观看视频一区二区三区| 国产精品不卡一区| 不卡视频一二三| 国产精品国产a级| 99热在这里有精品免费| 综合色中文字幕| 91国偷自产一区二区三区观看| 亚洲品质自拍视频| 欧美在线一二三| 日韩va亚洲va欧美va久久| 91精品国产综合久久精品麻豆|