CMU
[EM_Library]

Clock management unit (CMU) Peripheral API. More...

Collaboration diagram for CMU:

Defines

#define cmuClkDiv_1   1
#define cmuClkDiv_2   2
#define cmuClkDiv_4   4
#define cmuClkDiv_8   8
#define cmuClkDiv_16   16
#define cmuClkDiv_32   32
#define cmuClkDiv_64   64
#define cmuClkDiv_128   128
#define cmuClkDiv_256   256
#define cmuClkDiv_512   512
#define cmuClkDiv_1024   1024
#define cmuClkDiv_2048   2048
#define cmuClkDiv_4096   4096
#define cmuClkDiv_8192   8192
#define cmuClkDiv_16384   16384
#define cmuClkDiv_32768   32768

Typedefs

typedef uint32_t CMU_ClkDiv_TypeDef

Enumerations

enum  CMU_HFRCOBand_TypeDef {
  cmuHFRCOBand_1MHz = _CMU_HFRCOCTRL_BAND_1MHZ,
  cmuHFRCOBand_7MHz = _CMU_HFRCOCTRL_BAND_7MHZ,
  cmuHFRCOBand_11MHz = _CMU_HFRCOCTRL_BAND_11MHZ,
  cmuHFRCOBand_14MHz = _CMU_HFRCOCTRL_BAND_14MHZ,
  cmuHFRCOBand_21MHz = _CMU_HFRCOCTRL_BAND_21MHZ
}
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,
  cmuClock_I2C1,
  cmuClock_CORE,
  cmuClock_AES,
  cmuClock_DMA,
  cmuClock_CORELE,
  cmuClock_EBI,
  cmuClock_USBC,
  cmuClock_USB,
  cmuClock_LFA,
  cmuClock_RTC,
  cmuClock_LETIMER0,
  cmuClock_LCDpre,
  cmuClock_LCD,
  cmuClock_PCNT0,
  cmuClock_PCNT1,
  cmuClock_PCNT2,
  cmuClock_LESENSE,
  cmuClock_LFB,
  cmuClock_LEUART0,
  cmuClock_LEUART1
}
enum  CMU_Osc_TypeDef {
  cmuOsc_LFXO,
  cmuOsc_LFRCO,
  cmuOsc_HFXO,
  cmuOsc_HFRCO,
  cmuOsc_AUXHFRCO,
  cmuOsc_ULFRCO
}
enum  CMU_Select_TypeDef {
  cmuSelect_Error,
  cmuSelect_Disabled,
  cmuSelect_LFXO,
  cmuSelect_LFRCO,
  cmuSelect_HFXO,
  cmuSelect_HFRCO,
  cmuSelect_CORELEDIV2,
  cmuSelect_AUXHFRCO,
  cmuSelect_HFCLK,
  cmuSelect_ULFRCO
}

Functions

void CMU_ClockEnable (CMU_Clock_TypeDef clock, bool enable)
 Enable/disable a clock.
uint32_t CMU_ClockFreqGet (CMU_Clock_TypeDef clock)
 Get clock frequency for a clock point.
CMU_ClkDiv_TypeDef CMU_ClockDivGet (CMU_Clock_TypeDef clock)
 Get clock divisor/prescaler.
CMU_Select_TypeDef CMU_ClockSelectGet (CMU_Clock_TypeDef clock)
 Get currently selected reference clock used for a clock branch.
void CMU_ClockDivSet (CMU_Clock_TypeDef clock, CMU_ClkDiv_TypeDef div)
 Set clock divisor/prescaler.
void CMU_ClockSelectSet (CMU_Clock_TypeDef clock, CMU_Select_TypeDef ref)
 Select reference clock/oscillator used for a clock branch.
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.
void CMU_HFRCOStartupDelaySet (uint32_t delay)
 Set the HFRCO startup delay.
uint32_t CMU_HFRCOStartupDelayGet (void)
 Get the HFRCO startup delay.
void CMU_OscillatorEnable (CMU_Osc_TypeDef osc, bool enable, bool wait)
 Enable/disable oscillator.
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.
bool CMU_PCNTClockExternalGet (unsigned int inst)
 Determine if currently selected PCNTn clock used is external or LFBCLK.
