EFR32 Blue Gecko 12 Software Documentation
efr32bg12-doc-5.1.2
|
Energy Management Unit (EMU) Peripheral API.
This module contains functions to control the EMU peripheral of Silicon Labs 32-bit MCUs and SoCs. The EMU handles the different low energy modes in Silicon Labs microcontrollers.
Data Structures | |
struct | EMU_DCDCInit_TypeDef |
struct | EMU_EM01Init_TypeDef |
struct | EMU_EM23Init_TypeDef |
struct | EMU_EM4Init_TypeDef |
struct | EMU_VmonHystInit_TypeDef |
struct | EMU_VmonInit_TypeDef |
Macros | |
#define | EMU_DCDCINIT_DEFAULT |
#define | EMU_EM01INIT_DEFAULT |
#define | EMU_EM23INIT_DEFAULT |
#define | EMU_EM4INIT_DEFAULT |
#define | EMU_VMONHYSTINIT_DEFAULT |
#define | EMU_VMONINIT_DEFAULT |
#define | emuDcdcLnFastTransient 160 |
#define | emuDcdcLnHighEfficiency -1 |
#define | PWRCFG_DCDCTODVDD_VMAX 3000 |
#define | PWRCFG_DCDCTODVDD_VMIN 1800 |
Typedefs | |
typedef int16_t | EMU_DcdcLnReverseCurrentControl_TypeDef |
Enumerations | |
enum | EMU_BODMode_TypeDef { emuBODMode_Active, emuBODMode_Inactive } |
enum | EMU_DcdcAnaPeripheralPower_TypeDef { emuDcdcAnaPeripheralPower_AVDD = EMU_PWRCTRL_ANASW_AVDD, emuDcdcAnaPeripheralPower_DCDC = EMU_PWRCTRL_ANASW_DVDD } |
enum | EMU_DcdcConductionMode_TypeDef { emuDcdcConductionMode_ContinuousLN, emuDcdcConductionMode_DiscontinuousLN } |
enum | EMU_DcdcLnCompCtrl_TypeDef { emuDcdcLnCompCtrl_1u0F, emuDcdcLnCompCtrl_4u7F } |
enum | EMU_DcdcLnRcoBand_TypeDef { emuDcdcLnRcoBand_3MHz = 0, emuDcdcLnRcoBand_4MHz = 1, emuDcdcLnRcoBand_5MHz = 2, emuDcdcLnRcoBand_6MHz = 3, emuDcdcLnRcoBand_7MHz = 4, emuDcdcLnRcoBand_8MHz = 5, emuDcdcLnRcoBand_9MHz = 6, emuDcdcLnRcoBand_10MHz = 7 } |
enum | EMU_DcdcMode_TypeDef { emuDcdcMode_Bypass = EMU_DCDCCTRL_DCDCMODE_BYPASS, emuDcdcMode_LowNoise = EMU_DCDCCTRL_DCDCMODE_LOWNOISE, emuDcdcMode_LowPower = EMU_DCDCCTRL_DCDCMODE_LOWPOWER } |
enum | EMU_EM4PinRetention_TypeDef { emuPinRetentionDisable = EMU_EM4CTRL_EM4IORETMODE_DISABLE, emuPinRetentionEm4Exit = EMU_EM4CTRL_EM4IORETMODE_EM4EXIT, emuPinRetentionLatch = EMU_EM4CTRL_EM4IORETMODE_SWUNLATCH } |
enum | EMU_EM4State_TypeDef { emuEM4Hibernate = EMU_EM4CTRL_EM4STATE_EM4H, emuEM4Shutoff = EMU_EM4CTRL_EM4STATE_EM4S } |
enum | EMU_PeripheralRetention_TypeDef { emuPeripheralRetention_LEUART0 = _EMU_EM23PERNORETAINCTRL_LEUART0DIS_MASK, emuPeripheralRetention_CSEN = _EMU_EM23PERNORETAINCTRL_CSENDIS_MASK, emuPeripheralRetention_LESENSE0 = _EMU_EM23PERNORETAINCTRL_LESENSE0DIS_MASK, emuPeripheralRetention_LETIMER0 = _EMU_EM23PERNORETAINCTRL_LETIMER0DIS_MASK, emuPeripheralRetention_ADC0 = _EMU_EM23PERNORETAINCTRL_ADC0DIS_MASK, emuPeripheralRetention_IDAC0 = _EMU_EM23PERNORETAINCTRL_IDAC0DIS_MASK, emuPeripheralRetention_VDAC0 = _EMU_EM23PERNORETAINCTRL_DAC0DIS_MASK, emuPeripheralRetention_I2C1 = _EMU_EM23PERNORETAINCTRL_I2C1DIS_MASK, emuPeripheralRetention_I2C0 = _EMU_EM23PERNORETAINCTRL_I2C0DIS_MASK, emuPeripheralRetention_ACMP1 = _EMU_EM23PERNORETAINCTRL_ACMP1DIS_MASK, emuPeripheralRetention_ACMP0 = _EMU_EM23PERNORETAINCTRL_ACMP0DIS_MASK, emuPeripheralRetention_PCNT2 = _EMU_EM23PERNORETAINCTRL_PCNT2DIS_MASK, emuPeripheralRetention_PCNT1 = _EMU_EM23PERNORETAINCTRL_PCNT1DIS_MASK, emuPeripheralRetention_PCNT0 = _EMU_EM23PERNORETAINCTRL_PCNT0DIS_MASK, emuPeripheralRetention_D1, emuPeripheralRetention_D2, emuPeripheralRetention_ALL } |
enum | EMU_PowerConfig_TypeDef { emuPowerConfig_DcdcToDvdd } |
enum | EMU_VmonChannel_TypeDef { emuVmonChannel_AVDD, emuVmonChannel_ALTAVDD, emuVmonChannel_DVDD, emuVmonChannel_IOVDD0 } |
enum | EMU_VScaleEM01_TypeDef { emuVScaleEM01_HighPerformance = _EMU_STATUS_VSCALE_VSCALE2, emuVScaleEM01_LowPower = _EMU_STATUS_VSCALE_VSCALE0 } |
enum | EMU_VScaleEM23_TypeDef { emuVScaleEM23_FastWakeup = _EMU_CTRL_EM23VSCALE_VSCALE2, emuVScaleEM23_LowPower = _EMU_CTRL_EM23VSCALE_VSCALE0 } |
enum | EMU_VScaleEM4H_TypeDef { emuVScaleEM4H_FastWakeup = _EMU_CTRL_EM4HVSCALE_VSCALE2, emuVScaleEM4H_LowPower = _EMU_CTRL_EM4HVSCALE_VSCALE0 } |
Functions | |
void | EMU_DCDCConductionModeSet (EMU_DcdcConductionMode_TypeDef conductionMode, bool rcoDefaultSet) |
Set DCDC LN regulator conduction mode. More... | |
bool | EMU_DCDCInit (const EMU_DCDCInit_TypeDef *dcdcInit) |
Configure DCDC regulator. More... | |
void | EMU_DCDCLnRcoBandSet (EMU_DcdcLnRcoBand_TypeDef band) |
Set DCDC Low-noise RCO band. More... | |
void | EMU_DCDCModeSet (EMU_DcdcMode_TypeDef dcdcMode) |
Set DCDC regulator operating mode. More... | |
void | EMU_DCDCOptimizeSlice (uint32_t em0LoadCurrent_mA) |
Optimize DCDC slice count based on the estimated average load current in EM0. More... | |
bool | EMU_DCDCOutputVoltageSet (uint32_t mV, bool setLpVoltage, bool setLnVoltage) |
Set DCDC output voltage. More... | |
bool | EMU_DCDCPowerOff (void) |
Power off the DCDC regulator. More... | |
void | EMU_EM01Init (const EMU_EM01Init_TypeDef *em01Init) |
Update EMU module with Energy Mode 0 and 1 configuration. More... | |
void | EMU_EM23Init (const EMU_EM23Init_TypeDef *em23Init) |
Update EMU module with Energy Mode 2 and 3 configuration. More... | |
__STATIC_INLINE void | EMU_EM2Block (void) |
Block entering EM2 or higher number energy modes. | |
__STATIC_INLINE void | EMU_EM2UnBlock (void) |
Unblock entering EM2 or higher number energy modes. | |
void | EMU_EM4Init (const EMU_EM4Init_TypeDef *em4Init) |
Update EMU module with Energy Mode 4 configuration. More... | |
__STATIC_INLINE void | EMU_EnterEM1 (void) |
Enter energy mode 1 (EM1). | |
void | EMU_EnterEM2 (bool restore) |
Enter energy mode 2 (EM2). More... | |
void | EMU_EnterEM3 (bool restore) |
Enter energy mode 3 (EM3). More... | |
void | EMU_EnterEM4 (void) |
Enter energy mode 4 (EM4). More... | |
void | EMU_EnterEM4H (void) |
Enter energy mode 4 hibernate (EM4H). More... | |
void | EMU_EnterEM4S (void) |
Enter energy mode 4 shutoff (EM4S). More... | |
__STATIC_INLINE void | EMU_IntClear (uint32_t flags) |
Clear one or more pending EMU interrupts. More... | |
__STATIC_INLINE void | EMU_IntDisable (uint32_t flags) |
Disable one or more EMU interrupts. More... | |
__STATIC_INLINE void | EMU_IntEnable (uint32_t flags) |
Enable one or more EMU interrupts. More... | |
__STATIC_INLINE uint32_t | EMU_IntGet (void) |
Get pending EMU interrupt flags. More... | |
__STATIC_INLINE uint32_t | EMU_IntGetEnabled (void) |
Get enabled and pending EMU interrupt flags. Useful for handling more interrupt sources in the same interrupt handler. More... | |
__STATIC_INLINE void | EMU_IntSet (uint32_t flags) |
Set one or more pending EMU interrupts. More... | |
__STATIC_INLINE void | EMU_Lock (void) |
Lock the EMU in order to protect its registers against unintended modification. More... | |
void | EMU_MemPwrDown (uint32_t blocks) |
Power down memory block. More... | |
void | EMU_PeripheralRetention (EMU_PeripheralRetention_TypeDef periMask, bool enable) |
Set EM2 3 peripheral retention control. More... | |
__STATIC_INLINE void | EMU_PowerLock (void) |
Lock the EMU regulator control registers in order to protect against unintended modification. | |
__STATIC_INLINE void | EMU_PowerUnlock (void) |
Unlock the EMU power control registers so that writing to locked registers again is possible. | |
void | EMU_RamPowerDown (uint32_t start, uint32_t end) |
Power down RAM memory blocks. More... | |
void | EMU_Restore (void) |
Restore CMU HF clock select state, oscillator enable and voltage scaling (if available) after EMU_EnterEM2() or EMU_EnterEM3() are called with the restore parameter set to false. Calling this function is equivalent to calling EMU_EnterEM2() or EMU_EnterEM3() with the restore parameter set to true, but it allows the application to evaluate the wakeup reason before restoring state. | |
__STATIC_INLINE void | EMU_UnlatchPinRetention (void) |
When EM4 pin retention is set to emuPinRetentionLatch, then pins are retained through EM4 entry and wakeup. The pin state is released by calling this function. The feature allows peripherals or GPIO to be re-initialized after EM4 exit (reset), and when the initialization is done, this function can release pins and return control to the peripherals or GPIO. | |
__STATIC_INLINE void | EMU_Unlock (void) |
Unlock the EMU so that writing to locked registers again is possible. | |
void | EMU_UpdateOscConfig (void) |
Update EMU module with CMU oscillator selection/enable status. More... | |
bool | EMU_VmonChannelStatusGet (EMU_VmonChannel_TypeDef channel) |
Get the status of a voltage monitor channel. More... | |
void | EMU_VmonEnable (EMU_VmonChannel_TypeDef channel, bool enable) |
Enable or disable a VMON channel. More... | |
void | EMU_VmonHystInit (const EMU_VmonHystInit_TypeDef *vmonInit) |
Initialize VMON channel with hysteresis (separate rise and fall triggers). More... | |
void | EMU_VmonInit (const EMU_VmonInit_TypeDef *vmonInit) |
Initialize VMON channel. More... | |
__STATIC_INLINE bool | EMU_VmonStatusGet (void) |
Get the status of the voltage monitor (VMON). More... | |
void | EMU_VScaleEM01 (EMU_VScaleEM01_TypeDef voltage, bool wait) |
Force voltage scaling in EM0 and 1 to a specific voltage level. More... | |
void | EMU_VScaleEM01ByClock (uint32_t clockFrequency, bool wait) |
Voltage scale in EM0 and 1 by clock frequency. More... | |
__STATIC_INLINE EMU_VScaleEM01_TypeDef | EMU_VScaleGet (void) |
Get current voltage scaling level. More... | |
__STATIC_INLINE void | EMU_VScaleWait (void) |
Wait for voltage scaling to complete. | |
#define EMU_DCDCINIT_DEFAULT |
Default DCDC initialization
#define EMU_EM01INIT_DEFAULT |
#define EMU_EM23INIT_DEFAULT |
Default initialization of EM2 and 3 configuration
#define EMU_EM4INIT_DEFAULT |
Default initialization of EM4 configuration (Series 1 with VSCALE)
Definition at line 448 of file em_emu.h.
Referenced by UTIL_shutdown().
#define EMU_VMONHYSTINIT_DEFAULT |
Default VMON Hysteresis initialization structure
#define EMU_VMONINIT_DEFAULT |
Default VMON initialization structure
#define emuDcdcLnFastTransient 160 |
#define emuDcdcLnHighEfficiency -1 |
typedef int16_t EMU_DcdcLnReverseCurrentControl_TypeDef |
enum EMU_BODMode_TypeDef |
DCDC to DVDD mode analog peripheral power supply select
DCDC conduction modes
DCDC Low-noise RCO band select
enum EMU_DcdcMode_TypeDef |
Enumerator | |
---|---|
emuPinRetentionDisable |
No Retention: Pads enter reset state when entering EM4 |
emuPinRetentionEm4Exit |
Retention through EM4: Pads enter reset state when exiting EM4 |
emuPinRetentionLatch |
Retention through EM4 and wakeup: call EMU_UnlatchPinRetention() to release pins from retention after EM4 wakeup |
enum EMU_EM4State_TypeDef |
Supported EM0/1 Voltage Scaling Levels
Enumerator | |
---|---|
emuVScaleEM01_HighPerformance |
High-performance voltage level. HF clock can be set to any frequency. |
emuVScaleEM01_LowPower |
Low-power optimized voltage level. The HF clock must be limited to CMU_VSCALEEM01_LOWPOWER_VOLTAGE_CLOCK_MAX Hz at this voltage. EM0/1 voltage scaling is applied when the core clock frequency is changed from CMU or when calling EMU_EM01Init() when the HF clock is already below the limit. |
Supported EM2/3 Voltage Scaling Levels
Enumerator | |
---|---|
emuVScaleEM23_FastWakeup |
Fast-wakeup voltage level. |
emuVScaleEM23_LowPower |
Low-power optimized voltage level. Using this voltage level in EM2 and 3 adds 20-25us to wakeup time if the EM0 and 1 voltage must be scaled up to emuVScaleEM01_HighPerformance on EM2 or 3 exit. |
Supported EM4H Voltage Scaling Levels
Enumerator | |
---|---|
emuVScaleEM4H_FastWakeup |
Fast-wakeup voltage level. |
emuVScaleEM4H_LowPower |
Low-power optimized voltage level. Using this voltage level in EM4H adds 20-25us to wakeup time if the EM0 and 1 voltage must be scaled up to emuVScaleEM01_HighPerformance on EM4H exit. |
void EMU_DCDCConductionModeSet | ( | EMU_DcdcConductionMode_TypeDef | conductionMode, |
bool | rcoDefaultSet | ||
) |
Set DCDC LN regulator conduction mode.
[in] | conductionMode | DCDC LN conduction mode. |
[in] | rcoDefaultSet | The default DCDC RCO band for the conductionMode will be used if true. Otherwise the current RCO configuration is used. |
Definition at line 1813 of file em_emu.c.
References _EMU_DCDCCTRL_DCDCMODE_MASK, _EMU_DCDCLNFREQCTRL_RCOBAND_MASK, _EMU_DCDCLNFREQCTRL_RCOBAND_SHIFT, EMU, EMU_DCDCLnRcoBandSet(), EMU_DCDCMISCCTRL_LNFORCECCM, EMU_DCDCModeSet(), EMU_DCDCOptimizeSlice(), EMU_DCDCSYNC_DCDCCTRLBUSY, EMU_IF_DCDCINBYPASS, EMU_IFC_DCDCINBYPASS, EMU_IntClear(), EMU_IntGet(), emuDcdcConductionMode_DiscontinuousLN, emuDcdcLnRcoBand_3MHz, emuDcdcLnRcoBand_4MHz, emuDcdcLnRcoBand_7MHz, and emuDcdcMode_Bypass.
bool EMU_DCDCInit | ( | const EMU_DCDCInit_TypeDef * | dcdcInit | ) |
Configure DCDC regulator.
[in] | dcdcInit | DCDC initialization structure |
Definition at line 1869 of file em_emu.c.
References _EMU_DCDCLPEM01CFG_LPCMPBIASEM01_MASK, _EMU_DCDCMISCCTRL_LNFORCECCM_MASK, _EMU_PWRCFG_PWRCFG_MASK, _EMU_PWRCTRL_ANASW_SHIFT, EMU_DCDCInit_TypeDef::anaPeripheralPower, BUS_RegBitWrite(), EMU_DCDCInit_TypeDef::dcdcLnCompCtrl, EMU_DCDCInit_TypeDef::dcdcMode, EMU_DCDCInit_TypeDef::em01LoadCurrent_mA, EMU_DCDCInit_TypeDef::em234LoadCurrent_uA, EMU, EMU_DCDCLPEM01CFG_LPCMPBIASEM01_BIAS3, EMU_DCDCMISCCTRL_LNFORCECCM, EMU_DCDCModeSet(), EMU_DCDCOptimizeSlice(), EMU_DCDCOutputVoltageSet(), EMU_PWRCFG_PWRCFG_DCDCTODVDD, EMU_PWRCTRL_REGPWRSEL_DVDD, emuDcdcMode_LowNoise, emuDcdcMode_LowPower, EMU_DCDCInit_TypeDef::maxCurrent_mA, EMU_DCDCInit_TypeDef::mVout, and EMU_DCDCInit_TypeDef::reverseCurrentControl.
void EMU_DCDCLnRcoBandSet | ( | EMU_DcdcLnRcoBand_TypeDef | band | ) |
Set DCDC Low-noise RCO band.
[in] | band | RCO band to set. |
Definition at line 2260 of file em_emu.c.
References _EMU_DCDCLNFREQCTRL_RCOBAND_MASK, _EMU_DCDCLNFREQCTRL_RCOBAND_SHIFT, _EMU_DCDCMISCCTRL_LNFORCECCM_SHIFT, BUS_RegBitRead(), EMU, EMU_DCDCOptimizeSlice(), and emuDcdcLnRcoBand_4MHz.
Referenced by EMU_DCDCConductionModeSet().
void EMU_DCDCModeSet | ( | EMU_DcdcMode_TypeDef | dcdcMode | ) |
Set DCDC regulator operating mode.
[in] | dcdcMode | DCDC mode |
Definition at line 1760 of file em_emu.c.
References _EMU_DCDCCLIMCTRL_BYPLIMEN_SHIFT, _EMU_DCDCCTRL_DCDCMODE_MASK, BUS_RegBitWrite(), EMU, EMU_DCDCCTRL_DCDCMODE_BYPASS, EMU_DCDCCTRL_DCDCMODE_LOWNOISE, EMU_DCDCCTRL_DCDCMODE_OFF, EMU_DCDCSYNC_DCDCCTRLBUSY, EMU_IF_DCDCLNRUNNING, EMU_IFC_DCDCLNRUNNING, EMU_IntClear(), EMU_IntGet(), emuDcdcMode_Bypass, emuDcdcMode_LowNoise, and emuDcdcMode_LowPower.
Referenced by EMU_DCDCConductionModeSet(), EMU_DCDCInit(), and EMU_EnterEM4().
void EMU_DCDCOptimizeSlice | ( | uint32_t | em0LoadCurrent_mA | ) |
Optimize DCDC slice count based on the estimated average load current in EM0.
[in] | em0LoadCurrent_mA | Estimated average EM0 load current in mA. |
Definition at line 2184 of file em_emu.c.
References _EMU_DCDCLNFREQCTRL_RCOBAND_MASK, _EMU_DCDCLNFREQCTRL_RCOBAND_SHIFT, _EMU_DCDCMISCCTRL_LNFORCECCM_MASK, _EMU_DCDCMISCCTRL_NFETCNT_MASK, _EMU_DCDCMISCCTRL_NFETCNT_SHIFT, _EMU_DCDCMISCCTRL_PFETCNT_MASK, _EMU_DCDCMISCCTRL_PFETCNT_SHIFT, EMU, emuDcdcLnRcoBand_4MHz, and emuDcdcLnRcoBand_5MHz.
Referenced by EMU_DCDCConductionModeSet(), EMU_DCDCInit(), and EMU_DCDCLnRcoBandSet().
bool EMU_DCDCOutputVoltageSet | ( | uint32_t | mV, |
bool | setLpVoltage, | ||
bool | setLnVoltage | ||
) |
Set DCDC output voltage.
[in] | mV | Target DCDC output voltage in mV |
Definition at line 2020 of file em_emu.c.
References _DEVINFO_DCDCLNVCTRL0_1V2LNATT0_MASK, _DEVINFO_DCDCLNVCTRL0_1V2LNATT0_SHIFT, _DEVINFO_DCDCLNVCTRL0_1V8LNATT0_MASK, _DEVINFO_DCDCLNVCTRL0_1V8LNATT0_SHIFT, _DEVINFO_DCDCLNVCTRL0_1V8LNATT1_MASK, _DEVINFO_DCDCLNVCTRL0_1V8LNATT1_SHIFT, _DEVINFO_DCDCLNVCTRL0_3V0LNATT1_MASK, _DEVINFO_DCDCLNVCTRL0_3V0LNATT1_SHIFT, _EMU_DCDCLNVCTRL_LNATT_MASK, _EMU_DCDCLNVCTRL_LNVREF_MASK, _EMU_DCDCLNVCTRL_LNVREF_SHIFT, _EMU_DCDCLPEM01CFG_LPCMPBIASEM01_MASK, _EMU_DCDCLPEM01CFG_LPCMPBIASEM01_SHIFT, _EMU_DCDCLPVCTRL_LPATT_MASK, _EMU_DCDCLPVCTRL_LPVREF_MASK, _EMU_DCDCLPVCTRL_LPVREF_SHIFT, DEVINFO, EMU, EMU_DCDCLNVCTRL_LNATT, EMU_DCDCLPVCTRL_LPATT, SL_MAX, and SL_MIN.
Referenced by EMU_DCDCInit().
bool EMU_DCDCPowerOff | ( | void | ) |
Power off the DCDC regulator.
This function powers off the DCDC controller. This function should only be used if the external power circuit is wired for no DCDC. If the external power circuit is wired for DCDC usage, then use EMU_DCDCInit() and set the DCDC in bypass mode to disable DCDC.
Definition at line 2288 of file em_emu.c.
References EMU, EMU_DCDCCTRL_DCDCMODE_OFF, EMU_DCDCSYNC_DCDCCTRLBUSY, EMU_PWRCFG_PWRCFG_DCDCTODVDD, and EMU_PWRCTRL_REGPWRSEL_DVDD.
void EMU_EM01Init | ( | const EMU_EM01Init_TypeDef * | em01Init | ) |
Update EMU module with Energy Mode 0 and 1 configuration.
[in] | em01Init | Energy Mode 0 and 1 configuration structure |
Definition at line 1062 of file em_emu.c.
References EMU_VScaleEM01ByClock(), and EMU_EM01Init_TypeDef::vScaleEM01LowPowerVoltageEnable.
void EMU_EM23Init | ( | const EMU_EM23Init_TypeDef * | em23Init | ) |
Update EMU module with Energy Mode 2 and 3 configuration.
[in] | em23Init | Energy Mode 2 and 3 configuration structure |
Definition at line 1078 of file em_emu.c.
References _EMU_CTRL_EM23VSCALE_MASK, _EMU_CTRL_EM23VSCALE_SHIFT, EMU_EM23Init_TypeDef::em23VregFullEn, EMU, and EMU_EM23Init_TypeDef::vScaleEM23Voltage.
void EMU_EM4Init | ( | const EMU_EM4Init_TypeDef * | em4Init | ) |
Update EMU module with Energy Mode 4 configuration.
[in] | em4Init | Energy Mode 4 configuration structure |
Definition at line 1105 of file em_emu.c.
References _EMU_CTRL_EM4HVSCALE_MASK, _EMU_CTRL_EM4HVSCALE_SHIFT, _EMU_EM4CTRL_EM4IORETMODE_MASK, _EMU_EM4CTRL_EM4STATE_MASK, _EMU_EM4CTRL_RETAINLFRCO_MASK, _EMU_EM4CTRL_RETAINLFXO_MASK, _EMU_EM4CTRL_RETAINULFRCO_MASK, EMU_EM4Init_TypeDef::em4State, EMU, EMU_EM4CTRL_EM4STATE_EM4H, EMU_EM4CTRL_RETAINLFRCO, EMU_EM4CTRL_RETAINLFXO, EMU_EM4CTRL_RETAINULFRCO, EMU_EM4Init_TypeDef::pinRetentionMode, EMU_EM4Init_TypeDef::retainLfrco, EMU_EM4Init_TypeDef::retainLfxo, EMU_EM4Init_TypeDef::retainUlfrco, and EMU_EM4Init_TypeDef::vScaleEM4HVoltage.
Referenced by UTIL_shutdown().
void EMU_EnterEM2 | ( | bool | restore | ) |
Enter energy mode 2 (EM2).
When entering EM2, the high frequency clocks are disabled, ie HFXO, HFRCO and AUXHFRCO (for AUXHFRCO, see exception note below). When re-entering EM0, HFRCO is re-enabled and the core will be clocked by the configured HFRCO band. This ensures a quick wakeup from EM2.
However, prior to entering EM2, the core may have been using another oscillator than HFRCO. The restore
parameter gives the user the option to restore all HF oscillators according to state prior to entering EM2, as well as the clock used to clock the core. This restore procedure is handled by SW. However, since handled by SW, it will not be restored before completing the interrupt function(s) waking up the core!
restore
parameter. restore
parameter when waking up on the wakeup sources corresponding to the autostart and select setting. [in] | restore |
|
restore
option should only be used if all clock control is done via the CMU API. Definition at line 480 of file em_emu.c.
References SystemCoreClockUpdate().
Referenced by CAPLESENSE_Sleep(), UTIL_sleep(), and UTIL_waitForEvent().
void EMU_EnterEM3 | ( | bool | restore | ) |
Enter energy mode 3 (EM3).
When entering EM3, the high frequency clocks are disabled by HW, ie HFXO, HFRCO and AUXHFRCO (for AUXHFRCO, see exception note below). In addition, the low frequency clocks, ie LFXO and LFRCO are disabled by SW. When re-entering EM0, HFRCO is re-enabled and the core will be clocked by the configured HFRCO band. This ensures a quick wakeup from EM3.
However, prior to entering EM3, the core may have been using another oscillator than HFRCO. The restore
parameter gives the user the option to restore all HF/LF oscillators according to state prior to entering EM3, as well as the clock used to clock the core. This restore procedure is handled by SW. However, since handled by SW, it will not be restored before completing the interrupt function(s) waking up the core!
restore
parameter. [in] | restore |
|
restore
option should only be used if all clock control is done via the CMU API. Definition at line 597 of file em_emu.c.
References CMU, CMU_Lock(), CMU_LOCK_LOCKKEY_LOCKED, CMU_OSCENCMD_LFRCODIS, CMU_OSCENCMD_LFXODIS, CMU_Unlock(), and SystemCoreClockUpdate().
void EMU_EnterEM4 | ( | void | ) |
Enter energy mode 4 (EM4).
Definition at line 705 of file em_emu.c.
References _EMU_DCDCCTRL_DCDCMODE_MASK, _EMU_EM4CTRL_EM4ENTRY_MASK, _EMU_EM4CTRL_EM4ENTRY_SHIFT, _EMU_EM4CTRL_EM4STATE_MASK, EMU, EMU_BASE, EMU_DCDCCTRL_DCDCMODE_LOWNOISE, EMU_DCDCCTRL_DCDCMODE_LOWPOWER, EMU_DCDCModeSet(), EMU_EM4CTRL_EM4STATE_EM4H, EMU_EM4CTRL_EM4STATE_EM4S, EMU_Unlock(), and emuDcdcMode_Bypass.
Referenced by EMU_EnterEM4H(), EMU_EnterEM4S(), and UTIL_shutdown().
void EMU_EnterEM4H | ( | void | ) |
Enter energy mode 4 hibernate (EM4H).
Definition at line 787 of file em_emu.c.
References _EMU_EM4CTRL_EM4STATE_SHIFT, BUS_RegBitWrite(), EMU, and EMU_EnterEM4().
void EMU_EnterEM4S | ( | void | ) |
Enter energy mode 4 shutoff (EM4S).
Definition at line 801 of file em_emu.c.
References _EMU_EM4CTRL_EM4STATE_SHIFT, BUS_RegBitWrite(), EMU, and EMU_EnterEM4().
__STATIC_INLINE void EMU_IntClear | ( | uint32_t | flags | ) |
Clear one or more pending EMU interrupts.
[in] | flags | Pending EMU interrupt sources to clear. Use one or more valid interrupt flags for the EMU module (EMU_IFC_nnn). |
Definition at line 772 of file em_emu.h.
References EMU.
Referenced by disableInterrupts(), EMU_DCDCConductionModeSet(), EMU_DCDCModeSet(), and TEMPDRV_IRQHandler().
__STATIC_INLINE void EMU_IntDisable | ( | uint32_t | flags | ) |
Disable one or more EMU interrupts.
[in] | flags | EMU interrupt sources to disable. Use one or more valid interrupt flags for the EMU module (EMU_IEN_nnn). |
Definition at line 786 of file em_emu.h.
References EMU.
Referenced by disableInterrupts(), and updateInterrupts().
__STATIC_INLINE void EMU_IntEnable | ( | uint32_t | flags | ) |
Enable one or more EMU interrupts.
[in] | flags | EMU interrupt sources to enable. Use one or more valid interrupt flags for the EMU module (EMU_IEN_nnn). |
Definition at line 805 of file em_emu.h.
References EMU.
Referenced by updateInterrupts().
__STATIC_INLINE uint32_t EMU_IntGet | ( | void | ) |
Get pending EMU interrupt flags.
Definition at line 822 of file em_emu.h.
References EMU.
Referenced by EMU_DCDCConductionModeSet(), and EMU_DCDCModeSet().
__STATIC_INLINE uint32_t EMU_IntGetEnabled | ( | void | ) |
Get enabled and pending EMU interrupt flags. Useful for handling more interrupt sources in the same interrupt handler.
Definition at line 842 of file em_emu.h.
References EMU.
Referenced by TEMPDRV_IRQHandler().
__STATIC_INLINE void EMU_IntSet | ( | uint32_t | flags | ) |
__STATIC_INLINE void EMU_Lock | ( | void | ) |
Lock the EMU in order to protect its registers against unintended modification.
Definition at line 916 of file em_emu.h.
References EMU, and EMU_LOCK_LOCKKEY_LOCK.
Referenced by RMU_ResetCauseClear().
void EMU_MemPwrDown | ( | uint32_t | blocks | ) |
Power down memory block.
[in] | blocks | Specifies a logical OR of bits indicating memory blocks to power down. Bit 0 selects block 1, bit 1 selects block 2, etc. Memory block 0 cannot be disabled. Please refer to the reference manual for available memory blocks for a device. |
Definition at line 825 of file em_emu.c.
References _EMU_RAM0CTRL_MASK, and EMU.
void EMU_PeripheralRetention | ( | EMU_PeripheralRetention_TypeDef | periMask, |
bool | enable | ||
) |
Set EM2 3 peripheral retention control.
[in] | periMask | Peripheral select mask. Use | operator to select multiple peripheral, for example emuPeripheralRetention_LEUART0 | emuPeripheralRetention_VDAC0. |
[in] | enable | Peripheral retention enable (true) or disable (false). |
Definition at line 943 of file em_emu.c.
References EMU.
void EMU_RamPowerDown | ( | uint32_t | start, |
uint32_t | end | ||
) |
Power down RAM memory blocks.
This function will power down all the RAM blocks that are within a given range. The RAM block layout is different between device families, so this function can be used in a generic way to power down a RAM memory region which is known to be unused.
This function will only power down blocks which are completely enclosed by the memory range given by [start, end).
Here is an example of how to power down all RAM blocks except the first one. The first RAM block is special in that it cannot be powered down by the hardware. The size of this first RAM block is device specific see the reference manual to find the RAM block sizes.
[in] | start | The start address of the RAM region to power down. This address is inclusive. |
[in] | end | The end address of the RAM region to power down. This address is exclusive. If this parameter is 0, then all RAM blocks contained in the region from start to the upper RAM address will be powered down. |
Definition at line 870 of file em_emu.c.
References EMU, RAM1_MEM_BASE, RAM1_MEM_END, RAM_MEM_BASE, SRAM_BASE, and SRAM_SIZE.
void EMU_UpdateOscConfig | ( | void | ) |
Update EMU module with CMU oscillator selection/enable status.
bool EMU_VmonChannelStatusGet | ( | EMU_VmonChannel_TypeDef | channel | ) |
Get the status of a voltage monitor channel.
[in] | channel | VMON channel to get status for |
Definition at line 2482 of file em_emu.c.
References _EMU_STATUS_VMONALTAVDD_SHIFT, _EMU_STATUS_VMONAVDD_SHIFT, _EMU_STATUS_VMONDVDD_SHIFT, _EMU_STATUS_VMONIO0_SHIFT, BUS_RegBitRead(), and EMU.
void EMU_VmonEnable | ( | EMU_VmonChannel_TypeDef | channel, |
bool | enable | ||
) |
Enable or disable a VMON channel.
[in] | channel | VMON channel to enable/disable |
[in] | enable | Whether to enable or disable |
Definition at line 2441 of file em_emu.c.
References _EMU_VMONALTAVDDCTRL_EN_SHIFT, _EMU_VMONAVDDCTRL_EN_SHIFT, _EMU_VMONDVDDCTRL_EN_SHIFT, _EMU_VMONIO0CTRL_EN_SHIFT, BUS_RegBitWrite(), and EMU.
void EMU_VmonHystInit | ( | const EMU_VmonHystInit_TypeDef * | vmonInit | ) |
Initialize VMON channel with hysteresis (separate rise and fall triggers).
Initialize a VMON channel which supports hysteresis. The AVDD channel is the only channel to support separate rise and fall triggers.
[in] | vmonInit | VMON Hysteresis initialization struct |
Definition at line 2400 of file em_emu.c.
References _EMU_VMONAVDDCTRL_FALLTHRESCOARSE_SHIFT, _EMU_VMONAVDDCTRL_FALLTHRESFINE_SHIFT, _EMU_VMONAVDDCTRL_RISETHRESCOARSE_SHIFT, _EMU_VMONAVDDCTRL_RISETHRESFINE_SHIFT, EMU_VmonHystInit_TypeDef::channel, EMU, EMU_VMONAVDDCTRL_EN, EMU_VMONAVDDCTRL_FALLWU, EMU_VMONAVDDCTRL_RISEWU, EMU_VmonHystInit_TypeDef::enable, EMU_VmonHystInit_TypeDef::fallThreshold, EMU_VmonHystInit_TypeDef::fallWakeup, EMU_VmonHystInit_TypeDef::riseThreshold, and EMU_VmonHystInit_TypeDef::riseWakeup.
void EMU_VmonInit | ( | const EMU_VmonInit_TypeDef * | vmonInit | ) |
Initialize VMON channel.
Initialize a VMON channel without hysteresis. If the channel supports separate rise and fall triggers, both thresholds will be set to the same value.
[in] | vmonInit | VMON initialization struct |
Definition at line 2342 of file em_emu.c.
References _EMU_VMONALTAVDDCTRL_THRESCOARSE_SHIFT, _EMU_VMONALTAVDDCTRL_THRESFINE_SHIFT, _EMU_VMONAVDDCTRL_FALLTHRESCOARSE_SHIFT, _EMU_VMONAVDDCTRL_FALLTHRESFINE_SHIFT, _EMU_VMONAVDDCTRL_RISETHRESCOARSE_SHIFT, _EMU_VMONAVDDCTRL_RISETHRESFINE_SHIFT, _EMU_VMONDVDDCTRL_THRESCOARSE_SHIFT, _EMU_VMONDVDDCTRL_THRESFINE_SHIFT, _EMU_VMONIO0CTRL_THRESCOARSE_SHIFT, _EMU_VMONIO0CTRL_THRESFINE_SHIFT, EMU_VmonInit_TypeDef::channel, EMU, EMU_VMONALTAVDDCTRL_EN, EMU_VMONALTAVDDCTRL_FALLWU, EMU_VMONALTAVDDCTRL_RISEWU, EMU_VMONAVDDCTRL_EN, EMU_VMONAVDDCTRL_FALLWU, EMU_VMONAVDDCTRL_RISEWU, EMU_VMONDVDDCTRL_EN, EMU_VMONDVDDCTRL_FALLWU, EMU_VMONDVDDCTRL_RISEWU, EMU_VMONIO0CTRL_EN, EMU_VMONIO0CTRL_FALLWU, EMU_VMONIO0CTRL_RETDIS, EMU_VMONIO0CTRL_RISEWU, EMU_VmonInit_TypeDef::enable, EMU_VmonInit_TypeDef::fallWakeup, EMU_VmonInit_TypeDef::retDisable, EMU_VmonInit_TypeDef::riseWakeup, and EMU_VmonInit_TypeDef::threshold.
__STATIC_INLINE bool EMU_VmonStatusGet | ( | void | ) |
Get the status of the voltage monitor (VMON).
Definition at line 757 of file em_emu.h.
References _EMU_STATUS_VMONRDY_SHIFT, BUS_RegBitRead(), and EMU.
void EMU_VScaleEM01 | ( | EMU_VScaleEM01_TypeDef | voltage, |
bool | wait | ||
) |
Force voltage scaling in EM0 and 1 to a specific voltage level.
[in] | voltage | Target VSCALE voltage level. |
[in] | wait | Wait for scaling to complate. |
Definition at line 1033 of file em_emu.c.
References _CMU_HFPRESC_PRESC_MASK, _CMU_HFPRESC_PRESC_SHIFT, CMU, EMU, EMU_VScaleWait(), emuVScaleEM01_LowPower, and SystemHFClockGet().
void EMU_VScaleEM01ByClock | ( | uint32_t | clockFrequency, |
bool | wait | ||
) |
Voltage scale in EM0 and 1 by clock frequency.
[in] | clockFrequency | Use CMSIS HF clock if 0, or override to custom clock. Providing a custom clock frequency is required if using a non-standard HFXO frequency. |
[in] | wait | Wait for scaling to complate. |
Definition at line 979 of file em_emu.c.
References _CMU_HFPRESC_PRESC_MASK, _CMU_HFPRESC_PRESC_SHIFT, CMU, EMU, EMU_VScaleWait(), emuVScaleEM01_HighPerformance, emuVScaleEM01_LowPower, SystemHFClockGet(), and EMU_EM01Init_TypeDef::vScaleEM01LowPowerVoltageEnable.
Referenced by CMU_ClockSelectSet(), CMU_HFRCOBandSet(), and EMU_EM01Init().
__STATIC_INLINE EMU_VScaleEM01_TypeDef EMU_VScaleGet | ( | void | ) |
Get current voltage scaling level.
Definition at line 740 of file em_emu.h.
References _EMU_STATUS_VSCALE_MASK, _EMU_STATUS_VSCALE_SHIFT, EMU, and EMU_VScaleWait().