EFM32 Happy Gecko Software Documentation
efm32hg-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_EM23Init_TypeDef |
Macros | |
#define | EMU_EM23INIT_DEFAULT |
Enumerations | |
enum | EMU_BODMode_TypeDef { emuBODMode_Active, emuBODMode_Inactive } |
enum | EMU_PowerConfig_TypeDef { emuPowerConfig_DcdcToDvdd } |
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_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. | |
__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... | |
__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_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_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... | |
#define EMU_EM23INIT_DEFAULT |
enum EMU_BODMode_TypeDef |
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, EMU_DCDCLnRcoBandSet(), EMU_DCDCModeSet(), and EMU_DCDCOptimizeSlice().
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 BUS_RegBitWrite(), EMU, EMU_DCDCModeSet(), EMU_DCDCOptimizeSlice(), and EMU_DCDCOutputVoltageSet().
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 BUS_RegBitRead(), EMU, and EMU_DCDCOptimizeSlice().
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 BUS_RegBitWrite(), and EMU.
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.
Referenced by EMU_DCDCConductionModeSet(), EMU_DCDCInit(), and EMU_DCDCLnRcoBandSet().
bool EMU_DCDCOutputVoltageSet | ( | uint32_t | mV, |
bool | setLpVoltage, | ||
bool | setLnVoltage | ||
) |
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.
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_EM23Init_TypeDef::em23VregFullEn, EMU, and EMU_CTRL_EMVREG.
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_CTRL_EM4CTRL_MASK, _EMU_CTRL_EM4CTRL_SHIFT, EMU, EMU_BASE, EMU_DCDCModeSet(), and EMU_Unlock().
Referenced by UTIL_shutdown().
__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.
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, RAM_MEM_BASE, SRAM_BASE, and SRAM_SIZE.
void EMU_UpdateOscConfig | ( | void | ) |
Update EMU module with CMU oscillator selection/enable status.