void CMU_PCNTClockExternalSet (unsigned int inst, bool external)
 Select PCNTn clock.
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_FreezeEnable (bool enable)
 CMU low frequency register synchronization freeze control.
uint32_t CMU_Calibrate (uint32_t HFCycles, CMU_Osc_TypeDef ref)
 Calibrate clock.
__STATIC_INLINE void CMU_IntClear (uint32_t flags)
 Clear one or more pending CMU interrupts.
__STATIC_INLINE void CMU_IntDisable (uint32_t flags)
 Disable one or more CMU interrupts.
__STATIC_INLINE void CMU_IntEnable (uint32_t flags)
 Enable one or more CMU interrupts.
__STATIC_INLINE uint32_t CMU_IntGet (void)
 Get pending CMU interrupts.
__STATIC_INLINE uint32_t CMU_IntGetEnabled (void)
 Get enabled and pending CMU interrupt flags.
__STATIC_INLINE void CMU_IntSet (uint32_t flags)
 Set one or more pending CMU interrupts from SW.
__STATIC_INLINE void CMU_Lock (void)
 Lock the CMU in order to protect some of its registers against unintended modification.
__STATIC_INLINE void CMU_Unlock (void)
 Unlock the CMU so that writing to locked registers again is possible.
__STATIC_INLINE uint32_t CMU_CalibrateCountGet (void)
 Get calibration count register.
__STATIC_INLINE void CMU_CalibrateStart (void)
 Starts calibration.

Detailed Description

Clock management unit (CMU) Peripheral API.


Define Documentation

#define cmuClkDiv_1   1

Clock divisors. These values are valid for prescalers. Divide clock by 1.

Definition at line 127 of file em_cmu.h.

Referenced by CMU_ClockDivGet(), and CMU_ClockDivSet().

#define cmuClkDiv_1024   1024

Divide clock by 1024.

Definition at line 137 of file em_cmu.h.

#define cmuClkDiv_128   128

Divide clock by 128.

Definition at line 134 of file em_cmu.h.

Referenced by CMU_ClockDivSet(), and CMU_LCDClkFDIVSet().

#define cmuClkDiv_16   16

Divide clock by 16.

Definition at line 131 of file em_cmu.h.

Referenced by CMU_ClockDivGet(), CMU_ClockDivSet(), and CMU_ClockFreqGet().

#define cmuClkDiv_16384   16384

Divide clock by 16384.

Definition at line 141 of file em_cmu.h.

#define cmuClkDiv_2   2

Divide clock by 2.

Definition at line 128 of file em_cmu.h.

#define cmuClkDiv_2048   2048

Divide clock by 2048.

Definition at line 138 of file em_cmu.h.

#define cmuClkDiv_256   256

Divide clock by 256.

Definition at line 135 of file em_cmu.h.

#define cmuClkDiv_32   32

Divide clock by 32.

Definition at line 132 of file em_cmu.h.

#define cmuClkDiv_32768   32768

Divide clock by 32768.

Definition at line 142 of file em_cmu.h.

Referenced by CMU_ClockDivSet().

#define cmuClkDiv_4   4

Divide clock by 4.

Definition at line 129 of file em_cmu.h.

#define cmuClkDiv_4096   4096

Divide clock by 4096.

Definition at line 139 of file em_cmu.h.

#define cmuClkDiv_512   512

Divide clock by 512.

Definition at line 136 of file em_cmu.h.

Referenced by CMU_ClockDivSet().

#define cmuClkDiv_64   64

Divide clock by 64.

Definition at line 133 of file em_cmu.h.

#define cmuClkDiv_8   8

Divide clock by 8.

Definition at line 130 of file em_cmu.h.

Referenced by CMU_ClockDivSet().

#define cmuClkDiv_8192   8192

Divide clock by 8192.

Definition at line 140 of file em_cmu.h.


Typedef Documentation

typedef uint32_t CMU_ClkDiv_TypeDef

Clock divider configuration

Definition at line 145 of file em_cmu.h.


Enumeration Type Documentation

Clock points in CMU. Please refer to CMU overview in 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_USART2 

Universal sync/async receiver/transmitter 2 clock.

cmuClock_UART0 

Universal async receiver/transmitter 0 clock.

cmuClock_UART1 

Universal async receiver/transmitter 1 clock.

cmuClock_TIMER0 

