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

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

?? stm32f10x_tim1.c

?? STM32利用正交編碼器實現(xiàn)電機的控制
?? C
?? 第 1 頁 / 共 5 頁
字號:
  /* Check the parameters */
  assert(IS_TIM1_SLAVE_MODE(TIM1_SlaveMode));

  tmpsmcr = TIM1->SMCR;

  /* Reset the SMS Bits */
  tmpsmcr &= SMCR_SMS_Mask;

  /* Select the Slave Mode */
  tmpsmcr |= TIM1_SlaveMode;

  TIM1->SMCR = (u16)tmpsmcr;
}

/*******************************************************************************
* Function Name  : TIM1_SelectMasterSlaveMode
* Description    : Sets or Resets the TIM1 Master/Slave Mode.
* Input          : - TIM1_MasterSlaveMode: specifies the TIM1 Master Slave Mode.
*                    This paramter can be one of the following values:
*                       - TIM1_MasterSlaveMode_Enable: synchronization between
*                         the current timer and its slaves (through TRGO).
*                       - TIM1_MasterSlaveMode_Disable: No action
* Output         : None
* Return         : None
*******************************************************************************/
void TIM1_SelectMasterSlaveMode(u16 TIM1_MasterSlaveMode)
{
  /* Check the parameters */
  assert(IS_TIM1_MSM_STATE(TIM1_MasterSlaveMode));

  /* Set or Reset the MSM Bit */
  *(vu32 *) SMCR_MSM_BB = TIM1_MasterSlaveMode;
}

/*******************************************************************************
* Function Name  : TIM1_EncoderInterfaceConfig
* Description    : Configures the TIM1 Encoder Interface.
* Input          : - TIM1_EncoderMode: specifies the TIM1 Encoder Mode.
*                    This parameter can be one of the following values:
*                       - TIM1_EncoderMode_TI1: Counter counts on TI1FP1 edge
*                         depending on TI2FP2 level.
*                       - TIM1_EncoderMode_TI2: Counter counts on TI2FP2 edge
*                         depending on TI1FP1 level.
*                       - TIM1_EncoderMode_TI12: Counter counts on both TI1FP1 and
*                         TI2FP2 edges depending on the level of the other input.
*                  - TIM1_IC1Polarity: specifies the IC1 Polarity
*                    This parmeter can be one of the following values:
*                       - TIM1_ICPolarity_Falling
*                       - TIM1_ICPolarity_Rising
*                  - TIM1_IC2Polarity: specifies the IC2 Polarity
*                    This parmeter can be one of the following values:
*                       - TIM1_ICPolarity_Falling
*                       - TIM1_ICPolarity_Rising
* Output         : None
* Return         : None
*******************************************************************************/
void TIM1_EncoderInterfaceConfig(u16 TIM1_EncoderMode, u16 TIM1_IC1Polarity,
                                u16 TIM1_IC2Polarity)
{
  u32 tmpsmcr = 0;
  u32 tmpccmr1 = 0;

  /* Check the parameters */
  assert(IS_TIM1_ENCODER_MODE(TIM1_EncoderMode));
  assert(IS_TIM1_IC_POLARITY(TIM1_IC1Polarity));
  assert(IS_TIM1_IC_POLARITY(TIM1_IC2Polarity));

  tmpsmcr = TIM1->SMCR;
  tmpccmr1 = TIM1->CCMR1;

  /* Set the encoder Mode */
  tmpsmcr &= SMCR_SMS_Mask;
  tmpsmcr |= TIM1_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 */
  *(vu32 *) CCER_CC1P_BB = TIM1_IC1Polarity;
  *(vu32 *) CCER_CC2P_BB = TIM1_IC2Polarity;

  TIM1->SMCR = (u16)tmpsmcr;

  TIM1->CCMR1 = (u16)tmpccmr1;
}

