STM32F439xx HAL User Manual
Functions
Peripheral Control functions
TIM Exported Functions

Peripheral Control functions. More...

Functions

HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent (TIM_HandleTypeDef *htim, uint32_t InputTrigger, uint32_t CommutationSource)
 Configure the TIM commutation event sequence.
HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent_IT (TIM_HandleTypeDef *htim, uint32_t InputTrigger, uint32_t CommutationSource)
 Configure the TIM commutation event sequence with interrupt.
HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent_DMA (TIM_HandleTypeDef *htim, uint32_t InputTrigger, uint32_t CommutationSource)
 Configure the TIM commutation event sequence with DMA.
HAL_StatusTypeDef HAL_TIMEx_MasterConfigSynchronization (TIM_HandleTypeDef *htim, TIM_MasterConfigTypeDef *sMasterConfig)
 Configures the TIM in master mode.
HAL_StatusTypeDef HAL_TIMEx_ConfigBreakDeadTime (TIM_HandleTypeDef *htim, TIM_BreakDeadTimeConfigTypeDef *sBreakDeadTimeConfig)
 Configures the Break feature, dead time, Lock level, OSSI/OSSR State and the AOE(automatic output enable).
HAL_StatusTypeDef HAL_TIMEx_RemapConfig (TIM_HandleTypeDef *htim, uint32_t Remap)
 Configures the TIM2, TIM5 and TIM11 Remapping input capabilities.

Detailed Description

Peripheral Control functions.

  ==============================================================================
                    ##### Peripheral Control functions #####
  ==============================================================================  
  [..]  
    This section provides functions allowing to:
    (+) Configure The Input Output channels for OC, PWM, IC or One Pulse mode. 
    (+) Configure External Clock source.
    (+) Configure Complementary channels, break features and dead time.
    (+) Configure Master and the Slave synchronization.
    (+) Configure the commutation event in case of use of the Hall sensor interface.
    (+) Configure the DMA Burst Mode.
      

Function Documentation

HAL_StatusTypeDef HAL_TIMEx_ConfigBreakDeadTime ( TIM_HandleTypeDef htim,
TIM_BreakDeadTimeConfigTypeDef sBreakDeadTimeConfig 
)

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

Parameters:
htimpointer to a TIM_HandleTypeDef structure that contains the configuration information for TIM module.
sBreakDeadTimeConfigpointer to a TIM_ConfigBreakDeadConfig_TypeDef structure that contains the BDTR Register configuration information for the TIM peripheral.
Return values:
HALstatus

Definition at line 1644 of file stm32f4xx_hal_tim_ex.c.

References assert_param, TIM_BreakDeadTimeConfigTypeDef::AutomaticOutput, TIM_BreakDeadTimeConfigTypeDef::BreakPolarity, TIM_BreakDeadTimeConfigTypeDef::BreakState, TIM_BreakDeadTimeConfigTypeDef::DeadTime, TIM_HandleTypeDef::Instance, IS_TIM_AUTOMATIC_OUTPUT_STATE, IS_TIM_BREAK_POLARITY, IS_TIM_BREAK_STATE, IS_TIM_DEADTIME, IS_TIM_LOCK_LEVEL, IS_TIM_OSSI_STATE, IS_TIM_OSSR_STATE, TIM_BreakDeadTimeConfigTypeDef::LockLevel, TIM_BreakDeadTimeConfigTypeDef::OffStateIDLEMode, and TIM_BreakDeadTimeConfigTypeDef::OffStateRunMode.

HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent ( TIM_HandleTypeDef htim,
uint32_t  InputTrigger,
uint32_t  CommutationSource 
)

Configure the TIM commutation event sequence.

Note:
This function is mandatory to use the commutation event in order to update the configuration at each commutation detection on the TRGI input of the Timer, the typical use of this feature is with the use of another Timer(interface Timer) configured in Hall sensor interface, this interface Timer will generate the commutation at its TRGO output (connected to Timer used in this function) each time the TI1 of the Interface Timer detect a commutation at its input TI1.
Parameters:
htimpointer to a TIM_HandleTypeDef structure that contains the configuration information for TIM module.
InputTriggerthe Internal trigger corresponding to the Timer Interfacing with the Hall sensor. This parameter can be one of the following values:
  • TIM_TS_ITR0: Internal trigger 0 selected
  • TIM_TS_ITR1: Internal trigger 1 selected
  • TIM_TS_ITR2: Internal trigger 2 selected
  • TIM_TS_ITR3: Internal trigger 3 selected
  • TIM_TS_NONE: No trigger is needed
