WB32L003 Standard Peripherals Firmware Library

模块 | 结构体 | 函数
TIM
WB32L003_StdPeriph_Driver

TIM driver modules 更多...

## 模块
| TIM_Exported_constants
| TIM_Private_Defines
| TIM_Private_FunctionPrototypes
| TIM_Private_Functions

## 结构体
struct | TIM_TimeBaseInitTypeDef
| TIM Time Base Init structure definition 更多...
struct | TIM_OCInitTypeDef
| TIM Output Compare Init structure definition 更多...
struct | TIM_ICInitTypeDef
| TIM Input Capture Init structure definition 更多...
struct | TIM_BDTRInitTypeDef
| BDTR structure definition 更多...

## 函数
void | TIM_DeInit (TIM_TypeDef *TIMx)
| Deinitializes the TIMx peripheral registers to their default reset values. 更多...
void | TIM_TimeBaseInit (TIM_TypeDef *TIMx, TIM_TimeBaseInitTypeDef *TIM_TimeBaseInitStruct)
| Initializes the TIMx Time Base Unit peripheral according to the specified parameters in the TIM_TimeBaseInitStruct. 更多...
void | TIM_OC1Init (TIM_TypeDef *TIMx, TIM_OCInitTypeDef *TIM_OCInitStruct)
| Initializes the TIMx Channel1 according to the specified parameters in the TIM_OCInitStruct. 更多...
void | TIM_OC2Init (TIM_TypeDef *TIMx, TIM_OCInitTypeDef *TIM_OCInitStruct)
| Initializes the TIMx Channel2 according to the specified parameters in the TIM_OCInitStruct. 更多...
void | TIM_OC3Init (TIM_TypeDef *TIMx, TIM_OCInitTypeDef *TIM_OCInitStruct)
| Initializes the TIMx Channel3 according to the specified parameters in the TIM_OCInitStruct. 更多...
void | TIM_OC4Init (TIM_TypeDef *TIMx, TIM_OCInitTypeDef *TIM_OCInitStruct)
| Initializes the TIMx Channel4 according to the specified parameters in the TIM_OCInitStruct. 更多...
void | TIM_ICInit (TIM_TypeDef *TIMx, TIM_ICInitTypeDef *TIM_ICInitStruct)
| Initializes the TIM peripheral according to the specified parameters in the TIM_ICInitStruct. 更多...
void | TIM_PWMIConfig (TIM_TypeDef *TIMx, TIM_ICInitTypeDef *TIM_ICInitStruct)
| Configures the TIM peripheral according to the specified parameters in the TIM_ICInitStruct to measure an external PWM signal. 更多...
void | TIM_BDTRConfig (TIM_TypeDef *TIMx, TIM_BDTRInitTypeDef *TIM_BDTRInitStruct)
| Configures the: Break feature, dead time, Lock level, the OSSI, the OSSR State and the AOE(automatic output enable). 更多...
void | TIM_TimeBaseStructInit (TIM_TimeBaseInitTypeDef *TIM_TimeBaseInitStruct)
| Fills each TIM_TimeBaseInitStruct member with its default value. 更多...
void | TIM_OCStructInit (TIM_OCInitTypeDef *TIM_OCInitStruct)
| Fills each TIM_OCInitStruct member with its default value. 更多...
void | TIM_ICStructInit (TIM_ICInitTypeDef *TIM_ICInitStruct)
| Fills each TIM_ICInitStruct member with its default value. 更多...
void | TIM_BDTRStructInit (TIM_BDTRInitTypeDef *TIM_BDTRInitStruct)
| Fills each TIM_BDTRInitStruct member with its default value. 更多...
void | TIM_Cmd (TIM_TypeDef *TIMx, FunctionalState NewState)
| Enables or disables the specified TIM peripheral. 更多...
void | TIM_CtrlPWMOutputs (TIM_TypeDef *TIMx, FunctionalState NewState)
| Enables or disables the TIM peripheral Main Outputs. 更多...
void | TIM_ITConfig (TIM_TypeDef *TIMx, uint16_t TIM_IT, FunctionalState NewState)
| Enables or disables the specified TIM interrupts. 更多...
void | TIM_GenerateEvent (TIM_TypeDef *TIMx, uint16_t TIM_EventSource)
| Configures the TIMx event to be generate by software. 更多...
void | TIM_InternalClockConfig (TIM_TypeDef *TIMx)
| Configures the TIMx internal Clock 更多...
void | TIM_ITRxExternalClockConfig (TIM_TypeDef *TIMx, uint16_t TIM_InputTriggerSource)
| Configures the TIMx Internal Trigger as External Clock 更多...
void | TIM_TIxExternalClockConfig (TIM_TypeDef *TIMx, uint16_t TIM_TIxExternalCLKSource, uint16_t TIM_ICPolarity, uint16_t ICFilter)
| Configures the TIMx Trigger as External Clock 更多...
void | TIM_ETRClockMode1Config (TIM_TypeDef *TIMx, uint16_t TIM_ExtTRGPrescaler, uint16_t TIM_ExtTRGPolarity, uint16_t ExtTRGFilter)
| Configures the External clock Mode1 更多...
void | TIM_ETRClockMode2Config (TIM_TypeDef *TIMx, uint16_t TIM_ExtTRGPrescaler, uint16_t TIM_ExtTRGPolarity, uint16_t ExtTRGFilter)
| Configures the External clock Mode2 更多...
void | TIM_ETRConfig (TIM_TypeDef *TIMx, uint16_t TIM_ExtTRGPrescaler, uint16_t TIM_ExtTRGPolarity, uint16_t ExtTRGFilter)
| Configures the TIMx External Trigger (ETR). 更多...
void | TIM_PrescalerConfig (TIM_TypeDef *TIMx, uint16_t Prescaler, uint16_t TIM_PSCReloadMode)
| Configures the TIMx Prescaler. 更多...
void | TIM_CounterModeConfig (TIM_TypeDef *TIMx, uint16_t TIM_CounterMode)
| Specifies the TIMx Counter Mode to be used. 更多...
void | TIM_SelectInputTrigger (TIM_TypeDef *TIMx, uint16_t TIM_InputTriggerSource)
| Selects the Input Trigger source 更多...
void | TIM_EncoderInterfaceConfig (TIM_TypeDef *TIMx, uint16_t TIM_EncoderMode, uint16_t TIM_IC1Polarity, uint16_t TIM_IC2Polarity)
| Configures the TIMx Encoder Interface. 更多...
void | TIM_ForcedOC1Config (TIM_TypeDef *TIMx, uint16_t TIM_ForcedAction)
| Forces the TIMx output 1 waveform to active or inactive level. 更多...
void | TIM_ForcedOC2Config (TIM_TypeDef *TIMx, uint16_t TIM_ForcedAction)
| Forces the TIMx output 2 waveform to active or inactive level. 更多...
void | TIM_ForcedOC3Config (TIM_TypeDef *TIMx, uint16_t TIM_ForcedAction)
| Forces the TIMx output 3 waveform to active or inactive level. 更多...
void | TIM_ForcedOC4Config (TIM_TypeDef *TIMx, uint16_t TIM_ForcedAction)
| Forces the TIMx output 4 waveform to active or inactive level. 更多...
void | TIM_ARRPreloadConfig (TIM_TypeDef *TIMx, FunctionalState NewState)
| Enables or disables TIMx peripheral Preload register on ARR. 更多...
void | TIM_SelectCOM (TIM_TypeDef *TIMx, FunctionalState NewState)
| Selects the TIM peripheral Commutation event. 更多...
void | TIM_CCPreloadControl (TIM_TypeDef *TIMx, FunctionalState NewState)
| Sets or Resets the TIM peripheral Capture Compare Preload Control bit. 更多...
void | TIM_OC1PreloadConfig (TIM_TypeDef *TIMx, uint16_t TIM_OCPreload)
| Enables or disables the TIMx peripheral Preload register on CCR1. 更多...
void | TIM_OC2PreloadConfig (TIM_TypeDef *TIMx, uint16_t TIM_OCPreload)
| Enables or disables the TIMx peripheral Preload register on CCR2. 更多...
void | TIM_OC3PreloadConfig (TIM_TypeDef *TIMx, uint16_t TIM_OCPreload)
| Enables or disables the TIMx peripheral Preload register on CCR3. 更多...
void | TIM_OC4PreloadConfig (TIM_TypeDef *TIMx, uint16_t TIM_OCPreload)
| Enables or disables the TIMx peripheral Preload register on CCR4. 更多...
void | TIM_OC1FastConfig (TIM_TypeDef *TIMx, uint16_t TIM_OCFast)
| Configures the TIMx Output Compare 1 Fast feature. 更多...
void | TIM_OC2FastConfig (TIM_TypeDef *TIMx, uint16_t TIM_OCFast)
| Configures the TIMx Output Compare 2 Fast feature. 更多...
void | TIM_OC3FastConfig (TIM_TypeDef *TIMx, uint16_t TIM_OCFast)
| Configures the TIMx Output Compare 3 Fast feature. 更多...
void | TIM_OC4FastConfig (TIM_TypeDef *TIMx, uint16_t TIM_OCFast)
| Configures the TIMx Output Compare 4 Fast feature. 更多...
void | TIM_ClearOC1Ref (TIM_TypeDef *TIMx, uint16_t TIM_OCClear)
| Clears or safeguards the OCREF1 signal on an external event 更多...
void | TIM_ClearOC2Ref (TIM_TypeDef *TIMx, uint16_t TIM_OCClear)
| Clears or safeguards the OCREF2 signal on an external event 更多...
void | TIM_ClearOC3Ref (TIM_TypeDef *TIMx, uint16_t TIM_OCClear)
| Clears or safeguards the OCREF3 signal on an external event 更多...
void | TIM_ClearOC4Ref (TIM_TypeDef *TIMx, uint16_t TIM_OCClear)
| Clears or safeguards the OCREF4 signal on an external event 更多...
void | TIM_OC1PolarityConfig (TIM_TypeDef *TIMx, uint16_t TIM_OCPolarity)
| Configures the TIMx channel 1 polarity. 更多...
void | TIM_OC1NPolarityConfig (TIM_TypeDef *TIMx, uint16_t TIM_OCNPolarity)
| Configures the TIMx Channel 1N polarity. 更多...
void | TIM_OC2PolarityConfig (TIM_TypeDef *TIMx, uint16_t TIM_OCPolarity)
| Configures the TIMx channel 2 polarity. 更多...
void | TIM_OC2NPolarityConfig (TIM_TypeDef *TIMx, uint16_t TIM_OCNPolarity)
| Configures the TIMx Channel 2N polarity. 更多...
void | TIM_OC3PolarityConfig (TIM_TypeDef *TIMx, uint16_t TIM_OCPolarity)
| Configures the TIMx channel 3 polarity. 更多...
void | TIM_OC3NPolarityConfig (TIM_TypeDef *TIMx, uint16_t TIM_OCNPolarity)
| Configures the TIMx Channel 3N polarity. 更多...
void | TIM_OC4PolarityConfig (TIM_TypeDef *TIMx, uint16_t TIM_OCPolarity)
| Configures the TIMx channel 4 polarity. 更多...
void | TIM_CCxCmd (TIM_TypeDef *TIMx, uint16_t TIM_Channel, uint16_t TIM_CCx)
| Enables or disables the TIM Capture Compare Channel x. 更多...
void | TIM_CCxNCmd (TIM_TypeDef *TIMx, uint16_t TIM_Channel, uint16_t TIM_CCxN)
| Enables or disables the TIM Capture Compare Channel xN. 更多...
void | TIM_SelectOCxM (TIM_TypeDef *TIMx, uint16_t TIM_Channel, uint16_t TIM_OCMode)
| Selects the TIM Output Compare Mode. 更多...
void | TIM_UpdateDisableConfig (TIM_TypeDef *TIMx, FunctionalState NewState)
| Enables or Disables the TIMx Update event. 更多...
void | TIM_UpdateRequestConfig (TIM_TypeDef *TIMx, uint16_t TIM_UpdateSource)
| Configures the TIMx Update Request Interrupt source. 更多...
void | TIM_SelectHallSensor (TIM_TypeDef *TIMx, FunctionalState NewState)
| Enables or disables the TIMx's Hall sensor interface. 更多...
void | TIM_SelectOnePulseMode (TIM_TypeDef *TIMx, uint16_t TIM_OPMode)
| Selects the TIMx's One Pulse Mode. 更多...
void | TIM_SelectOutputTrigger (TIM_TypeDef *TIMx, uint16_t TIM_TRGOSource)
| Selects the TIMx Trigger Output Mode. 更多...
void | TIM_SelectSlaveMode (TIM_TypeDef *TIMx, uint16_t TIM_SlaveMode)
| Selects the TIMx Slave Mode. 更多...
void | TIM_SelectMasterSlaveMode (TIM_TypeDef *TIMx, uint16_t TIM_MasterSlaveMode)
| Sets or Resets the TIMx Master/Slave Mode. 更多...
void | TIM_SetCounter (TIM_TypeDef *TIMx, uint16_t Counter)
| Sets the TIMx Counter Register value 更多...
void | TIM_SetAutoreload (TIM_TypeDef *TIMx, uint16_t Autoreload)
| Sets the TIMx Autoreload Register value 更多...
void | TIM_SetCompare1 (TIM_TypeDef *TIMx, uint16_t Compare1)
| Sets the TIMx Capture Compare1 Register value 更多...
void | TIM_SetCompare2 (TIM_TypeDef *TIMx, uint16_t Compare2)
| Sets the TIMx Capture Compare2 Register value 更多...
void | TIM_SetCompare3 (TIM_TypeDef *TIMx, uint16_t Compare3)
| Sets the TIMx Capture Compare3 Register value 更多...
void | TIM_SetCompare4 (TIM_TypeDef *TIMx, uint16_t Compare4)
| Sets the TIMx Capture Compare4 Register value 更多...
void | TIM_SetIC1Prescaler (TIM_TypeDef *TIMx, uint16_t TIM_ICPSC)
| Sets the TIMx Input Capture 1 prescaler. 更多...
void | TIM_SetIC2Prescaler (TIM_TypeDef *TIMx, uint16_t TIM_ICPSC)
| Sets the TIMx Input Capture 2 prescaler. 更多...
void | TIM_SetIC3Prescaler (TIM_TypeDef *TIMx, uint16_t TIM_ICPSC)
| Sets the TIMx Input Capture 3 prescaler. 更多...
void | TIM_SetIC4Prescaler (TIM_TypeDef *TIMx, uint16_t TIM_ICPSC)
| Sets the TIMx Input Capture 4 prescaler. 更多...
void | TIM_SetClockDivision (TIM_TypeDef *TIMx, uint16_t TIM_CKD)
| Sets the TIMx Clock Division value. 更多...
uint16_t | TIM_GetCapture1 (TIM_TypeDef *TIMx)
| Gets the TIMx Input Capture 1 value. 更多...
uint16_t | TIM_GetCapture2 (TIM_TypeDef *TIMx)
| Gets the TIMx Input Capture 2 value. 更多...
uint16_t | TIM_GetCapture3 (TIM_TypeDef *TIMx)
| Gets the TIMx Input Capture 3 value. 更多...
uint16_t | TIM_GetCapture4 (TIM_TypeDef *TIMx)
| Gets the TIMx Input Capture 4 value. 更多...
uint16_t | TIM_GetCounter (TIM_TypeDef *TIMx)
| Gets the TIMx Counter value. 更多...
uint16_t | TIM_GetPrescaler (TIM_TypeDef *TIMx)
| Gets the TIMx Prescaler value. 更多...
FlagStatus | TIM_GetFlagStatus (TIM_TypeDef *TIMx, uint16_t TIM_FLAG)
| Checks whether the specified TIM flag is set or not. 更多...
void | TIM_ClearFlag (TIM_TypeDef *TIMx, uint16_t TIM_FLAG)
| Clears the TIMx's pending flags. 更多...
ITStatus | TIM_GetITStatus (TIM_TypeDef *TIMx, uint16_t TIM_IT)
| Checks whether the TIM interrupt has occurred or not. 更多...
void | TIM_ClearITPendingBit (TIM_TypeDef *TIMx, uint16_t TIM_IT)
| Clears the TIMx's interrupt pending bits. 更多...

