HAL + 0/1 examples
CodeScope will show references to __LL_TIM_CALC_DEADTIME from the following samples and libraries:
Examples
STM32F411RE-Nucleo
Examples_LL
TIM
 
Symbols
loading...
Files
loading...

__LL_TIM_CALC_DEADTIME macro

HELPER macro calculating DTG[0:7] in the TIMx_BDTR register to achieve the requested dead time duration.

Syntax

#define __LL_TIM_CALC_DEADTIME(__TIMCLK__, __CKD__, __DT__) \     ( (((uint64_t)((__DT__)*1000U)) < ((DT_DELAY_1+1U) * TIM_CALC_DTS((__TIMCLK__), (__CKD__)))) ? \     (uint8_t)(((uint64_t)((__DT__)*1000U) / TIM_CALC_DTS((__TIMCLK__), (__CKD__))) & DT_DELAY_1) : \     (((uint64_t)((__DT__)*1000U)) < ((64U + (DT_DELAY_2+1U)) * 2U * TIM_CALC_DTS((__TIMCLK__), (__CKD__)))) ? \     (uint8_t)(DT_RANGE_2 | ((uint8_t)((uint8_t)((((uint64_t)((__DT__)*1000U))/ TIM_CALC_DTS((__TIMCLK__), \     (__CKD__))) >> 1U) - (uint8_t) 64) & DT_DELAY_2)) :\     (((uint64_t)((__DT__)*1000U)) < ((32U + (DT_DELAY_3+1U)) * 8U * TIM_CALC_DTS((__TIMCLK__), (__CKD__)))) ? \     (uint8_t)(DT_RANGE_3 | ((uint8_t)((uint8_t)(((((uint64_t)(__DT__)*1000U))/ TIM_CALC_DTS((__TIMCLK__), \     (__CKD__))) >> 3U) - (uint8_t) 32) & DT_DELAY_3)) :\     (((uint64_t)((__DT__)*1000U)) < ((32U + (DT_DELAY_4+1U)) * 16U * TIM_CALC_DTS((__TIMCLK__), (__CKD__)))) ? \     (uint8_t)(DT_RANGE_4 | ((uint8_t)((uint8_t)(((((uint64_t)(__DT__)*1000U))/ TIM_CALC_DTS((__TIMCLK__), \     (__CKD__))) >> 4U) - (uint8_t) 32) & DT_DELAY_4)) :\     0U)

Arguments

__TIMCLK__

timer input clock frequency (in Hz)

__CKD__

This parameter can be one of the following values: @arg LL_TIM_CLOCKDIVISION_DIV1 @arg LL_TIM_CLOCKDIVISION_DIV2 @arg LL_TIM_CLOCKDIVISION_DIV4

__DT__

deadtime duration (in ns)

Return value

DTG[0:7]

Notes

ex: __LL_TIM_CALC_DEADTIME (80000000, LL_TIM_GetClockDivision (), 120);

Examples

__LL_TIM_CALC_DEADTIME is referenced by 1 libraries and example projects.

References

LocationText
stm32f4xx_ll_tim.h:1022
#define __LL_TIM_CALC_DEADTIME(__TIMCLK__, __CKD__, __DT__) \