stm32/rcc: unify L4 and L5.

This commit is contained in:
Dario Nieuwenhuis
2023-10-16 03:47:54 +02:00
parent 870dcc5970
commit 18e96898ea
9 changed files with 97 additions and 346 deletions

View File

@ -45,8 +45,17 @@ async fn net_task(stack: &'static Stack<Device<'static, MTU>>) -> ! {
#[embassy_executor::main]
async fn main(spawner: Spawner) {
let mut config = Config::default();
config.rcc.mux = ClockSrc::PLL(PLLSource::HSI16, PllRDiv::DIV2, PllPreDiv::DIV1, PllMul::MUL10, None);
config.rcc.hsi48 = true;
config.rcc.hsi16 = true;
config.rcc.mux = ClockSrc::PLL;
config.rcc.pll = Some(Pll {
// 80Mhz clock (16 / 1 * 10 / 2)
source: PLLSource::HSI16,
prediv: PllPreDiv::DIV1,
mul: PllMul::MUL10,
divp: None,
divq: None,
divr: Some(PllRDiv::DIV2),
});
let p = embassy_stm32::init(config);
// Create the driver, from the HAL.