## 详细描述

TIM driver modules

## 函数说明

## ◆ TIM_ARRPreloadConfig()

void TIM_ARRPreloadConfig | ( | TIM_TypeDef * | TIMx,
|  | FunctionalState | NewState
| ) |  |

Enables or disables TIMx peripheral Preload register on ARR.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  NewState | new state of the TIMx peripheral Preload register This parameter can be: ENABLE or DISABLE.

返回值

  None |

## ◆ TIM_BDTRConfig()

void TIM_BDTRConfig | ( | TIM_TypeDef * | TIMx,
|  | TIM_BDTRInitTypeDef * | TIM_BDTRInitStruct
| ) |  |

Configures the: Break feature, dead time, Lock level, the OSSI, the OSSR State and the AOE(automatic output enable).

参数

  TIMx | where x can be 1 to select the TIM
  TIM_BDTRInitStruct | pointer to a TIM_BDTRInitTypeDef structure that contains the BDTR Register configuration information for the TIM peripheral.

返回值

  None |

## ◆ TIM_BDTRStructInit()

void TIM_BDTRStructInit | ( | TIM_BDTRInitTypeDef * | TIM_BDTRInitStruct | ) |

Fills each TIM_BDTRInitStruct member with its default value.

参数

  TIM_BDTRInitStruct | pointer to a TIM_BDTRInitTypeDef structure which will be initialized.

返回值

  None |

## ◆ TIM_CCPreloadControl()

void TIM_CCPreloadControl | ( | TIM_TypeDef * | TIMx,
|  | FunctionalState | NewState
| ) |  |

Sets or Resets the TIM peripheral Capture Compare Preload Control bit.

参数

  TIMx | where x can be 1, 2. to select the TIMx peripheral
  NewState | new state of the Capture Compare Preload Control bit This parameter can be: ENABLE or DISABLE.

返回值

  None |

## ◆ TIM_CCxCmd()

void TIM_CCxCmd | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_Channel,
|  | uint16_t | TIM_CCx
| ) |  |

Enables or disables the TIM Capture Compare Channel x.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_Channel | specifies the TIM Channel This parameter can be one of the following values: TIM_Channel_1: TIM Channel 1 TIM_Channel_2: TIM Channel 2 TIM_Channel_3: TIM Channel 3 TIM_Channel_4: TIM Channel 4
  TIM_CCx | specifies the TIM Channel CCxE bit new state. This parameter can be: TIM_CCx_Enable or TIM_CCx_Disable.

返回值

  None |

## ◆ TIM_CCxNCmd()

void TIM_CCxNCmd | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_Channel,
|  | uint16_t | TIM_CCxN
| ) |  |

Enables or disables the TIM Capture Compare Channel xN.

参数

  TIMx | where x can be 1 to select the TIM peripheral.
  TIM_Channel | specifies the TIM Channel This parameter can be one of the following values: TIM_Channel_1: TIM Channel 1 TIM_Channel_2: TIM Channel 2 TIM_Channel_3: TIM Channel 3
  TIM_CCxN | specifies the TIM Channel CCxNE bit new state. This parameter can be: TIM_CCxN_Enable or TIM_CCxN_Disable.

返回值

  None |

## ◆ TIM_ClearFlag()

void TIM_ClearFlag | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_FLAG
| ) |  |

Clears the TIMx's pending flags.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_FLAG | specifies the flag bit to clear. This parameter can be any combination of the following values: TIM_FLAG_Update: TIM update Flag TIM_FLAG_CC1: TIM Capture Compare 1 Flag TIM_FLAG_CC2: TIM Capture Compare 2 Flag TIM_FLAG_CC3: TIM Capture Compare 3 Flag TIM_FLAG_CC4: TIM Capture Compare 4 Flag TIM_FLAG_COM: TIM Commutation Flag TIM_FLAG_Trigger: TIM Trigger Flag TIM_FLAG_Break: TIM Break Flag TIM_FLAG_CC1OF: TIM Capture Compare 1 overcapture Flag TIM_FLAG_CC2OF: TIM Capture Compare 2 overcapture Flag TIM_FLAG_CC3OF: TIM Capture Compare 3 overcapture Flag TIM_FLAG_CC4OF: TIM Capture Compare 4 overcapture Flag

