pub struct Config {
pub hsi: bool,
pub hse: Option<Hse>,
pub pll1: Option<Pll>,
pub sys: Sysclk,
pub ahb_pre: AHBPrescaler,
pub ahb5_pre: AHB5Prescaler,
pub apb1_pre: APBPrescaler,
pub apb2_pre: APBPrescaler,
pub apb7_pre: APBPrescaler,
pub ls: LsConfig,
pub voltage_scale: VoltageScale,
pub mux: ClockMux,
}Expand description
Clocks configuration
Fields§
§hsi: bool§hse: Option<Hse>§pll1: Option<Pll>§sys: Sysclk§ahb_pre: AHBPrescaler§ahb5_pre: AHB5Prescaler§apb1_pre: APBPrescaler§apb2_pre: APBPrescaler§apb7_pre: APBPrescaler§ls: LsConfig§voltage_scale: VoltageScale§mux: ClockMuxPer-peripheral kernel clock selection muxes
Implementations§
Source§impl Config
impl Config
pub const fn new() -> Self
Sourcepub const fn new_wpan_lsi() -> Self
pub const fn new_wpan_lsi() -> Self
BLE radio config for boards without an LSE crystal.
Identical to new_wpan except the 32 kHz sleep-timer clock comes from
LSI1 (internal RC) instead of LSE. LSI is less accurate (~1-2% vs <20 ppm for LSE), which
increases BLE sleep-clock tolerance and slightly degrades power consumption in deep sleep.
RADIOSTSEL is set to Lsi (hardware bit value 0x02).
Sourcepub const fn new_wpan_hse() -> Self
pub const fn new_wpan_hse() -> Self
BLE radio config for boards that have HSE but no LSE crystal.
Identical to new_wpan except the BLE radio sleep timer
is sourced from HSE / 1000 (≈32 kHz) instead of LSE, and the RTC peripheral
falls back to LSI (since no LSE is available).
Prefer this over new_wpan_lsi when HSE is available:
the HSE crystal is much more accurate than LSI (~50 ppm vs ~1–2 %), which
keeps BLE sleep-clock tolerance tight and reduces wake-up margin overhead.
RADIOSTSEL is set to Hse (hardware bit value 0x03).