/*******************************************************************************
* Function Name  : TIM1_PrescalerConfig
* Description    : Configures the TIM1 Prescaler.
* Input          : - Prescaler: specifies the Prescaler Register value
*                  - TIM1_PSCReloadMode: specifies the TIM1 Prescaler Reload mode.
*                    This parmeter can be one of the following values:
*                       - TIM1_PSCReloadMode_Update: The Prescaler is loaded at
*                         the update event.
*                       - TIM1_PSCReloadMode_Immediate: The Prescaler is loaded
*                         immediatly.
* Output         : None
* Return         : None
*******************************************************************************/
void TIM1_PrescalerConfig(u16 Prescaler, u16 TIM1_PSCReloadMode)
{
  /* Check the parameters */
  assert(IS_TIM1_PRESCALER_RELOAD(TIM1_PSCReloadMode));

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

  /* Set or reset the UG Bit */
  *(vu32 *) EGR_UG_BB = TIM1_PSCReloadMode;
}
/*******************************************************************************
* Function Name  : TIM1_CounterModeConfig
* Description    : Specifies the TIM1 Counter Mode to be used.
* Input          : - TIM1_CounterMode: specifies the Counter Mode to be used
*                    This parameter can be one of the following values:
*                       - TIM1_CounterMode_Up: TIM1 Up Counting Mode
*                       - TIM1_CounterMode_Down: TIM1 Down Counting Mode
*                       - TIM1_CounterMode_CenterAligned1: TIM1 Center Aligned Mode1
*                       - TIM1_CounterMode_CenterAligned2: TIM1 Center Aligned Mode2
*                       - TIM1_CounterMode_CenterAligned3: TIM1 Center Aligned Mode3
* Output         : None
* Return         : None
*******************************************************************************/
void TIM1_CounterModeConfig(u16 TIM1_CounterMode)
{
  u32 tmpcr1 = 0;

  /* Check the parameters */
  assert(IS_TIM1_COUNTER_MODE(TIM1_CounterMode));

  tmpcr1 = TIM1->CR1;

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

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

  TIM1->CR1 = (u16)tmpcr1;
}

/*******************************************************************************
* Function Name  : TIM1_ForcedOC1Config
* Description    : Forces the TIM1 Channel1 output waveform to active or inactive 
*                  level.
* Input          : - TIM1_ForcedAction: specifies the forced Action to be set to
*                    the output waveform.
*                    This parameter can be one of the following values:
*                       - TIM1_ForcedAction_Active: Force active level on OC1REF
*                       - TIM1_ForcedAction_InActive: Force inactive level on
*                         OC1REF.
* Output         : None
* Return         : None
*******************************************************************************/
void TIM1_ForcedOC1Config(u16 TIM1_ForcedAction)
{
  u32 tmpccmr1 = 0;

  /* Check the parameters */
  assert(IS_TIM1_FORCED_ACTION(TIM1_ForcedAction));

  tmpccmr1 = TIM1->CCMR1;

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

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

  TIM1->CCMR1 = (u16)tmpccmr1;
}

/*******************************************************************************
* Function Name  : TIM1_ForcedOC2Config
* Description    : Forces the TIM1 Channel2 output waveform to active or inactive 
*                  level.
* Input          : - TIM1_ForcedAction: specifies the forced Action to be set to
*                    the output waveform.
*                    This parameter can be one of the following values:
*                       - TIM1_ForcedAction_Active: Force active level on OC2REF
*                       - TIM1_ForcedAction_InActive: Force inactive level on
*                         OC2REF.
* Output         : None
* Return         : None
*******************************************************************************/
void TIM1_ForcedOC2Config(u16 TIM1_ForcedAction)
{
  u32 tmpccmr1 = 0;

  /* Check the parameters */
  assert(IS_TIM1_FORCED_ACTION(TIM1_ForcedAction));

  tmpccmr1 = TIM1->CCMR1;

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

  /* Configure The Forced output Mode */
  tmpccmr1 |= (u32)TIM1_ForcedAction << 8;

  TIM1->CCMR1 = (u16)tmpccmr1;
}

/*******************************************************************************
* Function Name  : TIM1_ForcedOC3Config
* Description    : Forces the TIM1 Channel3 output waveform to active or inactive 
*                  level.
* Input          : - TIM1_ForcedAction: specifies the forced Action to be set to
*                    the output waveform.
*                    This parameter can be one of the following values:
*                       - TIM1_ForcedAction_Active: Force active level on OC3REF
*                       - TIM1_ForcedAction_InActive: Force inactive level on
*                         OC3REF.
* Output         : None
* Return         : None
*******************************************************************************/
void TIM1_ForcedOC3Config(u16 TIM1_ForcedAction)
{
  u32 tmpccmr2 = 0;

  /* Check the parameters */
  assert(IS_TIM1_FORCED_ACTION(TIM1_ForcedAction));

  tmpccmr2 = TIM1->CCMR2;

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

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

  TIM1->CCMR2 = (u16)tmpccmr2;
}

