stm32/powerctrlboot: Allow PLL1 Q and R outputs to be enabled on H5.

If a board needs these outputs then it can define MICROPY_HW_CLK_PLLQ/R.

It saves power to not enable them if they are not needed.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George 2023-09-14 11:33:41 +10:00
parent fa68523968
commit a3862e7267
1 changed files with 10 additions and 2 deletions

View File

@ -218,13 +218,21 @@ void SystemClock_Config(void) {
// Configure PLL1 for use as system clock.
LL_RCC_PLL1_ConfigDomain_SYS(pll1_source, MICROPY_HW_CLK_PLLM, MICROPY_HW_CLK_PLLN, MICROPY_HW_CLK_PLLP);
LL_RCC_PLL1_SetQ(MICROPY_HW_CLK_PLLQ);
LL_RCC_PLL1_SetR(MICROPY_HW_CLK_PLLR);
LL_RCC_PLL1_SetFRACN(MICROPY_HW_CLK_PLLFRAC);
LL_RCC_PLL1_SetVCOInputRange(MICROPY_HW_CLK_PLLVCI_LL);
LL_RCC_PLL1_SetVCOOutputRange(MICROPY_HW_CLK_PLLVCO_LL);
LL_RCC_PLL1P_Enable();
#if defined(MICROPY_HW_CLK_PLLQ)
LL_RCC_PLL1_SetQ(MICROPY_HW_CLK_PLLQ);
LL_RCC_PLL1Q_Enable();
#endif
#if defined(MICROPY_HW_CLK_PLLR)
LL_RCC_PLL1_SetR(MICROPY_HW_CLK_PLLR);
LL_RCC_PLL1R_Enable();
#endif
// Enable PLL1.
LL_RCC_PLL1_Enable();
while (!LL_RCC_PLL1_IsReady()) {