Timer 0 clock.

cmuClock_TIMER1 

Timer 1 clock.

cmuClock_TIMER2 

Timer 2 clock.

cmuClock_TIMER3 

Timer 3 clock.

cmuClock_ACMP0 

Analog comparator 0 clock.

cmuClock_ACMP1 

Analog comparator 1 clock.

cmuClock_PRS 

Peripheral reflex system clock.

cmuClock_DAC0 

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_I2C1 

I2C 1 clock.

cmuClock_CORE 

Core clock

cmuClock_AES 

Advanced encryption standard accelerator clock.

cmuClock_DMA 

Direct memory access controller clock.

cmuClock_CORELE 

Low energy clocking module clock.

cmuClock_EBI 

External bus interface clock.

cmuClock_USBC 

USB Core clock.

cmuClock_USB 

USB clock.

cmuClock_LFA 

Low frequency A clock

cmuClock_RTC 

Real time counter clock.

cmuClock_LETIMER0 

Low energy timer 0 clock.

cmuClock_LCDpre 

Liquid crystal display, pre FDIV clock.

cmuClock_LCD 

Liquid crystal display clock. Please notice that FDIV prescaler must be set by special API.

cmuClock_PCNT0 

Pulse counter 0 clock.

cmuClock_PCNT1 

Pulse counter 1 clock.

cmuClock_PCNT2 

Pulse counter 2 clock.

cmuClock_LESENSE 

LESENSE clock.

cmuClock_LFB 

Low frequency B clock

cmuClock_LEUART0 

Low energy universal asynchronous receiver/transmitter 0 clock.

cmuClock_LEUART1 

Low energy universal asynchronous receiver/transmitter 1 clock.

Definition at line 189 of file em_cmu.h.

High frequency RC bands.

Enumerator:
cmuHFRCOBand_1MHz 

1MHz RC band.

cmuHFRCOBand_7MHz 

7MHz RC band.

cmuHFRCOBand_11MHz 

11MHz RC band.

cmuHFRCOBand_14MHz 

14MHz RC band.

cmuHFRCOBand_21MHz 

21MHz RC band.

Definition at line 148 of file em_cmu.h.

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_ULFRCO 

Ultra low frequency RC oscillator.

Definition at line 582 of file em_cmu.h.

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_CORELEDIV2 

Core low energy clock divided by 2.

cmuSelect_AUXHFRCO 

Auxilliary clock source can be used for debug clock

cmuSelect_HFCLK 

Divided HFCLK on Giant for debug clock, undivided on Tiny Gecko and for USBC (not used on Gecko)

cmuSelect_ULFRCO 

Ultra low frequency RC oscillator.

Definition at line 596 of file em_cmu.h.


Function Documentation

uint32_t CMU_Calibrate ( uint32_t  HFCycles,
CMU_Osc_TypeDef  ref 
)

Calibrate clock.

Run a calibration for HFCLK against a selectable reference clock. Please refer to the EFM32 reference manual, CMU chapter, for further details.

Note:
This function will not return until calibration measurement is completed.
Parameters:
[in] HFCycles The number of HFCLK cycles to run calibration. Increasing this number increases precision, but the calibration will take more time.
[in] ref The reference clock used to compare HFCLK with.
Returns:
The number of ticks the reference clock after HFCycles ticks on the HF clock.

Definition at line 480 of file em_cmu.c.

References cmuOsc_AUXHFRCO, cmuOsc_HFRCO, cmuOsc_HFXO, cmuOsc_LFRCO, and cmuOsc_LFXO.

__STATIC_INLINE uint32_t CMU_CalibrateCountGet ( void   ) 

Get calibration count register.

Note:
If continuous calibrartion mode is active, calibration busy will allmost always be on, and we just need to read the value, where the normal case would be that this function call has been triggered by the CALRDY interrupt flag.
Returns:
Calibration count, the number of UPSEL clocks (see CMU_CalibrateConfig) in the period of DOWNSEL oscillator clock cycles configured by a previous write operation to CMU->CALCNT

Definition at line 797 of file em_cmu.h.

__STATIC_INLINE void CMU_CalibrateStart ( void   ) 

Starts calibration.

Note:
This call is usually invoked after CMU_CalibrateConfig() and possibly CMU_CalibrateCont()

