TUKS MCU Introductory course / TUKS-COURSE-THERMOMETER

Fork of TUKS-COURSE-TIMER by TUKS MCU Introductory course

Embed: (wiki syntax)

« Back to documentation index

Extended Peripheral Control functions

Extended Peripheral Control functions
[TIM Extended 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_ConfigBreakInput (TIM_HandleTypeDef *htim, uint32_t BreakInput, TIMEx_BreakInputConfigTypeDef *sBreakInputConfig)
 Configures the break input source.
HAL_StatusTypeDef HAL_TIMEx_RemapConfig (TIM_HandleTypeDef *htim, uint32_t Remap)
 Configures the TIMx Remapping input capabilities.
HAL_StatusTypeDef HAL_TIMEx_GroupChannel5 (TIM_HandleTypeDef *htim, uint32_t Channels)
 Group channel 5 and channel 1, 2 or 3.

Detailed Description

Peripheral Control functions.

  ==============================================================================
                    ##### Peripheral Control functions #####
  ==============================================================================
  [..]
    This section provides functions allowing to:
    (+) Configure the commutation event in case of use of the Hall sensor interface.
      (+) Configure Output channels for OC and PWM mode.

      (+) Configure Complementary channels, break features and dead time.
      (+) Configure Master synchronization.
      (+) Configure timer remapping capabilities.
      (+) Enable or disable channel grouping


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:
htim,:TIM handle
sBreakDeadTimeConfig,:pointer to a TIM_ConfigBreakDeadConfigTypeDef structure that contains the BDTR Register configuration information for the TIM peripheral.
Return values:
HALstatus

Definition at line 1671 of file stm32l4xx_hal_tim_ex.c.

HAL_StatusTypeDef HAL_TIMEx_ConfigBreakInput ( TIM_HandleTypeDef *  htim,
uint32_t  BreakInput,
TIMEx_BreakInputConfigTypeDef *  sBreakInputConfig 
)

Configures the break input source.

Parameters:
htim,:TIM handle.
BreakInput,:Break input to configure This parameter can be one of the following values:

  • TIM_BREAKINPUT_BRK: Timer break input
  • TIM_BREAKINPUT_BRK2: Timer break 2 input
sBreakInputConfig,:Break input source configuration
Return values:
HALstatus

Definition at line 1753 of file stm32l4xx_hal_tim_ex.c.

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:
htim,:TIM handle
InputTrigger: the 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
CommutationSource: the 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 1464 of file stm32l4xx_hal_tim_ex.c.

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:
htim,:TIM handle
InputTrigger: the 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
CommutationSource: the 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 1566 of file stm32l4xx_hal_tim_ex.c.

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:
htim,:TIM handle
InputTrigger: the 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
CommutationSource: the 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 1513 of file stm32l4xx_hal_tim_ex.c.

HAL_StatusTypeDef HAL_TIMEx_GroupChannel5 ( TIM_HandleTypeDef *  htim,
uint32_t  Channels 
)

Group channel 5 and channel 1, 2 or 3.

Parameters:
htim,:TIM handle.
Channels,:specifies the reference signal(s) the OC5REF is combined with. This parameter can be any combination of the following values: TIM_GROUPCH5_NONE: No effect of OC5REF on OC1REFC, OC2REFC and OC3REFC TIM_GROUPCH5_OC1REFC: OC1REFC is the logical AND of OC1REFC and OC5REF TIM_GROUPCH5_OC2REFC: OC2REFC is the logical AND of OC2REFC and OC5REF TIM_GROUPCH5_OC3REFC: OC3REFC is the logical AND of OC3REFC and OC5REF
Return values:
HALstatus

Definition at line 2094 of file stm32l4xx_hal_tim_ex.c.

HAL_StatusTypeDef HAL_TIMEx_MasterConfigSynchronization ( TIM_HandleTypeDef *  htim,
TIM_MasterConfigTypeDef *  sMasterConfig 
)

Configures the TIM in master mode.

Parameters:
htim,:TIM handle.
sMasterConfig,:pointer to a TIM_MasterConfigTypeDef structure that contains the selected trigger output (TRGO) and the Master/Slave mode.
Return values:
HALstatus

Definition at line 1610 of file stm32l4xx_hal_tim_ex.c.

HAL_StatusTypeDef HAL_TIMEx_RemapConfig ( TIM_HandleTypeDef *  htim,
uint32_t  Remap 
)

Configures the TIMx Remapping input capabilities.

Parameters:
htim,:TIM handle.
Remap,:specifies the TIM remapping source.

For TIM15, the parameter is a combination of 3 fields (field1 | field2):

field1 can have the following values:

  • TIM_TIM15_TI1_GPIO: TIM15 TI1 is connected to GPIO
  • TIM_TIM15_TI1_LSE: TIM15 TI1 is connected to LSE

field2 can have the following values:

  • TIM_TIM15_ENCODERMODE_NONE: No redirection
  • TIM_TIM15_ENCODERMODE_TIM2: TIM2 IC1 and TIM2 IC2 are connected to TIM15 IC1 and TIM15 IC2 respectively
  • TIM_TIM15_ENCODERMODE_TIM3: TIM3 IC1 and TIM3 IC2 are connected to TIM15 IC1 and TIM15 IC2 respectively
  • TIM_TIM15_ENCODERMODE_TIM4: TIM4 IC1 and TIM4 IC2 are connected to TIM15 IC1 and TIM15 IC2 respectively
Return values:
HALstatus

Definition at line 2044 of file stm32l4xx_hal_tim_ex.c.