EMU - Energy Management Unit

Description

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
 EM2 and 3 initialization structure.
 
struct  EMU_EM4Init_TypeDef
 EM4 initialization structure.
 
struct  EMU_DCDCInit_TypeDef
 DCDC initialization structure.
 
struct  EMU_VmonInit_TypeDef
 VMON initialization structure.
 
struct  EMU_VmonHystInit_TypeDef
 VMON Hysteresis initialization structure.
 

Functions

void EMU_EM23Init (const EMU_EM23Init_TypeDef *em23Init)
 Update the EMU module with Energy Mode 2 and 3 configuration.
 
void EMU_EM23PresleepHook (void)
 Energy mode 2/3 pre-sleep hook function.
 
void EMU_EM23PostsleepHook (void)
 Energy mode 2/3 post-sleep hook function.
 
void EMU_EM4Init (const EMU_EM4Init_TypeDef *em4Init)
 Update the EMU module with Energy Mode 4 configuration.
 
void EMU_EnterEM2 (bool restore)
 Enter energy mode 2 (EM2).
 
void EMU_EnterEM3 (bool restore)
 Enter energy mode 3 (EM3).
 
void EMU_Save (void)
 Save the CMU HF clock select state, oscillator enable, and voltage scaling (if available) before EMU_EnterEM2() or EMU_EnterEM3() are called with the restore parameter set to false.
 
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.
 
void EMU_EnterEM4 (void)
 Enter energy mode 4 (EM4).
 
void EMU_EnterEM4H (void)
 Enter energy mode 4 hibernate (EM4H).
 
void EMU_EnterEM4S (void)
 Enter energy mode 4 shutoff (EM4S).
 
void EMU_MemPwrDown (uint32_t blocks)
 Power down memory block.
 
void EMU_RamPowerDown (uint32_t start, uint32_t end)
 Power down RAM memory blocks.
 
void EMU_RamPowerUp (void)
 Power up all available RAM memory blocks.
 
void EMU_UpdateOscConfig (void)
 Update EMU module with CMU oscillator selection/enable status.
 
bool EMU_DCDCInit (const EMU_DCDCInit_TypeDef *dcdcInit)
 Configure the DCDC regulator.
 
void EMU_DCDCModeSet (EMU_DcdcMode_TypeDef dcdcMode)
 Set DCDC regulator operating mode.
 
void EMU_DCDCModeEM23Set (EMU_DcdcModeEM23_TypeDef dcdcModeEM23)
 Set DCDC Mode EM23 operating mode.
 
bool EMU_DCDCPowerOff (void)
 Power off the DCDC regulator.
 
void EMU_DCDCConductionModeSet (EMU_DcdcConductionMode_TypeDef conductionMode, bool rcoDefaultSet)
 Set DCDC LN regulator conduction mode.
 
bool EMU_DCDCOutputVoltageSet (uint32_t mV, bool setLpVoltage, bool setLnVoltage)
 Set the DCDC output voltage.
 
void EMU_DCDCOptimizeSlice (uint32_t em0LoadCurrentmA)
 Optimize the DCDC slice count based on the estimated average load current in EM0.
 
void EMU_DCDCLnRcoBandSet (EMU_DcdcLnRcoBand_TypeDef band)
 Set DCDC Low-noise RCO band.
 
void EMU_VmonInit (const EMU_VmonInit_TypeDef *vmonInit)
 Initialize a VMON channel.
 
void EMU_VmonHystInit (const EMU_VmonHystInit_TypeDef *vmonInit)
 Initialize a VMON channel with hysteresis (separate rise and fall triggers).
 
void EMU_VmonEnable (EMU_VmonChannel_TypeDef channel, bool enable)
 Enable or disable a VMON channel.
 
bool EMU_VmonChannelStatusGet (EMU_VmonChannel_TypeDef channel)
 Get the status of a voltage monitor channel.
 
float EMU_TemperatureGet (void)
 Get temperature in degrees Celcius.
 
bool EMU_LDOStatusGet (void)
 Check status of the internal LDO regulator.
 
void EMU_EnterEM1 (void)
 Enter energy mode 1 (EM1).
 
bool EMU_VmonStatusGet (void)
 Get the status of the voltage monitor (VMON).
 
