Skip to content

Commit 2c8a31e

Browse files
committed
clock_control: clock_stm32_ll_mp2: add wwdg1 clock support
WWDG1 clock = ((MCU clock / LSMCU div) /APB3 prescaler) Signed-off-by: Luc BEAUFILS <luc.beaufils@savoirfairelinux.com>
1 parent 55ec92c commit 2c8a31e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/clock_control/clock_stm32_ll_mp2.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ static int stm32_clock_control_get_subsys_rate(const struct device *dev,
7272
case STM32_CLOCK_PERIPH_UART9:
7373
*rate = LL_RCC_GetUARTClockFreq(LL_RCC_UART9_CLKSOURCE);
7474
break;
75+
case STM32_CLOCK_PERIPH_WWDG1:
76+
/* The WWDG1 clock is derived from the APB3 clock */
77+
int wwdg1_clock = 400000000 >> LL_RCC_Get_LSMCUDIVR();
78+
*rate = wwdg1_clock >> LL_RCC_GetAPB3Prescaler();
79+
break;
7580
default:
7681
return -ENOTSUP;
7782
}

0 commit comments

Comments
 (0)