STM32F439xx HAL User Manual
Functions
Time Encoder functions
TIM Exported Functions

Time Encoder functions. More...

Functions

HAL_StatusTypeDef HAL_TIM_Encoder_Init (TIM_HandleTypeDef *htim, TIM_Encoder_InitTypeDef *sConfig)
 Initializes the TIM Encoder Interface and create the associated handle.
HAL_StatusTypeDef HAL_TIM_Encoder_DeInit (TIM_HandleTypeDef *htim)
 DeInitializes the TIM Encoder interface.
__weak void HAL_TIM_Encoder_MspInit (TIM_HandleTypeDef *htim)
 Initializes the TIM Encoder Interface MSP.
__weak void HAL_TIM_Encoder_MspDeInit (TIM_HandleTypeDef *htim)
 DeInitializes TIM Encoder Interface MSP.
HAL_StatusTypeDef HAL_TIM_Encoder_Start (TIM_HandleTypeDef *htim, uint32_t Channel)
 Starts the TIM Encoder Interface.
HAL_StatusTypeDef HAL_TIM_Encoder_Stop (TIM_HandleTypeDef *htim, uint32_t Channel)
 Stops the TIM Encoder Interface.
HAL_StatusTypeDef HAL_TIM_Encoder_Start_IT (TIM_HandleTypeDef *htim, uint32_t Channel)
 Starts the TIM Encoder Interface in interrupt mode.
HAL_StatusTypeDef HAL_TIM_Encoder_Stop_IT (TIM_HandleTypeDef *htim, uint32_t Channel)
 Stops the TIM Encoder Interface in interrupt mode.
HAL_StatusTypeDef HAL_TIM_Encoder_Start_DMA (TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData1, uint32_t *pData2, uint16_t Length)
 Starts the TIM Encoder Interface in DMA mode.
HAL_StatusTypeDef HAL_TIM_Encoder_Stop_DMA (TIM_HandleTypeDef *htim, uint32_t Channel)
 Stops the TIM Encoder Interface in DMA mode.

Detailed Description

Time Encoder functions.

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

Function Documentation

HAL_StatusTypeDef HAL_TIM_Encoder_DeInit ( TIM_HandleTypeDef htim)

DeInitializes the TIM Encoder interface.

Parameters:
htimpointer to a TIM_HandleTypeDef structure that contains the configuration information for TIM module.
Return values:
HALstatus

Definition at line 2374 of file stm32f4xx_hal_tim.c.

References __HAL_TIM_DISABLE, assert_param, HAL_TIM_Encoder_MspDeInit(), HAL_TIM_STATE_BUSY, HAL_TIM_STATE_RESET, TIM_HandleTypeDef::Instance, and TIM_HandleTypeDef::State.

HAL_StatusTypeDef HAL_TIM_Encoder_Init ( TIM_HandleTypeDef htim,
TIM_Encoder_InitTypeDef sConfig 
)

DeInitializes TIM Encoder Interface MSP.

Parameters:
htimpointer to a TIM_HandleTypeDef structure that contains the configuration information for TIM module.
Return values:
None

Definition at line 2417 of file stm32f4xx_hal_tim.c.

Referenced by HAL_TIM_Encoder_DeInit().

Initializes the TIM Encoder Interface MSP.

Parameters:
htimpointer to a TIM_HandleTypeDef structure that contains the configuration information for TIM module.
Return values:
None

Definition at line 2402 of file stm32f4xx_hal_tim.c.

Referenced by HAL_TIM_Encoder_Init().

HAL_StatusTypeDef HAL_TIM_Encoder_Start ( TIM_HandleTypeDef htim,
uint32_t  Channel 
)

Starts the TIM Encoder Interface.

Parameters:
htimpointer to a TIM_HandleTypeDef structure that contains the configuration information for TIM module.
ChannelTIM Channels to be enabled. This parameter can be one of the following values:
  • TIM_CHANNEL_1: TIM Channel 1 selected
  • TIM_CHANNEL_2: TIM Channel 2 selected
  • TIM_CHANNEL_ALL: TIM Channel 1 and TIM Channel 2 are selected
Return values:
HALstatus

Definition at line 2437 of file stm32f4xx_hal_tim.c.

References __HAL_TIM_ENABLE, assert_param, TIM_HandleTypeDef::Instance, TIM_CCx_ENABLE, TIM_CCxChannelCmd(), TIM_CHANNEL_1, and TIM_CHANNEL_2.

HAL_StatusTypeDef HAL_TIM_Encoder_Start_DMA ( TIM_HandleTypeDef htim,
uint32_t  Channel,
uint32_t *  pData1,
uint32_t *  pData2,
uint16_t  Length 
)

Starts the TIM Encoder Interface in DMA mode.

Parameters:
htimpointer to a TIM_HandleTypeDef structure that contains the configuration information for TIM module.
ChannelTIM Channels to be enabled. This parameter can be one of the following values:
  • TIM_CHANNEL_1: TIM Channel 1 selected
  • TIM_CHANNEL_2: TIM Channel 2 selected
  • TIM_CHANNEL_ALL: TIM Channel 1 and TIM Channel 2 are selected
