Skip to main content

Module rcc

Module rcc 

Source
Expand description

Reset and clock control (RCC).

§API shape (all chip families)

ItemRole
ConfigFamily-specific clock setup (presets + optional fields)
initApply Config to hardware and refresh the global cache
refreshRead RCC registers and refresh the cache (bootloader / dual-stage init)
clocksCached AHB/APB frequencies for drivers
HSI_FREQ / LSI_FREQNominal RC oscillator rates
HseExternal clock description when HSE is used

On CH32H4, clocks additionally reports the V3F/V5F core frequencies ([Clocks::v3f], [Clocks::v5f]); there is no separate core_clocks().

Pass the board HSE crystal frequency to refresh whenever SYSCLK can be sourced from HSE or PLL fed by HSE (same requirement as HSE_VALUE in the WCH C SDK).

Re-exports§

pub use mco::Mco;
pub use mco::McoPin;

Modules§

mco
Microcontroller clock output (MCO).

Structs§

Clocks
Config
Hse
External high-speed clock (HSE).
LsConfig
LseConfig

Enums§

HseMode
LseMode
McoSource
RtcClockSource

Constants§

HSI_FREQ
Nominal HSI frequency for the selected chip.
HSI_FREQUENCY
LSI_FREQ
LSI_FREQUENCY

Functions§

clocks
init⚠
refresh⚠
Re-measure RCC and update clocks (on H4 that includes v3f / v5f).