diff options
| author | Dario Nieuwenhuis <[email protected]> | 2023-11-13 01:56:28 +0100 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2023-11-13 01:59:33 +0100 |
| commit | ace52210802a18a551f506bc3ad163703e3f9efa (patch) | |
| tree | 69cd68e35968cf0a5da5000308e338bdbad3724a /tests | |
| parent | 2376b3bdfa573027c1ee4d66f8fdd6ca422a0fdd (diff) | |
stm32/rcc: unify f2 into f4/f7.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/stm32/src/common.rs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/tests/stm32/src/common.rs b/tests/stm32/src/common.rs index fe694cbef..a44e8230f 100644 --- a/tests/stm32/src/common.rs +++ b/tests/stm32/src/common.rs | |||
| @@ -236,24 +236,25 @@ pub fn config() -> Config { | |||
| 236 | { | 236 | { |
| 237 | use embassy_stm32::rcc::*; | 237 | use embassy_stm32::rcc::*; |
| 238 | // By default, HSE on the board comes from a 8 MHz clock signal (not a crystal) | 238 | // By default, HSE on the board comes from a 8 MHz clock signal (not a crystal) |
| 239 | config.rcc.hse = Some(HSEConfig { | 239 | config.rcc.hse = Some(Hse { |
| 240 | frequency: Hertz(8_000_000), | 240 | freq: Hertz(8_000_000), |
| 241 | source: HSESrc::Bypass, | 241 | mode: HseMode::Bypass, |
| 242 | }); | 242 | }); |
| 243 | // PLL uses HSE as the clock source | 243 | // PLL uses HSE as the clock source |
| 244 | config.rcc.pll_mux = PllSource::HSE; | 244 | config.rcc.pll_src = PllSource::HSE; |
| 245 | config.rcc.pll = Pll { | 245 | config.rcc.pll = Some(Pll { |
| 246 | // 8 MHz clock source / 8 = 1 MHz PLL input | 246 | // 8 MHz clock source / 8 = 1 MHz PLL input |
| 247 | pre_div: unwrap!(PllPreDiv::try_from(8)), | 247 | prediv: unwrap!(PllPreDiv::try_from(8)), |
| 248 | // 1 MHz PLL input * 240 = 240 MHz PLL VCO | 248 | // 1 MHz PLL input * 240 = 240 MHz PLL VCO |
| 249 | mul: unwrap!(PllMul::try_from(240)), | 249 | mul: unwrap!(PllMul::try_from(240)), |
| 250 | // 240 MHz PLL VCO / 2 = 120 MHz main PLL output | 250 | // 240 MHz PLL VCO / 2 = 120 MHz main PLL output |
| 251 | divp: PllPDiv::DIV2, | 251 | divp: Some(PllPDiv::DIV2), |
| 252 | // 240 MHz PLL VCO / 5 = 48 MHz PLL48 output | 252 | // 240 MHz PLL VCO / 5 = 48 MHz PLL48 output |
| 253 | divq: PllQDiv::DIV5, | 253 | divq: Some(PllQDiv::DIV5), |
| 254 | }; | 254 | divr: None, |
| 255 | }); | ||
| 255 | // System clock comes from PLL (= the 120 MHz main PLL output) | 256 | // System clock comes from PLL (= the 120 MHz main PLL output) |
| 256 | config.rcc.mux = ClockSrc::PLL; | 257 | config.rcc.sys = Sysclk::PLL1_P; |
| 257 | // 120 MHz / 4 = 30 MHz APB1 frequency | 258 | // 120 MHz / 4 = 30 MHz APB1 frequency |
| 258 | config.rcc.apb1_pre = APBPrescaler::DIV4; | 259 | config.rcc.apb1_pre = APBPrescaler::DIV4; |
| 259 | // 120 MHz / 2 = 60 MHz APB2 frequency | 260 | // 120 MHz / 2 = 60 MHz APB2 frequency |