void EMU_IntClear (uint32_t flags)
 Clear one or more pending EMU interrupts.
 
void EMU_IntDisable (uint32_t flags)
 Disable one or more EMU interrupts.
 
void EMU_IntEnable (uint32_t flags)
 Enable one or more EMU interrupts.
 
uint32_t EMU_IntGet (void)
 Get pending EMU interrupt flags.
 
uint32_t EMU_IntGetEnabled (void)
 Get enabled and pending EMU interrupt flags.
 
void EMU_IntSet (uint32_t flags)
 Set one or more pending EMU interrupts.
 
void EMU_Lock (void)
 Lock EMU registers in order to protect them against unintended modification.
 
void EMU_Unlock (void)
 Unlock the EMU so that writing to locked registers again is possible.
 
void EMU_PowerLock (void)
 Lock the EMU regulator control registers in order to protect against unintended modification.
 
void EMU_PowerUnlock (void)
 Unlock the EMU power control registers so that writing to locked registers again is possible.
 
void EMU_EM2Block (void)
 Block entering EM2 or higher number energy modes.
 
void EMU_EM2UnBlock (void)
 Unblock entering EM2 or higher number energy modes.
 
void EMU_UnlatchPinRetention (void)
 When EM4 pin retention is set to emuPinRetentionLatch, then pins are retained through EM4 entry and wakeup.
 
bool EMU_TemperatureReady (void)
 Temperature measurement ready status.
 
void EMU_SetBiasMode (EMU_BiasMode_TypeDef mode)
 Adjust the bias refresh rate.
 

Macros

#define emuDcdcLnHighEfficiency   -1
 High efficiency mode.
 
#define emuDcdcLnFastTransient   160
 Default reverse current for fast transient response mode (low noise).
 
#define EMU_EM23INIT_DEFAULT
 Default initialization of EM2 and 3 configuration.
 
#define EMU_EM4INIT_DEFAULT
 Default initialization of EM4 configuration (Series 1 without VSCALE).
 
#define EMU_DCDCINIT_DEFAULT
 Default DCDC initialization.
 
#define EMU_VMONINIT_DEFAULT
 Default VMON initialization structure.
 
#define EMU_VMONHYSTINIT_DEFAULT
 Default VMON Hysteresis initialization structure.
 
#define EMU_TEMP_ZERO_C_IN_KELVIN   (273.15f)
 Zero degrees Celcius in Kelvin.
 
#define EMU_TEMPCO_CONST   (0.273f)
 As we do not know what energy mode a temperature measurement was taken at, we choose a constant for the TEMPCO calculation that is midway between the EM0/EM1 constant and the EM2/EM3/EM4 constant.
 

Typedefs

typedef int16_t EMU_DcdcLnReverseCurrentControl_TypeDef
 DCDC Forced CCM and reverse current limiter control.
 

Enumerations

enum  EMU_BODMode_TypeDef {
  emuBODMode_Active,
  emuBODMode_Inactive
}
 BOD threshold setting selector, active or inactive mode.
 
enum  EMU_EM4State_TypeDef {
  emuEM4Shutoff = 0,
  emuEM4Hibernate = 1
}
 EM4 modes.
 
enum  EMU_EM4PinRetention_TypeDef {
  emuPinRetentionDisable = EMU_EM4CTRL_EM4IORETMODE_DISABLE,
  emuPinRetentionEm4Exit = EMU_EM4CTRL_EM4IORETMODE_EM4EXIT,
  emuPinRetentionLatch = EMU_EM4CTRL_EM4IORETMODE_SWUNLATCH
}
 EM4 Pin Retention Type.
 
enum  EMU_PowerConfig_TypeDef { emuPowerConfig_DcdcToDvdd }
 Power configurations.
 
enum  EMU_DcdcMode_TypeDef {
  emuDcdcMode_Bypass = EMU_DCDCCTRL_DCDCMODE_BYPASS,
  emuDcdcMode_LowNoise = EMU_DCDCCTRL_DCDCMODE_LOWNOISE
}
 DCDC operating modes.
 
enum  EMU_DcdcModeEM23_TypeDef {
  emuDcdcModeEM23_LowPower = EMU_DCDCCTRL_DCDCMODEEM23_EM23LOWPOWER,
  emuDcdcModeEM23_Sw = EMU_DCDCCTRL_DCDCMODEEM23_EM23SW
}
 
enum  EMU_DcdcConductionMode_TypeDef {
  emuDcdcConductionMode_ContinuousLN,
  emuDcdcConductionMode_DiscontinuousLN
}
 DCDC conduction modes.
 
enum  EMU_DcdcAnaPeripheralPower_TypeDef {
  emuDcdcAnaPeripheralPower_AVDD = EMU_PWRCTRL_ANASW_AVDD,
  emuDcdcAnaPeripheralPower_DCDC = EMU_PWRCTRL_ANASW_DVDD
}
 DCDC to DVDD mode analog peripheral power supply select.
 
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
}
 DCDC Low-noise RCO band select.
 
enum  EMU_DcdcLnCompCtrl_TypeDef {
  emuDcdcLnCompCtrl_1u0F,
  emuDcdcLnCompCtrl_4u7F
}
 DCDC Low Noise Compensator Control register.
 
enum  EMU_VmonChannel_TypeDef {
  emuVmonChannel_AVDD,
  emuVmonChannel_ALTAVDD,
  emuVmonChannel_DVDD,
  emuVmonChannel_IOVDD0
}
 VMON channels.
 
enum  EMU_BiasMode_TypeDef {
  emuBiasMode_1KHz,
  emuBiasMode_4KHz,
  emuBiasMode_Continuous
}
 Bias mode configurations.
 

Function Documentation

◆ EMU_EM23Init()

void EMU_EM23Init ( const EMU_EM23Init_TypeDef em23Init)

Update the EMU module with Energy Mode 2 and 3 configuration.

Parameters
[in]em23InitEnergy Mode 2 and 3 configuration structure.

◆ EMU_EM23PresleepHook()

void EMU_EM23PresleepHook ( void  )

Energy mode 2/3 pre-sleep hook function.

This function is called by EMU_EnterEM2() and EMU_EnterEM3() functions just prior to execution of the WFI instruction. The function implementation does not perform anything, but it is SL_WEAK so that it can be re- implemented in application code if actions are needed.

Note
The function is primarily meant to be used in systems with EFP circuitry. (EFP = Energy Friendly Pmic (PMIC = Power Management IC)). In such systems there is a need to drive certain signals to EFP pins to notify about energy mode transitions.

◆ EMU_EM23PostsleepHook()

void EMU_EM23PostsleepHook ( void  )

Energy mode 2/3 post-sleep hook function.

This function is called by EMU_EnterEM2() and EMU_EnterEM3() functions just after wakeup from the WFI instruction. The function implementation does not perform anything, but it is SL_WEAK so that it can be re- implemented in application code if actions are needed.

Note
The function is primarily meant to be used in systems with EFP circuitry. (EFP = Energy Friendly Pmic (PMIC = Power Management IC)). In such systems there is a need to drive certain signals to EFP pins to notify about energy mode transitions.

◆ EMU_EM4Init()

void EMU_EM4Init ( const EMU_EM4Init_TypeDef em4Init)

Update the EMU module with Energy Mode 4 configuration.

Parameters
[in]em4InitEnergy Mode 4 configuration structure.

◆ EMU_EnterEM2()

void EMU_EnterEM2 ( bool  restore)

Enter energy mode 2 (EM2).

When entering EM2, high-frequency clocks are disabled, i.e., 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!

Note
If restoring core clock to use the HFXO oscillator, which has been disabled during EM2 mode, this function will stall until the oscillator has stabilized. Stalling time can be reduced by adding interrupt support detecting stable oscillator, and an asynchronous switch to the original oscillator. See CMU documentation. Such a feature is however outside the scope of the implementation in this function.
If ERRATA_FIX_EMU_E110_ENABLE is active, the core's SLEEPONEXIT feature can not be used.
If HFXO is re-enabled by this function, and NOT used to clock the core, this function will not wait for HFXO to stabilize. This must be considered by the application if trying to use features relying on that oscillator upon return.
If a debugger is attached, the AUXHFRCO will not be disabled if enabled upon entering EM2. It will thus remain enabled when returning to EM0 regardless of the restore parameter.
If HFXO autostart and select is enabled by using CMU_HFXOAutostartEnable(), the automatic starting and selecting of the core clocks will be done, regardless of the restore parameter, when waking up on the wakeup sources corresponding to the autostart and select setting.
If voltage scaling is supported, the restore parameter is true and the EM0 voltage scaling level is set higher than the EM2 level, then the EM0 level is also restored.
On Series 2 Config 2 devices (EFRxG22), this function will also relock the DPLL if the DPLL is used and restore is true.

