STM32L443xx HAL User Manual
|
Defines | |
#define | __LL_TIM_GETFLAG_UIFCPY(__CNT__) (READ_BIT((__CNT__), TIM_CNT_UIFCPY) >> TIM_CNT_UIFCPY_Pos) |
HELPER macro retrieving the UIFCPY flag from the counter value. | |
#define | __LL_TIM_CALC_DEADTIME(__TIMCLK__, __CKD__, __DT__) |
HELPER macro calculating DTG[0:7] in the TIMx_BDTR register to achieve the requested dead time duration. | |
#define | __LL_TIM_CALC_PSC(__TIMCLK__, __CNTCLK__) (((__TIMCLK__) >= (__CNTCLK__)) ? (uint32_t)(((__TIMCLK__)/(__CNTCLK__)) - 1U) : 0U) |
HELPER macro calculating the prescaler value to achieve the required counter clock frequency. | |
#define | __LL_TIM_CALC_ARR(__TIMCLK__, __PSC__, __FREQ__) ((((__TIMCLK__)/((__PSC__) + 1U)) >= (__FREQ__)) ? (((__TIMCLK__)/((__FREQ__) * ((__PSC__) + 1U))) - 1U) : 0U) |
HELPER macro calculating the auto-reload value to achieve the required output signal frequency. | |
#define | __LL_TIM_CALC_DELAY(__TIMCLK__, __PSC__, __DELAY__) |
HELPER macro calculating the compare value required to achieve the required timer output compare active/inactive delay. | |
#define | __LL_TIM_CALC_PULSE(__TIMCLK__, __PSC__, __DELAY__, __PULSE__) |
HELPER macro calculating the auto-reload value to achieve the required pulse duration (when the timer operates in one pulse mode). | |
#define | __LL_TIM_GET_ICPSC_RATIO(__ICPSC__) ((uint32_t)(0x01U << (((__ICPSC__) >> 16U) >> TIM_CCMR1_IC1PSC_Pos))) |
HELPER macro retrieving the ratio of the input capture prescaler. |
#define __LL_TIM_CALC_ARR | ( | __TIMCLK__, | |
__PSC__, | |||
__FREQ__ | |||
) | ((((__TIMCLK__)/((__PSC__) + 1U)) >= (__FREQ__)) ? (((__TIMCLK__)/((__FREQ__) * ((__PSC__) + 1U))) - 1U) : 0U) |
HELPER macro calculating the auto-reload value to achieve the required output signal frequency.
__TIMCLK__ | timer input clock frequency (in Hz) |
__PSC__ | prescaler |
__FREQ__ | output signal frequency (in Hz) |
Auto-reload | value (between Min_Data=0 and Max_Data=65535) |
Definition at line 1419 of file stm32l4xx_ll_tim.h.
#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)
HELPER macro calculating DTG[0:7] in the TIMx_BDTR register to achieve the requested dead time duration.
__TIMCLK__ | timer input clock frequency (in Hz) |
__CKD__ | This parameter can be one of the following values: |
__DT__ | deadtime duration (in ns) |
DTG[0:7] |
Definition at line 1387 of file stm32l4xx_ll_tim.h.
#define __LL_TIM_CALC_DELAY | ( | __TIMCLK__, | |
__PSC__, | |||
__DELAY__ | |||
) |
((uint32_t)(((uint64_t)(__TIMCLK__) * (uint64_t)(__DELAY__)) \ / ((uint64_t)1000000U * (uint64_t)((__PSC__) + 1U))))
HELPER macro calculating the compare value required to achieve the required timer output compare active/inactive delay.
__TIMCLK__ | timer input clock frequency (in Hz) |
__PSC__ | prescaler |
__DELAY__ | timer output compare active/inactive delay (in us) |
Compare | value (between Min_Data=0 and Max_Data=65535) |
Definition at line 1431 of file stm32l4xx_ll_tim.h.
#define __LL_TIM_CALC_PSC | ( | __TIMCLK__, | |
__CNTCLK__ | |||
) | (((__TIMCLK__) >= (__CNTCLK__)) ? (uint32_t)(((__TIMCLK__)/(__CNTCLK__)) - 1U) : 0U) |
HELPER macro calculating the prescaler value to achieve the required counter clock frequency.
__TIMCLK__ | timer input clock frequency (in Hz) |
__CNTCLK__ | counter clock frequency (in Hz) |
Prescaler | value (between Min_Data=0 and Max_Data=65535) |
Definition at line 1408 of file stm32l4xx_ll_tim.h.
#define __LL_TIM_CALC_PULSE | ( | __TIMCLK__, | |
__PSC__, | |||
__DELAY__, | |||
__PULSE__ | |||
) |
((uint32_t)(__LL_TIM_CALC_DELAY((__TIMCLK__), (__PSC__), (__PULSE__)) \ + __LL_TIM_CALC_DELAY((__TIMCLK__), (__PSC__), (__DELAY__))))
HELPER macro calculating the auto-reload value to achieve the required pulse duration (when the timer operates in one pulse mode).
__TIMCLK__ | timer input clock frequency (in Hz) |
__PSC__ | prescaler |
__DELAY__ | timer output compare active/inactive delay (in us) |
__PULSE__ | pulse duration (in us) |
Auto-reload | value (between Min_Data=0 and Max_Data=65535) |
Definition at line 1445 of file stm32l4xx_ll_tim.h.
#define __LL_TIM_GET_ICPSC_RATIO | ( | __ICPSC__ | ) | ((uint32_t)(0x01U << (((__ICPSC__) >> 16U) >> TIM_CCMR1_IC1PSC_Pos))) |
HELPER macro retrieving the ratio of the input capture prescaler.
__ICPSC__ | This parameter can be one of the following values: |
Input | capture prescaler ratio (1, 2, 4 or 8) |
Definition at line 1459 of file stm32l4xx_ll_tim.h.
#define __LL_TIM_GETFLAG_UIFCPY | ( | __CNT__ | ) | (READ_BIT((__CNT__), TIM_CNT_UIFCPY) >> TIM_CNT_UIFCPY_Pos) |
HELPER macro retrieving the UIFCPY flag from the counter value.
__CNT__ | Counter value |
UIF | status bit |
Definition at line 1373 of file stm32l4xx_ll_tim.h.