CommutationSourcethe Commutation Event source. This parameter can be one of the following values:
  • TIM_COMMUTATION_TRGI: Commutation source is the TRGI of the Interface Timer
  • TIM_COMMUTATION_SOFTWARE: Commutation source is set by software using the COMG bit
Return values:
HALstatus

Definition at line 1458 of file stm32f4xx_hal_tim_ex.c.

References assert_param, TIM_HandleTypeDef::Instance, IS_TIM_INTERNAL_TRIGGEREVENT_SELECTION, TIM_TS_ITR0, TIM_TS_ITR1, TIM_TS_ITR2, and TIM_TS_ITR3.

HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent_DMA ( TIM_HandleTypeDef htim,
uint32_t  InputTrigger,
uint32_t  CommutationSource 
)

Configure the TIM commutation event sequence with DMA.

Note:
This function is mandatory to use the commutation event in order to update the configuration at each commutation detection on the TRGI input of the Timer, the typical use of this feature is with the use of another Timer(interface Timer) configured in Hall sensor interface, this interface Timer will generate the commutation at its TRGO output (connected to Timer used in this function) each time the TI1 of the Interface Timer detect a commutation at its input TI1.
: The user should configure the DMA in his own software, in This function only the COMDE bit is set
Parameters:
htimpointer to a TIM_HandleTypeDef structure that contains the configuration information for TIM module.
InputTriggerthe Internal trigger corresponding to the Timer Interfacing with the Hall sensor. This parameter can be one of the following values:
  • TIM_TS_ITR0: Internal trigger 0 selected
  • TIM_TS_ITR1: Internal trigger 1 selected
  • TIM_TS_ITR2: Internal trigger 2 selected
  • TIM_TS_ITR3: Internal trigger 3 selected
  • TIM_TS_NONE: No trigger is needed
CommutationSourcethe Commutation Event source. This parameter can be one of the following values:
  • TIM_COMMUTATION_TRGI: Commutation source is the TRGI of the Interface Timer
  • TIM_COMMUTATION_SOFTWARE: Commutation source is set by software using the COMG bit
Return values:
HALstatus

Definition at line 1562 of file stm32f4xx_hal_tim_ex.c.

References __HAL_TIM_ENABLE_DMA, assert_param, TIM_HandleTypeDef::hdma, TIM_HandleTypeDef::Instance, IS_TIM_INTERNAL_TRIGGEREVENT_SELECTION, TIM_DMA_COM, TIM_DMA_ID_COMMUTATION, TIM_DMAError(), TIM_TS_ITR0, TIM_TS_ITR1, TIM_TS_ITR2, TIM_TS_ITR3, TIMEx_DMACommutationCplt(), __DMA_HandleTypeDef::XferCpltCallback, and __DMA_HandleTypeDef::XferErrorCallback.

HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent_IT ( TIM_HandleTypeDef htim,
uint32_t  InputTrigger,
uint32_t  CommutationSource 
)

Configure the TIM commutation event sequence with interrupt.

Note:
This function is mandatory to use the commutation event in order to update the configuration at each commutation detection on the TRGI input of the Timer, the typical use of this feature is with the use of another Timer(interface Timer) configured in Hall sensor interface, this interface Timer will generate the commutation at its TRGO output (connected to Timer used in this function) each time the TI1 of the Interface Timer detect a commutation at its input TI1.
Parameters:
htimpointer to a TIM_HandleTypeDef structure that contains the configuration information for TIM module.
InputTriggerthe Internal trigger corresponding to the Timer Interfacing with the Hall sensor. This parameter can be one of the following values:
  • TIM_TS_ITR0: Internal trigger 0 selected
  • TIM_TS_ITR1: Internal trigger 1 selected
  • TIM_TS_ITR2: Internal trigger 2 selected
  • TIM_TS_ITR3: Internal trigger 3 selected
  • TIM_TS_NONE: No trigger is needed
