diff options
| author | Dario Nieuwenhuis <[email protected]> | 2023-11-13 00:46:43 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-11-13 00:46:43 +0000 |
| commit | f00e97a5f14b25d261eafba7cbc63b035c938996 (patch) | |
| tree | 5930d02cad012665af217acd78464d52b9b48678 /tests | |
| parent | 39c737162185adb4f30f18f700da08a55be6b55a (diff) | |
| parent | 066dc297ed4508c334effafcc134296cb776eb06 (diff) | |
Merge pull request #2177 from embassy-rs/rcc-no-spaghetti
stm32/rcc: unify l0l1 and l4l5.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/stm32/src/common.rs | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/tests/stm32/src/common.rs b/tests/stm32/src/common.rs index 3668e18ce..e7367d5ed 100644 --- a/tests/stm32/src/common.rs +++ b/tests/stm32/src/common.rs | |||
| @@ -241,16 +241,16 @@ pub fn config() -> Config { | |||
| 241 | source: HSESrc::Bypass, | 241 | source: HSESrc::Bypass, |
| 242 | }); | 242 | }); |
| 243 | // PLL uses HSE as the clock source | 243 | // PLL uses HSE as the clock source |
| 244 | config.rcc.pll_mux = PLLSrc::HSE; | 244 | config.rcc.pll_mux = PllSource::HSE; |
| 245 | config.rcc.pll = PLLConfig { | 245 | config.rcc.pll = 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 | pre_div: 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 | p_div: PLLPDiv::DIV2, | 251 | divp: PllPDiv::DIV2, |
| 252 | // 240 MHz PLL VCO / 5 = 48 MHz PLL48 output | 252 | // 240 MHz PLL VCO / 5 = 48 MHz PLL48 output |
| 253 | q_div: PLLQDiv::DIV5, | 253 | divq: PllQDiv::DIV5, |
| 254 | }; | 254 | }; |
| 255 | // System clock comes from PLL (= the 120 MHz main PLL output) | 255 | // System clock comes from PLL (= the 120 MHz main PLL output) |
| 256 | config.rcc.mux = ClockSrc::PLL; | 256 | config.rcc.mux = ClockSrc::PLL; |
| @@ -397,7 +397,7 @@ pub fn config() -> Config { | |||
| 397 | config.rcc.mux = ClockSrc::PLL1_R; | 397 | config.rcc.mux = ClockSrc::PLL1_R; |
| 398 | config.rcc.hsi = true; | 398 | config.rcc.hsi = true; |
| 399 | config.rcc.pll = Some(Pll { | 399 | config.rcc.pll = Some(Pll { |
| 400 | source: PLLSource::HSI, | 400 | source: PllSource::HSI, |
| 401 | prediv: PllPreDiv::DIV1, | 401 | prediv: PllPreDiv::DIV1, |
| 402 | mul: PllMul::MUL18, | 402 | mul: PllMul::MUL18, |
| 403 | divp: None, | 403 | divp: None, |
| @@ -416,7 +416,7 @@ pub fn config() -> Config { | |||
| 416 | }); | 416 | }); |
| 417 | config.rcc.mux = ClockSrc::PLL1_R; | 417 | config.rcc.mux = ClockSrc::PLL1_R; |
| 418 | config.rcc.pll = Some(Pll { | 418 | config.rcc.pll = Some(Pll { |
| 419 | source: PLLSource::HSE, | 419 | source: PllSource::HSE, |
| 420 | prediv: PllPreDiv::DIV2, | 420 | prediv: PllPreDiv::DIV2, |
| 421 | mul: PllMul::MUL6, | 421 | mul: PllMul::MUL6, |
| 422 | divp: None, | 422 | divp: None, |
| @@ -432,7 +432,7 @@ pub fn config() -> Config { | |||
| 432 | config.rcc.mux = ClockSrc::PLL1_R; | 432 | config.rcc.mux = ClockSrc::PLL1_R; |
| 433 | config.rcc.pll = Some(Pll { | 433 | config.rcc.pll = Some(Pll { |
| 434 | // 110Mhz clock (16 / 4 * 55 / 2) | 434 | // 110Mhz clock (16 / 4 * 55 / 2) |
| 435 | source: PLLSource::HSI, | 435 | source: PllSource::HSI, |
| 436 | prediv: PllPreDiv::DIV4, | 436 | prediv: PllPreDiv::DIV4, |
| 437 | mul: PllMul::MUL55, | 437 | mul: PllMul::MUL55, |
| 438 | divp: None, | 438 | divp: None, |
| @@ -462,11 +462,11 @@ pub fn config() -> Config { | |||
| 462 | use embassy_stm32::rcc::*; | 462 | use embassy_stm32::rcc::*; |
| 463 | config.rcc.hsi = true; | 463 | config.rcc.hsi = true; |
| 464 | config.rcc.pll = Some(Pll { | 464 | config.rcc.pll = Some(Pll { |
| 465 | source: PLLSource::HSI, | 465 | source: PllSource::HSI, |
| 466 | mul: PLLMul::MUL4, | 466 | mul: PllMul::MUL4, |
| 467 | div: PLLDiv::DIV2, // 32Mhz clock (16 * 4 / 2) | 467 | div: PllDiv::DIV2, // 32Mhz clock (16 * 4 / 2) |
| 468 | }); | 468 | }); |
| 469 | config.rcc.mux = ClockSrc::PLL1_P; | 469 | config.rcc.mux = ClockSrc::PLL1_R; |
| 470 | } | 470 | } |
| 471 | 471 | ||
| 472 | #[cfg(any(feature = "stm32l152re"))] | 472 | #[cfg(any(feature = "stm32l152re"))] |
| @@ -474,11 +474,11 @@ pub fn config() -> Config { | |||
| 474 | use embassy_stm32::rcc::*; | 474 | use embassy_stm32::rcc::*; |
| 475 | config.rcc.hsi = true; | 475 | config.rcc.hsi = true; |
| 476 | config.rcc.pll = Some(Pll { | 476 | config.rcc.pll = Some(Pll { |
| 477 | source: PLLSource::HSI, | 477 | source: PllSource::HSI, |
| 478 | mul: PLLMul::MUL4, | 478 | mul: PllMul::MUL4, |
| 479 | div: PLLDiv::DIV2, // 32Mhz clock (16 * 4 / 2) | 479 | div: PllDiv::DIV2, // 32Mhz clock (16 * 4 / 2) |
| 480 | }); | 480 | }); |
| 481 | config.rcc.mux = ClockSrc::PLL1_P; | 481 | config.rcc.mux = ClockSrc::PLL1_R; |
| 482 | } | 482 | } |
| 483 | 483 | ||
| 484 | config | 484 | config |
