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.
Modules#
Enumerations#
High-frequency system RCO bands.
AUX high-frequency RCO bands.
Universal serial high-frequency RC bands.
Clock points in CMU.
Oscillator types.
Selectable clock sources.
Typedefs#
Clock divider configuration.
Functions#
Get the AUXHFRCO band in use.
Set the AUXHFRCO band and the tuning value based on the value in the calibration table made during production.
Calibrate the clock.
Configure the clock calibration.
Get the calibration count register.
Enable/disable a clock.
Get the clock divisor/prescaler.
Set the clock divisor/prescaler.
Get the clock frequency for a clock point.
Select the reference clock/oscillator used for a clock branch.
Get the currently selected reference clock used for a clock branch.
Gets the precision (in PPM) of the specified low frequency clock branch.
Gets the precision (in PPM) of the specified high frequency clock branch.
CMU low frequency register synchronization freeze control.
Get HFRCO band in use.
Set HFRCO band and the tuning value based on the value in the calibration table made during production.
Get the HFRCO startup delay.
Set the HFRCO startup delay.
Set HFXO control registers.
Get the LCD framerate divisor (FDIV) setting.
Set the LCD framerate divisor (FDIV) setting.
Set LFXO control registers.
Sets LFXO's crystal precision, in PPM.
Gets LFXO's crystal precision, in PPM.
Sets HFXO's crystal precision, in PPM.
Gets HFXO's crystal precision, in PPM.
Enable/disable oscillator.
Get the oscillator frequency tuning setting.
Set the oscillator frequency tuning control.
Select the PCNTn clock.
Determine if the currently selected PCNTn clock used is external or LFBCLK.
Get USHFRCO band in use.
Set the USHFRCO band to use.
Get USHFRCO frequency.
Configure various wait states to switch to a certain frequency and a certain voltage scale.
Configure continuous calibration mode.
Start calibration.
Stop the calibration counters.
Convert divider to logarithmic value.
Clear one or more pending CMU interrupts.
Disable one or more CMU interrupts.
Enable one or more CMU interrupts.
Get pending CMU interrupts.
Get enabled and pending CMU interrupt flags.
Set one or more pending CMU interrupts.
Lock the CMU to protect some of its registers against unintended modification.
Unlock the CMU so that writing to locked registers again is possible.
Get the AUX clock frequency.
Get the Debug Trace clock frequency.
Configure flash access wait states to support the given core clock frequency.
Configure flash access wait states to the most conservative setting for this target.
Get the LFnCLK frequency based on the current configuration.
Wait for an ongoing sync of register(s) to low-frequency domain to complete.
Set HFPER clock tree prescalers to safe values.
Set HFPER clock tree prescalers to give highest possible clock node frequency while still beeing within spec.
Macros#
Macro to set clock sources in the clock tree.
Clock divisors.
Divide clock by 2.
Divide clock by 4.
Divide clock by 8.
Divide clock by 16.
Divide clock by 32.
Divide clock by 64.
Divide clock by 128.
Divide clock by 256.
Divide clock by 512.
Divide clock by 1024.
Divide clock by 2048.
Divide clock by 4096.
Divide clock by 8192.
Divide clock by 16384.
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.
Enumeration Documentation#
CMU_HFRCOBand_TypeDef#
CMU_HFRCOBand_TypeDef
High-frequency system RCO bands.
Enumerator | |
---|---|
cmuHFRCOBand_1MHz | 1 MHz HFRCO band |
cmuHFRCOBand_7MHz | 7 MHz HFRCO band |
cmuHFRCOBand_11MHz | 11 MHz HFRCO band |
cmuHFRCOBand_14MHz | 14 MHz HFRCO band |
cmuHFRCOBand_21MHz | 21 MHz HFRCO band |
1847
of file platform/emlib/inc/em_cmu.h
CMU_AUXHFRCOBand_TypeDef#
CMU_AUXHFRCOBand_TypeDef
AUX high-frequency RCO bands.
Enumerator | |
---|---|
cmuAUXHFRCOBand_1MHz | 1 MHz RC band |
cmuAUXHFRCOBand_7MHz | 7 MHz RC band |
cmuAUXHFRCOBand_11MHz | 11 MHz RC band |
cmuAUXHFRCOBand_14MHz | 14 MHz RC band |
cmuAUXHFRCOBand_21MHz | 21 MHz RC band |
1861
of file platform/emlib/inc/em_cmu.h
CMU_USHFRCOBand_TypeDef#
CMU_USHFRCOBand_TypeDef
Universal serial high-frequency RC bands.
Enumerator | |
---|---|
cmuUSHFRCOBand_24MHz | 24 MHz RC band. |
cmuUSHFRCOBand_48MHz | 48 MHz RC band. |
1875
of file platform/emlib/inc/em_cmu.h
CMU_Clock_TypeDef#
CMU_Clock_TypeDef
Clock points in CMU.
See CMU overview in the reference manual.
Enumerator | |
---|---|
cmuClock_HF | High-frequency clock. |
cmuClock_DBG | Debug clock. |
cmuClock_AUX | AUX clock. |
cmuClock_HFPER | High-frequency peripheral clock. |
cmuClock_USART0 | Universal sync/async receiver/transmitter 0 clock. |
cmuClock_USART1 | Universal sync/async receiver/transmitter 1 clock. |
cmuClock_TIMER0 | Timer 0 clock. |
cmuClock_TIMER1 | Timer 1 clock. |
cmuClock_TIMER2 | Timer 2 clock. |
cmuClock_ACMP0 | Analog comparator 0 clock. |
cmuClock_PRS | Peripheral-reflex system clock. |
cmuClock_IDAC0 | Current digital-to-analog converter 0 clock. |
cmuClock_GPIO | General-purpose input/output clock. |
cmuClock_VCMP | Voltage comparator clock. |
cmuClock_ADC0 | Analog-to-digital converter 0 clock. |
cmuClock_I2C0 | I2C 0 clock. |
cmuClock_CORE | Core clock. |
cmuClock_AES | Advanced encryption standard accelerator clock. |
cmuClock_DMA | Direct memory access controller clock. |
cmuClock_HFLE | Low-energy clock divided down from HFCORECLK. |
cmuClock_USB | USB clock. |
cmuClock_LFA | Low-frequency A clock. |
cmuClock_RTC | Real time counter clock. |
cmuClock_PCNT0 | Pulse counter 0 clock. |
cmuClock_LFB | Low-frequency B clock. |
cmuClock_LEUART0 | Low-energy universal asynchronous receiver/transmitter 0 clock. |
cmuClock_LFC | Low-frequency C clock. |
cmuClock_USBLE | USB LE clock. |
1982
of file platform/emlib/inc/em_cmu.h
CMU_Osc_TypeDef#
CMU_Osc_TypeDef
Oscillator types.
Enumerator | |
---|---|
cmuOsc_LFXO | Low-frequency crystal oscillator. |
cmuOsc_LFRCO | Low-frequency RC oscillator. |
cmuOsc_HFXO | High-frequency crystal oscillator. |
cmuOsc_HFRCO | High-frequency RC oscillator. |
cmuOsc_AUXHFRCO | Auxiliary high-frequency RC oscillator. |
cmuOsc_USHFRCO | Universal serial high-frequency RC oscillator. |
cmuOsc_ULFRCO | Ultra low-frequency RC oscillator. |
2976
of file platform/emlib/inc/em_cmu.h
CMU_OscMode_TypeDef#
CMU_OscMode_TypeDef
Oscillator modes.
Enumerator | |
---|---|
cmuOscMode_Crystal | Crystal oscillator. |
cmuOscMode_AcCoupled | AC-coupled buffer. |
cmuOscMode_External | External digital clock. |
2997
of file platform/emlib/inc/em_cmu.h
CMU_Select_TypeDef#
CMU_Select_TypeDef
Selectable clock sources.
Enumerator | |
---|---|
cmuSelect_Error | Usage error. |
cmuSelect_Disabled | Clock selector disabled. |
cmuSelect_LFXO | Low-frequency crystal oscillator. |
cmuSelect_LFRCO | Low-frequency RC oscillator. |
cmuSelect_HFXO | High-frequency crystal oscillator. |
cmuSelect_HFRCO | High-frequency RC oscillator. |
cmuSelect_HFCLKLE | High-frequency LE clock divided by 2 or 4. |
cmuSelect_AUXHFRCO | Auxiliary clock source can be used for debug clock. |
cmuSelect_HFSRCCLK | High-frequency source clock. |
cmuSelect_HFCLK | Divided HFCLK on Giant for debug clock, undivided on Tiny Gecko and for USBC (not used on Gecko). |
cmuSelect_USHFRCO | Universal serial high-frequency RC oscillator. |
cmuSelect_USHFRCODIV2 | Universal serial high-frequency RC oscillator / 2. |
cmuSelect_ULFRCO | Ultra low-frequency RC oscillator. |
3004
of file platform/emlib/inc/em_cmu.h
CMU_LFXOBoost_TypeDef#
CMU_LFXOBoost_TypeDef
LFXO Boost values.
Enumerator | |
---|---|
cmuLfxoBoost70 | |
cmuLfxoBoost100 |
3061
of file platform/emlib/inc/em_cmu.h
Typedef Documentation#
CMU_ClkDiv_TypeDef#
typedef uint32_t CMU_ClkDiv_TypeDef
Clock divider configuration.
1838
of file platform/emlib/inc/em_cmu.h
Function Documentation#
CMU_AUXHFRCOBandGet#
CMU_AUXHFRCOBand_TypeDef CMU_AUXHFRCOBandGet (void )
Get the AUXHFRCO band in use.
N/A |
Returns
AUXHFRCO band in use.
6697
of file platform/emlib/src/em_cmu.c
CMU_AUXHFRCOBandSet#
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.
[in] | band | AUXHFRCO band to activate. |
6714
of file platform/emlib/src/em_cmu.c
CMU_Calibrate#
uint32_t CMU_Calibrate (uint32_t HFCycles, CMU_Osc_TypeDef reference)
Calibrate the clock.
[in] | HFCycles | The number of HFCLK cycles to run the calibration. Increasing this number increases precision but the calibration will take more time. |
[in] | reference | The reference clock used to compare HFCLK. |
Run a calibration for HFCLK against a selectable reference clock. See the reference manual, CMU chapter, for more details.
Note
This function will not return until the calibration measurement is completed.
Returns
The number of ticks the reference clock after HFCycles ticks on the HF clock.
6905
of file platform/emlib/src/em_cmu.c
CMU_CalibrateConfig#
void CMU_CalibrateConfig (uint32_t downCycles, CMU_Osc_TypeDef downSel, CMU_Osc_TypeDef upSel)
Configure the clock calibration.
[in] | downCycles | The number of downSel clock cycles to run the calibration. Increasing this number increases precision but the calibration will take more time. |
[in] | downSel | The clock, which will be counted down downCycles. |
[in] | upSel | The reference clock; the number of cycles generated by this clock will be counted and added up and the result can be given with the CMU_CalibrateCountGet() function call. |
Configure a calibration for a selectable clock source against another selectable reference clock. See the reference manual, CMU chapter, for more details.
Note
After configuration, a call to CMU_CalibrateStart() is required and the resulting calibration value can be read out with the CMU_CalibrateCountGet() function call.
6994
of file platform/emlib/src/em_cmu.c
CMU_CalibrateCountGet#
uint32_t CMU_CalibrateCountGet (void )
Get the calibration count register.
N/A |
Note
If continuous calibration mode is active, calibration busy will almost always be off and only the value needs to be read. In a normal case, this function call is triggered by the CALRDY interrupt flag.
Returns
The calibration count, the number of UPSEL clocks in the period of DOWNSEL oscillator clock cycles configured by a previous write operation to CMU->CALCNT.
7102
of file platform/emlib/src/em_cmu.c
CMU_ClockEnable#
void CMU_ClockEnable (CMU_Clock_TypeDef clock, bool enable)
Enable/disable a clock.
[in] | clock | The clock to enable/disable. Notice that not all defined clock points have separate enable/disable control. See the CMU overview in the reference manual. |
[in] | enable |
|
In general, module clocking is disabled after a reset. If a module clock is disabled, the registers of that module are not accessible and reading from such registers may return undefined values. Writing to registers of clock-disabled modules has no effect. Avoid accessing module registers of a module with a disabled clock.
Note
If enabling/disabling an LF clock, synchronization into the low-frequency domain is required. If the same register is modified before a previous update has completed, this function will stall until the previous synchronization has completed. See CMU_FreezeEnable() for a suggestion on how to reduce the stalling time in some use cases.
HFCLKLE prescaler is automatically modified when peripherals with clock domain HFBUSCLK is chosen based on the maximum HFLE frequency allowed.
7502
of file platform/emlib/src/em_cmu.c
CMU_ClockDivGet#
CMU_ClkDiv_TypeDef CMU_ClockDivGet (CMU_Clock_TypeDef clock)
Get the clock divisor/prescaler.
[in] | clock | A clock point to get the divisor/prescaler for. Notice that not all clock points have a divisor/prescaler. See the CMU overview in the reference manual. |
Returns
The current clock point divisor/prescaler. 1 is returned if
clock
specifies a clock point without a divisor/prescaler.
7137
of file platform/emlib/src/em_cmu.c
CMU_ClockDivSet#
void CMU_ClockDivSet (CMU_Clock_TypeDef clock, CMU_ClkDiv_TypeDef div)
Set the clock divisor/prescaler.
[in] | clock | Clock point to set divisor/prescaler for. Notice that not all clock points have a divisor/prescaler. See the CMU overview in the reference manual. |
[in] | div | The clock divisor to use (<= cmuClkDiv_512). |
Note
If setting an LF clock prescaler, synchronization into the low-frequency domain is required. If the same register is modified before a previous update has completed, this function will stall until the previous synchronization has completed. See CMU_FreezeEnable() for a suggestion on how to reduce the stalling time in some use cases.
HFCLKLE prescaler is automatically modified when peripherals with clock domain HFBUSCLK is chosen based on the maximum HFLE frequency allowed.
7277
of file platform/emlib/src/em_cmu.c
CMU_ClockFreqGet#
uint32_t CMU_ClockFreqGet (CMU_Clock_TypeDef clock)
Get the clock frequency for a clock point.
[in] | clock | A clock point to fetch the frequency for. |
Returns
The current frequency in Hz.
7626
of file platform/emlib/src/em_cmu.c
CMU_ClockSelectSet#
void CMU_ClockSelectSet (CMU_Clock_TypeDef clock, CMU_Select_TypeDef ref)
Select the reference clock/oscillator used for a clock branch.
[in] | clock | A clock branch to select reference clock for. One of: |
[in] | ref | A reference selected for clocking. See the reference manual for details about references available for a specific clock branch. |
Notice that if a selected reference is not enabled prior to selecting its use, it will be enabled and this function will wait for the selected oscillator to be stable. It will however NOT be disabled if another reference clock is selected later.
This feature is particularly important if selecting a new reference clock for the clock branch clocking the core. Otherwise, the system may halt.
Note
HFCLKLE prescaler is automatically modified when peripherals with clock domain HFBUSCLK is chosen based on the maximum HFLE frequency allowed.
9393
of file platform/emlib/src/em_cmu.c
CMU_ClockSelectGet#
CMU_Select_TypeDef CMU_ClockSelectGet (CMU_Clock_TypeDef clock)
Get the currently selected reference clock used for a clock branch.
[in] | clock | Clock branch to fetch selected ref. clock for. One of: |
Returns
The reference clock used for clocking the selected branch, cmuSelect_Error if invalid
clock
provided.
8477
of file platform/emlib/src/em_cmu.c
CMU_LF_ClockPrecisionGet#
uint16_t CMU_LF_ClockPrecisionGet (CMU_Clock_TypeDef clock)
Gets the precision (in PPM) of the specified low frequency clock branch.
[in] | clock | Clock branch. |
Returns
Precision, in PPM, of the specified clock branch.
Note
This function is only for internal usage.
The current implementation of this function is used to determine if the clock has a precision <= 500 ppm or not (which is the minimum required for BLE). Future version of this function should provide more accurate precision numbers to allow for further optimizations from the stacks.
10117
of file platform/emlib/src/em_cmu.c
CMU_HF_ClockPrecisionGet#
uint16_t CMU_HF_ClockPrecisionGet (CMU_Clock_TypeDef clock)
Gets the precision (in PPM) of the specified high frequency clock branch.
[in] | clock | Clock branch. |
Returns
Precision, in PPM, of the specified clock branch.
Note
This function is only for internal usage.
The current implementation of this function is used to determine if the clock has a precision <= 500 ppm or not (which is the minimum required for BLE). Future version of this function should provide more accurate precision numbers to allow for further optimizations from the stacks.
10160
of file platform/emlib/src/em_cmu.c
CMU_FreezeEnable#
void CMU_FreezeEnable (bool enable)
CMU low frequency register synchronization freeze control.
[in] | enable |
|
Some CMU registers require synchronization into the low-frequency (LF) domain. The freeze feature allows for several such registers to be modified before passing them to the LF domain simultaneously (which takes place when the freeze mode is disabled).
Another use case for this feature is using an API (such as the CMU API) for modifying several bit fields consecutively in the same register. If freeze mode is enabled during this sequence, stalling can be avoided.
Note
When enabling freeze mode, this function will wait for all current ongoing CMU synchronization to LF domain to complete (normally synchronization will not be in progress.) However, for this reason, when using freeze mode, modifications of registers requiring LF synchronization should be done within one freeze enable/disable block to avoid unnecessary stalling.
10363
of file platform/emlib/src/em_cmu.c
CMU_HFRCOBandGet#
CMU_HFRCOBand_TypeDef CMU_HFRCOBandGet (void )
Get HFRCO band in use.
N/A |
Returns
HFRCO band in use.
10390
of file platform/emlib/src/em_cmu.c
CMU_HFRCOBandSet#
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.
[in] | band | HFRCO band to activate. |
Note
HFCLKLE prescaler is automatically modified based on the maximum HFLE frequency allowed.
10410
of file platform/emlib/src/em_cmu.c
CMU_HFRCOStartupDelayGet#
uint32_t CMU_HFRCOStartupDelayGet (void )
Get the HFRCO startup delay.
N/A |
See the reference manual for more details.
Returns
The startup delay in use.
10673
of file platform/emlib/src/em_cmu.c
CMU_HFRCOStartupDelaySet#
void CMU_HFRCOStartupDelaySet (uint32_t delay)
Set the HFRCO startup delay.
[in] | delay | The startup delay to set (<= 31). |
See the reference manual for more details.
10689
of file platform/emlib/src/em_cmu.c
CMU_HFXOInit#
void CMU_HFXOInit (const CMU_HFXOInit_TypeDef * hfxoInit)
Set HFXO control registers.
[in] | hfxoInit | HFXO setup parameters. |
Note
HFXO configuration should be obtained from a configuration tool, app note, or crystal data sheet. This function disables the HFXO to ensure a valid state before update.
10864
of file platform/emlib/src/em_cmu.c
CMU_LCDClkFDIVGet#
uint32_t CMU_LCDClkFDIVGet (void )
Get the LCD framerate divisor (FDIV) setting.
N/A |
Returns
The LCD framerate divisor.
10996
of file platform/emlib/src/em_cmu.c
CMU_LCDClkFDIVSet#
void CMU_LCDClkFDIVSet (uint32_t div)
Set the LCD framerate divisor (FDIV) setting.
[in] | div | The FDIV setting to use. |
Note
The FDIV field (CMU LCDCTRL register) should only be modified while the LCD module is clock disabled (CMU LFACLKEN0.LCD bit is 0). This function will NOT modify FDIV if the LCD module clock is enabled. See CMU_ClockEnable() for disabling/enabling LCD clock.
11018
of file platform/emlib/src/em_cmu.c
CMU_LFXOInit#
void CMU_LFXOInit (const CMU_LFXOInit_TypeDef * lfxoInit)
Set LFXO control registers.
[in] | lfxoInit | LFXO setup parameters. |
Note
LFXO configuration should be obtained from a configuration tool, app note, or crystal data sheet. This function disables the LFXO when necessary to ensure a valid state before update.
11048
of file platform/emlib/src/em_cmu.c
CMU_LFXOPrecisionSet#
void CMU_LFXOPrecisionSet (uint16_t precision)
Sets LFXO's crystal precision, in PPM.
[in] | precision | LFXO's crystal precision, in PPM. |
Note
LFXO precision should be obtained from a crystal datasheet.
11101
of file platform/emlib/src/em_cmu.c
CMU_LFXOPrecisionGet#
uint16_t CMU_LFXOPrecisionGet (void )
Gets LFXO's crystal precision, in PPM.
[in] | LFXO's crystal precision, in PPM. |
11113
of file platform/emlib/src/em_cmu.c
CMU_HFXOPrecisionSet#
void CMU_HFXOPrecisionSet (uint16_t precision)
Sets HFXO's crystal precision, in PPM.
[in] | precision | HFXO's crystal precision, in PPM. |
Note
HFXO precision should be obtained from a crystal datasheet.
11128
of file platform/emlib/src/em_cmu.c
CMU_HFXOPrecisionGet#
uint16_t CMU_HFXOPrecisionGet (void )
Gets HFXO's crystal precision, in PPM.
[in] | HFXO's crystal precision, in PPM. |
11140
of file platform/emlib/src/em_cmu.c
CMU_OscillatorEnable#
void CMU_OscillatorEnable (CMU_Osc_TypeDef osc, bool enable, bool wait)
Enable/disable oscillator.
[in] | osc | The oscillator to enable/disable. |
[in] | enable |
|
[in] | wait | Only used if
|
Note
WARNING: When this function is called to disable either cmuOsc_LFXO or cmuOsc_HFXO, the LFXOMODE or HFXOMODE fields of the CMU_CTRL register are reset to the reset value. In other words, if external clock sources are selected in either LFXOMODE or HFXOMODE fields, the configuration will be cleared and needs to be reconfigured if needed later.
11169
of file platform/emlib/src/em_cmu.c
CMU_OscillatorTuningGet#
uint32_t CMU_OscillatorTuningGet (CMU_Osc_TypeDef osc)
Get the oscillator frequency tuning setting.
[in] | osc | An oscillator to get tuning value for, one of the following:
|
Returns
The oscillator frequency tuning setting in use.
11358
of file platform/emlib/src/em_cmu.c
CMU_OscillatorTuningSet#
void CMU_OscillatorTuningSet (CMU_Osc_TypeDef osc, uint32_t val)
Set the oscillator frequency tuning control.
[in] | osc | An oscillator to set tuning value for, one of the following:
|
[in] | val | The oscillator frequency tuning setting to use. |
Note
Oscillator tuning is done during production and the tuning value is automatically loaded after reset. Changing the tuning value from the calibrated value is for more advanced use. Certain oscillators also have build-in tuning optimization.
11432
of file platform/emlib/src/em_cmu.c
CMU_PCNTClockExternalSet#
void CMU_PCNTClockExternalSet (unsigned int instance, bool external)
Select the PCNTn clock.
[in] | instance | PCNT instance number to set selected clock source for. |
[in] | external | Set to true to select the external clock, false to select LFBCLK. |
11704
of file platform/emlib/src/em_cmu.c
CMU_PCNTClockExternalGet#
bool CMU_PCNTClockExternalGet (unsigned int instance)
Determine if the currently selected PCNTn clock used is external or LFBCLK.
[in] | instance | PCNT instance number to get currently selected clock source for. |
Returns
true - selected clock is external clock.
false - selected clock is LFBCLK.
11664
of file platform/emlib/src/em_cmu.c
CMU_USHFRCOBandGet#
CMU_USHFRCOBand_TypeDef CMU_USHFRCOBandGet (void )
Get USHFRCO band in use.
N/A |
Returns
USHFRCO band in use.
11731
of file platform/emlib/src/em_cmu.c
CMU_USHFRCOBandSet#
void CMU_USHFRCOBandSet (CMU_USHFRCOBand_TypeDef band)
Set the USHFRCO band to use.
[in] | band | USHFRCO band to activate. |
11759
of file platform/emlib/src/em_cmu.c
CMU_USHFRCOFreqGet#
uint32_t CMU_USHFRCOFreqGet (void )
Get USHFRCO frequency.
N/A |
Returns
USHFRCO frequency.
11745
of file platform/emlib/src/em_cmu.c
CMU_UpdateWaitStates#
void CMU_UpdateWaitStates (uint32_t freq, int vscale)
Configure various wait states to switch to a certain frequency and a certain voltage scale.
[in] | freq | The core clock frequency to configure wait-states. |
[in] | vscale | The voltage scale to configure wait-states. Expected values are 0 or 2, higher number is lower voltage. |
This function will set up the necessary flash, bus, and RAM wait states. Updating the wait state configuration must be done before increasing the clock frequency and it must be done after decreasing the clock frequency. Updating the wait state configuration must be done before core voltage is decreased and it must be done after a core voltage is increased.
0 = 1.2 V (VSCALE2)
2 = 1.0 V (VSCALE0)
6316
of file platform/emlib/src/em_cmu.c
CMU_CalibrateCont#
void CMU_CalibrateCont (bool enable)
Configure continuous calibration mode.
[in] | enable | If true, enables continuous calibration, if false disables continuous calibration. |
3429
of file platform/emlib/inc/em_cmu.h
CMU_CalibrateStart#
void CMU_CalibrateStart (void )
Start calibration.
N/A |
Note
This call is usually invoked after CMU_CalibrateConfig() and possibly CMU_CalibrateCont().
3442
of file platform/emlib/inc/em_cmu.h
CMU_CalibrateStop#
void CMU_CalibrateStop (void )
Stop the calibration counters.
N/A |
3452
of file platform/emlib/inc/em_cmu.h
CMU_DivToLog2#
uint32_t CMU_DivToLog2 (CMU_ClkDiv_TypeDef div)
Convert divider to logarithmic value.
[in] | div | An unscaled divider. |
It only works for even numbers equal to 2^n.
Returns
Logarithm base 2 (binary) value, i.e. exponent as used by fixed 2^n prescalers.
3470
of file platform/emlib/inc/em_cmu.h
CMU_IntClear#
void CMU_IntClear (uint32_t flags)
Clear one or more pending CMU interrupts.
[in] | flags | CMU interrupt sources to clear. |
3503
of file platform/emlib/inc/em_cmu.h
CMU_IntDisable#
void CMU_IntDisable (uint32_t flags)
Disable one or more CMU interrupts.
[in] | flags | CMU interrupt sources to disable. |
3515
of file platform/emlib/inc/em_cmu.h
CMU_IntEnable#
void CMU_IntEnable (uint32_t flags)
Enable one or more CMU interrupts.
[in] | flags | CMU interrupt sources to enable. |
Note
Depending on use case, a pending interrupt may already be set prior to enabling the interrupt. Consider using CMU_IntClear() prior to enabling if the pending interrupt should be ignored.
3532
of file platform/emlib/inc/em_cmu.h
CMU_IntGet#
uint32_t CMU_IntGet (void )
Get pending CMU interrupts.
N/A |
Returns
CMU interrupt sources pending.
3544
of file platform/emlib/inc/em_cmu.h
CMU_IntGetEnabled#
uint32_t CMU_IntGetEnabled (void )
Get enabled and pending CMU interrupt flags.
N/A |
Useful for handling more interrupt sources in the same interrupt handler.
Note
This function does not clear event bits.
Returns
Pending and enabled CMU interrupt sources. The return value is the bitwise AND of
the enabled interrupt sources in CMU_IEN and
the pending interrupt flags CMU_IF
3565
of file platform/emlib/inc/em_cmu.h
CMU_IntSet#
void CMU_IntSet (uint32_t flags)
Set one or more pending CMU interrupts.
[in] | flags | CMU interrupt sources to set to pending. |
3580
of file platform/emlib/inc/em_cmu.h
CMU_Lock#
void CMU_Lock (void )
Lock the CMU to protect some of its registers against unintended modification.
N/A |
See the reference manual for CMU registers that will be locked.
Note
If locking the CMU registers, they must be unlocked prior to using any CMU API functions modifying CMU registers protected by the lock.
3598
of file platform/emlib/inc/em_cmu.h
CMU_Unlock#
void CMU_Unlock (void )
Unlock the CMU so that writing to locked registers again is possible.
N/A |
3607
of file platform/emlib/inc/em_cmu.h
auxClkGet#
static uint32_t auxClkGet (void )
Get the AUX clock frequency.
N/A |
Used by MSC flash programming and LESENSE, by default also as a debug clock.
Returns
AUX Frequency in Hz.
5742
of file platform/emlib/src/em_cmu.c
dbgClkGet#
static uint32_t dbgClkGet (void )
Get the Debug Trace clock frequency.
N/A |
Returns
Debug Trace frequency in Hz.
5827
of file platform/emlib/src/em_cmu.c
flashWaitStateControl#
static void flashWaitStateControl (uint32_t coreFreq, int vscale)
Configure flash access wait states to support the given core clock frequency.
[in] | coreFreq | The core clock frequency to configure flash wait-states. |
[in] | vscale | Voltage Scale level. Supported levels are 0 and 2 where 0 is the default. |
6098
of file platform/emlib/src/em_cmu.c
flashWaitStateMax#
static void flashWaitStateMax (void )
Configure flash access wait states to the most conservative setting for this target.
N/A |
Retain SCBTP (Suppressed Conditional Branch Target Prefetch) setting.
6207
of file platform/emlib/src/em_cmu.c
lfClkGet#
static uint32_t lfClkGet (CMU_Clock_TypeDef lfClkBranch)
Get the LFnCLK frequency based on the current configuration.
[in] | lfClkBranch | Selected LF branch. |
Returns
The LFnCLK frequency in Hz. If no LFnCLK is selected (disabled), 0 is returned.
6402
of file platform/emlib/src/em_cmu.c
syncReg#
void syncReg (uint32_t mask)
Wait for an ongoing sync of register(s) to low-frequency domain to complete.
[in] | mask | A bitmask corresponding to SYNCBUSY register defined bits, indicating registers that must complete any ongoing synchronization. |
6564
of file platform/emlib/src/em_cmu.c
hfperClkSafePrescaler#
static void hfperClkSafePrescaler (void )
Set HFPER clock tree prescalers to safe values.
N/A |
Note
This function applies to EFM32GG11B. There are 3 HFPER clock trees with these frequency limits: HFPERCLK (A-tree): 20MHz in VSCALE0 mode, 50MHz in VSCALE2 mode. HFPERBCLK (B-tree): 20MHz in VSCALE0 mode, 72MHz in VSCALE2 mode. HFPERCCLK (C-tree): 20MHz in VSCALE0 mode, 50MHz in VSCALE2 mode.
6629
of file platform/emlib/src/em_cmu.c
hfperClkOptimizedPrescaler#
static void hfperClkOptimizedPrescaler (void )
Set HFPER clock tree prescalers to give highest possible clock node frequency while still beeing within spec.
N/A |
Note
This function applies to EFM32GG11B. There are 3 HFPER clock trees with these frequency limits: HFPERCLK (A-tree): 20MHz in VSCALE0 mode, 50MHz in VSCALE2 mode. HFPERBCLK (B-tree): 20MHz in VSCALE0 mode, 72MHz in VSCALE2 mode. HFPERCCLK (C-tree): 20MHz in VSCALE0 mode, 50MHz in VSCALE2 mode.
6652
of file platform/emlib/src/em_cmu.c
Macro Definition Documentation#
CMU_CLOCK_SELECT_SET#
#define CMU_CLOCK_SELECT_SETValue:
(clock, sel)
Macro to set clock sources in the clock tree.
55
of file platform/emlib/inc/em_cmu.h
cmuClkDiv_1#
#define cmuClkDiv_1Value:
1
Clock divisors.
These values are valid for prescalers. Divide clock by 1.
1820
of file platform/emlib/inc/em_cmu.h
cmuClkDiv_2#
#define cmuClkDiv_2Value:
2
Divide clock by 2.
1821
of file platform/emlib/inc/em_cmu.h
cmuClkDiv_4#
#define cmuClkDiv_4Value:
4
Divide clock by 4.
1822
of file platform/emlib/inc/em_cmu.h
cmuClkDiv_8#
#define cmuClkDiv_8Value:
8
Divide clock by 8.
1823
of file platform/emlib/inc/em_cmu.h
cmuClkDiv_16#
#define cmuClkDiv_16Value:
16
Divide clock by 16.
1824
of file platform/emlib/inc/em_cmu.h
cmuClkDiv_32#
#define cmuClkDiv_32Value:
32
Divide clock by 32.
1825
of file platform/emlib/inc/em_cmu.h
cmuClkDiv_64#
#define cmuClkDiv_64Value:
64
Divide clock by 64.
1826
of file platform/emlib/inc/em_cmu.h
cmuClkDiv_128#
#define cmuClkDiv_128Value:
128
Divide clock by 128.
1827
of file platform/emlib/inc/em_cmu.h
cmuClkDiv_256#
#define cmuClkDiv_256Value:
256
Divide clock by 256.
1828
of file platform/emlib/inc/em_cmu.h
cmuClkDiv_512#
#define cmuClkDiv_512Value:
512
Divide clock by 512.
1829
of file platform/emlib/inc/em_cmu.h
cmuClkDiv_1024#
#define cmuClkDiv_1024Value:
1024
Divide clock by 1024.
1830
of file platform/emlib/inc/em_cmu.h
cmuClkDiv_2048#
#define cmuClkDiv_2048Value:
2048
Divide clock by 2048.
1831
of file platform/emlib/inc/em_cmu.h
cmuClkDiv_4096#
#define cmuClkDiv_4096Value:
4096
Divide clock by 4096.
1832
of file platform/emlib/inc/em_cmu.h
cmuClkDiv_8192#
#define cmuClkDiv_8192Value:
8192
Divide clock by 8192.
1833
of file platform/emlib/inc/em_cmu.h
cmuClkDiv_16384#
#define cmuClkDiv_16384Value:
16384
Divide clock by 16384.
1834
of file platform/emlib/inc/em_cmu.h
cmuClkDiv_32768#
#define cmuClkDiv_32768Value:
32768
Divide clock by 32768.
1835
of file platform/emlib/inc/em_cmu.h
CMU_LFXOINIT_DEFAULT#
#define CMU_LFXOINIT_DEFAULTValue:
Default LFXO initialization values.
3129
of file platform/emlib/inc/em_cmu.h
CMU_LFXOINIT_EXTERNAL_CLOCK#
#define CMU_LFXOINIT_EXTERNAL_CLOCKValue:
Default LFXO initialization for external clock.
3136
of file platform/emlib/inc/em_cmu.h
CMU_HFXOINIT_DEFAULT#
#define CMU_HFXOINIT_DEFAULTValue:
Default HFXO initialization values for Platform 1 devices.
3271
of file platform/emlib/inc/em_cmu.h
CMU_HFXOINIT_EXTERNAL_CLOCK#
#define CMU_HFXOINIT_EXTERNAL_CLOCKValue:
Default HFXO initialization for external clock.
3279
of file platform/emlib/inc/em_cmu.h