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_EM01Init_TypeDef
 EM0 and 1 initialization structure.
 
struct  EMU_EM23Init_TypeDef
 EM2 and 3 initialization structure.
 
struct  EMU_EM4Init_TypeDef
 EM4 initialization structure.
 
struct  EMU_BUInit_TypeDef
 Backup Power Domain 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_EM01Init (const EMU_EM01Init_TypeDef *em01Init)
 Update the EMU module with Energy Mode 0 and 1 configuration.
 
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_EFPEM23PresleepHook (void)
 EFP's Energy mode 2/3 pre-sleep hook function.
 
void EMU_EM23PostsleepHook (void)
 Energy mode 2/3 post-sleep hook function.
 
void EMU_EFPEM23PostsleepHook (void)
 EFP's Energy mode 2/3 post-sleep hook function.
 
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_EM4Init (const EMU_EM4Init_TypeDef *em4Init)
 Update the EMU module with Energy Mode 4 configuration.
 
void EMU_EM4PresleepHook (void)
 Energy mode 4 pre-sleep hook function.
 
void EMU_EFPEM4PresleepHook (void)
 EFP's Energy mode 4 pre-sleep hook function.
 
void EMU_EnterEM4 (void)
 Enter energy mode 4 (EM4).
 
void EMU_EnterEM4Wait (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_PeripheralRetention (EMU_PeripheralRetention_TypeDef periMask, bool enable)
 Set EM2 3 peripheral retention control.
 
void EMU_UpdateOscConfig (void)
 Update EMU module with CMU oscillator selection/enable status.
 
void EMU_VScaleEM01ByClock (uint32_t clockFrequency, bool wait)
 Voltage scale in EM0 and 1 by clock frequency.
 
void EMU_VScaleEM01 (EMU_VScaleEM01_TypeDef voltage, bool wait)
 Force voltage scaling in EM0 and 1 to a specific voltage level.
 
void EMU_BUInit (const EMU_BUInit_TypeDef *buInit)
 Configure Backup Power Domain settings.
 
void EMU_BUDisMaxCompSet (bool disableMainBuComparator)
 Disable Main Backup Power Domain comparator.
 
void EMU_BUBuInactPwrConSet (EMU_BUBuInactPwrCon_TypeDef inactPwrCon)
 Configure power connection configuration when not in Backup mode.
 
void EMU_BUBuActPwrConSet (EMU_BUBuActPwrCon_TypeDef actPwrCon)
 Configure power connection configuration when in Backup mode.
 
void EMU_BUPwrResSet (EMU_BUPwrRes_TypeDef pwrRes)
 Power domain resistor selection.
 
void EMU_BUVoutResSet (EMU_BUVoutRes_TypeDef resistorSel)
 B_VOUT resistor select.
 
void EMU_BUBuVinProbeEnSet (bool enable)
 Enable BU_VIN probing.
 
void EMU_BUStatEnSet (bool enable)
 Enable backup mode status export.
 
void EMU_BUEnableSet (bool enable)
 Enable backup mode.
 
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 Celsius.
 
bool EMU_LDOStatusGet (void)
 Check status of the internal LDO regulator.
 
void EMU_EnterEM1 (void)
 Enter energy mode 1 (EM1).
 
void EMU_VScaleWait (void)
 Wait for voltage scaling to complete.
 
EMU_VScaleEM01_TypeDef EMU_VScaleGet (void)
 Get current voltage scaling level.
 
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_BUReady (void)
 Halts until backup power functionality is ready.
 
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.
 

Macros

#define EMU_VSCALE_PRESENT
 Voltage scaling present.
 
#define EMU_VSCALE_EM01_PRESENT
 Voltage scaling for EM01 present.
 
#define EMU_SERIES1_DCDC_BUCK_PRESENT
 DC-DC buck converter present.
 
#define emuDcdcLnHighEfficiency   -1
 High efficiency mode.
 
#define emuDcdcLnFastTransient   160
 Default reverse current for fast transient response mode (low noise).
 
#define EMU_EM01INIT_DEFAULT
 Default initialization of EM0 and 1 configuration.
 
#define EMU_EM23INIT_DEFAULT
 Default initialization of EM2 and 3 configuration.
 
#define EMU_EM4INIT_DEFAULT
 Default initialization of EM4 configuration (Series 1 with VSCALE).
 
#define EMU_BUINIT_DEFAULT
 Default Backup Power Domain configuration.
 
#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.
 

Typedefs

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

Enumerations

enum  EMU_BUBuInactPwrCon_TypeDef {
  emuBuBuInactPwrCon_None = EMU_BUCTRL_BUINACTPWRCON_NONE,
  emuBuBuInactPwrCon_MainBu = EMU_BUCTRL_BUINACTPWRCON_MAINBU,
  emuBuBuInactPwrCon_BuMain = EMU_BUCTRL_BUINACTPWRCON_BUMAIN,
  emuBuBuInactPwrCon_NoDiode = EMU_BUCTRL_BUINACTPWRCON_NODIODE
}
 Backup Power Domain power connection configuration when not in backup mode selection.
 
enum  EMU_BUBuActPwrCon_TypeDef {
  emuBuBuActPwrCon_None = EMU_BUCTRL_BUACTPWRCON_NONE,
  emuBuBuActPwrCon_MainBu = EMU_BUCTRL_BUACTPWRCON_MAINBU,
  emuBuBuActPwrCon_BuMain = EMU_BUCTRL_BUACTPWRCON_BUMAIN,
  emuBuBuActPwrCon_NoDiode = EMU_BUCTRL_BUACTPWRCON_NODIODE
}
 Backup Power Domain power connection configuration in backup mode selection.
 
enum  EMU_BUPwrRes_TypeDef {
  emuBuPwrRes_Res0 = EMU_BUCTRL_PWRRES_RES0,
  emuBuPwrRes_Res1 = EMU_BUCTRL_PWRRES_RES1,
  emuBuPwrRes_Res2 = EMU_BUCTRL_PWRRES_RES2,
  emuBuPwrRes_Res3 = EMU_BUCTRL_PWRRES_RES3
}
 Backup Power Domain resistor selection.
 
enum  EMU_BUVoutRes_TypeDef {
  emuBuVoutRes_Dis = EMU_BUCTRL_VOUTRES_DIS,
  emuBuVoutRes_Weak = EMU_BUCTRL_VOUTRES_WEAK,
  emuBuVoutRes_Med = EMU_BUCTRL_VOUTRES_MED,
  emuBuVoutRes_Strong = EMU_BUCTRL_VOUTRES_STRONG
}
 Resistance between backup domain power supply and BU_VOUT.
 
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,
  emuDcdcMode_LowPower = EMU_DCDCCTRL_DCDCMODE_LOWPOWER
}
 DCDC operating modes.
 
