TIM One Pulse functions.
More...
TIM One Pulse functions.
==============================================================================
##### TIM One Pulse functions #####
==============================================================================
[..]
This section provides functions allowing to:
(+) Initialize and configure the TIM One Pulse.
(+) De-initialize the TIM One Pulse.
(+) Start the TIM One Pulse.
(+) Stop the TIM One Pulse.
(+) Start the TIM One Pulse and enable interrupt.
(+) Stop the TIM One Pulse and disable interrupt.
(+) Start the TIM One Pulse and enable DMA transfer.
(+) Stop the TIM One Pulse and disable DMA transfer.
◆ HAL_TIM_OnePulse_DeInit()
DeInitializes the TIM One Pulse.
- Parameters
-
- Return values
-
Definition at line 2353 of file stm32l4xx_hal_tim.c.
2361 __HAL_TIM_DISABLE(htim);
2363 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) 2364 if (htim->OnePulse_MspDeInitCallback == NULL)
2369 htim->OnePulse_MspDeInitCallback(htim);
void HAL_TIM_OnePulse_MspDeInit(TIM_HandleTypeDef *htim)
DeInitializes TIM One Pulse MSP.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))
◆ HAL_TIM_OnePulse_Init()
| HAL_StatusTypeDef HAL_TIM_OnePulse_Init |
( |
TIM_HandleTypeDef * |
htim, |
|
|
uint32_t |
OnePulseMode |
|
) |
| |
Initializes the TIM One Pulse Time Base according to the specified parameters in the TIM_HandleTypeDef and initializes 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_OnePulse_DeInit() before HAL_TIM_OnePulse_Init()
- Parameters
-
| htim | TIM One Pulse handle |
| OnePulseMode | Select the One pulse mode. This parameter can be one of the following values:
- TIM_OPMODE_SINGLE: Only one pulse will be generated.
- TIM_OPMODE_REPETITIVE: Repetitive pulses will be generated.
|
- Return values
-
Definition at line 2294 of file stm32l4xx_hal_tim.c.
2304 assert_param(IS_TIM_COUNTER_MODE(htim->Init.CounterMode));
2305 assert_param(IS_TIM_CLOCKDIVISION_DIV(htim->Init.ClockDivision));
2307 assert_param(IS_TIM_AUTORELOAD_PRELOAD(htim->Init.AutoReloadPreload));
2314 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) 2318 if (htim->OnePulse_MspInitCallback == NULL)
2323 htim->OnePulse_MspInitCallback(htim);
2337 htim->Instance->CR1 &= ~TIM_CR1_OPM;
2340 htim->Instance->CR1 |= OnePulseMode;
void TIM_Base_SetConfig(TIM_TypeDef *TIMx, TIM_Base_InitTypeDef *Structure)
Time Base configuration.
void TIM_ResetCallback(TIM_HandleTypeDef *htim)
Reset interrupt callbacks to the legacy weak callbacks.
void HAL_TIM_OnePulse_MspInit(TIM_HandleTypeDef *htim)
Initializes the TIM One Pulse MSP.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))
◆ HAL_TIM_OnePulse_MspDeInit()
◆ HAL_TIM_OnePulse_MspInit()
◆ HAL_TIM_OnePulse_Start()
| HAL_StatusTypeDef HAL_TIM_OnePulse_Start |
( |
TIM_HandleTypeDef * |
htim, |
|
|
uint32_t |
OutputChannel |
|
) |
| |
Starts the TIM One Pulse signal generation.
- Parameters
-
| htim | TIM One Pulse handle |
| OutputChannel | TIM 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
|
- Return values
-
Definition at line 2423 of file stm32l4xx_hal_tim.c.
2426 UNUSED(OutputChannel);
2440 if (IS_TIM_BREAK_INSTANCE(htim->Instance) != RESET)
2443 __HAL_TIM_MOE_ENABLE(htim);
void TIM_CCxChannelCmd(TIM_TypeDef *TIMx, uint32_t Channel, uint32_t ChannelState)
Enables or disables the TIM Capture Compare Channel x.
◆ HAL_TIM_OnePulse_Start_IT()
| HAL_StatusTypeDef HAL_TIM_OnePulse_Start_IT |
( |
TIM_HandleTypeDef * |
htim, |
|
|
uint32_t |
OutputChannel |
|
) |
| |
Starts the TIM One Pulse signal generation in interrupt mode.
- Parameters
-
| htim | TIM One Pulse handle |
| OutputChannel | TIM 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
|
- Return values
-
Definition at line 2495 of file stm32l4xx_hal_tim.c.
2498 UNUSED(OutputChannel);
2510 __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC1);
2513 __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC2);
2518 if (IS_TIM_BREAK_INSTANCE(htim->Instance) != RESET)
2521 __HAL_TIM_MOE_ENABLE(htim);
void TIM_CCxChannelCmd(TIM_TypeDef *TIMx, uint32_t Channel, uint32_t ChannelState)
Enables or disables the TIM Capture Compare Channel x.
◆ HAL_TIM_OnePulse_Stop()
| HAL_StatusTypeDef HAL_TIM_OnePulse_Stop |
( |
TIM_HandleTypeDef * |
htim, |
|
|
uint32_t |
OutputChannel |
|
) |
| |
Stops the TIM One Pulse signal generation.
- Parameters
-
| htim | TIM One Pulse handle |
| OutputChannel | TIM Channels to be disable This parameter can be one of the following values:
- TIM_CHANNEL_1: TIM Channel 1 selected
- TIM_CHANNEL_2: TIM Channel 2 selected
|
- Return values
-
Definition at line 2459 of file stm32l4xx_hal_tim.c.
2462 UNUSED(OutputChannel);
2473 if (IS_TIM_BREAK_INSTANCE(htim->Instance) != RESET)
2476 __HAL_TIM_MOE_DISABLE(htim);
2480 __HAL_TIM_DISABLE(htim);
void TIM_CCxChannelCmd(TIM_TypeDef *TIMx, uint32_t Channel, uint32_t ChannelState)
Enables or disables the TIM Capture Compare Channel x.
◆ HAL_TIM_OnePulse_Stop_IT()
| HAL_StatusTypeDef HAL_TIM_OnePulse_Stop_IT |
( |
TIM_HandleTypeDef * |
htim, |
|
|
uint32_t |
OutputChannel |
|
) |
| |
Stops the TIM One Pulse signal generation in interrupt mode.
- Parameters
-
| htim | TIM One Pulse handle |
| OutputChannel | TIM 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
|
- Return values
-
Definition at line 2537 of file stm32l4xx_hal_tim.c.
2540 UNUSED(OutputChannel);
2543 __HAL_TIM_DISABLE_IT(htim, TIM_IT_CC1);
2546 __HAL_TIM_DISABLE_IT(htim, TIM_IT_CC2);
2556 if (IS_TIM_BREAK_INSTANCE(htim->Instance) != RESET)
2559 __HAL_TIM_MOE_DISABLE(htim);
2563 __HAL_TIM_DISABLE(htim);
void TIM_CCxChannelCmd(TIM_TypeDef *TIMx, uint32_t Channel, uint32_t ChannelState)
Enables or disables the TIM Capture Compare Channel x.