Note that the hardware will automatically update the HFRCO frequency in the case where voltage scaling is used in EM2/EM3 and not in EM0/EM1. When the restore argument to this function is true then software will restore the original HFRCO frequency after EM2/EM3 wake up. If the restore argument is false then the HFRCO frequency is 19 MHz when coming out of EM2/EM3 and all wait states are at a safe value.

Parameters
[in]restore
  • true - save and restore oscillators, clocks and voltage scaling, see function details.
  • false - do not save and restore oscillators and clocks, see function details.
The restore option should only be used if all clock control is done via the CMU API.

◆ EMU_EnterEM3()

void EMU_EnterEM3 ( bool  restore)

Enter energy mode 3 (EM3).

When entering EM3, the high-frequency clocks are disabled by hardware, i.e., HFXO, HFRCO, and AUXHFRCO (for AUXHFRCO, see exception note below). In addition, the low-frequency clocks, i.e., LFXO and LFRCO are disabled by software. 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 an oscillator other 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 software. However, since it is handled by software, it will not be restored before completing the interrupt function(s) waking up the core!

Note
If restoring core clock to use an oscillator other than HFRCO, this function will stall until the oscillator has stabilized. Stalling time can be reduced by adding interrupt support detecting stable oscillator, and an asynchronous switch to the original oscillator. See CMU documentation. This feature is, however, outside the scope of the implementation in this function.
If ERRATA_FIX_EMU_E110_ENABLE is active, the core's SLEEPONEXIT feature can't be used.
If HFXO/LFXO/LFRCO are re-enabled by this function, and NOT used to clock the core, this function will not wait for those oscillators to stabilize. This must be considered by the application if trying to use features relying on those oscillators upon return.
If a debugger is attached, the AUXHFRCO will not be disabled if enabled upon entering EM3. It will, therefore, remain enabled when returning to EM0 regardless of the restore parameter.
If voltage scaling is supported, the restore parameter is true and the EM0 voltage scaling level is set higher than the EM3 level, then the EM0 level is also restored.
On Series 2 Config 2 devices (EFRxG22), this function will also relock the DPLL if the DPLL is used and restore is true.
Parameters
[in]restore
  • true - save and restore oscillators, clocks and voltage scaling, see function details.
  • false - do not save and restore oscillators and clocks, see function details.
The restore option should only be used if all clock control is done via the CMU API.

◆ EMU_Save()

void EMU_Save ( void  )

Save the CMU HF clock select state, oscillator enable, and voltage scaling (if available) before 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 state to be saved without going to sleep. The state can be restored manually by calling EMU_Restore().

◆ EMU_Restore()

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.

◆ EMU_EnterEM4()

void EMU_EnterEM4 ( void  )

Enter energy mode 4 (EM4).

Note
Only a power on reset or external reset pin can wake the device from EM4.

◆ EMU_EnterEM4H()

void EMU_EnterEM4H ( void  )

Enter energy mode 4 hibernate (EM4H).

Note
Retention of clocks and GPIO in EM4 can be configured using EMU_EM4Init before calling this function.

◆ EMU_EnterEM4S()

void EMU_EnterEM4S ( void  )

Enter energy mode 4 shutoff (EM4S).

Note
Retention of clocks and GPIO in EM4 can be configured using EMU_EM4Init before calling this function.

◆ EMU_MemPwrDown()

void EMU_MemPwrDown ( uint32_t  blocks)

Power down memory block.

Parameters
[in]blocksSpecifies a logical OR of bits indicating memory blocks to power down. Bit 0 selects block 1, bit 1 selects block 2, and so on. Memory block 0 cannot be disabled. See the reference manual for available memory blocks for a device.
Note
Only a POR reset can power up the specified memory block(s) after power down.