enum  EMU_DcdcModeEM23_TypeDef {
  emuDcdcModeEM23_LowPower = EMU_DCDCCTRL_DCDCMODEEM23_EM23LOWPOWER,
  emuDcdcModeEM23_Sw = EMU_DCDCCTRL_DCDCMODEEM23_EM23SW
}
 DCDC operating modes in EM2 or EM3.
 
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,
  emuVmonChannel_IOVDD1,
  emuVmonChannel_BUVDD
}
 VMON channels.
 
enum  EMU_VScaleEM01_TypeDef {
  emuVScaleEM01_HighPerformance = _EMU_STATUS_VSCALE_VSCALE2,
  emuVScaleEM01_LowPower = _EMU_STATUS_VSCALE_VSCALE0
}
 Supported EM0/1 Voltage Scaling Levels.
 
enum  EMU_VScaleEM23_TypeDef {
  emuVScaleEM23_FastWakeup = _EMU_CTRL_EM23VSCALE_VSCALE2,
  emuVScaleEM23_LowPower = _EMU_CTRL_EM23VSCALE_VSCALE0
}
 Supported EM2/3 Voltage Scaling Levels.
 
enum  EMU_VScaleEM4H_TypeDef {
  emuVScaleEM4H_FastWakeup = _EMU_CTRL_EM4HVSCALE_VSCALE2,
  emuVScaleEM4H_LowPower = _EMU_CTRL_EM4HVSCALE_VSCALE0
}
 Supported EM4H Voltage Scaling Levels.
 
enum  EMU_PeripheralRetention_TypeDef {
  emuPeripheralRetention_USB = _EMU_EM23PERNORETAINCTRL_USBDIS_MASK,
  emuPeripheralRetention_RTC = _EMU_EM23PERNORETAINCTRL_RTCDIS_MASK,
  emuPeripheralRetention_ACMP2 = _EMU_EM23PERNORETAINCTRL_ACMP2DIS_MASK,
  emuPeripheralRetention_ADC1 = _EMU_EM23PERNORETAINCTRL_ADC1DIS_MASK,
  emuPeripheralRetention_LETIMER1 = _EMU_EM23PERNORETAINCTRL_LETIMER1DIS_MASK,
  emuPeripheralRetention_LCD = _EMU_EM23PERNORETAINCTRL_LCDDIS_MASK,
  emuPeripheralRetention_LEUART1 = _EMU_EM23PERNORETAINCTRL_LEUART1DIS_MASK,
  emuPeripheralRetention_LEUART0 = _EMU_EM23PERNORETAINCTRL_LEUART0DIS_MASK,
  emuPeripheralRetention_CSEN = _EMU_EM23PERNORETAINCTRL_CSENDIS_MASK,
  emuPeripheralRetention_LESENSE0 = _EMU_EM23PERNORETAINCTRL_LESENSE0DIS_MASK,
  emuPeripheralRetention_WDOG1 = _EMU_EM23PERNORETAINCTRL_WDOG1DIS_MASK,
  emuPeripheralRetention_WDOG0 = _EMU_EM23PERNORETAINCTRL_WDOG0DIS_MASK,
  emuPeripheralRetention_LETIMER0 = _EMU_EM23PERNORETAINCTRL_LETIMER0DIS_MASK,
  emuPeripheralRetention_ADC0 = _EMU_EM23PERNORETAINCTRL_ADC0DIS_MASK,
  emuPeripheralRetention_IDAC0 = _EMU_EM23PERNORETAINCTRL_IDAC0DIS_MASK,
  emuPeripheralRetention_VDAC0 = _EMU_EM23PERNORETAINCTRL_VDAC0DIS_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
}
 Peripheral EM2 and 3 retention control.
 

Function Documentation

◆ EMU_EM01Init()

void EMU_EM01Init ( const EMU_EM01Init_TypeDef em01Init)

Update the EMU module with Energy Mode 0 and 1 configuration.

Parameters
[in]em01InitEnergy Mode 0 and 1 configuration structure.

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

◆ EMU_EFPEM23PresleepHook()