CommutationSourcethe Commutation Event source. This parameter can be one of the following values:
  • TIM_COMMUTATION_TRGI: Commutation source is the TRGI of the Interface Timer
  • TIM_COMMUTATION_SOFTWARE: Commutation source is set by software using the COMG bit
Return values:
HALstatus

Definition at line 1508 of file stm32f4xx_hal_tim_ex.c.

References __HAL_TIM_ENABLE_IT, assert_param, TIM_HandleTypeDef::Instance, IS_TIM_INTERNAL_TRIGGEREVENT_SELECTION, TIM_IT_COM, TIM_TS_ITR0, TIM_TS_ITR1, TIM_TS_ITR2, and TIM_TS_ITR3.

HAL_StatusTypeDef HAL_TIMEx_MasterConfigSynchronization ( TIM_HandleTypeDef htim,
TIM_MasterConfigTypeDef sMasterConfig 
)

Configures the TIM in master mode.

Parameters:
htimpointer to a TIM_HandleTypeDef structure that contains the configuration information for TIM module.
sMasterConfigpointer to a TIM_MasterConfigTypeDef structure that contains the selected trigger output (TRGO) and the Master/Slave mode.
Return values:
HALstatus

Definition at line 1607 of file stm32f4xx_hal_tim_ex.c.

References assert_param, HAL_TIM_STATE_BUSY, HAL_TIM_STATE_READY, TIM_HandleTypeDef::Instance, IS_TIM_MSM_STATE, IS_TIM_TRGO_SOURCE, TIM_MasterConfigTypeDef::MasterOutputTrigger, TIM_MasterConfigTypeDef::MasterSlaveMode, and TIM_HandleTypeDef::State.

HAL_StatusTypeDef HAL_TIMEx_RemapConfig ( TIM_HandleTypeDef htim,
uint32_t  Remap 
)

Configures the TIM2, TIM5 and TIM11 Remapping input capabilities.

Parameters:
htimpointer to a TIM_HandleTypeDef structure that contains the configuration information for TIM module.
Remapspecifies the TIM input remapping source. This parameter can be one of the following values:
  • TIM_TIM2_TIM8_TRGO: TIM2 ITR1 input is connected to TIM8 Trigger output(default)
  • TIM_TIM2_ETH_PTP: TIM2 ITR1 input is connected to ETH PTP trigger output.
  • TIM_TIM2_USBFS_SOF: TIM2 ITR1 input is connected to USB FS SOF.
  • TIM_TIM2_USBHS_SOF: TIM2 ITR1 input is connected to USB HS SOF.
  • TIM_TIM5_GPIO: TIM5 CH4 input is connected to dedicated Timer pin(default)
  • TIM_TIM5_LSI: TIM5 CH4 input is connected to LSI clock.
  • TIM_TIM5_LSE: TIM5 CH4 input is connected to LSE clock.
  • TIM_TIM5_RTC: TIM5 CH4 input is connected to RTC Output event.
  • TIM_TIM11_GPIO: TIM11 CH4 input is connected to dedicated Timer pin(default)
  • TIM_TIM11_HSE: TIM11 CH4 input is connected to HSE_RTC clock (HSE divided by a programmable prescaler)
  • TIM_TIM9_TIM3_TRGO: TIM9 ITR1 input is connected to TIM3 Trigger output(default)
  • TIM_TIM9_LPTIM: TIM9 ITR1 input is connected to LPTIM.
  • TIM_TIM5_TIM3_TRGO: TIM5 ITR1 input is connected to TIM3 Trigger output(default)
  • TIM_TIM5_LPTIM: TIM5 ITR1 input is connected to LPTIM.
  • TIM_TIM1_TIM3_TRGO: TIM1 ITR2 input is connected to TIM3 Trigger output(default)
  • TIM_TIM1_LPTIM: TIM1 ITR2 input is connected to LPTIM.
Return values:
HALstatus

Definition at line 1708 of file stm32f4xx_hal_tim_ex.c.

References assert_param, HAL_TIM_STATE_READY, TIM_HandleTypeDef::Instance, IS_TIM_REMAP, and TIM_HandleTypeDef::State.