Expand description
Reset and clock control (RCC).
§API shape (all chip families)
| Item | Role |
|---|---|
Config | Family-specific clock setup (presets + optional fields) |
init | Apply Config to hardware and refresh the global cache |
refresh | Read RCC registers and refresh the cache (bootloader / dual-stage init) |
clocks | Cached AHB/APB frequencies for drivers |
HSI_FREQ / LSI_FREQ | Nominal RC oscillator rates |
Hse | External 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§
Modules§
- mco
- Microcontroller clock output (MCO).
Structs§
Enums§
- AHBPrescaler
- AHB prescaler.
- APBPrescaler
- APB Low speed prescaler (APB1).
- HsPll
Prescaler - HsPll
Ref - HsPll
Source - HseMode
- LseMode
- McoSource
- Microcontroller clock output.
- PllMul
- PLL Multiplication Factor.
- PllPre
Div - PREDIV1 division factor.
- PllSource
- PllxMul
- PLL2, PLL3 Multiplication Factor.
- RtcClock
Source - Sysclk
- System clock Switch.
- Usbpre
- USB prescaler.
Constants§
- HSI_
FREQ - Nominal HSI frequency for the selected chip.
- HSI_
FREQUENCY - LSI_
FREQ