STMicroelectronics / STM32CubeF7

STM32Cube MCU Full Package for the STM32F7 series - (HAL + LL Drivers, CMSIS Core, CMSIS Device, MW libraries plus a set of Projects running on all boards provided by ST (Nucleo, Evaluation and Discovery Kits))
Other
322 stars 191 forks source link

Add HAL_TIM_GetFrequency #32

Closed jrahlf closed 3 years ago

jrahlf commented 3 years ago

Hi,

it would be great if there as a function to get the frequency of a given timer, e.g. HAL_TIM_GetFrequency() Currently one has to query APB1 or APB2, but before one has to know which peripheral bus the timer is connected to, which you generally do not know.

This has been requested on the forums before, e.g. 1, 2

This affects all STM32Fxx packages.

ASELSTM commented 3 years ago

Hi @jrahlf,

Thank you for this report.

Actually such a request is out of HAL driver scoop since it requires system information that are unknown at driver level such as the APBx clock the timer is clocked by or the APBx clock prescaler configuration. So, such service must be handled on top of the HAL driver. Therefore, our development team regrets to decline your request. Thank you for your understanding.

Please allow me then to close this thread. Thank you for your comprehension and thank you again for your contribution.

With regards,