stm32/rcc: remove builders on Config.

This makes API consistent with other Config structs in Embassy, where
the convention is to not use builders.
This commit is contained in:
Dario Nieuwenhuis
2022-01-04 11:18:59 +01:00
parent f744b74e90
commit cdc66e110f
12 changed files with 42 additions and 236 deletions

View File

@ -25,7 +25,7 @@ use lorawan_encoding::default_crypto::DefaultFactory as Crypto;
fn config() -> embassy_stm32::Config {
let mut config = embassy_stm32::Config::default();
config.rcc = config.rcc.clock_src(embassy_stm32::rcc::ClockSrc::HSI16);
config.rcc.mux = embassy_stm32::rcc::ClockSrc::HSI16;
config
}

View File

@ -14,13 +14,13 @@ use example_common::*;
fn config() -> Config {
let mut config = Config::default();
config.rcc = config.rcc.clock_src(ClockSrc::PLL(
config.rcc.mux = ClockSrc::PLL(
PLLSource::HSI16,
PLLClkDiv::Div2,
PLLSrcDiv::Div1,
PLLMul::Mul8,
Some(PLLClkDiv::Div2),
));
);
config
}

View File

@ -23,7 +23,7 @@ use lorawan_encoding::default_crypto::DefaultFactory as Crypto;
fn config() -> embassy_stm32::Config {
let mut config = embassy_stm32::Config::default();
config.rcc = config.rcc.clock_src(embassy_stm32::rcc::ClockSrc::HSI16);
config.rcc.mux = embassy_stm32::rcc::ClockSrc::HSI16;
config
}

View File

@ -66,7 +66,7 @@ const TX_PARAMS: TxParams = TxParams::new()
fn config() -> embassy_stm32::Config {
let mut config = embassy_stm32::Config::default();
config.rcc = config.rcc.clock_src(embassy_stm32::rcc::ClockSrc::HSE32);
config.rcc.mux = embassy_stm32::rcc::ClockSrc::HSE32;
config
}