Definition at line 822 of file em_cmu.h.

CMU_ClkDiv_TypeDef CMU_ClockDivGet ( CMU_Clock_TypeDef  clock  ) 

Get clock divisor/prescaler.

Parameters:
[in] clock Clock point to get divisor/prescaler for. Notice that not all clock points have a divisor/prescaler. Please refer to CMU overview in reference manual.
Returns:
The current clock point divisor/prescaler. 1 is returned if clock specifies a clock point without a divisor/prescaler.

Definition at line 638 of file em_cmu.c.

References cmuClkDiv_1, cmuClkDiv_16, cmuClock_LCDpre, cmuClock_LESENSE, cmuClock_LETIMER0, cmuClock_LEUART0, cmuClock_LEUART1, and cmuClock_RTC.

Referenced by CMU_ClockEnable().

Here is the caller graph for this function:

void CMU_ClockDivSet ( CMU_Clock_TypeDef  clock,
CMU_ClkDiv_TypeDef  div 
)

Set clock divisor/prescaler.

Note:
If setting a 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. Please refer to CMU_FreezeEnable() for a suggestion on how to reduce stalling time in some use cases.
Parameters:
[in] clock Clock point to set divisor/prescaler for. Notice that not all clock points have a divisor/prescaler, please refer to CMU overview in the reference manual.
[in] div The clock divisor to use (<= cmuClkDiv_512).

Definition at line 764 of file em_cmu.c.

References BITBAND_Peripheral(), CMU_ClockSelectGet(), cmuClkDiv_1, cmuClkDiv_128, cmuClkDiv_16, cmuClkDiv_32768, cmuClkDiv_512, cmuClkDiv_8, cmuClock_HF, cmuClock_LCDpre, cmuClock_LESENSE, cmuClock_LETIMER0, cmuClock_LEUART0, cmuClock_LEUART1, cmuClock_RTC, and cmuSelect_HFXO.

Here is the call graph for this function:

void CMU_ClockEnable ( CMU_Clock_TypeDef  clock,
bool  enable 
)

Enable/disable a clock.

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 have no effect. One should normally avoid accessing module registers of a module with a disabled clock.

Note:
If enabling/disabling a 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. Please refer to CMU_FreezeEnable() for a suggestion on how to reduce stalling time in some use cases.
Parameters:
[in] clock The clock to enable/disable. Notice that not all defined clock points have separate enable/disable control, please refer to CMU overview in reference manual.
[in] enable 
  • true - enable specified clock.
  • false - disable specified clock.

Definition at line 986 of file em_cmu.c.

References BITBAND_Peripheral(), CMU_ClockDivGet(), CMU_ClockSelectGet(), cmuClock_CORE, cmuClock_HF, and cmuSelect_HFXO.

Referenced by DMA_Init().

Here is the call graph for this function:

Here is the caller graph for this function:

uint32_t CMU_ClockFreqGet ( CMU_Clock_TypeDef  clock  ) 

Get clock frequency for a clock point.

Parameters:
[in] clock Clock point to fetch frequency for.
Returns:
The current frequency in Hz.

Definition at line 1066 of file em_cmu.c.

References cmuClkDiv_16.

Referenced by ADC_PrescaleCalc(), ADC_TimebaseCalc(), DAC_PrescaleCalc(), I2C_BusFreqGet(), I2C_BusFreqSet(), LESENSE_ScanFreqSet(), LEUART_BaudrateGet(), LEUART_BaudrateSet(), MSC_Init(), USART_BaudrateAsyncSet(), USART_BaudrateGet(), and USART_BaudrateSyncSet().

Here is the caller graph for this function:

CMU_Select_TypeDef CMU_ClockSelectGet ( CMU_Clock_TypeDef  clock  ) 

Get currently selected reference clock used for a clock branch.

Parameters:
[in] clock Clock branch to fetch selected ref. clock for. One of:

Returns:
Reference clock used for clocking selected branch, cmuSelect_Error if invalid clock provided.

Definition at line 1233 of file em_cmu.c.

References cmuSelect_AUXHFRCO, cmuSelect_CORELEDIV2, cmuSelect_Disabled, cmuSelect_Error, cmuSelect_HFCLK, cmuSelect_HFRCO, cmuSelect_HFXO, cmuSelect_LFRCO, cmuSelect_LFXO, and cmuSelect_ULFRCO.

Referenced by CMU_ClockDivSet(), CMU_ClockEnable(), and CMU_HFRCOBandSet().

Here is the caller graph for this function:

void CMU_ClockSelectSet ( CMU_Clock_TypeDef  clock,
CMU_Select_TypeDef  ref 
)

Select reference clock/oscillator used for a 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.

Parameters:
[in] clock Clock branch to select reference clock for. One of:

[in] ref Reference selected for clocking, please refer to reference manual for for details on which reference is available for a specific clock branch.

Definition at line 1412 of file em_cmu.c.

References BITBAND_Peripheral(), CMU_OscillatorEnable(), cmuOsc_HFRCO, cmuOsc_HFXO, cmuOsc_LFRCO, cmuOsc_LFXO, cmuSelect_AUXHFRCO, cmuSelect_CORELEDIV2, cmuSelect_Disabled, cmuSelect_HFCLK, cmuSelect_HFRCO, cmuSelect_HFXO, cmuSelect_LFRCO, cmuSelect_LFXO, cmuSelect_ULFRCO, and EMU_UpdateOscConfig().

Here is the call graph for this function:

void CMU_FreezeEnable ( bool  enable  ) 

CMU low frequency register synchronization freeze control.

Some CMU registers requires 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 usage scenario of this feature, is when 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 unecessary stalling.
Parameters:
[in] enable 
  • true - enable freeze, modified registers are not propagated to the LF domain
  • false - disable freeze, modified registers are propagated to LF domain

Definition at line 1689 of file em_cmu.c.

CMU_HFRCOBand_TypeDef CMU_HFRCOBandGet ( void   ) 

Get HFRCO band in use.

Returns:
HFRCO band in use.

Definition at line 1795 of file em_cmu.c.

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.

Parameters:
[in] band HFRCO band to activate.

Definition at line 1810 of file em_cmu.c.

References CMU_ClockSelectGet(), cmuClock_HF, cmuHFRCOBand_11MHz, cmuHFRCOBand_14MHz, cmuHFRCOBand_1MHz, cmuHFRCOBand_21MHz, cmuHFRCOBand_7MHz, and cmuSelect_HFRCO.

Here is the call graph for this function:

uint32_t CMU_HFRCOStartupDelayGet ( void   ) 

Get the HFRCO startup delay.

Please refer to the reference manual for further details.

Returns:
The startup delay in use.

Definition at line 1895 of file em_cmu.c.

void CMU_HFRCOStartupDelaySet ( uint32_t  delay  ) 

Set the HFRCO startup delay.

Please refer to the reference manual for further details.

Parameters:
[in] delay The startup delay to set (<= 31).

Definition at line 1912 of file em_cmu.c.

__STATIC_INLINE void CMU_IntClear ( uint32_t  flags  ) 

Clear one or more pending CMU interrupts.

Parameters:
[in] flags CMU interrupt sources to clear.

Definition at line 660 of file em_cmu.h.

__STATIC_INLINE void CMU_IntDisable ( uint32_t  flags  ) 

Disable one or more CMU interrupts.

Parameters:
[in] flags CMU interrupt sources to disable.

Definition at line 673 of file em_cmu.h.

__STATIC_INLINE void CMU_IntEnable ( uint32_t  flags  ) 

Enable one or more CMU interrupts.

Note:
Depending on the use, a pending interrupt may already be set prior to enabling the interrupt. Consider using CMU_IntClear() prior to enabling if such a pending interrupt should be ignored.
Parameters:
[in] flags CMU interrupt sources to enable.

Definition at line 691 of file em_cmu.h.

__STATIC_INLINE uint32_t CMU_IntGet ( void   ) 

Get pending CMU interrupts.

Returns:
CMU interrupt sources pending.

Definition at line 704 of file em_cmu.h.

__STATIC_INLINE uint32_t CMU_IntGetEnabled ( void   ) 

Get enabled and pending CMU interrupt flags.

Useful for handling more interrupt sources in the same interrupt handler.

Note:
The event bits are not cleared by the use of this function.
Returns:
Pending and enabled CMU interrupt sources. The return value is the bitwise AND combination of
  • the OR combination of enabled interrupt sources in CMU_IEN_nnn register (CMU_IEN_nnn) and
  • the OR combination of valid interrupt flags of the CMU module (CMU_IF_nnn).