pData1The destination Buffer address for IC1.
pData2The destination Buffer address for IC2.
LengthThe length of data to be transferred from TIM peripheral to memory.
Return values:
HALstatus

Definition at line 2628 of file stm32f4xx_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, TIM_HandleTypeDef::State, TIM_CCx_ENABLE, TIM_CCxChannelCmd(), TIM_CHANNEL_1, TIM_CHANNEL_2, TIM_CHANNEL_ALL, TIM_DMA_CC1, TIM_DMA_CC2, TIM_DMA_ID_CC1, TIM_DMA_ID_CC2, TIM_DMACaptureCplt(), TIM_DMAError(), __DMA_HandleTypeDef::XferCpltCallback, and __DMA_HandleTypeDef::XferErrorCallback.

HAL_StatusTypeDef HAL_TIM_Encoder_Start_IT ( TIM_HandleTypeDef htim,
uint32_t  Channel 
)

Starts the TIM Encoder Interface in interrupt mode.

Parameters:
htimpointer to a TIM_HandleTypeDef structure that contains the configuration information for TIM module.
ChannelTIM Channels to be enabled. This parameter can be one of the following values:
  • TIM_CHANNEL_1: TIM Channel 1 selected
  • TIM_CHANNEL_2: TIM Channel 2 selected
  • TIM_CHANNEL_ALL: TIM Channel 1 and TIM Channel 2 are selected
Return values:
HALstatus

Definition at line 2524 of file stm32f4xx_hal_tim.c.

References __HAL_TIM_ENABLE, __HAL_TIM_ENABLE_IT, assert_param, TIM_HandleTypeDef::Instance, TIM_CCx_ENABLE, TIM_CCxChannelCmd(), TIM_CHANNEL_1, TIM_CHANNEL_2, TIM_IT_CC1, and TIM_IT_CC2.

HAL_StatusTypeDef HAL_TIM_Encoder_Stop ( TIM_HandleTypeDef htim,
uint32_t  Channel 
)

Stops the TIM Encoder Interface.

Parameters:
htimpointer to a TIM_HandleTypeDef structure that contains the configuration information for TIM module.
ChannelTIM Channels to be disabled. This parameter can be one of the following values:
  • TIM_CHANNEL_1: TIM Channel 1 selected
  • TIM_CHANNEL_2: TIM Channel 2 selected
  • TIM_CHANNEL_ALL: TIM Channel 1 and TIM Channel 2 are selected
Return values:
HALstatus

Definition at line 2480 of file stm32f4xx_hal_tim.c.

References __HAL_TIM_DISABLE, assert_param, TIM_HandleTypeDef::Instance, TIM_CCx_DISABLE, TIM_CCxChannelCmd(), TIM_CHANNEL_1, and TIM_CHANNEL_2.

HAL_StatusTypeDef HAL_TIM_Encoder_Stop_DMA ( TIM_HandleTypeDef htim,
uint32_t  Channel 
)

Stops the TIM Encoder Interface in DMA mode.

Parameters:
htimpointer to a TIM_HandleTypeDef structure that contains the configuration information for TIM module.
ChannelTIM Channels to be enabled. This parameter can be one of the following values:
  • TIM_CHANNEL_1: TIM Channel 1 selected
  • TIM_CHANNEL_2: TIM Channel 2 selected
  • TIM_CHANNEL_ALL: TIM Channel 1 and TIM Channel 2 are selected
Return values:
HALstatus

Definition at line 2746 of file stm32f4xx_hal_tim.c.

References __HAL_TIM_DISABLE, __HAL_TIM_DISABLE_DMA, assert_param, HAL_TIM_STATE_READY, TIM_HandleTypeDef::Instance, TIM_HandleTypeDef::State, TIM_CCx_DISABLE, TIM_CCxChannelCmd(), TIM_CHANNEL_1, TIM_CHANNEL_2, TIM_DMA_CC1, and TIM_DMA_CC2.

HAL_StatusTypeDef HAL_TIM_Encoder_Stop_IT ( TIM_HandleTypeDef htim,
uint32_t  Channel 
)

Stops the TIM Encoder Interface in interrupt mode.

Parameters:
htimpointer to a TIM_HandleTypeDef structure that contains the configuration information for TIM module.
ChannelTIM Channels to be disabled. This parameter can be one of the following values:
  • TIM_CHANNEL_1: TIM Channel 1 selected
  • TIM_CHANNEL_2: TIM Channel 2 selected
  • TIM_CHANNEL_ALL: TIM Channel 1 and TIM Channel 2 are selected
Return values:
HALstatus

Definition at line 2573 of file stm32f4xx_hal_tim.c.

References __HAL_TIM_DISABLE, __HAL_TIM_DISABLE_IT, assert_param, HAL_TIM_STATE_READY, TIM_HandleTypeDef::Instance, TIM_HandleTypeDef::State, TIM_CCx_DISABLE, TIM_CCxChannelCmd(), TIM_CHANNEL_1, TIM_CHANNEL_2, TIM_IT_CC1, and TIM_IT_CC2.