注解
  - TIM_FLAG_CC2 or TIM_FLAG_Trigger
  - TIM_FLAG_Break is used only with TIM1
  - TIM_FLAG_COM is used only with TIM1

返回值

  None |

## ◆ TIM_ClearITPendingBit()

void TIM_ClearITPendingBit | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_IT
| ) |  |

Clears the TIMx's interrupt pending bits.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_IT | specifies the pending bit to clear. This parameter can be any combination of the following values: TIM_IT_Update: TIM1 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

注解
  TIM_IT_CC2 or TIM_IT_Trigger
  - TIM_IT_Break is used only with TIM1
  - TIM_IT_COM is used only with TIM1

返回值

  None |

## ◆ TIM_ClearOC1Ref()

void TIM_ClearOC1Ref | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_OCClear
| ) |  |

Clears or safeguards the OCREF1 signal on an external event

参数

  TIMx | where x can be 1, 2 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 Output clear enable TIM_OCClear_Disable: TIM Output clear disable

返回值

  None |

## ◆ TIM_ClearOC2Ref()

void TIM_ClearOC2Ref | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_OCClear
| ) |  |

Clears or safeguards the OCREF2 signal on an external event

参数

  TIMx | where x can be 1, 2 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 Output clear enable TIM_OCClear_Disable: TIM Output clear disable

返回值

  None |

## ◆ TIM_ClearOC3Ref()

void TIM_ClearOC3Ref | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_OCClear
| ) |  |

Clears or safeguards the OCREF3 signal on an external event

参数

  TIMx | where x can be 1, 2 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 Output clear enable TIM_OCClear_Disable: TIM Output clear disable

返回值

  None |

## ◆ TIM_ClearOC4Ref()

void TIM_ClearOC4Ref | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_OCClear
| ) |  |

Clears or safeguards the OCREF4 signal on an external event

参数

  TIMx | where x can be 1, 2 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 Output clear enable TIM_OCClear_Disable: TIM Output clear disable

返回值

  None |

## ◆ TIM_Cmd()

void TIM_Cmd | ( | TIM_TypeDef * | TIMx,
|  | FunctionalState | NewState
| ) |  |

Enables or disables the specified TIM peripheral.

参数

  TIMx | where x can be 1, 2 to select the TIMx peripheral.
  NewState | new state of the TIMx peripheral. This parameter can be: ENABLE or DISABLE.

返回值

  None |

## ◆ TIM_CounterModeConfig()

void TIM_CounterModeConfig | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_CounterMode
| ) |  |

Specifies the TIMx Counter Mode to be used.

参数

  TIMx | where x can be 1, 2 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

返回值

  None |

## ◆ TIM_CtrlPWMOutputs()

void TIM_CtrlPWMOutputs | ( | TIM_TypeDef * | TIMx,
|  | FunctionalState | NewState
| ) |  |

Enables or disables the TIM peripheral Main Outputs.

参数

  TIMx | where x can be 1 to select the TIMx peripheral.
  NewState | new state of the TIM peripheral Main Outputs. This parameter can be: ENABLE or DISABLE.

返回值

  None |

## ◆ TIM_DeInit()

void TIM_DeInit | ( | TIM_TypeDef * | TIMx | ) |

Deinitializes the TIMx peripheral registers to their default reset values.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.

返回值

  None |

## ◆ TIM_EncoderInterfaceConfig()

void TIM_EncoderInterfaceConfig | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_EncoderMode,
|  | uint16_t | TIM_IC1Polarity,
|  | uint16_t | TIM_IC2Polarity
| ) |  |

Configures the TIMx Encoder Interface.

参数

  TIMx | where x can be 1, 2 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 parameter can be one of the following values: TIM_ICPolarity_Falling: IC Falling edge. TIM_ICPolarity_Rising: IC Rising edge.
  TIM_IC2Polarity | specifies the IC2 Polarity This parameter can be one of the following values: TIM_ICPolarity_Falling: IC Falling edge. TIM_ICPolarity_Rising: IC Rising edge.

返回值

  None |

## ◆ TIM_ETRClockMode1Config()

void TIM_ETRClockMode1Config | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_ExtTRGPrescaler,
|  | uint16_t | TIM_ExtTRGPolarity,
|  | uint16_t | ExtTRGFilter
| ) |  |

Configures the External clock Mode1

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_ExtTRGPrescaler | The external Trigger Prescaler. This parameter can be one of the following values: TIM_ExtTRGPSC_OFF: ETRP Prescaler OFF. TIM_ExtTRGPSC_DIV2: ETRP frequency divided by 2. TIM_ExtTRGPSC_DIV4: ETRP frequency divided by 4. TIM_ExtTRGPSC_DIV8: ETRP frequency divided by 8.
  TIM_ExtTRGPolarity | The external Trigger Polarity. This parameter can be one of the following values: TIM_ExtTRGPolarity_Inverted: active low or falling edge active. TIM_ExtTRGPolarity_NonInverted: active high or rising edge active.
  ExtTRGFilter | External Trigger Filter. This parameter must be a value between 0x00 and 0x0F

返回值

  None |

## ◆ TIM_ETRClockMode2Config()

void TIM_ETRClockMode2Config | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_ExtTRGPrescaler,
|  | uint16_t | TIM_ExtTRGPolarity,
|  | uint16_t | ExtTRGFilter
| ) |  |

Configures the External clock Mode2

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_ExtTRGPrescaler | The external Trigger Prescaler. This parameter can be one of the following values: TIM_ExtTRGPSC_OFF: ETRP Prescaler OFF. TIM_ExtTRGPSC_DIV2: ETRP frequency divided by 2. TIM_ExtTRGPSC_DIV4: ETRP frequency divided by 4. TIM_ExtTRGPSC_DIV8: ETRP frequency divided by 8.
  TIM_ExtTRGPolarity | The external Trigger Polarity. This parameter can be one of the following values: TIM_ExtTRGPolarity_Inverted: active low or falling edge active. TIM_ExtTRGPolarity_NonInverted: active high or rising edge active.
  ExtTRGFilter | External Trigger Filter. This parameter must be a value between 0x00 and 0x0F

返回值

  None |

## ◆ TIM_ETRConfig()

void TIM_ETRConfig | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_ExtTRGPrescaler,
|  | uint16_t | TIM_ExtTRGPolarity,
|  | uint16_t | ExtTRGFilter
| ) |  |

Configures the TIMx External Trigger (ETR).

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_ExtTRGPrescaler | The external Trigger Prescaler. This parameter can be one of the following values: TIM_ExtTRGPSC_OFF: ETRP Prescaler OFF. TIM_ExtTRGPSC_DIV2: ETRP frequency divided by 2. TIM_ExtTRGPSC_DIV4: ETRP frequency divided by 4. TIM_ExtTRGPSC_DIV8: ETRP frequency divided by 8.
  TIM_ExtTRGPolarity | The external Trigger Polarity. This parameter can be one of the following values: TIM_ExtTRGPolarity_Inverted: active low or falling edge active. TIM_ExtTRGPolarity_NonInverted: active high or rising edge active.
  ExtTRGFilter | External Trigger Filter. This parameter must be a value between 0x00 and 0x0F

返回值

  None |

## ◆ TIM_ForcedOC1Config()

void TIM_ForcedOC1Config | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_ForcedAction
| ) |  |

Forces the TIMx output 1 waveform to active or inactive level.

参数

  TIMx | where x can be 1, 2 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.

返回值

  None |

## ◆ TIM_ForcedOC2Config()

void TIM_ForcedOC2Config | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_ForcedAction
| ) |  |

Forces the TIMx output 2 waveform to active or inactive level.

参数

  TIMx | where x can be 1, 2 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.

返回值

  None |

## ◆ TIM_ForcedOC3Config()

void TIM_ForcedOC3Config | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_ForcedAction
| ) |  |

Forces the TIMx output 3 waveform to active or inactive level.

参数

  TIMx | where x can be 1, 2 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.

返回值

  None |

## ◆ TIM_ForcedOC4Config()

void TIM_ForcedOC4Config | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_ForcedAction
| ) |  |

Forces the TIMx output 4 waveform to active or inactive level.

参数

  TIMx | where x can be 1, 2 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.

返回值

  None |

## ◆ TIM_GenerateEvent()

void TIM_GenerateEvent | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_EventSource
| ) |  |

Configures the TIMx event to be generate by software.

参数

  TIMx | where x can be 1, 2 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_COM: Timer COM event source TIM_EventSource_Trigger: Timer Trigger Event source TIM_EventSource_Break: Timer Break event source

注解
  TIM_EventSource_COM and TIM_EventSource_Break are used only with TIM1.

返回值

  None |

## ◆ TIM_GetCapture1()

uint16_t TIM_GetCapture1 | ( | TIM_TypeDef * | TIMx | ) |

Gets the TIMx Input Capture 1 value.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.

返回值

  Capture | Compare 1 Register value.

## ◆ TIM_GetCapture2()

uint16_t TIM_GetCapture2 | ( | TIM_TypeDef * | TIMx | ) |

Gets the TIMx Input Capture 2 value.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.

返回值

  Capture | Compare 2 Register value.

## ◆ TIM_GetCapture3()

uint16_t TIM_GetCapture3 | ( | TIM_TypeDef * | TIMx | ) |

Gets the TIMx Input Capture 3 value.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.

返回值

  Capture | Compare 3 Register value.

## ◆ TIM_GetCapture4()

uint16_t TIM_GetCapture4 | ( | TIM_TypeDef * | TIMx | ) |

Gets the TIMx Input Capture 4 value.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.

返回值

  Capture | Compare 4 Register value.

## ◆ TIM_GetCounter()

uint16_t TIM_GetCounter | ( | TIM_TypeDef * | TIMx | ) |

Gets the TIMx Counter value.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.

返回值

  Counter | Register value.

## ◆ TIM_GetFlagStatus()

FlagStatus TIM_GetFlagStatus | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_FLAG
| ) |  |

Checks whether the specified TIM flag is set or not.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_FLAG | specifies the flag to check. This parameter can be one of the following values: TIM_FLAG_Update: TIM update Flag TIM_FLAG_CC1: TIM Capture Compare 1 Flag TIM_FLAG_CC2: TIM Capture Compare 2 Flag TIM_FLAG_CC3: TIM Capture Compare 3 Flag TIM_FLAG_CC4: TIM Capture Compare 4 Flag TIM_FLAG_COM: TIM Commutation Flag TIM_FLAG_Trigger: TIM Trigger Flag TIM_FLAG_Break: TIM Break Flag TIM_FLAG_CC1OF: TIM Capture Compare 1 overcapture Flag TIM_FLAG_CC2OF: TIM Capture Compare 2 overcapture Flag TIM_FLAG_CC3OF: TIM Capture Compare 3 overcapture Flag TIM_FLAG_CC4OF: TIM Capture Compare 4 overcapture Flag

注解
  - TIM_FLAG_CC2 or TIM_FLAG_Trigger
  - TIM_FLAG_Break is used only with TIM1
  - TIM_FLAG_COM is used only with TIM1

返回值

  The | new state of TIM_FLAG (SET or RESET).

## ◆ TIM_GetITStatus()

ITStatus TIM_GetITStatus | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_IT
| ) |  |

Checks whether the TIM interrupt has occurred or not.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_IT | specifies the TIM interrupt source to check. This parameter can be one 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

注解
  - TIM_IT_CC2 or TIM_IT_Trigger
  - TIM_IT_Break is used only with TIM1
  - TIM_IT_COM is used only with TIM1

返回值

  The | new state of the TIM_IT(SET or RESET).

## ◆ TIM_GetPrescaler()

uint16_t TIM_GetPrescaler | ( | TIM_TypeDef * | TIMx | ) |

Gets the TIMx Prescaler value.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.

返回值

  Prescaler | Register value.

## ◆ TIM_ICInit()

void TIM_ICInit | ( | TIM_TypeDef * | TIMx,
|  | TIM_ICInitTypeDef * | TIM_ICInitStruct
| ) |  |

Initializes the TIM peripheral according to the specified parameters in the TIM_ICInitStruct.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_ICInitStruct | pointer to a TIM_ICInitTypeDef structure that contains the configuration information for the specified TIM peripheral.

返回值

  None |

## ◆ TIM_ICStructInit()

void TIM_ICStructInit | ( | TIM_ICInitTypeDef * | TIM_ICInitStruct | ) |

Fills each TIM_ICInitStruct member with its default value.

参数

  TIM_ICInitStruct | pointer to a TIM_ICInitTypeDef structure which will be initialized.

返回值

  None |

## ◆ TIM_InternalClockConfig()

void TIM_InternalClockConfig | ( | TIM_TypeDef * | TIMx | ) |

Configures the TIMx internal Clock

参数

  TIMx | where x can be 1, 2. to select the TIM peripheral.

返回值

  None |

## ◆ TIM_ITConfig()

void TIM_ITConfig | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_IT,
|  | FunctionalState | NewState
| ) |  |

Enables or disables the specified TIM interrupts.

参数

  TIMx | where x can be 1, 2 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

注解

- TIM_IT_CC2 or TIM_IT_Trigger
- TIM_IT_Break is used only with TIM1.
- TIM_IT_COM is used only with TIM1.
  参数

    NewState | new state of the TIM interrupts. This parameter can be: ENABLE or DISABLE.

  返回值

    None |

## ◆ TIM_ITRxExternalClockConfig()

void TIM_ITRxExternalClockConfig | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_InputTriggerSource
| ) |  |

Configures the TIMx Internal Trigger as External Clock

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_ITRSource | 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

返回值

  None |

## ◆ TIM_OC1FastConfig()

void TIM_OC1FastConfig | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_OCFast
| ) |  |

Configures the TIMx Output Compare 1 Fast feature.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_OCFast | new state of the Output Compare Fast Enable Bit. This parameter can be one of the following values: TIM_OCFast_Enable: TIM output compare fast enable TIM_OCFast_Disable: TIM output compare fast disable

返回值

  None |

## ◆ TIM_OC1Init()

void TIM_OC1Init | ( | TIM_TypeDef * | TIMx,
|  | TIM_OCInitTypeDef * | TIM_OCInitStruct
| ) |  |

Initializes the TIMx Channel1 according to the specified parameters in the TIM_OCInitStruct.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_OCInitStruct | pointer to a TIM_OCInitTypeDef structure that contains the configuration information for the specified TIM peripheral.

返回值

  None |

## ◆ TIM_OC1NPolarityConfig()

void TIM_OC1NPolarityConfig | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_OCNPolarity
| ) |  |

Configures the TIMx Channel 1N polarity.

参数

  TIMx | where x can be 1 to select the TIM peripheral.
  TIM_OCNPolarity | specifies the OC1N Polarity This parameter can be one of the following values: TIM_OCNPolarity_High: Output Compare active high TIM_OCNPolarity_Low: Output Compare active low

返回值

  None |

## ◆ TIM_OC1PolarityConfig()

void TIM_OC1PolarityConfig | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_OCPolarity
| ) |  |

Configures the TIMx channel 1 polarity.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_OCPolarity | specifies the OC1 Polarity This parameter can be one of the following values: TIM_OCPolarity_High: Output Compare active high TIM_OCPolarity_Low: Output Compare active low

返回值

  None |

## ◆ TIM_OC1PreloadConfig()

void TIM_OC1PreloadConfig | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_OCPreload
| ) |  |

Enables or disables the TIMx peripheral Preload register on CCR1.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_OCPreload | new state of the TIMx peripheral Preload register This parameter can be one of the following values: TIM_OCPreload_Enable TIM_OCPreload_Disable

返回值

  None |

## ◆ TIM_OC2FastConfig()

void TIM_OC2FastConfig | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_OCFast
| ) |  |

Configures the TIMx Output Compare 2 Fast feature.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_OCFast | new state of the Output Compare Fast Enable Bit. This parameter can be one of the following values: TIM_OCFast_Enable: TIM output compare fast enable TIM_OCFast_Disable: TIM output compare fast disable

返回值

  None |

## ◆ TIM_OC2Init()

void TIM_OC2Init | ( | TIM_TypeDef * | TIMx,
|  | TIM_OCInitTypeDef * | TIM_OCInitStruct
| ) |  |

Initializes the TIMx Channel2 according to the specified parameters in the TIM_OCInitStruct.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_OCInitStruct | pointer to a TIM_OCInitTypeDef structure that contains the configuration information for the specified TIM peripheral.

返回值

  None |

## ◆ TIM_OC2NPolarityConfig()

void TIM_OC2NPolarityConfig | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_OCNPolarity
| ) |  |

Configures the TIMx Channel 2N polarity.

参数

  TIMx | where x can be 1 to select the TIM peripheral.
  TIM_OCNPolarity | specifies the OC2N Polarity This parameter can be one of the following values: TIM_OCNPolarity_High: Output Compare active high TIM_OCNPolarity_Low: Output Compare active low

返回值

  None |

## ◆ TIM_OC2PolarityConfig()

void TIM_OC2PolarityConfig | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_OCPolarity
| ) |  |

Configures the TIMx channel 2 polarity.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_OCPolarity | specifies the OC2 Polarity This parameter can be one of the following values: TIM_OCPolarity_High: Output Compare active high TIM_OCPolarity_Low: Output Compare active low

返回值

  None |

## ◆ TIM_OC2PreloadConfig()

void TIM_OC2PreloadConfig | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_OCPreload
| ) |  |

Enables or disables the TIMx peripheral Preload register on CCR2.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_OCPreload | new state of the TIMx peripheral Preload register This parameter can be one of the following values: TIM_OCPreload_Enable TIM_OCPreload_Disable

返回值

  None |

## ◆ TIM_OC3FastConfig()

void TIM_OC3FastConfig | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_OCFast
| ) |  |

Configures the TIMx Output Compare 3 Fast feature.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_OCFast | new state of the Output Compare Fast Enable Bit. This parameter can be one of the following values: TIM_OCFast_Enable: TIM output compare fast enable TIM_OCFast_Disable: TIM output compare fast disable

返回值

  None |

## ◆ TIM_OC3Init()

void TIM_OC3Init | ( | TIM_TypeDef * | TIMx,
|  | TIM_OCInitTypeDef * | TIM_OCInitStruct
| ) |  |

Initializes the TIMx Channel3 according to the specified parameters in the TIM_OCInitStruct.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_OCInitStruct | pointer to a TIM_OCInitTypeDef structure that contains the configuration information for the specified TIM peripheral.

返回值

  None |

## ◆ TIM_OC3NPolarityConfig()

void TIM_OC3NPolarityConfig | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_OCNPolarity
| ) |  |

Configures the TIMx Channel 3N polarity.

参数

  TIMx | where x can be 1 to select the TIM peripheral.
  TIM_OCNPolarity | specifies the OC3N Polarity This parameter can be one of the following values: TIM_OCNPolarity_High: Output Compare active high TIM_OCNPolarity_Low: Output Compare active low

返回值

  None |

## ◆ TIM_OC3PolarityConfig()

void TIM_OC3PolarityConfig | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_OCPolarity
| ) |  |

Configures the TIMx channel 3 polarity.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_OCPolarity | specifies the OC3 Polarity This parameter can be one of the following values: TIM_OCPolarity_High: Output Compare active high TIM_OCPolarity_Low: Output Compare active low

返回值

  None |

## ◆ TIM_OC3PreloadConfig()

void TIM_OC3PreloadConfig | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_OCPreload
| ) |  |

Enables or disables the TIMx peripheral Preload register on CCR3.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_OCPreload | new state of the TIMx peripheral Preload register This parameter can be one of the following values: TIM_OCPreload_Enable TIM_OCPreload_Disable

返回值

  None |

## ◆ TIM_OC4FastConfig()

void TIM_OC4FastConfig | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_OCFast
| ) |  |

Configures the TIMx Output Compare 4 Fast feature.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_OCFast | new state of the Output Compare Fast Enable Bit. This parameter can be one of the following values: TIM_OCFast_Enable: TIM output compare fast enable TIM_OCFast_Disable: TIM output compare fast disable

返回值

  None |

## ◆ TIM_OC4Init()

void TIM_OC4Init | ( | TIM_TypeDef * | TIMx,
|  | TIM_OCInitTypeDef * | TIM_OCInitStruct
| ) |  |

Initializes the TIMx Channel4 according to the specified parameters in the TIM_OCInitStruct.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_OCInitStruct | pointer to a TIM_OCInitTypeDef structure that contains the configuration information for the specified TIM peripheral.

返回值

  None |

## ◆ TIM_OC4PolarityConfig()

void TIM_OC4PolarityConfig | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_OCPolarity
| ) |  |

Configures the TIMx channel 4 polarity.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_OCPolarity | specifies the OC4 Polarity This parameter can be one of the following values: TIM_OCPolarity_High: Output Compare active high TIM_OCPolarity_Low: Output Compare active low

返回值

  None |

## ◆ TIM_OC4PreloadConfig()

void TIM_OC4PreloadConfig | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_OCPreload
| ) |  |

Enables or disables the TIMx peripheral Preload register on CCR4.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_OCPreload | new state of the TIMx peripheral Preload register This parameter can be one of the following values: TIM_OCPreload_Enable TIM_OCPreload_Disable

返回值

  None |

## ◆ TIM_OCStructInit()

void TIM_OCStructInit | ( | TIM_OCInitTypeDef * | TIM_OCInitStruct | ) |

Fills each TIM_OCInitStruct member with its default value.

参数

  TIM_OCInitStruct | : pointer to a TIM_OCInitTypeDef structure which will be initialized.

返回值

  None |

## ◆ TIM_PrescalerConfig()

void TIM_PrescalerConfig | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | Prescaler,
|  | uint16_t | TIM_PSCReloadMode
| ) |  |

Configures the TIMx Prescaler.

参数

  TIMx | where x can be 1, 2 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 immediately.

返回值

  None |

## ◆ TIM_PWMIConfig()

void TIM_PWMIConfig | ( | TIM_TypeDef * | TIMx,
|  | TIM_ICInitTypeDef * | TIM_ICInitStruct
| ) |  |

Configures the TIM peripheral according to the specified parameters in the TIM_ICInitStruct to measure an external PWM signal.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_ICInitStruct | pointer to a TIM_ICInitTypeDef structure that contains the configuration information for the specified TIM peripheral.

返回值

  None |

## ◆ TIM_SelectCOM()

void TIM_SelectCOM | ( | TIM_TypeDef * | TIMx,
|  | FunctionalState | NewState
| ) |  |

Selects the TIM peripheral Commutation event.

参数

  TIMx | where x can be 1 to select the TIMx peripheral
  NewState | new state of the Commutation event. This parameter can be: ENABLE or DISABLE.

返回值

  None |

## ◆ TIM_SelectHallSensor()

void TIM_SelectHallSensor | ( | TIM_TypeDef * | TIMx,
|  | FunctionalState | NewState
| ) |  |

Enables or disables the TIMx's Hall sensor interface.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  NewState | new state of the TIMx Hall sensor interface. This parameter can be: ENABLE or DISABLE.

返回值

  None |

## ◆ TIM_SelectInputTrigger()

void TIM_SelectInputTrigger | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_InputTriggerSource
| ) |  |

Selects the Input Trigger source

参数

  TIMx | where x can be 1, 2 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

返回值

  None |

## ◆ TIM_SelectMasterSlaveMode()

void TIM_SelectMasterSlaveMode | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_MasterSlaveMode
| ) |  |

Sets or Resets the TIMx Master/Slave Mode.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_MasterSlaveMode | specifies the Timer Master Slave Mode. This parameter can be one of the following values: TIM_MasterSlaveMode_Enable: synchronization between the current timer and its slaves (through TRGO). TIM_MasterSlaveMode_Disable: No action

返回值

  None |

## ◆ TIM_SelectOCxM()

void TIM_SelectOCxM | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_Channel,
|  | uint16_t | TIM_OCMode
| ) |  |

Selects the TIM Output Compare Mode.

注解
  This function disables the selected channel before changing the Output Compare Mode. User has to enable this channel using TIM_CCxCmd and TIM_CCxNCmd functions.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_Channel | specifies the TIM Channel This parameter can be one of the following values: TIM_Channel_1: TIM Channel 1 TIM_Channel_2: TIM Channel 2 TIM_Channel_3: TIM Channel 3 TIM_Channel_4: TIM Channel 4
  TIM_OCMode | specifies the TIM Output Compare Mode. This parameter can be one of the following values: TIM_OCMode_Timing TIM_OCMode_Active TIM_OCMode_Toggle TIM_OCMode_PWM1 TIM_OCMode_PWM2 TIM_ForcedAction_Active TIM_ForcedAction_InActive

返回值

  None |

## ◆ TIM_SelectOnePulseMode()

void TIM_SelectOnePulseMode | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_OPMode
| ) |  |

Selects the TIMx's One Pulse Mode.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_OPMode | specifies the OPM Mode to be used. This parameter can be one of the following values: TIM_OPMode_Single TIM_OPMode_Repetitive

返回值

  None |

## ◆ TIM_SelectOutputTrigger()

void TIM_SelectOutputTrigger | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_TRGOSource
| ) |  |

Selects the TIMx Trigger Output Mode.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_TRGOSource | specifies the Trigger Output source. This paramter can be one of the following values: For all TIMx TIM_TRGOSource_Reset: The UG bit in the TIM_EGR register is used as the trigger output (TRGO). TIM_TRGOSource_Enable: The Counter Enable CEN is used as the trigger output (TRGO). TIM_TRGOSource_Update: The update event is selected as the trigger output (TRGO). TIM_TRGOSource_OC1: The trigger output sends a positive pulse when the CC1IF flag is to be set, as soon as a capture or compare match occurs (TRGO). TIM_TRGOSource_OC1Ref: OC1REF signal is used as the trigger output (TRGO). TIM_TRGOSource_OC2Ref: OC2REF signal is used as the trigger output (TRGO). TIM_TRGOSource_OC3Ref: OC3REF signal is used as the trigger output (TRGO). TIM_TRGOSource_OC4Ref: OC4REF signal is used as the trigger output (TRGO).

返回值

  None |

## ◆ TIM_SelectSlaveMode()

void TIM_SelectSlaveMode | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_SlaveMode
| ) |  |

Selects the TIMx Slave Mode.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_SlaveMode | specifies the Timer Slave Mode. This parameter can be one of the following values: TIM_SlaveMode_Reset: Rising edge of the selected trigger signal (TRGI) re-initializes the counter and triggers an update of the registers. TIM_SlaveMode_Gated: The counter clock is enabled when the trigger signal (TRGI) is high. TIM_SlaveMode_Trigger: The counter starts at a rising edge of the trigger TRGI. TIM_SlaveMode_External1: Rising edges of the selected trigger (TRGI) clock the counter.

返回值

  None |

## ◆ TIM_SetAutoreload()

void TIM_SetAutoreload | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | Autoreload
| ) |  |

Sets the TIMx Autoreload Register value

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  Autoreload | specifies the Autoreload register new value.

返回值

  None |

## ◆ TIM_SetClockDivision()

void TIM_SetClockDivision | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_CKD
| ) |  |

Sets the TIMx Clock Division value.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_CKD | specifies the clock division value. This parameter can be one of the following value: TIM_CKD_DIV1: TDTS = Tck_tim TIM_CKD_DIV2: TDTS = 2*Tck_tim TIM_CKD_DIV4: TDTS = 4*Tck_tim

返回值

  None |

## ◆ TIM_SetCompare1()

void TIM_SetCompare1 | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | Compare1
| ) |  |

Sets the TIMx Capture Compare1 Register value

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  Compare1 | specifies the Capture Compare1 register new value.

返回值

  None |

## ◆ TIM_SetCompare2()

void TIM_SetCompare2 | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | Compare2
| ) |  |

Sets the TIMx Capture Compare2 Register value

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  Compare2 | specifies the Capture Compare2 register new value.

返回值

  None |

## ◆ TIM_SetCompare3()

void TIM_SetCompare3 | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | Compare3
| ) |  |

Sets the TIMx Capture Compare3 Register value

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  Compare3 | specifies the Capture Compare3 register new value.

返回值

  None |

## ◆ TIM_SetCompare4()

void TIM_SetCompare4 | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | Compare4
| ) |  |

Sets the TIMx Capture Compare4 Register value

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  Compare4 | specifies the Capture Compare4 register new value.

返回值

  None |

## ◆ TIM_SetCounter()

void TIM_SetCounter | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | Counter
| ) |  |

Sets the TIMx Counter Register value

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  Counter | specifies the Counter register new value.

返回值

  None |

## ◆ TIM_SetIC1Prescaler()

void TIM_SetIC1Prescaler | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_ICPSC
| ) |  |

Sets the TIMx Input Capture 1 prescaler.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_ICPSC | specifies the Input Capture1 prescaler new value. This parameter can be one of the following values: TIM_ICPSC_DIV1: no prescaler TIM_ICPSC_DIV2: capture is done once every 2 events TIM_ICPSC_DIV4: capture is done once every 4 events TIM_ICPSC_DIV8: capture is done once every 8 events

返回值

  None |

## ◆ TIM_SetIC2Prescaler()

void TIM_SetIC2Prescaler | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_ICPSC
| ) |  |

Sets the TIMx Input Capture 2 prescaler.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_ICPSC | specifies the Input Capture2 prescaler new value. This parameter can be one of the following values: TIM_ICPSC_DIV1: no prescaler TIM_ICPSC_DIV2: capture is done once every 2 events TIM_ICPSC_DIV4: capture is done once every 4 events TIM_ICPSC_DIV8: capture is done once every 8 events

返回值

  None |

## ◆ TIM_SetIC3Prescaler()

void TIM_SetIC3Prescaler | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_ICPSC
| ) |  |

Sets the TIMx Input Capture 3 prescaler.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_ICPSC | specifies the Input Capture3 prescaler new value. This parameter can be one of the following values: TIM_ICPSC_DIV1: no prescaler TIM_ICPSC_DIV2: capture is done once every 2 events TIM_ICPSC_DIV4: capture is done once every 4 events TIM_ICPSC_DIV8: capture is done once every 8 events

返回值

  None |

## ◆ TIM_SetIC4Prescaler()

void TIM_SetIC4Prescaler | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_ICPSC
| ) |  |

Sets the TIMx Input Capture 4 prescaler.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_ICPSC | specifies the Input Capture4 prescaler new value. This parameter can be one of the following values: TIM_ICPSC_DIV1: no prescaler TIM_ICPSC_DIV2: capture is done once every 2 events TIM_ICPSC_DIV4: capture is done once every 4 events TIM_ICPSC_DIV8: capture is done once every 8 events

返回值

  None |

## ◆ TIM_TimeBaseInit()

void TIM_TimeBaseInit | ( | TIM_TypeDef * | TIMx,
|  | TIM_TimeBaseInitTypeDef * | TIM_TimeBaseInitStruct
| ) |  |

Initializes the TIMx Time Base Unit peripheral according to the specified parameters in the TIM_TimeBaseInitStruct.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_TimeBaseInitStruct | pointer to a TIM_TimeBaseInitTypeDef structure that contains the configuration information for the specified TIM peripheral.

返回值

  None |

## ◆ TIM_TimeBaseStructInit()

void TIM_TimeBaseStructInit | ( | TIM_TimeBaseInitTypeDef * | TIM_TimeBaseInitStruct | ) |

Fills each TIM_TimeBaseInitStruct member with its default value.

参数

  TIM_TimeBaseInitStruct | : pointer to a TIM_TimeBaseInitTypeDef structure which will be initialized.

返回值

  None |

## ◆ TIM_TIxExternalClockConfig()

void TIM_TIxExternalClockConfig | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_TIxExternalCLKSource,
|  | uint16_t | TIM_ICPolarity,
|  | uint16_t | ICFilter
| ) |  |

Configures the TIMx Trigger as External Clock

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_TIxExternalCLKSource | Trigger source. This parameter can be one of the following values: TIM_TIxExternalCLK1Source_TI1ED: TI1 Edge Detector TIM_TIxExternalCLK1Source_TI1: Filtered Timer Input 1 TIM_TIxExternalCLK1Source_TI2: Filtered Timer Input 2
  TIM_ICPolarity | specifies the TIx Polarity. This parameter can be one of the following values: TIM_ICPolarity_Rising TIM_ICPolarity_Falling
  ICFilter | : specifies the filter value. This parameter must be a value between 0x0 and 0xF.

返回值

  None |

## ◆ TIM_UpdateDisableConfig()

void TIM_UpdateDisableConfig | ( | TIM_TypeDef * | TIMx,
|  | FunctionalState | NewState
| ) |  |

Enables or Disables the TIMx Update event.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  NewState | new state of the TIMx UDIS bit This parameter can be: ENABLE or DISABLE.

返回值

  None |

## ◆ TIM_UpdateRequestConfig()

void TIM_UpdateRequestConfig | ( | TIM_TypeDef * | TIMx,
|  | uint16_t | TIM_UpdateSource
| ) |  |

Configures the TIMx Update Request Interrupt source.

参数

  TIMx | where x can be 1, 2 to select the TIM peripheral.
  TIM_UpdateSource | specifies the Update source. This parameter can be one of the following values: TIM_UpdateSource_Regular: Source of update is the counter overflow/underflow or the setting of UG bit, or an update generation through the slave mode controller. TIM_UpdateSource_Global: Source of update is counter overflow/underflow.

返回值

  None |