@@ -1273,16 +1273,25 @@ static const uint32_t REG_MASK_TAB_CPT[] =
12731273
12741274/** @defgroup HRTIM_LL_EC_DT_PRESCALER DEADTIME PRESCALER
12751275 * @{
1276- * @brief Constants defining division ratio between the timer clock frequency (fHRTIM) and the deadtime generator clock (fDTG).
1277- */
1278- #define LL_HRTIM_DT_PRESCALER_DIV8 0x00000000U /*!< fDTG = fHRTIM / 8 */
1279- #define LL_HRTIM_DT_PRESCALER_DIV4 (HRTIM_DTR_DTPRSC_0) /*!< fDTG = fHRTIM / 4 */
1280- #define LL_HRTIM_DT_PRESCALER_DIV2 (HRTIM_DTR_DTPRSC_1) /*!< fDTG = fHRTIM / 2 */
1281- #define LL_HRTIM_DT_PRESCALER_DIV1 (HRTIM_DTR_DTPRSC_1 | HRTIM_DTR_DTPRSC_0) /*!< fDTG = fHRTIM */
1282- #define LL_HRTIM_DT_PRESCALER_MUL2 (HRTIM_DTR_DTPRSC_2) /*!< fDTG = fHRTIM * 2 */
1283- #define LL_HRTIM_DT_PRESCALER_MUL4 (HRTIM_DTR_DTPRSC_2 | HRTIM_DTR_DTPRSC_0) /*!< fDTG = fHRTIM * 4 */
1284- #define LL_HRTIM_DT_PRESCALER_MUL8 (HRTIM_DTR_DTPRSC_2 | HRTIM_DTR_DTPRSC_1) /*!< fDTG = fHRTIM * 8 */
1285- #define LL_HRTIM_DT_PRESCALER_MUL16 (HRTIM_DTR_DTPRSC_2 | HRTIM_DTR_DTPRSC_1 | HRTIM_DTR_DTPRSC_0) /*!< fDTG = fHRTIM * 16 */
1276+ * @brief Constants defining the prescaler value for the deadtime generator time step (tDTG) relative to the
1277+ * HR-Timer clock period (tHRTIM).
1278+ * @note A customer reported that the HRTIM deadtime prescaler defines in
1279+ * stm32g4xx_ll_hrtim.h were swapped between the multiplication (MUL) and
1280+ * division (DIV) settings (for example, MUL8 and DIV8 values were reversed).
1281+ * The legacy naming is intentionally kept for backward compatibility, even
1282+ * though it does not strictly match the reference manual. Renaming these
1283+ * constants would introduce a breaking API change, which may lead to
1284+ * incorrect deadtime programming and potential safety issues due to deadtime
1285+ * violations in existing applications.
1286+ */
1287+ #define LL_HRTIM_DT_PRESCALER_MUL8 0x00000000U /*!< tDTG = tHRTIM / 8 */
1288+ #define LL_HRTIM_DT_PRESCALER_MUL4 (HRTIM_DTR_DTPRSC_0) /*!< tDTG = tHRTIM / 4 */
1289+ #define LL_HRTIM_DT_PRESCALER_MUL2 (HRTIM_DTR_DTPRSC_1) /*!< tDTG = tHRTIM / 2 */
1290+ #define LL_HRTIM_DT_PRESCALER_DIV1 (HRTIM_DTR_DTPRSC_1 | HRTIM_DTR_DTPRSC_0) /*!< tDTG = tHRTIM */
1291+ #define LL_HRTIM_DT_PRESCALER_DIV2 (HRTIM_DTR_DTPRSC_2) /*!< tDTG = tHRTIM * 2 */
1292+ #define LL_HRTIM_DT_PRESCALER_DIV4 (HRTIM_DTR_DTPRSC_2 | HRTIM_DTR_DTPRSC_0) /*!< tDTG = tHRTIM * 4 */
1293+ #define LL_HRTIM_DT_PRESCALER_DIV8 (HRTIM_DTR_DTPRSC_2 | HRTIM_DTR_DTPRSC_1) /*!< tDTG = tHRTIM * 8 */
1294+ #define LL_HRTIM_DT_PRESCALER_DIV16 (HRTIM_DTR_DTPRSC_2 | HRTIM_DTR_DTPRSC_1 | HRTIM_DTR_DTPRSC_0) /*!< tDTG = tHRTIM * 16 */
12861295/**
12871296 * @}
12881297 */
@@ -2836,7 +2845,8 @@ __STATIC_INLINE uint32_t LL_HRTIM_IsDisabledOutput(const HRTIM_TypeDef *HRTIMx,
28362845 * @arg @ref LL_HRTIM_ADCTRIG_SRC6810_TIMF_PER
28372846 * @retval None
28382847 */
2839- __STATIC_INLINE void LL_HRTIM_ConfigADCTrig(const HRTIM_TypeDef *HRTIMx, uint32_t ADCTrig, uint32_t Update, uint32_t Src)
2848+ __STATIC_INLINE void LL_HRTIM_ConfigADCTrig(const HRTIM_TypeDef *HRTIMx, uint32_t ADCTrig, uint32_t Update,
2849+ uint32_t Src)
28402850{
28412851 __IO uint32_t *padcur = (__IO uint32_t *)((uint32_t)((uint32_t)(&HRTIMx->sCommonRegs.CR1) +
28422852 REG_OFFSET_TAB_ADCUR[ADCTrig]));
@@ -6133,7 +6143,8 @@ __STATIC_INLINE uint32_t LL_HRTIM_TIM_GetIdlePushPullStatus(const HRTIM_TypeDef
61336143
61346144 * @retval None
61356145 */
6136- __STATIC_INLINE void LL_HRTIM_TIM_SetEventFilter(const HRTIM_TypeDef *HRTIMx, uint32_t Timer, uint32_t Event, uint32_t Filter)
6146+ __STATIC_INLINE void LL_HRTIM_TIM_SetEventFilter(const HRTIM_TypeDef *HRTIMx, uint32_t Timer, uint32_t Event,
6147+ uint32_t Filter)
61376148{
61386149 uint32_t iTimer = (uint8_t)(POSITION_VAL(Timer) - POSITION_VAL(LL_HRTIM_TIMER_A));
61396150 uint32_t iEvent = (uint8_t)(POSITION_VAL(Event) - POSITION_VAL(LL_HRTIM_EVENT_1));
@@ -6984,7 +6995,8 @@ __STATIC_INLINE uint32_t LL_HRTIM_TIM_IsEnabledDualDacTrigger(const HRTIM_TypeDe
69846995 * @param Threshold This parameter can be a number between Min_Data=0 and Max_Data=63
69856996 * @retval None
69866997 */
6987- __STATIC_INLINE void LL_HRTIM_TIM_SetEventCounterThreshold(const HRTIM_TypeDef *HRTIMx, uint32_t Timer, uint32_t EventCounter,
6998+ __STATIC_INLINE void LL_HRTIM_TIM_SetEventCounterThreshold(const HRTIM_TypeDef *HRTIMx, uint32_t Timer,
6999+ uint32_t EventCounter,
69887000 uint32_t Threshold)
69897001{
69907002 uint32_t iTimer = (uint8_t)(POSITION_VAL(Timer) - POSITION_VAL(LL_HRTIM_TIMER_A));
@@ -7050,7 +7062,8 @@ __STATIC_INLINE uint32_t LL_HRTIM_TIM_GetEventCounterThreshold(const HRTIM_TypeD
70507062 * @arg @ref LL_HRTIM_EVENT_10
70517063 * @retval None
70527064 */
7053- __STATIC_INLINE void LL_HRTIM_TIM_SetEventCounterSource(const HRTIM_TypeDef *HRTIMx, uint32_t Timer, uint32_t EventCounter,
7065+ __STATIC_INLINE void LL_HRTIM_TIM_SetEventCounterSource(const HRTIM_TypeDef *HRTIMx, uint32_t Timer,
7066+ uint32_t EventCounter,
70547067 uint32_t Event)
70557068{
70567069 uint32_t iTimer = (uint8_t)(POSITION_VAL(Timer) - POSITION_VAL(LL_HRTIM_TIMER_A));
@@ -7123,7 +7136,8 @@ __STATIC_INLINE uint32_t LL_HRTIM_TIM_GetEventCounterSource(const HRTIM_TypeDef
71237136 * @arg @ref LL_HRTIM_EE_COUNTER_RSTMODE_CONDITIONAL
71247137 * @retval None
71257138 */
7126- __STATIC_INLINE void LL_HRTIM_TIM_SetEventCounterResetMode(const HRTIM_TypeDef *HRTIMx, uint32_t Timer, uint32_t EventCounter,
7139+ __STATIC_INLINE void LL_HRTIM_TIM_SetEventCounterResetMode(const HRTIM_TypeDef *HRTIMx, uint32_t Timer,
7140+ uint32_t EventCounter,
71277141 uint32_t Mode)
71287142{
71297143 uint32_t iTimer = (uint8_t)(POSITION_VAL(Timer) - POSITION_VAL(LL_HRTIM_TIMER_A));
@@ -7227,7 +7241,8 @@ __STATIC_INLINE void LL_HRTIM_TIM_EnableEventCounter(const HRTIM_TypeDef *HRTIMx
72277241 * @arg @ref LL_HRTIM_EE_COUNTER_B
72287242 * @retval None
72297243 */
7230- __STATIC_INLINE void LL_HRTIM_TIM_DisableEventCounter(const HRTIM_TypeDef *HRTIMx, uint32_t Timer, uint32_t EventCounter)
7244+ __STATIC_INLINE void LL_HRTIM_TIM_DisableEventCounter(const HRTIM_TypeDef *HRTIMx, uint32_t Timer,
7245+ uint32_t EventCounter)
72317246{
72327247 uint32_t iTimer = (uint8_t)(POSITION_VAL(Timer) - POSITION_VAL(LL_HRTIM_TIMER_A));
72337248 __IO uint32_t *pReg = (__IO uint32_t *)((uint32_t)((uint32_t)(&HRTIMx->sTimerxRegs[iTimer].EEFxR3)));
@@ -7312,14 +7327,14 @@ __STATIC_INLINE void LL_HRTIM_DT_Config(const HRTIM_TypeDef *HRTIMx, uint32_t Ti
73127327 * @arg @ref LL_HRTIM_TIMER_E
73137328 * @arg @ref LL_HRTIM_TIMER_F
73147329 * @param Prescaler This parameter can be one of the following values:
7315- * @arg @ref LL_HRTIM_DT_PRESCALER_DIV8
7316- * @arg @ref LL_HRTIM_DT_PRESCALER_DIV4
7317- * @arg @ref LL_HRTIM_DT_PRESCALER_DIV2
7318- * @arg @ref LL_HRTIM_DT_PRESCALER_DIV1
7319- * @arg @ref LL_HRTIM_DT_PRESCALER_MUL2
7320- * @arg @ref LL_HRTIM_DT_PRESCALER_MUL4
73217330 * @arg @ref LL_HRTIM_DT_PRESCALER_MUL8
7322- * @arg @ref LL_HRTIM_DT_PRESCALER_MUL16
7331+ * @arg @ref LL_HRTIM_DT_PRESCALER_MUL4
7332+ * @arg @ref LL_HRTIM_DT_PRESCALER_MUL2
7333+ * @arg @ref LL_HRTIM_DT_PRESCALER_DIV1
7334+ * @arg @ref LL_HRTIM_DT_PRESCALER_DIV2
7335+ * @arg @ref LL_HRTIM_DT_PRESCALER_DIV4
7336+ * @arg @ref LL_HRTIM_DT_PRESCALER_DIV8
7337+ * @arg @ref LL_HRTIM_DT_PRESCALER_DIV16
73237338 * @retval None
73247339 */
73257340__STATIC_INLINE void LL_HRTIM_DT_SetPrescaler(const HRTIM_TypeDef *HRTIMx, uint32_t Timer, uint32_t Prescaler)
@@ -7342,14 +7357,14 @@ __STATIC_INLINE void LL_HRTIM_DT_SetPrescaler(const HRTIM_TypeDef *HRTIMx, uint3
73427357 * @arg @ref LL_HRTIM_TIMER_E
73437358 * @arg @ref LL_HRTIM_TIMER_F
73447359 * @retval Prescaler This parameter can be one of the following values:
7345- * @arg @ref LL_HRTIM_DT_PRESCALER_DIV8
7346- * @arg @ref LL_HRTIM_DT_PRESCALER_DIV4
7347- * @arg @ref LL_HRTIM_DT_PRESCALER_DIV2
7348- * @arg @ref LL_HRTIM_DT_PRESCALER_DIV1
7349- * @arg @ref LL_HRTIM_DT_PRESCALER_MUL2
7350- * @arg @ref LL_HRTIM_DT_PRESCALER_MUL4
73517360 * @arg @ref LL_HRTIM_DT_PRESCALER_MUL8
7352- * @arg @ref LL_HRTIM_DT_PRESCALER_MUL16
7361+ * @arg @ref LL_HRTIM_DT_PRESCALER_MUL4
7362+ * @arg @ref LL_HRTIM_DT_PRESCALER_MUL2
7363+ * @arg @ref LL_HRTIM_DT_PRESCALER_DIV1
7364+ * @arg @ref LL_HRTIM_DT_PRESCALER_DIV2
7365+ * @arg @ref LL_HRTIM_DT_PRESCALER_DIV4
7366+ * @arg @ref LL_HRTIM_DT_PRESCALER_DIV8
7367+ * @arg @ref LL_HRTIM_DT_PRESCALER_DIV16
73537368 */
73547369__STATIC_INLINE uint32_t LL_HRTIM_DT_GetPrescaler(const HRTIM_TypeDef *HRTIMx, uint32_t Timer)
73557370{
@@ -10095,7 +10110,7 @@ __STATIC_INLINE uint32_t LL_HRTIM_FLT_IsEnabledBlanking(const HRTIM_TypeDef *HRT
1009510110{
1009610111 uint32_t iFault = (uint8_t)POSITION_VAL(Fault);
1009710112 const __IO uint32_t *pReg = (__IO uint32_t *)((uint32_t)((uint32_t)(&HRTIMx->sCommonRegs.FLTINR3) +
10098- REG_OFFSET_TAB_FLTINR[iFault]));
10113+ REG_OFFSET_TAB_FLTINR[iFault]));
1009910114 uint32_t temp; /* MISRAC-2012 compliance */
1010010115 temp = READ_BIT(*pReg, (uint32_t)(HRTIM_FLTINR3_FLT1BLKE) << REG_SHIFT_TAB_FLTxE[iFault]) >> REG_SHIFT_TAB_FLTxE[iFault];
1010110116
0 commit comments