Definition at line 728 of file em_cmu.h.

__STATIC_INLINE void CMU_IntSet ( uint32_t  flags  ) 

Set one or more pending CMU interrupts from SW.

Parameters:
[in] flags CMU interrupt sources to set to pending.

Definition at line 749 of file em_cmu.h.

uint32_t CMU_LCDClkFDIVGet ( void   ) 

Get the LCD framerate divisor (FDIV) setting.

Returns:
The LCD framerate divisor.

Definition at line 1929 of file em_cmu.c.

void CMU_LCDClkFDIVSet ( uint32_t  div  ) 

Set the LCD framerate divisor (FDIV) setting.

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. Please refer to CMU_ClockEnable() for disabling/enabling LCD clock.
Parameters:
[in] div The FDIV setting to use.

Definition at line 1952 of file em_cmu.c.

References cmuClkDiv_128.

__STATIC_INLINE void CMU_Lock ( void   ) 

Lock the CMU in order to protect some of its registers against unintended modification.

Please refer to 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.

Definition at line 768 of file em_cmu.h.

Referenced by EMU_EnterEM3().

Here is the caller graph for this function:

void CMU_OscillatorEnable ( CMU_Osc_TypeDef  osc,
bool  enable,
bool  wait 
)

Enable/disable oscillator.

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. I.e. 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.
Parameters:
[in] osc The oscillator to enable/disable.
[in] enable 
  • true - enable specified oscillator.
  • false - disable specified oscillator.
[in] wait Only used if enable is true.

  • true - wait for oscillator start-up time to timeout before returning.
  • false - do not wait for oscillator start-up time to timeout before returning.

Definition at line 1996 of file em_cmu.c.

References cmuOsc_AUXHFRCO, cmuOsc_HFRCO, cmuOsc_HFXO, cmuOsc_LFRCO, cmuOsc_LFXO, cmuOsc_ULFRCO, and EMU_UpdateOscConfig().

Referenced by CMU_ClockSelectSet().

Here is the call graph for this function:

Here is the caller graph for this function:

uint32_t CMU_OscillatorTuningGet ( CMU_Osc_TypeDef  osc  ) 

Get oscillator frequency tuning setting.

Parameters:
[in] osc Oscillator to get tuning value for, one of:

Returns:
The oscillator frequency tuning setting in use.

Definition at line 2080 of file em_cmu.c.

References cmuOsc_AUXHFRCO, cmuOsc_HFRCO, and cmuOsc_LFRCO.

void CMU_OscillatorTuningSet ( CMU_Osc_TypeDef  osc,
uint32_t  val 
)

Set the oscillator frequency tuning control.

Note:
Oscillator tuning is done during production, and the tuning value is automatically loaded after a reset. Changing the tuning value from the calibrated value is for more advanced use.
Parameters:
[in] osc Oscillator to set tuning value for, one of:

[in] val The oscillator frequency tuning setting to use.

Definition at line 2129 of file em_cmu.c.

References cmuOsc_AUXHFRCO, cmuOsc_HFRCO, and cmuOsc_LFRCO.

bool CMU_PCNTClockExternalGet ( unsigned int  inst  ) 

Determine if currently selected PCNTn clock used is external or LFBCLK.

Parameters:
[in] inst PCNT instance number to get currently selected clock source for.
Returns:
  • true - selected clock is external clock.
  • false - selected clock is LFBCLK.

Definition at line 2175 of file em_cmu.c.

void CMU_PCNTClockExternalSet ( unsigned int  inst,
bool  external 
)

Select PCNTn clock.

Parameters:
[in] inst PCNT instance number to set selected clock source for.
[in] external Set to true to select external clock, false to select LFBCLK.

Definition at line 2227 of file em_cmu.c.

References BITBAND_Peripheral().

Referenced by PCNT_Init(), and PCNT_Reset().

Here is the call graph for this function:

Here is the caller graph for this function:

__STATIC_INLINE void CMU_Unlock ( void   ) 

Unlock the CMU so that writing to locked registers again is possible.

Definition at line 778 of file em_cmu.h.

Referenced by EMU_EnterEM3().

Here is the caller graph for this function: