STM32L486xx HAL User Manual
Functions
Time Base functions
TIM Exported Functions

Time Base functions. More...

Functions

HAL_StatusTypeDef HAL_TIM_Base_Init (TIM_HandleTypeDef *htim)
 Initializes the TIM Time base Unit according to the specified parameters in the TIM_HandleTypeDef and initialize the associated handle.
HAL_StatusTypeDef HAL_TIM_Base_DeInit (TIM_HandleTypeDef *htim)
 DeInitializes the TIM Base peripheral.
__weak void HAL_TIM_Base_MspInit (TIM_HandleTypeDef *htim)
 Initializes the TIM Base MSP.
__weak void HAL_TIM_Base_MspDeInit (TIM_HandleTypeDef *htim)
 DeInitializes TIM Base MSP.
HAL_StatusTypeDef HAL_TIM_Base_Start (TIM_HandleTypeDef *htim)
 Starts the TIM Base generation.
HAL_StatusTypeDef HAL_TIM_Base_Stop (TIM_HandleTypeDef *htim)
 Stops the TIM Base generation.
HAL_StatusTypeDef HAL_TIM_Base_Start_IT (TIM_HandleTypeDef *htim)
 Starts the TIM Base generation in interrupt mode.
HAL_StatusTypeDef HAL_TIM_Base_Stop_IT (TIM_HandleTypeDef *htim)
 Stops the TIM Base generation in interrupt mode.
HAL_StatusTypeDef HAL_TIM_Base_Start_DMA (TIM_HandleTypeDef *htim, uint32_t *pData, uint16_t Length)
 Starts the TIM Base generation in DMA mode.
HAL_StatusTypeDef HAL_TIM_Base_Stop_DMA (TIM_HandleTypeDef *htim)
 Stops the TIM Base generation in DMA mode.

Detailed Description

Time Base functions.

  ==============================================================================
              ##### Time Base functions #####
  ==============================================================================
  [..]
    This section provides functions allowing to:
    (+) Initialize and configure the TIM base.
    (+) De-initialize the TIM base.
    (+) Start the Time Base.
    (+) Stop the Time Base.
    (+) Start the Time Base and enable interrupt.
    (+) Stop the Time Base and disable interrupt.
    (+) Start the Time Base and enable DMA transfer.
    (+) Stop the Time Base and disable DMA transfer.


Function Documentation

HAL_StatusTypeDef HAL_TIM_Base_DeInit ( TIM_HandleTypeDef htim)

DeInitializes the TIM Base peripheral.

Parameters:
htimTIM Base handle
Return values:
HALstatus

Definition at line 314 of file stm32l4xx_hal_tim.c.

References __HAL_TIM_DISABLE, assert_param, __TIM_HandleTypeDef::Base_MspDeInitCallback, HAL_TIM_Base_MspDeInit(), HAL_TIM_STATE_BUSY, HAL_TIM_STATE_RESET, __TIM_HandleTypeDef::Instance, and __TIM_HandleTypeDef::State.

HAL_StatusTypeDef HAL_TIM_Base_Init ( TIM_HandleTypeDef htim)

Initializes the TIM Time base Unit according to the specified parameters in the TIM_HandleTypeDef and initialize the associated handle.

Note:
Switching from Center Aligned counter mode to Edge counter mode (or reverse) requires a timer reset to avoid unexpected direction due to DIR bit readonly in center aligned mode. Ex: call HAL_TIM_Base_DeInit() before HAL_TIM_Base_Init()
Parameters:
htimTIM Base handle
Return values:
HALstatus

Definition at line 262 of file stm32l4xx_hal_tim.c.

References assert_param, TIM_Base_InitTypeDef::AutoReloadPreload, __TIM_HandleTypeDef::Base_MspInitCallback, TIM_Base_InitTypeDef::ClockDivision, TIM_Base_InitTypeDef::CounterMode, HAL_TIM_Base_MspInit(), HAL_TIM_STATE_BUSY, HAL_TIM_STATE_READY, HAL_TIM_STATE_RESET, __TIM_HandleTypeDef::Init, __TIM_HandleTypeDef::Instance, IS_TIM_AUTORELOAD_PRELOAD, IS_TIM_CLOCKDIVISION_DIV, IS_TIM_COUNTER_MODE, __TIM_HandleTypeDef::Lock, __TIM_HandleTypeDef::State, TIM_Base_SetConfig(), and TIM_ResetCallback().

DeInitializes TIM Base MSP.

Parameters:
htimTIM Base handle
Return values:
None

Definition at line 365 of file stm32l4xx_hal_tim.c.

Referenced by HAL_TIM_Base_DeInit(), and HAL_TIM_UnRegisterCallback().

Initializes the TIM Base MSP.

Parameters:
htimTIM Base handle
Return values:
None

Definition at line 350 of file stm32l4xx_hal_tim.c.

Referenced by HAL_TIM_Base_Init(), and HAL_TIM_UnRegisterCallback().

HAL_StatusTypeDef HAL_TIM_Base_Start ( TIM_HandleTypeDef htim)

Starts the TIM Base generation.

Parameters:
htimTIM Base handle
Return values:
HALstatus

Definition at line 381 of file stm32l4xx_hal_tim.c.

References __HAL_TIM_ENABLE, assert_param, HAL_TIM_STATE_BUSY, HAL_TIM_STATE_READY, __TIM_HandleTypeDef::Instance, IS_TIM_SLAVEMODE_TRIGGER_ENABLED, and __TIM_HandleTypeDef::State.

HAL_StatusTypeDef HAL_TIM_Base_Start_DMA ( TIM_HandleTypeDef htim,
uint32_t *  pData,
uint16_t  Length 
)

Starts the TIM Base generation in DMA mode.

Parameters:
htimTIM Base handle
pDataThe source Buffer address.
LengthThe length of data to be transferred from memory to peripheral.
Return values:
HALstatus

Definition at line 474 of file stm32l4xx_hal_tim.c.

References __HAL_TIM_ENABLE, __HAL_TIM_ENABLE_DMA, assert_param, HAL_DMA_Start_IT(), HAL_TIM_STATE_BUSY, HAL_TIM_STATE_READY, __TIM_HandleTypeDef::hdma, __TIM_HandleTypeDef::Instance, IS_TIM_SLAVEMODE_TRIGGER_ENABLED, __TIM_HandleTypeDef::State, TIM_DMA_ID_UPDATE, TIM_DMA_UPDATE, TIM_DMAError(), TIM_DMAPeriodElapsedCplt(), __DMA_HandleTypeDef::XferCpltCallback, and __DMA_HandleTypeDef::XferErrorCallback.

HAL_StatusTypeDef HAL_TIM_Base_Start_IT ( TIM_HandleTypeDef htim)

Starts the TIM Base generation in interrupt mode.

Parameters:
htimTIM Base handle
Return values:
HALstatus

Definition at line 430 of file stm32l4xx_hal_tim.c.

References __HAL_TIM_ENABLE, __HAL_TIM_ENABLE_IT, assert_param, __TIM_HandleTypeDef::Instance, IS_TIM_SLAVEMODE_TRIGGER_ENABLED, and TIM_IT_UPDATE.

HAL_StatusTypeDef HAL_TIM_Base_Stop ( TIM_HandleTypeDef htim)

Stops the TIM Base generation.

Parameters:
htimTIM Base handle
Return values:
HALstatus

Definition at line 407 of file stm32l4xx_hal_tim.c.

References __HAL_TIM_DISABLE, assert_param, HAL_TIM_STATE_BUSY, HAL_TIM_STATE_READY, __TIM_HandleTypeDef::Instance, and __TIM_HandleTypeDef::State.

HAL_StatusTypeDef HAL_TIM_Base_Stop_DMA ( TIM_HandleTypeDef htim)

Stops the TIM Base generation in DMA mode.

Parameters:
htimTIM Base handle
Return values:
HALstatus

Definition at line 529 of file stm32l4xx_hal_tim.c.

References __HAL_TIM_DISABLE, __HAL_TIM_DISABLE_DMA, assert_param, HAL_TIM_STATE_READY, __TIM_HandleTypeDef::Instance, __TIM_HandleTypeDef::State, and TIM_DMA_UPDATE.

HAL_StatusTypeDef HAL_TIM_Base_Stop_IT ( TIM_HandleTypeDef htim)

Stops the TIM Base generation in interrupt mode.

Parameters:
htimTIM Base handle
Return values:
HALstatus

Definition at line 453 of file stm32l4xx_hal_tim.c.

References __HAL_TIM_DISABLE, __HAL_TIM_DISABLE_IT, assert_param, __TIM_HandleTypeDef::Instance, and TIM_IT_UPDATE.