/*******************************************************************************
* Function Name  : TIM1_ForcedOC4Config
* Description    : Forces the TIM1 Channel4 output waveform to active or inactive 
*                  level.
* Input          : - TIM1_ForcedAction: specifies the forced Action to be set to
*                    the output waveform.
*                    This parameter can be one of the following values:
*                       - TIM1_ForcedAction_Active: Force active level on OC4REF
*                       - TIM1_ForcedAction_InActive: Force inactive level on
*                         OC4REF.
* Output         : None
* Return         : None
*******************************************************************************/
void TIM1_ForcedOC4Config(u16 TIM1_ForcedAction)
{
  u32 tmpccmr2 = 0;

  /* Check the parameters */
  assert(IS_TIM1_FORCED_ACTION(TIM1_ForcedAction));

  tmpccmr2 = TIM1->CCMR1;

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

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

  TIM1->CCMR2 = (u16)tmpccmr2;
}

/*******************************************************************************
* Function Name  : TIM1_ARRPreloadConfig
* Description    : Enables or disables TIM1 peripheral Preload register on ARR.
* Input          : - Newstate: new state of the TIM1 peripheral Preload register
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : None
*******************************************************************************/
void TIM1_ARRPreloadConfig(FunctionalState Newstate)
{
  /* Check the parameters */
  assert(IS_FUNCTIONAL_STATE(Newstate));

  /* Set or Reset the ARPE Bit */
  *(vu32 *) CR1_ARPE_BB = (u16)Newstate;
}

/*******************************************************************************
* Function Name  : TIM1_SelectCOM
* Description    : Selects the TIM1 peripheral Commutation event.
* Input          : - Newstate: new state of the Commutation event.
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : None
*******************************************************************************/
void TIM1_SelectCOM(FunctionalState Newstate)
{
  /* Check the parameters */
  assert(IS_FUNCTIONAL_STATE(Newstate));

  /* Set or Reset the CCUS Bit */
  *(vu32 *) CR2_CCUS_BB = (u16)Newstate;
}

