Skip to content

Commit df4ed5e

Browse files
lucbeaufilskartben
authored andcommitted
clock_control: clock_stm32_ll_mp2: add wwdg1 clock support
WWDG1 clock = ((MCU clock / LSMCU div) /APB3 prescaler) Signed-off-by: Luc BEAUFILS <[email protected]>
1 parent dd86d70 commit df4ed5e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/clock_control/clock_stm32_ll_mp2.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ static int stm32_clock_control_get_subsys_rate(const struct device *dev,
105105
case STM32_CLOCK_PERIPH_SPI7:
106106
*rate = LL_RCC_GetSPIClockFreq(LL_RCC_SPI67_CLKSOURCE);
107107
break;
108+
case STM32_CLOCK_PERIPH_WWDG1:
109+
/* The WWDG1 clock is derived from the APB3 clock */
110+
*rate = SystemCoreClock >> (LL_RCC_Get_LSMCUDIVR() + LL_RCC_GetAPB3Prescaler());
111+
break;
108112
default:
109113
return -ENOTSUP;
110114
}

0 commit comments

Comments
 (0)