◆ EMU_RamPowerDown()

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).

This is an example 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 the first RAM block is device-specific. See the reference manual to find the RAM block sizes.

EMU_RamPowerDown(SRAM_BASE, SRAM_BASE + SRAM_SIZE);
Note
Only a reset can power up the specified memory block(s) after power down on a series 0 device.
Parameters
[in]startThe start address of the RAM region to power down. This address is inclusive.
[in]endThe end address of the RAM region to power down. This address is exclusive. If this parameter is 0, all RAM blocks contained in the region from start to the upper RAM address will be powered down.

◆ EMU_RamPowerUp()

void EMU_RamPowerUp ( void  )

Power up all available RAM memory blocks.

This function will power up all the RAM blocks on a device, this means that the RAM blocks are retained in EM2/EM3. Note that this functionality is not supported on Series 0 devices. Only a reset will power up the RAM blocks on a series 0 device.

◆ EMU_UpdateOscConfig()

void EMU_UpdateOscConfig ( void  )

Update EMU module with CMU oscillator selection/enable status.

◆ EMU_DCDCInit()

bool EMU_DCDCInit ( const EMU_DCDCInit_TypeDef dcdcInit)

Configure the DCDC regulator.

Note
Do not call this function if the power circuit is configured for NODCDC as described in the Power Configurations section of the Reference Manual. Instead, call EMU_DCDCPowerOff().
Parameters
[in]dcdcInitThe DCDC initialization structure.
Returns
True if initialization parameters are valid.

◆ EMU_DCDCModeSet()

void EMU_DCDCModeSet ( EMU_DcdcMode_TypeDef  dcdcMode)

Set DCDC regulator operating mode.

Parameters
[in]dcdcModeDCDC mode.

◆ EMU_DCDCModeEM23Set()

void EMU_DCDCModeEM23Set ( EMU_DcdcModeEM23_TypeDef  dcdcModeEM23)

Set DCDC Mode EM23 operating mode.

Parameters
[in]dcdcModeEM23DCDC mode EM23.

◆ EMU_DCDCPowerOff()

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, use EMU_DCDCInit() and set the DCDC in bypass mode to disable DCDC.

Returns
Return false if the DCDC could not be disabled.

◆ EMU_DCDCConductionModeSet()

void EMU_DCDCConductionModeSet ( EMU_DcdcConductionMode_TypeDef  conductionMode,
bool  rcoDefaultSet 
)

Set DCDC LN regulator conduction mode.

Parameters
[in]conductionModeDCDC LN conduction mode.
[in]rcoDefaultSetThe default DCDC RCO band for the conductionMode will be used if true. Otherwise, the current RCO configuration is used.

◆ EMU_DCDCOutputVoltageSet()

bool EMU_DCDCOutputVoltageSet ( uint32_t  mV,
bool  setLpVoltage,
bool  setLnVoltage 
)

Set the DCDC output voltage.

Note
The DCDC is not characterized for the entire valid output voltage range. For that reason an upper limit of 3.0V output voltage is enforced.
Parameters
[in]mVTarget DCDC output voltage in mV.
[in]setLpVoltageUpdate LP voltage
[in]setLnVoltageUpdate LN voltage
Returns
True if the mV parameter is valid.

◆ EMU_DCDCOptimizeSlice()

void EMU_DCDCOptimizeSlice ( uint32_t  em0LoadCurrentmA)

Optimize the DCDC slice count based on the estimated average load current in EM0.

Parameters
[in]em0LoadCurrentmAEstimated average EM0 load current in mA.

◆ EMU_DCDCLnRcoBandSet()

void EMU_DCDCLnRcoBandSet ( EMU_DcdcLnRcoBand_TypeDef  band)

Set DCDC Low-noise RCO band.

Parameters
[in]bandRCO band to set.

◆ EMU_VmonInit()

void EMU_VmonInit ( const EMU_VmonInit_TypeDef vmonInit)

Initialize a 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. The threshold will be converted to a register field value based on calibration values from the DI page.

Parameters
[in]vmonInitThe VMON initialization structure.

◆ EMU_VmonHystInit()

void EMU_VmonHystInit ( const EMU_VmonHystInit_TypeDef vmonInit)