/*******************************************************************************
* Function Name  : TIM1_SelectCCDMA
* Description    : Selects the TIM1 peripheral Capture Compare DMA source.
* Input          : - Newstate: new state of the Capture Compare DMA source
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : None
*******************************************************************************/
void TIM1_SelectCCDMA(FunctionalState Newstate)
{
  /* Check the parameters */
  assert(IS_FUNCTIONAL_STATE(Newstate));

  /* Set or Reset the CCDS Bit */
  *(vu32 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产目拍亚洲精品99久久精品| 国产精品一区二区久激情瑜伽 | 国产精品国产三级国产a| 精品一区二区在线播放| 欧美xxxxxxxx| 国产成人午夜视频| 综合中文字幕亚洲| 欧美亚洲国产一区二区三区va| 亚洲一区二区三区四区的| 欧美日本不卡视频| 精品影视av免费| 欧美—级在线免费片| 日本精品一区二区三区高清| 五月婷婷久久综合| www国产成人免费观看视频 深夜成人网| 国产老妇另类xxxxx| 最新中文字幕一区二区三区| 欧美日韩性生活| 久色婷婷小香蕉久久| 国产色婷婷亚洲99精品小说| 国产69精品久久99不卡| 亚洲欧美日韩国产综合在线| 欧美精品乱码久久久久久按摩| 亚洲国产日韩一级| 日韩免费性生活视频播放| 成人av综合一区| 亚洲高清免费观看高清完整版在线观看 | 久久久五月婷婷| 97久久精品人人做人人爽| 免费在线欧美视频| 国产精品午夜在线| 欧美日本一区二区三区四区| 国产成人av福利| 亚洲.国产.中文慕字在线| 久久免费美女视频| 欧美午夜精品免费| 国产99一区视频免费| 三级一区在线视频先锋| 欧美高清在线精品一区| 在线成人免费视频| a级精品国产片在线观看| 日本 国产 欧美色综合| 亚洲女同ⅹxx女同tv| 精品福利一二区| 欧美日韩性生活| 99视频精品全部免费在线| 激情综合亚洲精品| 婷婷综合五月天| 亚洲视频一二三| 久久精品在这里| 欧美一区二区在线免费播放| 91麻豆swag| 成人av集中营| 国产成都精品91一区二区三| 免费xxxx性欧美18vr| 亚洲一级在线观看| 亚洲人成影院在线观看| 久久奇米777| 欧美α欧美αv大片| 欧美精品三级日韩久久| 欧美色网站导航| 一本久久精品一区二区| 成人激情文学综合网| 国产精品 欧美精品| 激情伊人五月天久久综合| 五月激情综合网| 香蕉影视欧美成人| 亚洲午夜影视影院在线观看| 亚洲激情校园春色| 亚洲人成在线观看一区二区| 亚洲视频香蕉人妖| 亚洲欧美国产毛片在线| 亚洲精品视频在线看| 亚洲欧美日韩在线| 亚洲欧美激情插| 亚洲欧美福利一区二区| 亚洲欧美在线aaa| 中文字幕日韩一区| 最近中文字幕一区二区三区| 亚洲你懂的在线视频| 亚洲欧美日韩人成在线播放| 亚洲狠狠丁香婷婷综合久久久| 亚洲乱码日产精品bd| 亚洲最色的网站| 亚洲一区二区三区中文字幕| 亚洲一区二区三区不卡国产欧美 | 91啪亚洲精品| 91亚洲精华国产精华精华液| 91丨九色porny丨蝌蚪| 欧美在线视频不卡| 7777精品伊人久久久大香线蕉的 | 手机精品视频在线观看| 蜜臂av日日欢夜夜爽一区| 久久精品国产久精国产爱| 久久国产生活片100| 国产成人午夜视频| 91精品福利视频| 欧美欧美欧美欧美首页| 欧美一级一区二区| 国产日韩精品一区二区三区| 亚洲人成电影网站色mp4| 亚洲国产一区二区在线播放| 丝袜诱惑亚洲看片| 国产精品一区二区在线观看网站| 成人精品免费视频| 欧美久久免费观看| 久久亚洲精精品中文字幕早川悠里| 亚洲国产精品v| 亚洲国产一区二区视频| 精品无人区卡一卡二卡三乱码免费卡| 国产麻豆精品95视频| 91日韩一区二区三区| 91精品国产一区二区人妖| 国产性天天综合网| 亚洲成人精品影院| 国产成人在线网站| 精品视频1区2区3区| 久久久久久久久97黄色工厂| 亚洲男同1069视频| 久久精品国产澳门| 色偷偷成人一区二区三区91| 日韩视频免费观看高清完整版| 欧美国产97人人爽人人喊| 婷婷中文字幕综合| 高清久久久久久| 欧美日韩国产免费| 中文字幕字幕中文在线中不卡视频| 日本中文字幕一区二区视频| 99免费精品视频| 欧美mv日韩mv| 亚洲一区二区三区四区五区黄 | 99v久久综合狠狠综合久久| 91精品国模一区二区三区| 中文字幕一区二区三区四区不卡| 蜜桃视频免费观看一区| 在线免费观看一区| 国产日韩欧美制服另类| 蜜臀精品一区二区三区在线观看| 一本大道久久a久久综合婷婷 | 成人国产精品免费观看动漫| 欧美一区二区三区喷汁尤物| 亚洲另类在线一区| www.亚洲色图.com| 久久精品一区四区| 美女在线一区二区| 欧美乱熟臀69xxxxxx| 亚洲精品成人天堂一二三| 成人爽a毛片一区二区免费| 日韩精品一区二区三区蜜臀| 亚洲成人免费在线| 欧美又粗又大又爽| 亚洲色图在线播放| 成人网在线免费视频| 国产亚洲欧美激情| 国内精品自线一区二区三区视频| 欧美久久一二区| 五月天网站亚洲| 欧美日韩一区国产| 夜夜精品视频一区二区 | 国产日韩精品一区二区三区| 极品少妇xxxx精品少妇| 精品免费99久久| 美女视频网站久久| 日韩欧美国产系列| 麻豆精品一区二区| 日韩精品在线网站| 国内精品视频666| 精品国产乱码久久久久久久| 奇米综合一区二区三区精品视频| 欧美二区三区91| 日本在线不卡视频| 这里只有精品免费| 玉足女爽爽91| 成人短视频下载| 亚洲视频一区在线| 91国偷自产一区二区开放时间| 亚洲三级在线播放| 在线观看亚洲专区| 天堂蜜桃91精品| 日韩欧美高清一区| 国产高清在线精品| 中文在线资源观看网站视频免费不卡| 成人精品视频网站| 亚洲自拍偷拍图区| 国产成人免费9x9x人网站视频| 国产欧美一区二区精品忘忧草| 成人h精品动漫一区二区三区| 亚洲欧美日韩综合aⅴ视频| 欧美日韩免费不卡视频一区二区三区 | 亚洲成人一区在线| 91精品国产aⅴ一区二区| 激情六月婷婷久久| 国产精品美女久久久久aⅴ| 色视频一区二区| 日韩经典中文字幕一区| 久久久久九九视频| 91美女在线观看| 日本中文一区二区三区| 国产日韩欧美精品电影三级在线| 91小视频在线|