feat(stm32-f247): provide a const constructor on rcc::Config
This commit is contained in:
parent
4e6df17047
commit
3fcfec7b94
@ -108,8 +108,8 @@ pub struct Config {
|
|||||||
pub voltage: VoltageScale,
|
pub voltage: VoltageScale,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for Config {
|
impl Config {
|
||||||
fn default() -> Self {
|
pub const fn new() -> Self {
|
||||||
Self {
|
Self {
|
||||||
hsi: true,
|
hsi: true,
|
||||||
hse: None,
|
hse: None,
|
||||||
@ -127,15 +127,21 @@ impl Default for Config {
|
|||||||
apb1_pre: APBPrescaler::DIV1,
|
apb1_pre: APBPrescaler::DIV1,
|
||||||
apb2_pre: APBPrescaler::DIV1,
|
apb2_pre: APBPrescaler::DIV1,
|
||||||
|
|
||||||
ls: Default::default(),
|
ls: crate::rcc::LsConfig::new(),
|
||||||
|
|
||||||
#[cfg(stm32f2)]
|
#[cfg(stm32f2)]
|
||||||
voltage: VoltageScale::Range3,
|
voltage: VoltageScale::Range3,
|
||||||
mux: Default::default(),
|
mux: super::mux::ClockMux::default(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Default for Config {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self::new()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub(crate) unsafe fn init(config: Config) {
|
pub(crate) unsafe fn init(config: Config) {
|
||||||
// set VOS to SCALE1, if use PLL
|
// set VOS to SCALE1, if use PLL
|
||||||
// TODO: check real clock speed before set VOS
|
// TODO: check real clock speed before set VOS
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user