Initialize a 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. The rise and fall thresholds will be converted to a register field value based on the calibration values from the DI page.

Parameters
[in]vmonInitThe VMON hysteresis initialization structure.

◆ EMU_VmonEnable()

void EMU_VmonEnable ( EMU_VmonChannel_TypeDef  channel,
bool  enable 
)

Enable or disable a VMON channel.

Parameters
[in]channelA VMON channel to enable/disable.
[in]enableIndicates whether to enable or disable.

◆ EMU_VmonChannelStatusGet()

bool EMU_VmonChannelStatusGet ( EMU_VmonChannel_TypeDef  channel)

Get the status of a voltage monitor channel.

Parameters
[in]channelA VMON channel to get the status for.
Returns
A status of the selected VMON channel. True if the channel is triggered.

◆ EMU_TemperatureGet()

float EMU_TemperatureGet ( void  )

Get temperature in degrees Celcius.

Returns
Temperature in degrees Celcius

◆ EMU_LDOStatusGet()

bool EMU_LDOStatusGet ( void  )
inline

Check status of the internal LDO regulator.

Returns
Return true if the regulator is on, false if regulator is off.

◆ EMU_EnterEM1()

void EMU_EnterEM1 ( void  )
inline

Enter energy mode 1 (EM1).

◆ EMU_VmonStatusGet()

bool EMU_VmonStatusGet ( void  )
inline

Get the status of the voltage monitor (VMON).

Returns
Status of the VMON. True if all the enabled channels are ready, false if one or more of the enabled channels are not ready.

◆ EMU_IntClear()

void EMU_IntClear ( uint32_t  flags)
inline

Clear one or more pending EMU interrupts.

Parameters
[in]flagsPending EMU interrupt sources to clear. Use one or more valid interrupt flags for the EMU module (EMU_IFC_nnn).

◆ EMU_IntDisable()

void EMU_IntDisable ( uint32_t  flags)
inline

Disable one or more EMU interrupts.

Parameters
[in]flagsEMU interrupt sources to disable. Use one or more valid interrupt flags for the EMU module (EMU_IEN_nnn).

◆ EMU_IntEnable()

void EMU_IntEnable ( uint32_t  flags)
inline

Enable one or more EMU interrupts.

Note
Depending on the use, a pending interrupt may already be set prior to enabling the interrupt. To ignore a pending interrupt, consider using EMU_IntClear() prior to enabling the interrupt.
Parameters
[in]flagsEMU interrupt sources to enable. Use one or more valid interrupt flags for the EMU module (EMU_IEN_nnn).

◆ EMU_IntGet()

uint32_t EMU_IntGet ( void  )
inline

Get pending EMU interrupt flags.

Note
Event bits are not cleared by the use of this function.
Returns
EMU interrupt sources pending. Returns one or more valid interrupt flags for the EMU module (EMU_IF_nnn).

◆ EMU_IntGetEnabled()

uint32_t EMU_IntGetEnabled ( void  )
inline

Get enabled and pending EMU interrupt flags.

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

Note
Interrupt flags are not cleared by the use of this function.
Returns
Pending and enabled EMU interrupt sources Return value is the bitwise AND of
  • the enabled interrupt sources in EMU_IEN and
  • the pending interrupt flags EMU_IF.

◆ EMU_IntSet()

void EMU_IntSet ( uint32_t  flags)
inline

Set one or more pending EMU interrupts.

Parameters
[in]flagsEMU interrupt sources to set to pending. Use one or more valid interrupt flags for the EMU module (EMU_IFS_nnn).

◆ EMU_Lock()

void EMU_Lock ( void  )
inline

Lock EMU registers in order to protect them against unintended modification.

Note
If locking EMU registers, they must be unlocked prior to using any EMU API functions modifying EMU registers, excluding interrupt control and regulator control if the architecture has a EMU_PWRCTRL register. An exception to this is the energy mode entering API (EMU_EnterEMn()), which can be used when the EMU registers are locked.

◆ EMU_Unlock()

void EMU_Unlock ( void  )
inline

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

◆ EMU_PowerLock()

void EMU_PowerLock ( void  )
inline

Lock the EMU regulator control registers in order to protect against unintended modification.

◆ EMU_PowerUnlock()

void EMU_PowerUnlock ( void  )
inline

Unlock the EMU power control registers so that writing to locked registers again is possible.

◆ EMU_EM2Block()

void EMU_EM2Block ( void  )
inline

Block entering EM2 or higher number energy modes.

◆ EMU_EM2UnBlock()

void EMU_EM2UnBlock ( void  )
inline

Unblock entering EM2 or higher number energy modes.

◆ EMU_UnlatchPinRetention()

void EMU_UnlatchPinRetention ( void  )
inline

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 initialization is done, this function can release pins and return control to the peripherals or GPIO.

◆ EMU_TemperatureReady()

bool EMU_TemperatureReady ( void  )
inline

Temperature measurement ready status.

Returns
True if temperature measurement is ready

◆ EMU_SetBiasMode()

void EMU_SetBiasMode ( EMU_BiasMode_TypeDef  mode)

Adjust the bias refresh rate.

This function is only meant to be used under high-temperature operation on EFR32xG1 and EFM32xG1 devices. Adjusting the bias mode will increase the typical current consumption. See application note 1027 and errata documents for more details.

Parameters
[in]modeThe new bias refresh rate.

Macro Definition Documentation

◆ emuDcdcLnHighEfficiency

#define emuDcdcLnHighEfficiency   -1

High efficiency mode.

EMU_DCDCZDETCTRL_ZDETILIMSEL is "don't care".

◆ emuDcdcLnFastTransient

#define emuDcdcLnFastTransient   160

Default reverse current for fast transient response mode (low noise).


◆ EMU_EM23INIT_DEFAULT

#define EMU_EM23INIT_DEFAULT
Value:
{ \
false, /* Reduced voltage regulator drive strength in EM2/3.*/ \
}

Default initialization of EM2 and 3 configuration.

◆ EMU_EM4INIT_DEFAULT

#define EMU_EM4INIT_DEFAULT
Value:
{ \
false, /* Retain LFXO configuration upon EM4 entry. */ \
false, /* Retain LFRCO configuration upon EM4 entry. */ \
false, /* Retain ULFRCO configuration upon EM4 entry. */ \
emuEM4Shutoff, /* Use EM4 shutoff state. */ \
emuPinRetentionDisable, /* Do not retain pins in EM4. */ \
}

Default initialization of EM4 configuration (Series 1 without VSCALE).

◆ EMU_DCDCINIT_DEFAULT

#define EMU_DCDCINIT_DEFAULT
Value:
{ \
emuPowerConfig_DcdcToDvdd, /* DCDC to DVDD. */ \
emuDcdcMode_LowNoise, /* Low-noise mode in EM0. */ \
1800, /* Nominal output voltage for DVDD mode, 1.8V. */ \
15, /* Nominal EM0/1 load current of less than 15mA. */ \
10, /* Nominal EM2/3/4 load current less than 10uA. */ \
200, /* Maximum average current of 200mA
(assume strong battery or other power source). */ \
emuDcdcAnaPeripheralPower_DCDC,/* Select DCDC as analog power supply (lower power). */ \
160, /* Maximum reverse current of 160mA. */ \
emuDcdcLnCompCtrl_1u0F, /* 1uF DCDC capacitor. */ \
}

Default DCDC initialization.

◆ EMU_VMONINIT_DEFAULT

#define EMU_VMONINIT_DEFAULT
Value:
{ \
emuVmonChannel_AVDD, /* AVDD VMON channel. */ \
3200, /* 3.2 V threshold. */ \
false, /* Do not wake from EM4H on rising edge. */ \
false, /* Do not wake from EM4H on falling edge. */ \
true, /* Enable VMON channel. */ \
false /* Do not disable IO0 retention */ \
}

Default VMON initialization structure.

◆ EMU_VMONHYSTINIT_DEFAULT

#define EMU_VMONHYSTINIT_DEFAULT
Value:
{ \
emuVmonChannel_AVDD, /* AVDD VMON channel. */ \
3200, /* 3.2 V rise threshold. */ \
3200, /* 3.2 V fall threshold. */ \
false, /* Do not wake from EM4H on rising edge. */ \
false, /* Do not wake from EM4H on falling edge. */ \
true /* Enable VMON channel. */ \
}

Default VMON Hysteresis initialization structure.

◆ EMU_TEMP_ZERO_C_IN_KELVIN

#define EMU_TEMP_ZERO_C_IN_KELVIN   (273.15f)

Zero degrees Celcius in Kelvin.

◆ EMU_TEMPCO_CONST

#define EMU_TEMPCO_CONST   (0.273f)

As we do not know what energy mode a temperature measurement was taken at, we choose a constant for the TEMPCO calculation that is midway between the EM0/EM1 constant and the EM2/EM3/EM4 constant.

Typedef Documentation

◆ EMU_DcdcLnReverseCurrentControl_TypeDef

DCDC Forced CCM and reverse current limiter control.

Positive values have unit mA.

Enumeration Type Documentation

◆ EMU_BODMode_TypeDef

BOD threshold setting selector, active or inactive mode.

Enumerator
emuBODMode_Active 

Configure BOD threshold for active mode.

emuBODMode_Inactive 

Configure BOD threshold for inactive mode.

◆ EMU_EM4State_TypeDef

EM4 modes.

Enumerator
emuEM4Shutoff 

EM4 Shutoff.

emuEM4Hibernate 

EM4 Hibernate.

◆ EMU_EM4PinRetention_TypeDef

EM4 Pin Retention Type.

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.

◆ EMU_PowerConfig_TypeDef

Power configurations.

DCDC-to-DVDD is currently the only supported mode.

Enumerator
emuPowerConfig_DcdcToDvdd 

DCDC is connected to DVDD.

◆ EMU_DcdcMode_TypeDef

DCDC operating modes.

Enumerator
emuDcdcMode_Bypass 

DCDC regulator bypass.

emuDcdcMode_LowNoise 

DCDC low-noise mode.

◆ EMU_DcdcModeEM23_TypeDef

Enumerator
emuDcdcModeEM23_LowPower 

DCDC mode is low power.

emuDcdcModeEM23_Sw 

DCDC mode is according to DCDCMODE field.

◆ EMU_DcdcConductionMode_TypeDef

DCDC conduction modes.

Enumerator
emuDcdcConductionMode_ContinuousLN 

DCDC Low-Noise Continuous Conduction Mode (CCM).

EFR32 interference minimization features are available in this mode.

emuDcdcConductionMode_DiscontinuousLN 

DCDC Low-Noise Discontinuous Conduction Mode (DCM).

This mode should be used for EFM32 or for EFR32 when its radio is not enabled.

◆ EMU_DcdcAnaPeripheralPower_TypeDef

DCDC to DVDD mode analog peripheral power supply select.

Enumerator
emuDcdcAnaPeripheralPower_AVDD 

Select AVDD as analog power supply.

Typically lower noise, but less energy efficient.

emuDcdcAnaPeripheralPower_DCDC 

Select DCDC (DVDD) as analog power supply.

Typically more energy efficient, but more noise.

◆ EMU_DcdcLnRcoBand_TypeDef

DCDC Low-noise RCO band select.

Enumerator
emuDcdcLnRcoBand_3MHz 

Set RCO to 3MHz.

emuDcdcLnRcoBand_4MHz 

Set RCO to 4MHz.

emuDcdcLnRcoBand_5MHz 

Set RCO to 5MHz.

emuDcdcLnRcoBand_6MHz 

Set RCO to 6MHz.

emuDcdcLnRcoBand_7MHz 

Set RCO to 7MHz.

emuDcdcLnRcoBand_8MHz 

Set RCO to 8MHz.

emuDcdcLnRcoBand_9MHz 

Set RCO to 9MHz.

emuDcdcLnRcoBand_10MHz 

Set RCO to 10MHz.

◆ EMU_DcdcLnCompCtrl_TypeDef

DCDC Low Noise Compensator Control register.

Enumerator
emuDcdcLnCompCtrl_1u0F 

DCDC capacitor is 1uF.

emuDcdcLnCompCtrl_4u7F 

DCDC capacitor is 4.7uF.

◆ EMU_VmonChannel_TypeDef

VMON channels.

◆ EMU_BiasMode_TypeDef

Bias mode configurations.