CMU - Clock Management Unit


Clock management unit (CMU) Peripheral API.

This module contains functions for the CMU peripheral of Silicon Labs 32-bit MCUs and SoCs. The CMU module controls oscillators, clocks gates, clock multiplexers, pre-scalers, calibration modules and wait-states.

Data Structures

struct CMU_LFXOInit_TypeDef
LFXO initialization structure.
struct CMU_HFXOInit_TypeDef
HFXO initialization structure.


Get the AUXHFRCO band in use.
void CMU_AUXHFRCOBandSet ( CMU_AUXHFRCOBand_TypeDef band)
Set the AUXHFRCO band and the tuning value based on the value in the calibration table made during production.
uint32_t CMU_Calibrate (uint32_t HFCycles, CMU_Osc_TypeDef reference)
Calibrate the clock.
void CMU_CalibrateConfig (uint32_t downCycles, CMU_Osc_TypeDef downSel, CMU_Osc_TypeDef upSel)
Configure the clock calibration.
uint32_t CMU_CalibrateCountGet (void)
Get the calibration count register.
void CMU_ClockEnable ( CMU_Clock_TypeDef clock, bool enable)
Enable/disable a clock.
CMU_ClkDiv_TypeDef CMU_ClockDivGet ( CMU_Clock_TypeDef clock)
Get the clock divisor/prescaler.
void CMU_ClockDivSet ( CMU_Clock_TypeDef clock, CMU_ClkDiv_TypeDef div)
Set the clock divisor/prescaler.
uint32_t CMU_ClockFreqGet ( CMU_Clock_TypeDef clock)
Get the clock frequency for a clock point.
void CMU_ClockSelectSet ( CMU_Clock_TypeDef clock, CMU_Select_TypeDef ref)
Select the reference clock/oscillator used for a clock branch.
CMU_Select_TypeDef CMU_ClockSelectGet ( CMU_Clock_TypeDef clock)
Get the currently selected reference clock used for a clock branch.
uint16_t CMU_LF_ClockPrecisionGet ( CMU_Clock_TypeDef clock)
Gets the precision (in PPM) of the specified low frequency clock branch.
void CMU_FreezeEnable (bool enable)
CMU low frequency register synchronization freeze control.
CMU_HFRCOBand_TypeDef CMU_HFRCOBandGet (void)
Get HFRCO band in use.
void CMU_HFRCOBandSet ( CMU_HFRCOBand_TypeDef band)
Set HFRCO band and the tuning value based on the value in the calibration table made during production.
uint32_t CMU_HFRCOStartupDelayGet (void)
Get the HFRCO startup delay.
void CMU_HFRCOStartupDelaySet (uint32_t delay)
Set the HFRCO startup delay.
void CMU_HFXOInit (const CMU_HFXOInit_TypeDef *hfxoInit)
Set HFXO control registers.
uint32_t CMU_LCDClkFDIVGet (void)
Get the LCD framerate divisor (FDIV) setting.
void CMU_LCDClkFDIVSet (uint32_t div)
Set the LCD framerate divisor (FDIV) setting.
void CMU_LFXOInit (const CMU_LFXOInit_TypeDef *lfxoInit)
Set LFXO control registers.
void CMU_LFXOPrecisionSet (uint16_t precision)
Sets LFXO's crystal precision, in PPM.
void CMU_OscillatorEnable ( CMU_Osc_TypeDef osc, bool enable, bool wait)
Enable/disable oscillator.
uint32_t CMU_OscillatorTuningGet ( CMU_Osc_TypeDef osc)
Get the oscillator frequency tuning setting.
void CMU_OscillatorTuningSet ( CMU_Osc_TypeDef osc, uint32_t val)
Set the oscillator frequency tuning control.
void CMU_PCNTClockExternalSet (unsigned int instance, bool external)
Select the PCNTn clock.
bool CMU_PCNTClockExternalGet (unsigned int instance)
Determine if the currently selected PCNTn clock used is external or LFBCLK.
void CMU_UpdateWaitStates (uint32_t freq, int vscale)
Configure various wait states to switch to a certain frequency and a certain voltage scale.
void CMU_CalibrateCont (bool enable)
Configure continuous calibration mode.
void CMU_CalibrateStart (void)
Start calibration.
void CMU_CalibrateStop (void)
Stop the calibration counters.
uint32_t CMU_DivToLog2 ( CMU_ClkDiv_TypeDef div)
Convert dividend to logarithmic value.
void CMU_IntClear (uint32_t flags)
Clear one or more pending CMU interrupts.
void CMU_IntDisable (uint32_t flags)
Disable one or more CMU interrupts.
void CMU_IntEnable (uint32_t flags)
Enable one or more CMU interrupts.
uint32_t CMU_IntGet (void)
Get pending CMU interrupts.
uint32_t CMU_IntGetEnabled (void)
Get enabled and pending CMU interrupt flags.
void CMU_IntSet (uint32_t flags)
Set one or more pending CMU interrupts.
void CMU_Lock (void)
Lock the CMU to protect some of its registers against unintended modification.
uint32_t CMU_Log2ToDiv (uint32_t log2)
Convert logarithm of 2 prescaler to division factor.
void CMU_Unlock (void)
Unlock the CMU so that writing to locked registers again is possible.
void syncReg (uint32_t mask)
Wait for an ongoing sync of register(s) to low-frequency domain to complete.


#define cmuClkDiv_1 1
Clock divisors.
#define cmuClkDiv_2 2
Divide clock by 2.
#define cmuClkDiv_4 4
Divide clock by 4.
#define cmuClkDiv_8 8
Divide clock by 8.
#define cmuClkDiv_16 16
Divide clock by 16.
#define cmuClkDiv_32 32
Divide clock by 32.
#define cmuClkDiv_64 64
Divide clock by 64.
#define cmuClkDiv_128 128
Divide clock by 128.
#define cmuClkDiv_256 256
Divide clock by 256.
#define cmuClkDiv_512 512
Divide clock by 512.
#define cmuClkDiv_1024 1024
Divide clock by 1024.
#define cmuClkDiv_2048 2048
Divide clock by 2048.
#define cmuClkDiv_4096 4096
Divide clock by 4096.
#define cmuClkDiv_8192 8192
Divide clock by 8192.
#define cmuClkDiv_16384 16384
Divide clock by 16384.
#define cmuClkDiv_32768 32768
Divide clock by 32768.
Default LFXO initialization values.
Default LFXO initialization for external clock.
Default HFXO initialization values for Platform 1 devices.
Default HFXO initialization for external clock.


typedef uint32_t CMU_ClkDiv_TypeDef
Clock divider configuration.


enum CMU_HFRCOBand_TypeDef {
High-frequency system RCO bands.
enum CMU_AUXHFRCOBand_TypeDef {
AUX high-frequency RCO bands.
enum CMU_Clock_TypeDef {
cmuClock_HF ,
cmuClock_DBG ,
cmuClock_AUX ,
cmuClock_HFPER ,
cmuClock_USART0 ,
cmuClock_USART1 ,
cmuClock_USART2 ,
cmuClock_UART0 ,
cmuClock_UART1 ,
cmuClock_TIMER0 ,
cmuClock_TIMER1 ,
cmuClock_TIMER2 ,
cmuClock_TIMER3 ,
cmuClock_ACMP0 ,
cmuClock_ACMP1 ,
cmuClock_PRS ,
cmuClock_DAC0 ,
cmuClock_GPIO ,
cmuClock_VCMP ,
cmuClock_ADC0 ,
cmuClock_I2C0 ,