Skip to content

Commit 4b92193

Browse files
authored
Comments: Set PLLM, PLLN and PLLP
I have tested this code with a STM32f767 (at 216Mhz): ```rust let p = pac::Peripherals::take().unwrap(); let rcc = p.RCC.constrain(); let clocks = rcc .cfgr .hse(HSEClock { freq: 25_000_000, mode: HSEClockMode::Bypass, }) .use_pll() .pllm(25) .plln(432) .pllp(PLLP::Div2) .sysclk(216_000_000.hz()) .freeze(); ```
1 parent fd44adb commit 4b92193

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/rcc.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,8 @@ impl CFGR {
639639
return;
640640
}
641641

642+
/* We check if (pllm, plln, pllp) allow to obtain the requested Sysclk,
643+
so that we don't have to calculate them */
642644
let p_ok = (sysclk as u64)
643645
== (base_clk as u64 * self.plln as u64
644646
/ self.pllm as u64

0 commit comments

Comments
 (0)