__LL_TIM_CALC_ARR macro
HELPER macro calculating the auto-reload value to achieve the required output signal frequency.
#define __LL_TIM_CALC_ARR(__TIMCLK__, __PSC__, __FREQ__) \
((((__TIMCLK__)/((__PSC__) + 1U)) >= (__FREQ__)) ? (((__TIMCLK__)/((__FREQ__) * ((__PSC__) + 1U))) - 1U) : 0U)
Arguments
__TIMCLK__
timer input clock frequency (in Hz)
__PSC__
prescaler
__FREQ__
output signal frequency (in Hz)
Return value
Auto-reload value (between Min_Data=0 and Max_Data=65535)
Notes
Examples
__LL_TIM_CALC_ARR is referenced by
8 libraries and example projects.