STM32F4xx HAL Documentation
Hardware Abstraction Layer for STM32F4 familiy
Loading...
Searching...
No Matches
TIM Time Base functions

Time Base functions. More...

Collaboration diagram for TIM Time Base functions:

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.
 
void HAL_TIM_Base_MspInit (TIM_HandleTypeDef *htim)
 Initializes the TIM Base MSP.
 
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, const 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_TIM_Base_Init()

HAL_StatusTypeDef HAL_TIM_Base_Init ( TIM_HandleTypeDef * htim)

#include <stm32f4xx_hal_tim.h>

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 266 of file stm32f4xx_hal_tim.c.

References assert_param, TIM_Base_InitTypeDef::AutoReloadPreload, TIM_Base_InitTypeDef::ClockDivision, TIM_Base_InitTypeDef::CounterMode, TIM_HandleTypeDef::DMABurstState, HAL_DMA_BURST_STATE_READY, HAL_ERROR, HAL_OK, HAL_TIM_Base_MspInit(), HAL_TIM_CHANNEL_STATE_READY, HAL_TIM_STATE_BUSY, HAL_TIM_STATE_READY, HAL_TIM_STATE_RESET, HAL_UNLOCKED, TIM_HandleTypeDef::Init, TIM_HandleTypeDef::Instance, IS_TIM_AUTORELOAD_PRELOAD, IS_TIM_CLOCKDIVISION_DIV, IS_TIM_COUNTER_MODE, IS_TIM_PERIOD, TIM_HandleTypeDef::Lock, TIM_Base_InitTypeDef::Period, TIM_HandleTypeDef::State, TIM_Base_SetConfig(), TIM_CHANNEL_N_STATE_SET_ALL, and TIM_CHANNEL_STATE_SET_ALL.

Referenced by HAL_InitTick().

◆ HAL_TIM_Base_DeInit()

◆ HAL_TIM_Base_MspInit()

__weak void HAL_TIM_Base_MspInit ( TIM_HandleTypeDef * htim)

#include <stm32f4xx_hal_tim.h>

Initializes the TIM Base MSP.

Parameters
htimTIM Base handle
Return values
None

Definition at line 369 of file stm32f4xx_hal_tim.c.

References UNUSED.

Referenced by HAL_TIM_Base_Init().

◆ HAL_TIM_Base_MspDeInit()

__weak void HAL_TIM_Base_MspDeInit ( TIM_HandleTypeDef * htim)

#include <stm32f4xx_hal_tim.h>

DeInitializes TIM Base MSP.

Parameters
htimTIM Base handle
Return values
None

Definition at line 384 of file stm32f4xx_hal_tim.c.

References UNUSED.

Referenced by HAL_TIM_Base_DeInit().

◆ HAL_TIM_Base_Start()

HAL_StatusTypeDef HAL_TIM_Base_Start ( TIM_HandleTypeDef * htim)

#include <stm32f4xx_hal_tim.h>

Starts the TIM Base generation.

Parameters
htimTIM Base handle
Return values
HALstatus

Definition at line 400 of file stm32f4xx_hal_tim.c.

References __HAL_TIM_ENABLE, assert_param, HAL_ERROR, HAL_OK, HAL_TIM_STATE_BUSY, HAL_TIM_STATE_READY, TIM_HandleTypeDef::Instance, IS_TIM_SLAVEMODE_TRIGGER_ENABLED, and TIM_HandleTypeDef::State.

◆ HAL_TIM_Base_Stop()

HAL_StatusTypeDef HAL_TIM_Base_Stop ( TIM_HandleTypeDef * htim)

#include <stm32f4xx_hal_tim.h>

Stops the TIM Base generation.

Parameters
htimTIM Base handle
Return values
HALstatus

Definition at line 439 of file stm32f4xx_hal_tim.c.

References __HAL_TIM_DISABLE, assert_param, HAL_OK, HAL_TIM_STATE_READY, TIM_HandleTypeDef::Instance, and TIM_HandleTypeDef::State.

◆ HAL_TIM_Base_Start_IT()

HAL_StatusTypeDef HAL_TIM_Base_Start_IT ( TIM_HandleTypeDef * htim)

#include <stm32f4xx_hal_tim.h>

Starts the TIM Base generation in interrupt mode.

Parameters
htimTIM Base handle
Return values
HALstatus

Definition at line 459 of file stm32f4xx_hal_tim.c.

References __HAL_TIM_ENABLE, __HAL_TIM_ENABLE_IT, assert_param, HAL_ERROR, HAL_OK, HAL_TIM_STATE_BUSY, HAL_TIM_STATE_READY, TIM_HandleTypeDef::Instance, IS_TIM_SLAVEMODE_TRIGGER_ENABLED, TIM_HandleTypeDef::State, and TIM_IT_UPDATE.

Referenced by HAL_InitTick().

◆ HAL_TIM_Base_Stop_IT()

HAL_StatusTypeDef HAL_TIM_Base_Stop_IT ( TIM_HandleTypeDef * htim)

#include <stm32f4xx_hal_tim.h>

Stops the TIM Base generation in interrupt mode.

Parameters
htimTIM Base handle
Return values
HALstatus

Definition at line 501 of file stm32f4xx_hal_tim.c.

References __HAL_TIM_DISABLE, __HAL_TIM_DISABLE_IT, assert_param, HAL_OK, HAL_TIM_STATE_READY, TIM_HandleTypeDef::Instance, TIM_HandleTypeDef::State, and TIM_IT_UPDATE.

◆ HAL_TIM_Base_Start_DMA()

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

◆ HAL_TIM_Base_Stop_DMA()

HAL_StatusTypeDef HAL_TIM_Base_Stop_DMA ( TIM_HandleTypeDef * htim)

#include <stm32f4xx_hal_tim.h>

Stops the TIM Base generation in DMA mode.

Parameters
htimTIM Base handle
Return values
HALstatus

Definition at line 595 of file stm32f4xx_hal_tim.c.

References __HAL_TIM_DISABLE, __HAL_TIM_DISABLE_DMA, assert_param, HAL_DMA_Abort_IT(), HAL_OK, HAL_TIM_STATE_READY, TIM_HandleTypeDef::hdma, TIM_HandleTypeDef::Instance, TIM_HandleTypeDef::State, TIM_DMA_ID_UPDATE, and TIM_DMA_UPDATE.