EFM32 Pearl Gecko 12 Software Documentation
efm32pg12-doc-5.1.2
|
Clock management unit (CMU) Peripheral API.
This module contains functions to control the CMU peripheral of Silicon Labs 32-bit MCUs and SoCs. The CMU controls oscillators and clocks.
Data Structures | |
struct | CMU_HFXOInit_TypeDef |
struct | CMU_LFXOInit_TypeDef |
Macros | |
#define | CMU_AUXHFRCO_MAX cmuAUXHFRCOFreq_38M0Hz |
#define | CMU_AUXHFRCO_MIN cmuAUXHFRCOFreq_1M0Hz |
#define | CMU_HFRCO_MAX cmuHFRCOFreq_38M0Hz |
#define | CMU_HFRCO_MIN cmuHFRCOFreq_1M0Hz |
#define | CMU_HFXOINIT_DEFAULT |
#define | CMU_HFXOINIT_EXTERNAL_CLOCK |
#define | CMU_LFXOINIT_DEFAULT |
#define | CMU_LFXOINIT_EXTERNAL_CLOCK |
#define | cmuClkDiv_1 1 |
#define | cmuClkDiv_1024 1024 |
#define | cmuClkDiv_128 128 |
#define | cmuClkDiv_16 16 |
#define | cmuClkDiv_16384 16384 |
#define | cmuClkDiv_2 2 |
#define | cmuClkDiv_2048 2048 |
#define | cmuClkDiv_256 256 |
#define | cmuClkDiv_32 32 |
#define | cmuClkDiv_32768 32768 |
#define | cmuClkDiv_4 4 |
#define | cmuClkDiv_4096 4096 |
#define | cmuClkDiv_512 512 |
#define | cmuClkDiv_64 64 |
#define | cmuClkDiv_8 8 |
#define | cmuClkDiv_8192 8192 |
Typedefs | |
typedef uint32_t | CMU_ClkDiv_TypeDef |
typedef uint32_t | CMU_ClkPresc_TypeDef |
Functions | |
CMU_AUXHFRCOFreq_TypeDef | CMU_AUXHFRCOBandGet (void) |
Get current AUXHFRCO frequency. More... | |
void | CMU_AUXHFRCOBandSet (CMU_AUXHFRCOFreq_TypeDef setFreq) |
Set AUXHFRCO calibration for the selected target frequency. More... | |
static uint32_t | CMU_AUXHFRCODevinfoGet (CMU_AUXHFRCOFreq_TypeDef freq) |
Get a pointer to the AUXHFRCO frequency calibration word in DEVINFO. More... | |
__STATIC_INLINE CMU_AUXHFRCOFreq_TypeDef | CMU_AUXHFRCOFreqGet (void) |
Get current AUXHFRCO frequency. More... | |
__STATIC_INLINE void | CMU_AUXHFRCOFreqSet (CMU_AUXHFRCOFreq_TypeDef setFreq) |
Set AUXHFRCO calibration for the selected target frequency. More... | |
uint32_t | CMU_Calibrate (uint32_t HFCycles, CMU_Osc_TypeDef ref) |
Calibrate clock. More... | |
void | CMU_CalibrateConfig (uint32_t downCycles, CMU_Osc_TypeDef downSel, CMU_Osc_TypeDef upSel) |
Configure clock calibration. More... | |
__STATIC_INLINE void | CMU_CalibrateCont (bool enable) |
Configures continuous calibration mode. More... | |
uint32_t | CMU_CalibrateCountGet (void) |
Get calibration count register. More... | |
__STATIC_INLINE void | CMU_CalibrateStart (void) |
Starts calibration. More... | |
__STATIC_INLINE void | CMU_CalibrateStop (void) |
Stop the calibration counters. | |
CMU_ClkDiv_TypeDef | CMU_ClockDivGet (CMU_Clock_TypeDef clock) |
Get clock divisor/prescaler. More... | |
void | CMU_ClockDivSet (CMU_Clock_TypeDef clock, CMU_ClkDiv_TypeDef div) |
Set clock divisor/prescaler. More... | |
void | CMU_ClockEnable (CMU_Clock_TypeDef clock, bool enable) |
Enable/disable a clock. More... | |
uint32_t | CMU_ClockFreqGet (CMU_Clock_TypeDef clock) |
Get clock frequency for a clock point. More... | |
uint32_t | CMU_ClockPrescGet (CMU_Clock_TypeDef clock) |
Get clock prescaler. More... | |
void | CMU_ClockPrescSet (CMU_Clock_TypeDef clock, CMU_ClkPresc_TypeDef presc) |
Set clock prescaler. More... | |
CMU_Select_TypeDef | CMU_ClockSelectGet (CMU_Clock_TypeDef clock) |
Get currently selected reference clock used for a clock branch. More... | |
void | CMU_ClockSelectSet (CMU_Clock_TypeDef clock, CMU_Select_TypeDef ref) |
Select reference clock/oscillator used for a clock branch. More... | |
__STATIC_INLINE uint32_t | CMU_DivToLog2 (CMU_ClkDiv_TypeDef div) |
Convert dividend to logarithmic value. Only works for even numbers equal to 2^n. More... | |
void | CMU_FreezeEnable (bool enable) |
CMU low frequency register synchronization freeze control. More... | |
CMU_HFRCOFreq_TypeDef | CMU_HFRCOBandGet (void) |
Get current HFRCO frequency. More... | |
void | CMU_HFRCOBandSet (CMU_HFRCOFreq_TypeDef setFreq) |
Set HFRCO calibration for the selected target frequency. More... | |
static uint32_t | CMU_HFRCODevinfoGet (CMU_HFRCOFreq_TypeDef freq) |
Get a pointer to the HFRCO frequency calibration word in DEVINFO. More... | |
__STATIC_INLINE CMU_HFRCOFreq_TypeDef | CMU_HFRCOFreqGet (void) |
Get current HFRCO frequency. More... | |
__STATIC_INLINE void | CMU_HFRCOFreqSet (CMU_HFRCOFreq_TypeDef setFreq) |
Set HFRCO calibration for the selected target frequency. More... | |
uint32_t | CMU_HFRCOStartupDelayGet (void) |
void | CMU_HFRCOStartupDelaySet (uint32_t delay) |
void | CMU_HFXOAutostartEnable (uint32_t userSel, bool enEM0EM1Start, bool enEM0EM1StartSel) |
Enable or disable HFXO autostart. More... | |
void | CMU_HFXOInit (const CMU_HFXOInit_TypeDef *hfxoInit) |
Set HFXO control registers. More... | |
__STATIC_INLINE void | CMU_IntClear (uint32_t flags) |
Clear one or more pending CMU interrupts. More... | |
__STATIC_INLINE void | CMU_IntDisable (uint32_t flags) |
Disable one or more CMU interrupts. More... | |
__STATIC_INLINE void | CMU_IntEnable (uint32_t flags) |
Enable one or more CMU interrupts. More... | |
__STATIC_INLINE uint32_t | CMU_IntGet (void) |
Get pending CMU interrupts. More... | |
__STATIC_INLINE uint32_t | CMU_IntGetEnabled (void) |
Get enabled and pending CMU interrupt flags. More... | |
__STATIC_INLINE void | CMU_IntSet (uint32_t flags) |
Set one or more pending CMU interrupts. More... | |
uint32_t | CMU_LCDClkFDIVGet (void) |
Get the LCD framerate divisor (FDIV) setting. More... | |
void | CMU_LCDClkFDIVSet (uint32_t div) |
Set the LCD framerate divisor (FDIV) setting. More... | |
void | CMU_LFXOInit (const CMU_LFXOInit_TypeDef *lfxoInit) |
Set LFXO control registers. More... | |
__STATIC_INLINE void | CMU_Lock (void) |
Lock the CMU in order to protect some of its registers against unintended modification. More... | |
__STATIC_INLINE uint32_t | CMU_Log2ToDiv (uint32_t log2) |
Convert logarithm of 2 prescaler to division factor. More... | |
void | CMU_OscillatorEnable (CMU_Osc_TypeDef osc, bool enable, bool wait) |
Enable/disable oscillator. More... | |
uint32_t | CMU_OscillatorTuningGet (CMU_Osc_TypeDef osc) |
Get oscillator frequency tuning setting. More... | |
bool | CMU_OscillatorTuningOptimize (CMU_Osc_TypeDef osc, CMU_HFXOTuningMode_TypeDef mode, bool wait) |
Start and optionally wait for oscillator tuning optimization. More... | |
void | CMU_OscillatorTuningSet (CMU_Osc_TypeDef osc, uint32_t val) |
Set the oscillator frequency tuning control. More... | |
bool | CMU_OscillatorTuningWait (CMU_Osc_TypeDef osc, CMU_HFXOTuningMode_TypeDef mode) |
Wait for oscillator tuning optimization. More... | |
bool | CMU_PCNTClockExternalGet (unsigned int instance) |
Determine if currently selected PCNTn clock used is external or LFBCLK. More... | |
void | CMU_PCNTClockExternalSet (unsigned int instance, bool external) |
Select PCNTn clock. More... | |
__STATIC_INLINE uint32_t | CMU_PrescToLog2 (CMU_ClkPresc_TypeDef presc) |
Convert prescaler dividend to logarithmic value. Only works for even numbers equal to 2^n. More... | |
__STATIC_INLINE void | CMU_Unlock (void) |
Unlock the CMU so that writing to locked registers again is possible. | |
#define CMU_HFXOINIT_DEFAULT |
Default HFXO initialization values for Platform 2 devices which contain a separate HFXOCTRL register.
#define CMU_HFXOINIT_EXTERNAL_CLOCK |
#define CMU_LFXOINIT_DEFAULT |
Default LFXO initialization values for platform 2 devices which contain a separate LFXOCTRL register.
#define CMU_LFXOINIT_EXTERNAL_CLOCK |
#define cmuClkDiv_1 1 |
Clock divisors. These values are valid for prescalers. Divide clock by 1.
Definition at line 149 of file em_cmu.h.
Referenced by CAPLESENSE_setupCMU(), CMU_ClockDivGet(), CMU_ClockDivSet(), and RETARGET_SerialInit().
#define cmuClkDiv_128 128 |
Divide clock by 128.
Definition at line 156 of file em_cmu.h.
Referenced by CMU_ClockDivSet(), and CMU_LCDClkFDIVSet().
#define cmuClkDiv_16 16 |
Divide clock by 16.
Definition at line 153 of file em_cmu.h.
Referenced by CMU_ClockDivGet(), CMU_ClockDivSet(), and CMU_ClockFreqGet().
#define cmuClkDiv_256 256 |
#define cmuClkDiv_32768 32768 |
#define cmuClkDiv_512 512 |
#define cmuClkDiv_8 8 |
typedef uint32_t CMU_ClkDiv_TypeDef |
typedef uint32_t CMU_ClkPresc_TypeDef |
AUX High frequency RCO bands
enum CMU_Clock_TypeDef |
Clock points in CMU. Please refer to CMU overview in reference manual.
High frequency system RCO bands
enum CMU_Osc_TypeDef |
Oscillator types.
enum CMU_OscMode_TypeDef |
enum CMU_Select_TypeDef |
Selectable clock sources.
CMU_AUXHFRCOFreq_TypeDef CMU_AUXHFRCOBandGet | ( | void | ) |
Get current AUXHFRCO frequency.
Definition at line 828 of file em_cmu.c.
Referenced by CMU_AUXHFRCOFreqGet().
void CMU_AUXHFRCOBandSet | ( | CMU_AUXHFRCOFreq_TypeDef | setFreq | ) |
Set AUXHFRCO calibration for the selected target frequency.
[in] | setFreq | AUXHFRCO frequency to set |
Definition at line 843 of file em_cmu.c.
References _CMU_AUXHFRCOCTRL_CLKDIV_MASK, _CMU_SYNCBUSY_AUXHFRCOBSY_SHIFT, BUS_RegBitRead(), CMU, CMU_AUXHFRCOCTRL_CLKDIV_DIV1, CMU_AUXHFRCOCTRL_CLKDIV_DIV2, CMU_AUXHFRCOCTRL_CLKDIV_DIV4, CMU_AUXHFRCODevinfoGet(), cmuAUXHFRCOFreq_1M0Hz, cmuAUXHFRCOFreq_2M0Hz, and cmuAUXHFRCOFreq_4M0Hz.
Referenced by CMU_AUXHFRCOFreqSet().
|
static |
Get a pointer to the AUXHFRCO frequency calibration word in DEVINFO.
[in] | freq | Frequency in Hz |
Definition at line 782 of file em_cmu.c.
References cmuAUXHFRCOFreq_13M0Hz, cmuAUXHFRCOFreq_16M0Hz, cmuAUXHFRCOFreq_19M0Hz, cmuAUXHFRCOFreq_1M0Hz, cmuAUXHFRCOFreq_26M0Hz, cmuAUXHFRCOFreq_2M0Hz, cmuAUXHFRCOFreq_32M0Hz, cmuAUXHFRCOFreq_38M0Hz, cmuAUXHFRCOFreq_4M0Hz, cmuAUXHFRCOFreq_7M0Hz, and DEVINFO.
Referenced by CMU_AUXHFRCOBandSet().
__STATIC_INLINE CMU_AUXHFRCOFreq_TypeDef CMU_AUXHFRCOFreqGet | ( | void | ) |
Get current AUXHFRCO frequency.
Definition at line 1540 of file em_cmu.h.
References CMU_AUXHFRCOBandGet().
__STATIC_INLINE void CMU_AUXHFRCOFreqSet | ( | CMU_AUXHFRCOFreq_TypeDef | setFreq | ) |
Set AUXHFRCO calibration for the selected target frequency.
[in] | setFreq | AUXHFRCO frequency to set |
Definition at line 1556 of file em_cmu.h.
References CMU_AUXHFRCOBandSet().
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 reference manual, CMU chapter, for further details.
[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. |
Definition at line 904 of file em_cmu.c.
References _CMU_CALCNT_CALCNT_MASK, _CMU_CALCNT_CALCNT_SHIFT, _CMU_STATUS_CALRDY_SHIFT, BUS_RegBitRead(), CMU, CMU_CALCTRL_UPSEL_AUXHFRCO, CMU_CALCTRL_UPSEL_HFRCO, CMU_CALCTRL_UPSEL_HFXO, CMU_CALCTRL_UPSEL_LFRCO, CMU_CALCTRL_UPSEL_LFXO, CMU_CMD_CALSTART, cmuOsc_AUXHFRCO, cmuOsc_HFRCO, cmuOsc_HFXO, cmuOsc_LFRCO, and cmuOsc_LFXO.
void CMU_CalibrateConfig | ( | uint32_t | downCycles, |
CMU_Osc_TypeDef | downSel, | ||
CMU_Osc_TypeDef | upSel | ||
) |
Configure clock calibration.
Configure a calibration for a selectable clock source against another selectable reference clock. Refer to the reference manual, CMU chapter, for further details.
[in] | downCycles | The number of downSel clock cycles to run 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, the result can be given with the CMU_CalibrateCountGet() function call. |
Definition at line 985 of file em_cmu.c.
References _CMU_CALCNT_CALCNT_MASK, _CMU_CALCNT_CALCNT_SHIFT, _CMU_CALCTRL_DOWNSEL_MASK, _CMU_CALCTRL_UPSEL_MASK, CMU, CMU_CALCTRL_DOWNSEL_AUXHFRCO, CMU_CALCTRL_DOWNSEL_HFRCO, CMU_CALCTRL_DOWNSEL_HFXO, CMU_CALCTRL_DOWNSEL_LFRCO, CMU_CALCTRL_DOWNSEL_LFXO, CMU_CALCTRL_UPSEL_AUXHFRCO, CMU_CALCTRL_UPSEL_HFRCO, CMU_CALCTRL_UPSEL_HFXO, CMU_CALCTRL_UPSEL_LFRCO, CMU_CALCTRL_UPSEL_LFXO, cmuOsc_AUXHFRCO, cmuOsc_HFRCO, cmuOsc_HFXO, cmuOsc_LFRCO, and cmuOsc_LFXO.
__STATIC_INLINE void CMU_CalibrateCont | ( | bool | enable | ) |
Configures continuous calibration mode.
[in] | enable | If true, enables continuous calibration, if false disables continuous calibrartion |
Definition at line 1268 of file em_cmu.h.
References _CMU_CALCTRL_CONT_SHIFT, BUS_RegBitWrite(), and CMU.
uint32_t CMU_CalibrateCountGet | ( | void | ) |
Get calibration count register.
Definition at line 1072 of file em_cmu.c.
References _CMU_CALCTRL_CONT_SHIFT, _CMU_STATUS_CALRDY_SHIFT, BUS_RegBitRead(), and CMU.
__STATIC_INLINE void CMU_CalibrateStart | ( | void | ) |
Starts calibration.
Definition at line 1282 of file em_cmu.h.
References CMU, and CMU_CMD_CALSTART.
CMU_ClkDiv_TypeDef CMU_ClockDivGet | ( | CMU_Clock_TypeDef | clock | ) |
Get clock divisor/prescaler.
[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. |
clock
specifies a clock point without a divisor/prescaler. Definition at line 1112 of file em_cmu.c.
References _CMU_LFAPRESC0_LESENSE_MASK, _CMU_LFAPRESC0_LESENSE_SHIFT, _CMU_LFAPRESC0_LETIMER0_MASK, _CMU_LFAPRESC0_LETIMER0_SHIFT, _CMU_LFBPRESC0_LEUART0_MASK, _CMU_LFBPRESC0_LEUART0_SHIFT, CMU, CMU_ClockPrescGet(), CMU_DivToLog2(), CMU_Log2ToDiv(), cmuClkDiv_1, cmuClkDiv_16, cmuClock_LESENSE, cmuClock_LETIMER0, and cmuClock_LEUART0.
Referenced by UDELAY_Calibrate().
void CMU_ClockDivSet | ( | CMU_Clock_TypeDef | clock, |
CMU_ClkDiv_TypeDef | div | ||
) |
Set clock divisor/prescaler.
[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 1244 of file em_cmu.c.
References _CMU_LFAPRESC0_LESENSE_MASK, _CMU_LFAPRESC0_LESENSE_SHIFT, _CMU_LFAPRESC0_LETIMER0_MASK, _CMU_LFAPRESC0_LETIMER0_SHIFT, _CMU_LFBPRESC0_LEUART0_MASK, _CMU_LFBPRESC0_LEUART0_SHIFT, CMU, CMU_ClockPrescSet(), CMU_DivToLog2(), CMU_SYNCBUSY_LFAPRESC0, CMU_SYNCBUSY_LFBPRESC0, cmuClkDiv_1, cmuClkDiv_128, cmuClkDiv_16, cmuClkDiv_32768, cmuClkDiv_512, cmuClkDiv_8, cmuClock_LESENSE, cmuClock_LETIMER0, cmuClock_LEUART0, SystemCoreClockGet(), and SystemHFClockGet().
Referenced by CAPLESENSE_setupCMU(), RETARGET_SerialInit(), RTCDRV_Init(), SegmentLCD_Init(), UARTDRV_InitLeuart(), and UDELAY_Calibrate().
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.
[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 |
|
Definition at line 1453 of file em_cmu.c.
References BUS_RegBitWrite(), CMU, CMU_ClockFreqGet(), CMU_SYNCBUSY_LFACLKEN0, CMU_SYNCBUSY_LFBCLKEN0, CMU_SYNCBUSY_LFECLKEN0, and cmuClock_HFLE.
Referenced by adcInit(), BOARD_init(), BSP_BccDeInit(), BSP_BccInit(), BSP_BusControlModeSet(), BSP_EbiInit(), BSP_McuBoard_Init(), CAPLESENSE_setupCMU(), CAPSENSE_Init(), DMADRV_DeInit(), ezradio_hal_GpioInit(), I2CSPM_Init(), ICM20648_spiInit(), LDMA_DeInit(), LDMA_Init(), MIC_init(), MICROSD_Init(), MICROSD_PowerOff(), MICROSD_PowerOn(), MSDD_Init(), RETARGET_SerialInit(), RTCDRV_DeInit(), RTCDRV_Init(), SegmentLCD_Disable(), SegmentLCD_Init(), setupOscillators(), SPI_TFT_Init(), SPIDRV_DeInit(), SPIDRV_Init(), TOUCH_Init(), UARTDRV_DeInit(), UARTDRV_InitLeuart(), UARTDRV_InitUart(), UDELAY_Calibrate(), USTIMER_DeInit(), USTIMER_Init(), VDDCHECK_Disable(), and VDDCHECK_Init().
uint32_t CMU_ClockFreqGet | ( | CMU_Clock_TypeDef | clock | ) |
Get clock frequency for a clock point.
[in] | clock | Clock point to fetch frequency for. |
Definition at line 1550 of file em_cmu.c.
References _CMU_HFCOREPRESC_PRESC_MASK, _CMU_HFCOREPRESC_PRESC_SHIFT, _CMU_HFEXPPRESC_PRESC_MASK, _CMU_HFEXPPRESC_PRESC_SHIFT, _CMU_HFPERPRESC_PRESC_MASK, _CMU_HFPERPRESC_PRESC_SHIFT, _CMU_LFAPRESC0_LESENSE_MASK, _CMU_LFAPRESC0_LESENSE_SHIFT, _CMU_LFAPRESC0_LETIMER0_MASK, _CMU_LFAPRESC0_LETIMER0_SHIFT, _CMU_LFBPRESC0_CSEN_MASK, _CMU_LFBPRESC0_CSEN_SHIFT, _CMU_LFBPRESC0_LEUART0_MASK, _CMU_LFBPRESC0_LEUART0_SHIFT, CMU, CMU_DivToLog2(), CMU_Log2ToDiv(), cmuClkDiv_16, cmuClock_LFA, cmuClock_LFB, cmuClock_LFE, SystemCoreClockGet(), and SystemHFClockGet().
Referenced by ADC_PrescaleCalc(), ADC_TimebaseCalc(), BSP_TraceSwoSetup(), CMU_ClockEnable(), CMU_ClockPrescSet(), CMU_ClockSelectSet(), CMU_HFRCOBandSet(), I2C_BusFreqGet(), I2C_BusFreqSet(), LESENSE_ScanFreqSet(), LEUART_BaudrateGet(), LEUART_BaudrateSet(), MIC_init(), MSC_Init(), UARTDRV_InitLeuart(), USART_BaudrateAsyncSet(), USART_BaudrateGet(), USART_BaudrateSyncSet(), USTIMER_Init(), UTIL_init(), and VDAC_PrescaleCalc().
uint32_t CMU_ClockPrescGet | ( | CMU_Clock_TypeDef | clock | ) |
Get clock prescaler.
[in] | clock | Clock point to get the prescaler for. Notice that not all clock points have a prescaler. Please refer to CMU overview in reference manual. |
clock
specifies a clock point without a prescaler. Definition at line 1746 of file em_cmu.c.
References _CMU_HFCOREPRESC_PRESC_MASK, _CMU_HFCOREPRESC_PRESC_SHIFT, _CMU_HFEXPPRESC_PRESC_MASK, _CMU_HFEXPPRESC_PRESC_SHIFT, _CMU_HFPERPRESC_PRESC_MASK, _CMU_HFPERPRESC_PRESC_SHIFT, _CMU_HFPRESC_HFCLKLEPRESC_MASK, _CMU_HFPRESC_HFCLKLEPRESC_SHIFT, _CMU_HFPRESC_PRESC_MASK, _CMU_HFPRESC_PRESC_SHIFT, _CMU_LFAPRESC0_LESENSE_MASK, _CMU_LFAPRESC0_LESENSE_SHIFT, _CMU_LFAPRESC0_LETIMER0_MASK, _CMU_LFAPRESC0_LETIMER0_SHIFT, _CMU_LFBPRESC0_CSEN_MASK, _CMU_LFBPRESC0_CSEN_SHIFT, _CMU_LFBPRESC0_LEUART0_MASK, _CMU_LFBPRESC0_LEUART0_SHIFT, _CMU_LFEPRESC0_RTCC_DIV1, CMU, CMU_Log2ToDiv(), cmuClock_CSEN_LF, cmuClock_LESENSE, cmuClock_LETIMER0, cmuClock_LEUART0, and cmuClock_RTCC.
Referenced by CMU_ClockDivGet().
void CMU_ClockPrescSet | ( | CMU_Clock_TypeDef | clock, |
CMU_ClkPresc_TypeDef | presc | ||
) |
Set clock prescaler.
[in] | clock | Clock point to set prescaler for. Notice that not all clock points have a prescaler, please refer to CMU overview in the reference manual. |
[in] | presc | The clock prescaler to use. |
Definition at line 1894 of file em_cmu.c.
References _CMU_HFCOREPRESC_PRESC_MASK, _CMU_HFCOREPRESC_PRESC_SHIFT, _CMU_HFEXPPRESC_PRESC_MASK, _CMU_HFEXPPRESC_PRESC_SHIFT, _CMU_HFPERPRESC_PRESC_MASK, _CMU_HFPERPRESC_PRESC_SHIFT, _CMU_HFPRESC_HFCLKLEPRESC_MASK, _CMU_HFPRESC_HFCLKLEPRESC_SHIFT, _CMU_HFPRESC_PRESC_MASK, _CMU_HFPRESC_PRESC_SHIFT, _CMU_LFAPRESC0_LESENSE_MASK, _CMU_LFAPRESC0_LESENSE_SHIFT, _CMU_LFAPRESC0_LETIMER0_MASK, _CMU_LFAPRESC0_LETIMER0_SHIFT, _CMU_LFBPRESC0_CSEN_MASK, _CMU_LFBPRESC0_CSEN_SHIFT, _CMU_LFBPRESC0_LEUART0_MASK, _CMU_LFBPRESC0_LEUART0_SHIFT, _CMU_LFEPRESC0_RTCC_MASK, _CMU_LFEPRESC0_RTCC_SHIFT, CMU, CMU_ClockFreqGet(), CMU_PrescToLog2(), CMU_SYNCBUSY_LFAPRESC0, CMU_SYNCBUSY_LFBPRESC0, CMU_SYNCBUSY_LFEPRESC0, cmuClock_CSEN_LF, cmuClock_HFLE, cmuClock_LESENSE, cmuClock_LETIMER0, cmuClock_LEUART0, cmuClock_RTCC, and SystemCoreClockGet().
Referenced by CMU_ClockDivSet().
CMU_Select_TypeDef CMU_ClockSelectGet | ( | CMU_Clock_TypeDef | clock | ) |
Get currently selected reference clock used for a clock branch.
[in] | clock | Clock branch to fetch selected ref. clock for. One of: |
clock
provided. Definition at line 2146 of file em_cmu.c.
References _CMU_DBGCLKSEL_DBG_MASK, _CMU_HFCLKSTATUS_SELECTED_MASK, _CMU_LFACLKSEL_LFA_MASK, _CMU_LFBCLKSEL_LFB_MASK, _CMU_LFECLKSEL_LFE_MASK, CMU, CMU_DBGCLKSEL_DBG_AUXHFRCO, CMU_DBGCLKSEL_DBG_HFCLK, CMU_HFCLKSTATUS_SELECTED_HFXO, CMU_HFCLKSTATUS_SELECTED_LFRCO, CMU_HFCLKSTATUS_SELECTED_LFXO, CMU_LFACLKSEL_LFA_LFRCO, CMU_LFACLKSEL_LFA_LFXO, CMU_LFACLKSEL_LFA_ULFRCO, CMU_LFBCLKSEL_LFB_HFCLKLE, CMU_LFBCLKSEL_LFB_LFRCO, CMU_LFBCLKSEL_LFB_LFXO, CMU_LFBCLKSEL_LFB_ULFRCO, CMU_LFECLKSEL_LFE_LFRCO, CMU_LFECLKSEL_LFE_LFXO, CMU_LFECLKSEL_LFE_ULFRCO, cmuSelect_AUXHFRCO, cmuSelect_Disabled, cmuSelect_Error, cmuSelect_HFCLK, cmuSelect_HFCLKLE, cmuSelect_HFRCO, cmuSelect_HFXO, cmuSelect_LFRCO, cmuSelect_LFXO, and cmuSelect_ULFRCO.
Referenced by CMU_HFRCOBandSet(), CMU_HFXOInit(), CMU_LFXOInit(), and UDELAY_Calibrate().
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.
[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 2521 of file em_cmu.c.
References _CMU_HFBUSCLKEN0_LE_SHIFT, _CMU_LFACLKSEL_LFA_DISABLED, _CMU_LFACLKSEL_LFA_LFRCO, _CMU_LFACLKSEL_LFA_LFXO, _CMU_LFACLKSEL_LFA_ULFRCO, _CMU_LFBCLKSEL_LFB_HFCLKLE, BUS_RegBitWrite(), CMU, CMU_ClockFreqGet(), CMU_DBGCLKSEL_DBG_AUXHFRCO, CMU_DBGCLKSEL_DBG_HFCLK, CMU_HFCLKSEL_HF_HFRCO, CMU_HFCLKSEL_HF_HFXO, CMU_HFCLKSEL_HF_LFRCO, CMU_HFCLKSEL_HF_LFXO, CMU_HFRCOBandGet(), CMU_OscillatorEnable(), cmuClock_HF, cmuClock_HFLE, cmuOsc_HFRCO, cmuOsc_HFXO, cmuOsc_LFRCO, cmuOsc_LFXO, cmuSelect_AUXHFRCO, cmuSelect_Disabled, cmuSelect_HFCLK, cmuSelect_HFCLKLE, cmuSelect_HFRCO, cmuSelect_HFXO, cmuSelect_LFRCO, cmuSelect_LFXO, cmuSelect_ULFRCO, EMU_VScaleEM01ByClock(), EMU_VScaleWait(), SystemCoreClockGet(), and SystemHFXOClockGet().
Referenced by BSP_BccInit(), CAPLESENSE_setupCMU(), MIC_init(), RETARGET_SerialInit(), RTCDRV_Init(), SegmentLCD_Init(), setupOscillators(), UARTDRV_InitLeuart(), and UDELAY_Calibrate().
__STATIC_INLINE uint32_t CMU_DivToLog2 | ( | CMU_ClkDiv_TypeDef | div | ) |
Convert dividend to logarithmic value. Only works for even numbers equal to 2^n.
[in] | div | Unscaled dividend. |
Definition at line 1311 of file em_cmu.h.
Referenced by CMU_ClockDivGet(), CMU_ClockDivSet(), CMU_ClockFreqGet(), and RTCDRV_Init().
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.
[in] | enable |
|
Definition at line 3000 of file em_cmu.c.
References CMU, and CMU_FREEZE_REGFREEZE.
CMU_HFRCOFreq_TypeDef CMU_HFRCOBandGet | ( | void | ) |
Get current HFRCO frequency.
Definition at line 3181 of file em_cmu.c.
References SystemHfrcoFreq.
Referenced by CMU_ClockSelectSet(), and CMU_HFRCOFreqGet().
void CMU_HFRCOBandSet | ( | CMU_HFRCOFreq_TypeDef | setFreq | ) |
Set HFRCO calibration for the selected target frequency.
[in] | setFreq | HFRCO frequency to set |
Definition at line 3194 of file em_cmu.c.
References _CMU_HFRCOCTRL_CLKDIV_MASK, _CMU_SYNCBUSY_HFRCOBSY_SHIFT, BUS_RegBitRead(), CMU, CMU_ClockFreqGet(), CMU_ClockSelectGet(), CMU_HFRCOCTRL_CLKDIV_DIV1, CMU_HFRCOCTRL_CLKDIV_DIV2, CMU_HFRCOCTRL_CLKDIV_DIV4, CMU_HFRCODevinfoGet(), cmuClock_HF, cmuClock_HFLE, cmuHFRCOFreq_1M0Hz, cmuHFRCOFreq_2M0Hz, cmuHFRCOFreq_4M0Hz, cmuSelect_HFRCO, EMU_VScaleEM01ByClock(), SystemCoreClockGet(), and SystemHfrcoFreq.
Referenced by CMU_HFRCOFreqSet().
|
static |
Get a pointer to the HFRCO frequency calibration word in DEVINFO.
[in] | freq | Frequency in Hz |
Definition at line 3137 of file em_cmu.c.
References cmuHFRCOFreq_13M0Hz, cmuHFRCOFreq_16M0Hz, cmuHFRCOFreq_19M0Hz, cmuHFRCOFreq_1M0Hz, cmuHFRCOFreq_26M0Hz, cmuHFRCOFreq_2M0Hz, cmuHFRCOFreq_32M0Hz, cmuHFRCOFreq_38M0Hz, cmuHFRCOFreq_4M0Hz, cmuHFRCOFreq_7M0Hz, and DEVINFO.
Referenced by CMU_HFRCOBandSet().
__STATIC_INLINE CMU_HFRCOFreq_TypeDef CMU_HFRCOFreqGet | ( | void | ) |
Get current HFRCO frequency.
Definition at line 1506 of file em_cmu.h.
References CMU_HFRCOBandGet().
__STATIC_INLINE void CMU_HFRCOFreqSet | ( | CMU_HFRCOFreq_TypeDef | setFreq | ) |
Set HFRCO calibration for the selected target frequency.
[in] | setFreq | HFRCO frequency to set |
Definition at line 1522 of file em_cmu.h.
References CMU_HFRCOBandSet().
void CMU_HFXOAutostartEnable | ( | uint32_t | userSel, |
bool | enEM0EM1Start, | ||
bool | enEM0EM1StartSel | ||
) |
Enable or disable HFXO autostart.
[in] | userSel | Additional user specified enable bit. |
[in] | enEM0EM1Start | If true, HFXO is automatically started upon entering EM0/EM1 entry from EM2/EM3. HFXO selection has to be handled by the user. If false, HFXO is not started automatically when entering EM0/EM1. |
[in] | enEM0EM1StartSel | If true, HFXO is automatically started and immediately selected upon entering EM0/EM1 entry from EM2/EM3. Note that this option stalls the use of HFSRCCLK until HFXO becomes ready. If false, HFXO is not started or selected automatically when entering EM0/EM1. |
Definition at line 3330 of file em_cmu.c.
References _CMU_HFXOCTRL_AUTOSTARTEM0EM1_MASK, _CMU_HFXOCTRL_AUTOSTARTSELEM0EM1_MASK, CMU, CMU_HFXOCTRL_AUTOSTARTEM0EM1, CMU_HFXOCTRL_AUTOSTARTSELEM0EM1, and SystemHFXOClockGet().
void CMU_HFXOInit | ( | const CMU_HFXOInit_TypeDef * | hfxoInit | ) |
Set HFXO control registers.
[in] | hfxoInit | HFXO setup parameters |
Definition at line 3379 of file em_cmu.c.
References _CMU_HFXOCTRL_LOWPOWER_MASK, _CMU_HFXOCTRL_MODE_MASK, _CMU_HFXOSTARTUPCTRL_CTUNE_MASK, _CMU_HFXOSTARTUPCTRL_CTUNE_SHIFT, _CMU_HFXOSTARTUPCTRL_IBTRIMXOCORE_MASK, _CMU_HFXOSTARTUPCTRL_IBTRIMXOCORE_SHIFT, _CMU_HFXOSTEADYSTATECTRL_CTUNE_MASK, _CMU_HFXOSTEADYSTATECTRL_CTUNE_SHIFT, _CMU_HFXOSTEADYSTATECTRL_IBTRIMXOCORE_MASK, _CMU_HFXOSTEADYSTATECTRL_IBTRIMXOCORE_SHIFT, _CMU_HFXOSTEADYSTATECTRL_REGISH_MASK, _CMU_HFXOSTEADYSTATECTRL_REGISH_SHIFT, _CMU_HFXOSTEADYSTATECTRL_REGISHUPPER_MASK, _CMU_HFXOTIMEOUTCTRL_PEAKDETTIMEOUT_MASK, _CMU_HFXOTIMEOUTCTRL_PEAKDETTIMEOUT_SHIFT, _CMU_HFXOTIMEOUTCTRL_SHUNTOPTTIMEOUT_MASK, _CMU_HFXOTIMEOUTCTRL_SHUNTOPTTIMEOUT_SHIFT, _CMU_HFXOTIMEOUTCTRL_STARTUPTIMEOUT_MASK, _CMU_HFXOTIMEOUTCTRL_STARTUPTIMEOUT_SHIFT, _CMU_HFXOTIMEOUTCTRL_STEADYTIMEOUT_MASK, _CMU_HFXOTIMEOUTCTRL_STEADYTIMEOUT_SHIFT, CMU_HFXOInit_TypeDef::autoSelEm01, CMU_HFXOInit_TypeDef::autoStartEm01, CMU_HFXOInit_TypeDef::autoStartSelOnRacWakeup, BUS_RegMaskedWrite(), CMU, CMU_ClockSelectGet(), CMU_HFXOCTRL_LOWPOWER, CMU_HFXOCTRL_MODE_EXTCLK, CMU_HFXOCTRL_MODE_XTAL, CMU_OscillatorEnable(), cmuClock_HF, cmuOsc_HFXO, cmuOscMode_AcCoupled, cmuOscMode_External, cmuSelect_HFXO, CMU_HFXOInit_TypeDef::ctuneStartup, CMU_HFXOInit_TypeDef::ctuneSteadyState, EMU, EMU_PWRCTRL_REGPWRSEL_DVDD, CMU_HFXOInit_TypeDef::lowPowerMode, CMU_HFXOInit_TypeDef::mode, CMU_HFXOInit_TypeDef::regIshSteadyState, CMU_HFXOInit_TypeDef::thresholdPeakDetect, CMU_HFXOInit_TypeDef::timeoutPeakDetect, CMU_HFXOInit_TypeDef::timeoutShuntOptimization, CMU_HFXOInit_TypeDef::timeoutStartup, CMU_HFXOInit_TypeDef::timeoutSteady, CMU_HFXOInit_TypeDef::xoCoreBiasTrimStartup, and CMU_HFXOInit_TypeDef::xoCoreBiasTrimSteadyState.
__STATIC_INLINE void CMU_IntClear | ( | uint32_t | flags | ) |
__STATIC_INLINE void CMU_IntDisable | ( | uint32_t | flags | ) |
__STATIC_INLINE void CMU_IntEnable | ( | uint32_t | flags | ) |
Enable one or more CMU interrupts.
[in] | flags | CMU interrupt sources to enable. |
Definition at line 1363 of file em_cmu.h.
References CMU.
__STATIC_INLINE uint32_t CMU_IntGet | ( | void | ) |
__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.
Definition at line 1398 of file em_cmu.h.
References CMU.
__STATIC_INLINE void CMU_IntSet | ( | uint32_t | flags | ) |
uint32_t CMU_LCDClkFDIVGet | ( | void | ) |
void CMU_LCDClkFDIVSet | ( | uint32_t | div | ) |
Set the LCD framerate divisor (FDIV) setting.
[in] | div | The FDIV setting to use. |
Definition at line 3502 of file em_cmu.c.
References CMU, and cmuClkDiv_128.
Referenced by SegmentLCD_Init().
void CMU_LFXOInit | ( | const CMU_LFXOInit_TypeDef * | lfxoInit | ) |
Set LFXO control registers.
[in] | lfxoInit | LFXO setup parameters |
Definition at line 3534 of file em_cmu.c.
References _CMU_LFXOCTRL_GAIN_MASK, _CMU_LFXOCTRL_GAIN_SHIFT, _CMU_LFXOCTRL_MODE_MASK, _CMU_LFXOCTRL_MODE_SHIFT, _CMU_LFXOCTRL_TIMEOUT_MASK, _CMU_LFXOCTRL_TIMEOUT_SHIFT, _CMU_LFXOCTRL_TUNING_MASK, _CMU_LFXOCTRL_TUNING_SHIFT, BUS_RegBitWrite(), BUS_RegMaskedWrite(), CMU, CMU_ClockSelectGet(), CMU_OscillatorEnable(), cmuClock_HF, cmuOsc_LFXO, cmuSelect_LFXO, CMU_LFXOInit_TypeDef::ctune, EMU, CMU_LFXOInit_TypeDef::gain, CMU_LFXOInit_TypeDef::mode, and CMU_LFXOInit_TypeDef::timeout.
__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.
Definition at line 1433 of file em_cmu.h.
References CMU, and CMU_LOCK_LOCKKEY_LOCK.
Referenced by EMU_EnterEM3().
__STATIC_INLINE uint32_t CMU_Log2ToDiv | ( | uint32_t | log2 | ) |
Convert logarithm of 2 prescaler to division factor.
[in] | log2 | Logarithm of 2, as used by fixed prescalers. |
Definition at line 1449 of file em_cmu.h.
Referenced by CMU_ClockDivGet(), CMU_ClockFreqGet(), CMU_ClockPrescGet(), and CMU_PrescToLog2().
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 enable is true.
|
Definition at line 3594 of file em_cmu.c.
References _CMU_HFXOCTRL_MODE_MASK, _CMU_HFXOCTRL_PEAKDETSHUNTOPTMODE_MASK, _CMU_STATUS_AUXHFRCOENS_SHIFT, _CMU_STATUS_AUXHFRCORDY_SHIFT, _CMU_STATUS_HFRCOENS_SHIFT, _CMU_STATUS_HFRCORDY_SHIFT, _CMU_STATUS_HFXOENS_SHIFT, _CMU_STATUS_HFXORDY_SHIFT, _CMU_STATUS_LFRCOENS_SHIFT, _CMU_STATUS_LFRCORDY_SHIFT, _CMU_STATUS_LFXOENS_SHIFT, _CMU_STATUS_LFXORDY_SHIFT, BUS_RegBitRead(), CMU, CMU_HFXOCTRL_MODE_EXTCLK, CMU_HFXOCTRL_PEAKDETSHUNTOPTMODE_AUTOCMD, CMU_HFXOCTRL_PEAKDETSHUNTOPTMODE_CMD, CMU_OSCENCMD_AUXHFRCODIS, CMU_OSCENCMD_AUXHFRCOEN, CMU_OSCENCMD_HFRCODIS, CMU_OSCENCMD_HFRCOEN, CMU_OSCENCMD_HFXODIS, CMU_OSCENCMD_HFXOEN, CMU_OSCENCMD_LFRCODIS, CMU_OSCENCMD_LFRCOEN, CMU_OSCENCMD_LFXODIS, CMU_OSCENCMD_LFXOEN, CMU_OscillatorTuningGet(), CMU_OscillatorTuningOptimize(), CMU_OscillatorTuningSet(), CMU_OscillatorTuningWait(), cmuHFXOTuningMode_ShuntCommand, cmuOsc_AUXHFRCO, cmuOsc_HFRCO, cmuOsc_HFXO, cmuOsc_LFRCO, and cmuOsc_LFXO.
Referenced by CMU_ClockSelectSet(), CMU_HFXOInit(), CMU_LFXOInit(), DBG_SWOEnable(), setupOscillators(), and UDELAY_Calibrate().
uint32_t CMU_OscillatorTuningGet | ( | CMU_Osc_TypeDef | osc | ) |
Get oscillator frequency tuning setting.
[in] | osc | Oscillator to get tuning value for, one of:
|
Definition at line 3772 of file em_cmu.c.
References _CMU_AUXHFRCOCTRL_TUNING_MASK, _CMU_AUXHFRCOCTRL_TUNING_SHIFT, _CMU_HFRCOCTRL_TUNING_MASK, _CMU_HFRCOCTRL_TUNING_SHIFT, _CMU_HFXOTRIMSTATUS_IBTRIMXOCORE_MASK, _CMU_HFXOTRIMSTATUS_REGISH_MASK, _CMU_LFRCOCTRL_TUNING_MASK, _CMU_LFRCOCTRL_TUNING_SHIFT, CMU, cmuOsc_AUXHFRCO, cmuOsc_HFRCO, cmuOsc_HFXO, and cmuOsc_LFRCO.
Referenced by CMU_OscillatorEnable().
bool CMU_OscillatorTuningOptimize | ( | CMU_Osc_TypeDef | osc, |
CMU_HFXOTuningMode_TypeDef | mode, | ||
bool | wait | ||
) |
Start and optionally wait for oscillator tuning optimization.
[in] | osc | Oscillator to set tuning value for, one of: |
[in] | mode | Tuning optimization mode. |
[in] | wait | Wait for tuning optimization to complete. true - wait for tuning optimization to complete. false - return without waiting. |
Definition at line 3982 of file em_cmu.c.
References CMU, CMU_IFC_HFXOPEAKDETERR, CMU_OscillatorTuningWait(), and cmuOsc_HFXO.
Referenced by CMU_OscillatorEnable().
void CMU_OscillatorTuningSet | ( | CMU_Osc_TypeDef | osc, |
uint32_t | val | ||
) |
Set the oscillator frequency tuning control.
[in] | osc | Oscillator to set tuning value for, one of:
|
[in] | val | The oscillator frequency tuning setting to use. |
Definition at line 3830 of file em_cmu.c.
References _CMU_AUXHFRCOCTRL_TUNING_MASK, _CMU_AUXHFRCOCTRL_TUNING_SHIFT, _CMU_HFRCOCTRL_TUNING_MASK, _CMU_HFRCOCTRL_TUNING_SHIFT, _CMU_HFXOCTRL_PEAKDETSHUNTOPTMODE_MASK, _CMU_HFXOSTEADYSTATECTRL_IBTRIMXOCORE_MASK, _CMU_HFXOSTEADYSTATECTRL_REGISH_MASK, _CMU_HFXOSTEADYSTATECTRL_REGISH_SHIFT, _CMU_HFXOSTEADYSTATECTRL_REGISHUPPER_MASK, _CMU_LFRCOCTRL_TUNING_MASK, _CMU_LFRCOCTRL_TUNING_SHIFT, _CMU_SYNCBUSY_AUXHFRCOBSY_SHIFT, _CMU_SYNCBUSY_HFRCOBSY_SHIFT, _CMU_SYNCBUSY_LFRCOBSY_SHIFT, BUS_RegBitRead(), BUS_RegMaskedWrite(), CMU, CMU_HFXOCTRL_PEAKDETSHUNTOPTMODE_CMD, CMU_STATUS_HFXOENS, cmuOsc_AUXHFRCO, cmuOsc_HFRCO, cmuOsc_HFXO, and cmuOsc_LFRCO.
Referenced by CMU_OscillatorEnable().
bool CMU_OscillatorTuningWait | ( | CMU_Osc_TypeDef | osc, |
CMU_HFXOTuningMode_TypeDef | mode | ||
) |
Wait for oscillator tuning optimization.
[in] | osc | Oscillator to set tuning value for, one of: |
[in] | mode | Tuning optimization mode. |
Definition at line 3918 of file em_cmu.c.
References _CMU_HFXOCTRL_PEAKDETSHUNTOPTMODE_MASK, _CMU_STATUS_MASK, BUS_RegMaskedRead(), CMU, CMU_HFXOCTRL_PEAKDETSHUNTOPTMODE_AUTOCMD, CMU_IF_HFXOPEAKDETERR, CMU_STATUS_HFXOPEAKDETRDY, CMU_STATUS_HFXOSHUNTOPTRDY, cmuHFXOTuningMode_PeakShuntCommand, cmuHFXOTuningMode_ShuntCommand, and cmuOsc_HFXO.
Referenced by CMU_OscillatorEnable(), and CMU_OscillatorTuningOptimize().
bool CMU_PCNTClockExternalGet | ( | unsigned int | instance | ) |
Determine if currently selected PCNTn clock used is external or LFBCLK.
[in] | instance | PCNT instance number to get currently selected clock source for. |
Definition at line 4019 of file em_cmu.c.
References CMU, CMU_PCNTCTRL_PCNT0CLKSEL_PCNT0S0, CMU_PCNTCTRL_PCNT1CLKSEL_PCNT1S0, and CMU_PCNTCTRL_PCNT2CLKSEL_PCNT2S0.
void CMU_PCNTClockExternalSet | ( | unsigned int | instance, |
bool | external | ||
) |
Select PCNTn clock.
[in] | instance | 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 4061 of file em_cmu.c.
References BUS_RegBitWrite(), CMU, and PCNT_COUNT.
Referenced by PCNT_Init(), and PCNT_Reset().
__STATIC_INLINE uint32_t CMU_PrescToLog2 | ( | CMU_ClkPresc_TypeDef | presc | ) |
Convert prescaler dividend to logarithmic value. Only works for even numbers equal to 2^n.
[in] | presc | Unscaled dividend (dividend = presc + 1). |
Definition at line 1467 of file em_cmu.h.
References CMU_Log2ToDiv().
Referenced by CMU_ClockPrescSet().