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

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

?? stm32f10x_tim.c

?? STM32F RFID通訊源代碼(支持雙向發送接收)
?? C
?? 第 1 頁 / 共 5 頁
字號:
  /* Check the parameters */
  assert(IS_TIM_EXT_PRESCALER(TIM_ExtTRGPrescaler));
  assert(IS_TIM_EXT_POLARITY(TIM_ExtTRGPolarity));

  /* Configure the ETR Clock source */
  TIM_ETRConfig(TIMx, TIM_ExtTRGPrescaler, TIM_ExtTRGPolarity, ExtTRGFilter);

  /* Select the External clock mode1 */
  TIMx->SMCR &= SMCR_SMS_Mask;
  TIMx->SMCR |= TIM_SlaveMode_External1;

  /* Select the Trigger selection : ETRF */
  TIMx->SMCR &= SMCR_TS_Mask;
  TIMx->SMCR |= TIM_TS_ETRF;
}

/*******************************************************************************
* Function Name  : TIM_ETRClockMode2Config
* Description    : Configures the External clock Mode2
* Input          : - TIMx: where x can be 2, 3 or 4 to select the TIM peripheral.
*                  - TIM_ExtTRGPrescaler: The external Trigger Prescaler.
*                    It can be one of the following values:
*                       - TIM_ExtTRGPSC_OFF
*                       - TIM_ExtTRGPSC_DIV2
*                       - TIM_ExtTRGPSC_DIV4
*                       - TIM_ExtTRGPSC_DIV8
*                  - TIM_ExtTRGPolarity: The external Trigger Polarity.
*                    It can be one of the following values:
*                       - TIM_ExtTRGPolarity_Inverted
*                       - TIM_ExtTRGPolarity_NonInverted
*                  - ExtTRGFilter: External Trigger Filter.
*                    This parameter must be a value between 0x00 and 0x0F
* Output         : None
* Return         : None
*******************************************************************************/
void TIM_ETRClockMode2Config(TIM_TypeDef* TIMx, u16 TIM_ExtTRGPrescaler, 
                             u16 TIM_ExtTRGPolarity, u8 ExtTRGFilter)
{
  /* Check the parameters */
  assert(IS_TIM_EXT_PRESCALER(TIM_ExtTRGPrescaler));
  assert(IS_TIM_EXT_POLARITY(TIM_ExtTRGPolarity));

  /* Configure the ETR Clock source */
  TIM_ETRConfig(TIMx, TIM_ExtTRGPrescaler, TIM_ExtTRGPolarity, ExtTRGFilter);

  /* Enable the External clock mode2 */
  TIMx->SMCR |= SMCR_ECE_Set;
}

/*******************************************************************************
* Function Name  : TIM_ETRConfig
* Description    : Configures the TIMx External Trigger (ETR).
* Input          : - TIMx: where x can be 2, 3 or 4 to select the TIM peripheral.
*                  - TIM_ExtTRGPrescaler: The external Trigger Prescaler.
*                    This parameter can be one of the following values:
*                       - TIM_ExtTRGPSC_OFF
*                       - TIM_ExtTRGPSC_DIV2
*                       - TIM_ExtTRGPSC_DIV4
*                       - TIM_ExtTRGPSC_DIV8
*                  - TIM_ExtTRGPolarity: The external Trigger Polarity.
*                    This parameter can be one of the following values:
*                       - TIM_ExtTRGPolarity_Inverted
*                       - TIM_ExtTRGPolarity_NonInverted
*                  - ExtTRGFilter: External Trigger Filter.
*                    This parameter must be a value between 0x00 and 0x0F.
* Output         : None
* Return         : None
*******************************************************************************/
 void TIM_ETRConfig(TIM_TypeDef* TIMx, u16 TIM_ExtTRGPrescaler, u16 TIM_ExtTRGPolarity,
                       u8 ExtTRGFilter)
{
  u32 tmpsmcr = 0;

  tmpsmcr = TIMx->SMCR;

  /* Set the Prescaler, the Filter value and the Polarity */
  tmpsmcr &= SMCR_ETR_Mask;
  tmpsmcr |= TIM_ExtTRGPrescaler | TIM_ExtTRGPolarity | (u16)((u16)ExtTRGFilter << 8);

  TIMx->SMCR = (u16)tmpsmcr;
}

/*******************************************************************************
* Function Name  : TIM_SelectInputTrigger
* Description    : Selects the Input Trigger source
* Input          : - TIMx: where x can be 2, 3 or 4 to select the TIM peripheral.
*                  - TIM_InputTriggerSource: The Input Trigger source.
*                    This parameter can be one of the following values:
*                       - TIM_TS_ITR0: Internal Trigger 0
*                       - TIM_TS_ITR1: Internal Trigger 1
*                       - TIM_TS_ITR2: Internal Trigger 2
*                       - TIM_TS_ITR3: Internal Trigger 3
*                       - TIM_TS_TI1F_ED: TI1 Edge Detector
*                       - TIM_TS_TI1FP1: Filtered Timer Input 1
*                       - TIM_TS_TI2FP2: Filtered Timer Input 2
*                       - TIM_TS_ETRF: External Trigger input
* Output         : None
* Return         : None
*******************************************************************************/
void TIM_SelectInputTrigger(TIM_TypeDef* TIMx, u16 TIM_InputTriggerSource)
{
  u32 tmpsmcr = 0;

  /* Check the parameters */
  assert(IS_TIM_TRIGGER_SELECTION(TIM_InputTriggerSource));

  tmpsmcr = TIMx->SMCR;

  /* Select the Tgigger Source */
  tmpsmcr &= SMCR_TS_Mask;
  tmpsmcr |= TIM_InputTriggerSource;

  TIMx->SMCR = (u16)tmpsmcr;
}

/*******************************************************************************
* Function Name  : TIM_PrescalerConfig
* Description    : Configures the TIMx Prescaler.
* Input          : - TIMx: where x can be 2, 3 or 4 to select the TIM peripheral.
*                  - Prescaler: specifies the Prescaler Register value
*                  - TIM_PSCReloadMode: specifies the TIM Prescaler Reload mode
*                    This parameter can be one of the following values:
*                       - TIM_PSCReloadMode_Update: The Prescaler is loaded at
*                         the update event.
*                       - TIM_PSCReloadMode_Immediate: The Prescaler is loaded
*                         immediatly.
* Output         : None
* Return         : None
*******************************************************************************/
void TIM_PrescalerConfig(TIM_TypeDef* TIMx, u16 Prescaler, u16 TIM_PSCReloadMode)
{
  /* Check the parameters */
  assert(IS_TIM_PRESCALER_RELOAD(TIM_PSCReloadMode));

  /* Set the Prescaler value */
  TIMx->PSC = Prescaler;

  /* Set or reset the UG Bit */
  if (TIM_PSCReloadMode == TIM_PSCReloadMode_Immediate)
  {
    TIMx->EGR |= TIM_EventSource_Update;
  }
  else
  {
    TIMx->EGR &= TIM_EventSource_Update;
  }
}

/*******************************************************************************
* Function Name  : TIM_CounterModeConfig
* Description    : Specifies the TIMx Counter Mode to be used.
* Input          : - TIMx: where x can be 2, 3 or 4 to select the TIM peripheral.
*                  - TIM_CounterMode: specifies the Counter Mode to be used
*                    This parameter can be one of the following values:
*                       - TIM_CounterMode_Up: TIM Up Counting Mode
*                       - TIM_CounterMode_Down: TIM Down Counting Mode
*                       - TIM_CounterMode_CenterAligned1: TIM Center Aligned Mode1
*                       - TIM_CounterMode_CenterAligned2: TIM Center Aligned Mode2
*                       - TIM_CounterMode_CenterAligned3: TIM Center Aligned Mode3
* Output         : None
* Return         : None
*******************************************************************************/
void TIM_CounterModeConfig(TIM_TypeDef* TIMx, u16 TIM_CounterMode)
{
  u32 tmpcr1 = 0;

  /* Check the parameters */
  assert(IS_TIM_COUNTER_MODE(TIM_CounterMode));

  tmpcr1 = TIMx->CR1;

  /* Reset the CMS and DIR Bits */
  tmpcr1 &= CR1_CounterMode_Mask;

  /* Set the Counter Mode */
  tmpcr1 |= TIM_CounterMode;

  TIMx->CR1 = (u16)tmpcr1;
}

/*******************************************************************************
* Function Name  : TIM_ForcedOC1Config
* Description    : Forces the TIMx output 1 waveform to active or inactive level.
* Input          : - TIMx: where x can be 2, 3 or 4 to select the TIM peripheral.
*                  - TIM_ForcedAction: specifies the forced Action to be set to
*                    the output waveform.
*                    This parameter can be one of the following values:
*                       - TIM_ForcedAction_Active: Force active level on OC1REF
*                       - TIM_ForcedAction_InActive: Force inactive level on
*                         OC1REF.
* Output         : None
* Return         : None
*******************************************************************************/
void TIM_ForcedOC1Config(TIM_TypeDef* TIMx, u16 TIM_ForcedAction)
{
  u32 tmpccmr1 = 0;

  /* Check the parameters */
  assert(IS_TIM_FORCED_ACTION(TIM_ForcedAction));

  tmpccmr1 = TIMx->CCMR1;

  /* Reset the OCM Bits */
  tmpccmr1 &= CCMR_OCM13_Mask;

  /* Configure The Forced output Mode */
  tmpccmr1 |= TIM_ForcedAction;

  TIMx->CCMR1 = (u16)tmpccmr1;
}

/*******************************************************************************
* Function Name  : TIM_ForcedOC2Config
* Description    : Forces the TIMx output 2 waveform to active or inactive level.
* Input          : - TIMx: where x can be 2, 3 or 4 to select the TIM peripheral.
*                  - TIM_ForcedAction: specifies the forced Action to be set to
*                    the output waveform.
*                    This parameter can be one of the following values:
*                       - TIM_ForcedAction_Active: Force active level on OC2REF
*                       - TIM_ForcedAction_InActive: Force inactive level on
*                         OC2REF.
* Output         : None
* Return         : None
*******************************************************************************/
void TIM_ForcedOC2Config(TIM_TypeDef* TIMx, u16 TIM_ForcedAction)
{
  u32 tmpccmr1 = 0;

  /* Check the parameters */
  assert(IS_TIM_FORCED_ACTION(TIM_ForcedAction));

  tmpccmr1 = TIMx->CCMR1;

  /* Reset the OCM Bits */
  tmpccmr1 &= CCMR_OCM24_Mask;

  /* Configure The Forced output Mode */
  tmpccmr1 |= (u16)(TIM_ForcedAction << 8);

  TIMx->CCMR1 = (u16)tmpccmr1;
}

/*******************************************************************************
* Function Name  : TIM_ForcedOC3Config
* Description    : Forces the TIMx output 3 waveform to active or inactive level.
* Input          : - TIMx: where x can be 2, 3 or 4 to select the TIM peripheral.
*                  - TIM_ForcedAction: specifies the forced Action to be set to
*                    the output waveform.
*                    This parameter can be one of the following values:
*                       - TIM_ForcedAction_Active: Force active level on OC3REF
*                       - TIM_ForcedAction_InActive: Force inactive level on
*                         OC3REF.
* Output         : None
* Return         : None
*******************************************************************************/
void TIM_ForcedOC3Config(TIM_TypeDef* TIMx, u16 TIM_ForcedAction)
{
  u32 tmpccmr2 = 0;

  /* Check the parameters */
  assert(IS_TIM_FORCED_ACTION(TIM_ForcedAction));

  tmpccmr2 = TIMx->CCMR2;

  /* Reset the OCM Bits */
  tmpccmr2 &= CCMR_OCM13_Mask;

  /* Configure The Forced output Mode */
  tmpccmr2 |= TIM_ForcedAction;

  TIMx->CCMR2 = (u16)tmpccmr2;
}

/*******************************************************************************
* Function Name  : TIM_ForcedOC4Config
* Description    : Forces the TIMx output 4 waveform to active or inactive level.
* Input          : - TIMx: where x can be 2, 3 or 4 to select the TIM peripheral.
*                  - TIM_ForcedAction: specifies the forced Action to be set to
*                    the output waveform.
*                    This parameter can be one of the following values:
*                       - TIM_ForcedAction_Active: Force active level on OC4REF
*                       - TIM_ForcedAction_InActive: Force inactive level on
*                         OC4REF.
* Output         : None
* Return         : None
*******************************************************************************/
void TIM_ForcedOC4Config(TIM_TypeDef* TIMx, u16 TIM_ForcedAction)
{
  u32 tmpccmr2 = 0;

  /* Check the parameters */
  assert(IS_TIM_FORCED_ACTION(TIM_ForcedAction));

  tmpccmr2 = TIMx->CCMR2;

  /* Reset the OCM Bits */
  tmpccmr2 &= CCMR_OCM24_Mask;

  /* Configure The Forced output Mode */
  tmpccmr2 |= (u16)(TIM_ForcedAction << 8);

  TIMx->CCMR2 = (u16)tmpccmr2;
}

/*******************************************************************************
* Function Name  : TIM_ARRPreloadConfig
* Description    : Enables or disables TIMx peripheral Preload register on ARR.
* 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_ARRPreloadConfig(TIM_TypeDef* TIMx, FunctionalState Newstate)
{
  u32 tmpcr1 = 0;
  
  /* Check the parameters */
  assert(IS_FUNCTIONAL_STATE(Newstate));

  tmpcr1 = TIMx->CR1;

  if (Newstate != DISABLE)
  {
    /* Set the ARR Preload Bit */
    tmpcr1 |= CR1_ARPE_Set;
  }
  else
  {
    /* Reset the ARR Preload Bit */
    tmpcr1 &= CR1_ARPE_Reset;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人午夜精品一区二区三区| 成人一区二区三区视频| 精品无人码麻豆乱码1区2区| av不卡一区二区三区| 欧美高清你懂得| 中文字幕一区视频| 久久99精品国产麻豆婷婷| 91高清在线观看| 国产婷婷色一区二区三区| 天天射综合影视| 色素色在线综合| 欧美激情一区二区三区不卡| 日韩av电影天堂| 在线视频观看一区| 国产精品国产三级国产专播品爱网| 人人精品人人爱| 中文字幕一区二区三区在线播放 | 91精品国产综合久久婷婷香蕉| 国产欧美一区二区三区在线看蜜臀 | 亚洲天堂精品视频| 国产大片一区二区| 久久久久高清精品| 国产在线精品免费| wwwwww.欧美系列| 久久9热精品视频| 日韩欧美国产1| 日本成人在线不卡视频| 欧美日韩www| 日韩av一级片| 91精品国产一区二区三区| 亚洲成人手机在线| 欧美色视频一区| 国产激情一区二区三区桃花岛亚洲| 成人免费视频一区| 久久久www成人免费无遮挡大片| 美女诱惑一区二区| 日韩视频免费直播| 蜜桃在线一区二区三区| 欧美成人在线直播| 国产美女娇喘av呻吟久久| 久久午夜色播影院免费高清 | 欧美国产成人精品| 懂色av一区二区三区免费观看| 国产日韩精品一区二区浪潮av| 国产精品羞羞答答xxdd| 国产情人综合久久777777| 成人免费观看视频| 悠悠色在线精品| 欧美日韩国产一二三| 日本伊人午夜精品| 亚洲同性gay激情无套| 91在线观看视频| 国产精品久久三| 欧美性感一区二区三区| 日韩精品高清不卡| 久久一留热品黄| 91在线视频播放地址| 亚洲第一会所有码转帖| 欧美va亚洲va国产综合| 成人性视频免费网站| 亚洲国产日韩一区二区| 欧美刺激脚交jootjob| 成人动漫一区二区在线| 亚洲福中文字幕伊人影院| 精品美女一区二区| www.在线成人| 日韩av不卡在线观看| 久久精品视频网| 欧美一a一片一级一片| 免播放器亚洲一区| 综合色天天鬼久久鬼色| 欧美一三区三区四区免费在线看| 国产不卡一区视频| 亚洲第一福利一区| 欧美国产精品久久| 欧美二区三区的天堂| 成人网在线免费视频| 婷婷综合另类小说色区| 久久久精品蜜桃| 欧美日韩高清一区| 成人免费高清在线| 免费av成人在线| 亚洲免费av网站| 久久久久国产精品人| 91精品国产一区二区三区香蕉| 9l国产精品久久久久麻豆| 免费观看在线综合| 亚洲一区二区在线视频| 亚洲国产精品成人久久综合一区| 欧美一区二区视频观看视频| 色婷婷一区二区三区四区| 国内精品国产成人| 日韩在线观看一区二区| 一卡二卡三卡日韩欧美| 国产精品热久久久久夜色精品三区| 91精品国产手机| 欧美在线不卡一区| 91首页免费视频| 成人av免费在线观看| 激情文学综合网| 久久国产精品99久久久久久老狼| 一区二区三区四区国产精品| 国产精品的网站| 国产欧美日韩综合精品一区二区 | 欧美大胆人体bbbb| 欧美日韩中字一区| 91传媒视频在线播放| av资源网一区| 99热这里都是精品| caoporen国产精品视频| 国产69精品久久久久毛片 | voyeur盗摄精品| 成人一区在线观看| 成人久久久精品乱码一区二区三区 | 久久 天天综合| 久久99精品国产麻豆婷婷| 麻豆精品在线视频| 精品一区二区三区不卡| 久久er99热精品一区二区| 精品无人码麻豆乱码1区2区| 久久精品国产久精国产| 国产真实精品久久二三区| 韩国三级在线一区| 国产成人免费在线| 99在线精品一区二区三区| 91免费观看视频| 在线日韩国产精品| 精品视频全国免费看| 欧美一三区三区四区免费在线看| 欧美一区二区私人影院日本| 精品日本一线二线三线不卡| 337p日本欧洲亚洲大胆色噜噜| 久久久亚洲精华液精华液精华液| 欧美国产精品v| 亚洲欧美另类图片小说| 亚洲一二三四区| 乱中年女人伦av一区二区| 国产成人精品影院| 色先锋久久av资源部| 欧美美女网站色| 久久影院午夜片一区| 中文字幕人成不卡一区| 亚洲高清不卡在线观看| 国产一区二区三区日韩 | 一本到不卡精品视频在线观看| 欧洲国内综合视频| 日韩免费性生活视频播放| 久久久.com| 亚洲综合免费观看高清完整版在线| 视频在线观看91| 高清久久久久久| 欧美日韩亚洲综合在线| 精品日韩成人av| 一区二区三区.www| 久久国产精品无码网站| 色综合久久久久综合体| 精品va天堂亚洲国产| 亚洲乱码国产乱码精品精可以看| 免费在线一区观看| 99精品在线观看视频| 欧美mv和日韩mv的网站| 夜夜精品浪潮av一区二区三区| 极品少妇一区二区三区精品视频| 91免费观看在线| 久久天堂av综合合色蜜桃网| 一卡二卡欧美日韩| 高清不卡在线观看av| 欧美精品亚洲二区| 中文字幕亚洲一区二区va在线| 美女在线观看视频一区二区| 色噜噜久久综合| 国产亚洲精品超碰| 毛片av一区二区| 精品视频免费看| 亚洲嫩草精品久久| 国产成人免费视频精品含羞草妖精| 欧美高清视频一二三区| 亚洲欧美另类图片小说| 成人aa视频在线观看| www国产成人| 老司机精品视频导航| 欧美日韩dvd在线观看| 一区二区不卡在线播放| 91蜜桃网址入口| 国产精品久久久一区麻豆最新章节| 精品一区二区久久| 欧美一区国产二区| 天堂va蜜桃一区二区三区漫画版| 日本久久一区二区三区| 一区二区中文视频| 成人动漫一区二区三区| 国产精品视频免费| 国产98色在线|日韩| 久久久九九九九| 国产99精品国产| 国产午夜精品在线观看| 韩国中文字幕2020精品| 精品美女一区二区三区| 精品一区二区三区在线播放| 精品国产一区二区三区不卡|