HARMcksL: ARM HAL toolbox (yet STM32 oriented) 1.6
SMFSW collection of HAL hacks for STM32
Loading...
Searching...
No Matches
TIM_ex.h File Reference

Extensions for TIM peripherals. More...

#include "sarmfsw.h"
Include dependency graph for TIM_ex.h:
This graph shows which files directly or indirectly include this file:

Functions

uint32_t RCC_TIMCLKFreq (const TIM_HandleTypeDef *const pTim)
 Get TIM peripheral clock frequency.
 
HAL_StatusTypeDef write_TIM_Preload (TIM_HandleTypeDef *const pTim, const uint32_t chan)
 Write preload bit in TIM module for desired channel.
 
HAL_StatusTypeDef write_TIM_CCR (const TIM_HandleTypeDef *const pTim, const uint32_t chan, const uint32_t CCR_val)
 Low level TIM module CCR write.
 
HAL_StatusTypeDef set_TIM_Interrupts (TIM_HandleTypeDef *const pTim, const bool on)
 Start TIM module interrupts.
 
HAL_StatusTypeDef deinit_TIM_Base (TIM_HandleTypeDef *const pTim)
 De-Init TIM base module (stop interruptions)
 
HAL_StatusTypeDef init_TIM_Base (TIM_HandleTypeDef *const pTim, const uint32_t freq)
 Init TIM module and start interruptions.
 
HAL_StatusTypeDef set_TIM_Freq (TIM_HandleTypeDef *const pTim, const uint32_t freq)
 Set TIM module frequency.
 
HAL_StatusTypeDef set_TIM_Tick_Freq (TIM_HandleTypeDef *const pTim, const uint32_t freq)
 Set TIM module tick frequency.
 

Detailed Description

Extensions for TIM peripherals.

Author
SMFSW
Warning
Init functions assume that TIM peripherals instance were already configured by HAL
Shall work for all STM32 F/G/H/L families only (yet)
Note
TIM_MIN_GRANULARITY can defined at project level to tweak to needed minimum granularity

Function Documentation

◆ deinit_TIM_Base()

HAL_StatusTypeDef deinit_TIM_Base ( TIM_HandleTypeDef *const pTim)
inline

De-Init TIM base module (stop interruptions)

Parameters
[in,out]pTim- pointer to TIM instance
Returns
HAL Status
Here is the call graph for this function:

◆ init_TIM_Base()

HAL_StatusTypeDef init_TIM_Base ( TIM_HandleTypeDef *const pTim,
const uint32_t freq )

Init TIM module and start interruptions.

Parameters
[in,out]pTim- pointer to TIM instance
[in]freq- Desired TIM frequency
Returns
HAL Status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RCC_TIMCLKFreq()

uint32_t RCC_TIMCLKFreq ( const TIM_HandleTypeDef *const pTim)

Get TIM peripheral clock frequency.

Warning
Shall work for all STM32 F/G families, L families not totally covered
Parameters
[in,out]pTim- pointer to TIM instance
Returns
TIM peripheral clock frequency (Hz)
Note
TIM_MIN_GRANULARITY can defined at project level to tweak to needed minimum granularity
Here is the caller graph for this function:

◆ set_TIM_Freq()

HAL_StatusTypeDef set_TIM_Freq ( TIM_HandleTypeDef *const pTim,
const uint32_t freq )

Set TIM module frequency.

Parameters
[in,out]pTim- pointer to TIM instance for Frequency computation
[in]freq- Desired TIM frequency
Returns
HAL Status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_TIM_Interrupts()

HAL_StatusTypeDef set_TIM_Interrupts ( TIM_HandleTypeDef *const pTim,
const bool on )
inline

Start TIM module interrupts.

Parameters
[in,out]pTim- pointer to TIM instance
[in]on- Time Interrupts 0: off, 1: on
Returns
HAL Status
Here is the caller graph for this function:

◆ set_TIM_Tick_Freq()

HAL_StatusTypeDef set_TIM_Tick_Freq ( TIM_HandleTypeDef *const pTim,
const uint32_t freq )

Set TIM module tick frequency.

Note
This function sets TIM period to maximum value (which is most likely what is needed in such a configuration case)
Parameters
[in,out]pTim- pointer to TIM instance for Frequency computation
[in]freq- Desired TIM tick frequency
Returns
HAL Status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_TIM_CCR()

HAL_StatusTypeDef write_TIM_CCR ( const TIM_HandleTypeDef *const pTim,
const uint32_t chan,
const uint32_t CCR_val )

Low level TIM module CCR write.

Parameters
[in,out]pTim- pointer to TIM instance for PWM generation
[in]chan- Channel to write
[in]CCR_val- CCR value
Returns
HAL Status
Here is the caller graph for this function:

◆ write_TIM_Preload()

HAL_StatusTypeDef write_TIM_Preload ( TIM_HandleTypeDef *const pTim,
const uint32_t chan )

Write preload bit in TIM module for desired channel.

Parameters
[in,out]pTim- pointer to TIM instance
[in]chan- Channel to write
Returns
HAL Status
Here is the caller graph for this function: