CMU - Clock Management Unit

Description

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.
struct CMU_DPLLInit_TypeDef
DPLL initialization structure.

Functions

uint32_t CMU_Calibrate (uint32_t cycles, CMU_Select_TypeDef ref)
Calibrate an oscillator.
void CMU_CalibrateConfig (uint32_t downCycles, CMU_Select_TypeDef downSel, CMU_Select_TypeDef upSel)
Configure clock calibration.
uint32_t CMU_CalibrateCountGet (void)
Get calibration count value.
void CMU_ClkOutPinConfig (uint32_t clkNo, CMU_Select_TypeDef sel, CMU_ClkDiv_TypeDef clkDiv, GPIO_Port_TypeDef port, unsigned int pin)
Direct a clock to a GPIO pin.
CMU_ClkDiv_TypeDef CMU_ClockDivGet ( CMU_Clock_TypeDef clock)
Get clock divisor.
void CMU_ClockDivSet ( CMU_Clock_TypeDef clock, CMU_ClkDiv_TypeDef div)
Set clock divisor.
uint32_t CMU_ClockFreqGet ( CMU_Clock_TypeDef clock)
Get clock frequency for a clock point.
CMU_Select_TypeDef CMU_ClockSelectGet ( CMU_Clock_TypeDef clock)
Get currently selected reference clock used for a clock branch.
void CMU_ClockSelectSet ( CMU_Clock_TypeDef clock, CMU_Select_TypeDef ref)
Select reference clock/oscillator 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.
CMU_HFRCODPLLFreq_TypeDef CMU_HFRCODPLLBandGet (void)
Get HFRCODPLL band in use.
void CMU_HFRCODPLLBandSet ( CMU_HFRCODPLLFreq_TypeDef freq)
Set HFRCODPLL band and the tuning value based on the value in the calibration table made during production.
bool CMU_DPLLLock (const CMU_DPLLInit_TypeDef *init)
Lock the DPLL to a given frequency.
void CMU_HFXOInit (const CMU_HFXOInit_TypeDef *hfxoInit)
Initialize all HFXO control registers.
void CMU_HFXOCTuneDeltaSet (int32_t delta)
Set the HFXO crystal tuning delta.
int32_t CMU_HFXOCTuneDeltaGet (void)
Get the HFXO crystal tuning delta.
void CMU_LFXOInit (const CMU_LFXOInit_TypeDef *lfxoInit)
Initialize LFXO control registers.
void CMU_LFXOPrecisionSet (uint16_t precision)
Sets LFXO's crystal precision, in PPM.
uint32_t CMU_OscillatorTuningGet ( CMU_Osc_TypeDef osc)
Get oscillator frequency tuning setting.
void CMU_OscillatorTuningSet ( CMU_Osc_TypeDef osc, uint32_t val)
Set the oscillator frequency tuning control.
void CMU_UpdateWaitStates (uint32_t freq, int vscale)
Configure wait state settings necessary to switch to a given core clock frequency at a certain voltage scale level.
void CMU_PCNTClockExternalSet (unsigned int instance, bool external)
Select the PCNTn clock.
CMU_HFRCOEM23Freq_TypeDef CMU_HFRCOEM23BandGet (void)
Get HFRCOEM23 band in use.
void CMU_HFRCOEM23BandSet ( CMU_HFRCOEM23Freq_TypeDef freq)
Set HFRCOEM23 band and the tuning value based on the value in the calibration table made during production.
void CMU_ClockEnable ( CMU_Clock_TypeDef clock, bool enable)
Enable/disable a clock.
void CMU_CalibrateCont (bool enable)
Configures continuous calibration mode.
void CMU_CalibrateStart (void)
Starts calibration.
void CMU_CalibrateStop (void)
Stop calibration counters.
void CMU_DPLLUnlock (void)
Unlock the DPLL.
void CMU_IntClear (uint32_t flags)
Clear one or more pending CMU interrupt flags.
void CMU_IntDisable (uint32_t flags)
Disable one or more CMU interrupt sources.
void CMU_IntEnable (uint32_t flags)
Enable one or more CMU interrupt sources.
uint32_t CMU_IntGet (void)
Get pending CMU interrupt sources.
uint32_t CMU_IntGetEnabled (void)
Get enabled and pending CMU interrupt flags.
void CMU_IntSet (uint32_t flags)
Set one or more pending CMU interrupt sources.
void CMU_Lock (void)
Lock CMU register access in order to protect registers contents against unintended modification.
void CMU_OscillatorEnable ( CMU_Osc_TypeDef osc, bool enable, bool wait)
Enable/disable oscillator.
void CMU_Unlock (void)
Unlock CMU register access so that writing to registers is possible.
void CMU_WdogLock (void)