EMU - Energy Management Unit#

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.

Modules#

EMU_EM01Init_TypeDef

EMU_EM23Init_TypeDef

EMU_EM4Init_TypeDef

EMU_BUInit_TypeDef

EMU_DCDCInit_TypeDef

EMU_VmonInit_TypeDef

EMU_VmonHystInit_TypeDef

Enumerations#

enum
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
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
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
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
emuBODMode_Active
emuBODMode_Inactive
}

BOD threshold setting selector, active or inactive mode.

enum
emuEM4Shutoff = 0
emuEM4Hibernate = 1
}

EM4 modes.

enum
emuPinRetentionDisable = EMU_EM4CTRL_EM4IORETMODE_DISABLE
emuPinRetentionEm4Exit = EMU_EM4CTRL_EM4IORETMODE_EM4EXIT
emuPinRetentionLatch = EMU_EM4CTRL_EM4IORETMODE_SWUNLATCH
}

EM4 Pin Retention Type.

enum
emuPowerConfig_DcdcToDvdd
}

Power configurations.

enum
emuDcdcMode_Bypass = EMU_DCDCCTRL_DCDCMODE_BYPASS
emuDcdcMode_LowNoise = EMU_DCDCCTRL_DCDCMODE_LOWNOISE
emuDcdcMode_LowPower = EMU_DCDCCTRL_DCDCMODE_LOWPOWER
}

DCDC operating modes.

enum
emuDcdcModeEM23_LowPower = EMU_DCDCCTRL_DCDCMODEEM23_EM23LOWPOWER
emuDcdcModeEM23_Sw = EMU_DCDCCTRL_DCDCMODEEM23_EM23SW
}

DCDC operating modes in EM2 or EM3.

enum
emuDcdcConductionMode_ContinuousLN
emuDcdcConductionMode_DiscontinuousLN
}

DCDC conduction modes.

enum
emuDcdcAnaPeripheralPower_AVDD = EMU_PWRCTRL_ANASW_AVDD
emuDcdcAnaPeripheralPower_DCDC = EMU_PWRCTRL_ANASW_DVDD
}

DCDC to DVDD mode analog peripheral power supply select.

enum
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
emuDcdcLnCompCtrl_1u0F
emuDcdcLnCompCtrl_4u7F
}

DCDC Low Noise Compensator Control register.

enum
emuVmonChannel_AVDD
emuVmonChannel_ALTAVDD
emuVmonChannel_DVDD
emuVmonChannel_IOVDD0
emuVmonChannel_BUVDD
}

VMON channels.

enum
emuVScaleEM01_HighPerformance = _EMU_STATUS_VSCALE_VSCALE2
emuVScaleEM01_LowPower = _EMU_STATUS_VSCALE_VSCALE0
}

Supported EM0/1 Voltage Scaling Levels.

enum
emuVScaleEM23_FastWakeup = _EMU_CTRL_EM23VSCALE_VSCALE2
emuVScaleEM23_LowPower = _EMU_CTRL_EM23VSCALE_VSCALE0
}

Supported EM2/3 Voltage Scaling Levels.

enum
emuVScaleEM4H_FastWakeup = _EMU_CTRL_EM4HVSCALE_VSCALE2
emuVScaleEM4H_LowPower = _EMU_CTRL_EM4HVSCALE_VSCALE0
}

Supported EM4H Voltage Scaling Levels.

enum
emuPeripheralRetention_LCD = _EMU_EM23PERNORETAINCTRL_LCDDIS_MASK
emuPeripheralRetention_LEUART0 = _EMU_EM23PERNORETAINCTRL_LEUART0DIS_MASK
emuPeripheralRetention_CSEN = _EMU_EM23PERNORETAINCTRL_CSENDIS_MASK
emuPeripheralRetention_LESENSE0 = _EMU_EM23PERNORETAINCTRL_LESENSE0DIS_MASK
emuPeripheralRetention_WDOG0 = _EMU_EM23PERNORETAINCTRL_WDOG0DIS_MASK
emuPeripheralRetention_LETIMER0 = _EMU_EM23PERNORETAINCTRL_LETIMER0DIS_MASK
emuPeripheralRetention_ADC0 = _EMU_EM23PERNORETAINCTRL_ADC0DIS_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_PCNT0 = _EMU_EM23PERNORETAINCTRL_PCNT0DIS_MASK
emuPeripheralRetention_D1 = _EMU_EM23PERNORETAINCTRL_LETIMER0DIS_MASK | _EMU_EM23PERNORETAINCTRL_PCNT0DIS_MASK | _EMU_EM23PERNORETAINCTRL_ADC0DIS_MASK | _EMU_EM23PERNORETAINCTRL_ACMP0DIS_MASK | _EMU_EM23PERNORETAINCTRL_LESENSE0DIS_MASK
emuPeripheralRetention_D2 = _EMU_EM23PERNORETAINCTRL_ACMP1DIS_MASK | _EMU_EM23PERNORETAINCTRL_VDAC0DIS_MASK | _EMU_EM23PERNORETAINCTRL_CSENDIS_MASK | _EMU_EM23PERNORETAINCTRL_LEUART0DIS_MASK | _EMU_EM23PERNORETAINCTRL_LCDDIS_MASK | _EMU_EM23PERNORETAINCTRL_I2C1DIS_MASK | _EMU_EM23PERNORETAINCTRL_I2C0DIS_MASK
emuPeripheralRetention_ALL = emuPeripheralRetention_D1 | emuPeripheralRetention_D2 | emuPeripheralRetention_WDOG0
}

Peripheral EM2 and 3 retention control.

Typedefs#

typedef int16_t

DCDC Forced CCM and reverse current limiter control.

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

Energy mode 2/3 pre-sleep hook function.

void

Energy mode 2/3 post-sleep hook function.

void

EFP's Energy mode 2/3 pre-sleep hook function.

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

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

Energy mode 4 pre-sleep hook function.

void

EFP's Energy mode 4 pre-sleep hook function.

void

Enter energy mode 4 (EM4).

void

Enter energy mode 4 (EM4).

void

Enter energy mode 4 hibernate (EM4H).

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

Power up all available RAM memory blocks.

void
EMU_PeripheralRetention(EMU_PeripheralRetention_TypeDef periMask, bool enable)

Set EM2 3 peripheral retention control.

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

Enable BU_VIN probing.

void
EMU_BUStatEnSet(bool enable)

Enable backup mode status export.

void
EMU_BUEnableSet(bool enable)

Enable backup mode.

void
EMU_DCDCModeSet(EMU_DcdcMode_TypeDef dcdcMode)

Set DCDC regulator operating mode.

bool
EMU_DCDCInit(const EMU_DCDCInit_TypeDef *dcdcInit)

Configure the DCDC regulator.

bool

Power off the DCDC regulator.

void
EMU_DCDCModeEM23Set(EMU_DcdcModeEM23_TypeDef dcdcModeEM23)

Set DCDC Mode EM23 operating mode.

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

Get temperature in degrees Celsius.

bool

Check status of the internal LDO regulator.

void

Enter energy mode 1 (EM1).

void

Wait for voltage scaling to complete.

Get current voltage scaling level.

bool

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

Get pending EMU interrupt flags.

uint32_t

Get enabled and pending EMU interrupt flags.

void
EMU_IntSet(uint32_t flags)

Set one or more pending EMU interrupts.

void

Halts until backup power functionality is ready.

void
EMU_Lock(void)

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

void

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

void

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

void

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

void

Block entering EM2 or higher number energy modes.

void

Unblock entering EM2 or higher number energy modes.

void

When EM4 pin retention is set to emuPinRetentionLatch, then pins are retained through EM4 entry and wakeup.

bool

Temperature measurement ready status.

bool

Load DCDC calibration constants from the DI page.

void

Set recommended and validated current optimization and timing settings.

void

Compute current limiters: LNCLIMILIMSEL: LN current limiter threshold LPCLIMILIMSEL: LP current limiter threshold DCDCZDETCTRL: zero detector limiter threshold.

void
userCurrentLimitsSet(uint32_t maxCurrent_mA, EMU_DcdcLnReverseCurrentControl_TypeDef reverseCurrentControl)

Set static variables that hold the user set maximum peak current and reverse current.

void
compCtrlSet(EMU_DcdcLnCompCtrl_TypeDef comp)

Set DCDC low noise compensator control register.

bool
lpCmpHystCalibrationLoad(bool lpAttenuation, uint8_t lpCmpBias, dcdcTrimMode_TypeDef trimMode)

Load EMU_DCDCLPCTRL_LPCMPHYSSEL depending on LP bias, LP feedback attenuation, and DEVINFOREV.

void
lpGetDevinfoVrefLowHigh(uint32_t *vrefL, uint32_t *vrefH, bool lpAttenuation, uint8_t lpcmpBias)

Load LPVREF low and high from DEVINFO.

uint32_t
vmonCalibratedThreshold(EMU_VmonChannel_TypeDef channel, int threshold)

Get the calibrated threshold value.

Macros#

#define

Voltage scaling present.

#define

Voltage scaling for EM01 present.

#define

DC-DC buck converter present.

#define

High efficiency mode.

#define

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

#define

Default initialization of EM0 and 1 configuration.

#define

Default initialization of EM2 and 3 configuration.

#define

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

#define

Default Backup Power Domain configuration.

#define

Default DCDC initialization.

#define

Default VMON initialization structure.

#define

Default VMON Hysteresis initialization structure.

#define

Zero degrees Celcius in Kelvin.

Enumeration Documentation#

EMU_BUBuInactPwrCon_TypeDef#

EMU_BUBuInactPwrCon_TypeDef

Backup Power Domain power connection configuration when not in backup mode selection.

Enumerator
emuBuBuInactPwrCon_None

No connection.

emuBuBuInactPwrCon_MainBu

Allow power from main to backup.

emuBuBuInactPwrCon_BuMain

Allow power from backup to main.

emuBuBuInactPwrCon_NoDiode

Backup and main power are connected.


Definition at line 146 of file platform/emlib/inc/em_emu.h

EMU_BUBuActPwrCon_TypeDef#

EMU_BUBuActPwrCon_TypeDef

Backup Power Domain power connection configuration in backup mode selection.

Enumerator
emuBuBuActPwrCon_None

No connection.

emuBuBuActPwrCon_MainBu

Allow power from main to backup.

emuBuBuActPwrCon_BuMain

Allow power from backup to main.

emuBuBuActPwrCon_NoDiode

Backup and main power are connected.


Definition at line 160 of file platform/emlib/inc/em_emu.h

EMU_BUPwrRes_TypeDef#

EMU_BUPwrRes_TypeDef

Backup Power Domain resistor selection.

Enumerator
emuBuPwrRes_Res0

Main power and backup power connected with RES0 series resistance.

emuBuPwrRes_Res1

Main power and backup power connected with RES1 series resistance.

emuBuPwrRes_Res2

Main power and backup power connected with RES2 series resistance.

emuBuPwrRes_Res3

Main power and backup power connected with RES3 series resistance.


Definition at line 174 of file platform/emlib/inc/em_emu.h

EMU_BUVoutRes_TypeDef#

EMU_BUVoutRes_TypeDef

Resistance between backup domain power supply and BU_VOUT.

Enumerator
emuBuVoutRes_Dis

BU_VOUT is not connected.

emuBuVoutRes_Weak

Enable weak switch.

emuBuVoutRes_Med

Enable medium switch.

emuBuVoutRes_Strong

Enable strong switch.


Definition at line 188 of file platform/emlib/inc/em_emu.h

EMU_BODMode_TypeDef#

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.


Definition at line 201 of file platform/emlib/inc/em_emu.h

EMU_EM4State_TypeDef#

EMU_EM4State_TypeDef

EM4 modes.

Enumerator
emuEM4Shutoff

EM4 Shutoff.

emuEM4Hibernate

EM4 Hibernate.


Definition at line 209 of file platform/emlib/inc/em_emu.h

EMU_EM4PinRetention_TypeDef#

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.


Definition at line 218 of file platform/emlib/inc/em_emu.h

EMU_PowerConfig_TypeDef#

EMU_PowerConfig_TypeDef

Power configurations.

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

Enumerator
emuPowerConfig_DcdcToDvdd

DCDC is connected to DVDD.


Definition at line 230 of file platform/emlib/inc/em_emu.h

EMU_DcdcMode_TypeDef#

EMU_DcdcMode_TypeDef

DCDC operating modes.

Enumerator
emuDcdcMode_Bypass

DCDC regulator bypass.

emuDcdcMode_LowNoise

DCDC low-noise mode.

emuDcdcMode_LowPower

DCDC low-power mode.


Definition at line 237 of file platform/emlib/inc/em_emu.h

EMU_DcdcModeEM23_TypeDef#

EMU_DcdcModeEM23_TypeDef

DCDC operating modes in EM2 or EM3.

Enumerator
emuDcdcModeEM23_LowPower

DCDC mode is low power.

emuDcdcModeEM23_Sw

DCDC mode is according to DCDCMODE field.


Definition at line 249 of file platform/emlib/inc/em_emu.h

EMU_DcdcConductionMode_TypeDef#

EMU_DcdcConductionMode_TypeDef

DCDC conduction modes.

Enumerator
emuDcdcConductionMode_ContinuousLN

DCDC Low-Noise Continuous Conduction Mode (CCM).

emuDcdcConductionMode_DiscontinuousLN

DCDC Low-Noise Discontinuous Conduction Mode (DCM).


Definition at line 260 of file platform/emlib/inc/em_emu.h

EMU_DcdcAnaPeripheralPower_TypeDef#

EMU_DcdcAnaPeripheralPower_TypeDef

DCDC to DVDD mode analog peripheral power supply select.

Enumerator
emuDcdcAnaPeripheralPower_AVDD

Select AVDD as analog power supply.

emuDcdcAnaPeripheralPower_DCDC

Select DCDC (DVDD) as analog power supply.


Definition at line 272 of file platform/emlib/inc/em_emu.h

EMU_DcdcLnRcoBand_TypeDef#

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.


Definition at line 293 of file platform/emlib/inc/em_emu.h

EMU_DcdcLnCompCtrl_TypeDef#

EMU_DcdcLnCompCtrl_TypeDef

DCDC Low Noise Compensator Control register.

Enumerator
emuDcdcLnCompCtrl_1u0F

DCDC capacitor is 1uF.

emuDcdcLnCompCtrl_4u7F

DCDC capacitor is 4.7uF.


Definition at line 325 of file platform/emlib/inc/em_emu.h

EMU_VmonChannel_TypeDef#

EMU_VmonChannel_TypeDef

VMON channels.

Enumerator
emuVmonChannel_AVDD
emuVmonChannel_ALTAVDD
emuVmonChannel_DVDD
emuVmonChannel_IOVDD0
emuVmonChannel_BUVDD

Definition at line 510 of file platform/emlib/inc/em_emu.h

EMU_VScaleEM01_TypeDef#

EMU_VScaleEM01_TypeDef

Supported EM0/1 Voltage Scaling Levels.

Enumerator
emuVScaleEM01_HighPerformance

High-performance voltage level.

emuVScaleEM01_LowPower

Low-power optimized voltage level.


Definition at line 535 of file platform/emlib/inc/em_emu.h

EMU_VScaleEM23_TypeDef#

EMU_VScaleEM23_TypeDef

Supported EM2/3 Voltage Scaling Levels.

Enumerator
emuVScaleEM23_FastWakeup

Fast-wakeup voltage level.

emuVScaleEM23_LowPower

Low-power optimized voltage level.


Definition at line 554 of file platform/emlib/inc/em_emu.h

EMU_VScaleEM4H_TypeDef#

EMU_VScaleEM4H_TypeDef

Supported EM4H Voltage Scaling Levels.

Enumerator
emuVScaleEM4H_FastWakeup

Fast-wakeup voltage level.

emuVScaleEM4H_LowPower

Low-power optimized voltage level.


Definition at line 566 of file platform/emlib/inc/em_emu.h

EMU_PeripheralRetention_TypeDef#

EMU_PeripheralRetention_TypeDef

Peripheral EM2 and 3 retention control.

Enumerator
emuPeripheralRetention_LCD

Select LCD retention control.

emuPeripheralRetention_LEUART0

Select LEUART0 retention control.

emuPeripheralRetention_CSEN

Select CSEN retention control.

emuPeripheralRetention_LESENSE0

Select LESENSE0 retention control.

emuPeripheralRetention_WDOG0

Select WDOG0 retention control.

emuPeripheralRetention_LETIMER0

Select LETIMER0 retention control.

emuPeripheralRetention_ADC0

Select ADC0 retention control.

emuPeripheralRetention_VDAC0

Select VDAC0 retention control.

emuPeripheralRetention_I2C1

Select I2C1 retention control.

emuPeripheralRetention_I2C0

Select I2C0 retention control.

emuPeripheralRetention_ACMP1

Select ACMP1 retention control.

emuPeripheralRetention_ACMP0

Select ACMP0 retention control.

emuPeripheralRetention_PCNT0

Select PCNT0 retention control.

emuPeripheralRetention_D1

Select all peripherals in domain 1.

emuPeripheralRetention_D2

Select all peripherals in domain 2.

emuPeripheralRetention_ALL

Select all peripherals with retention control.


Definition at line 578 of file platform/emlib/inc/em_emu.h

Typedef Documentation#

EMU_DcdcLnReverseCurrentControl_TypeDef#

typedef int16_t EMU_DcdcLnReverseCurrentControl_TypeDef

DCDC Forced CCM and reverse current limiter control.

Positive values have unit mA.


Definition at line 282 of file platform/emlib/inc/em_emu.h

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]em01Init

Energy Mode 0 and 1 configuration structure.


Definition at line 784 of file platform/emlib/src/em_emu.c

EMU_EM23Init#

void EMU_EM23Init (const EMU_EM23Init_TypeDef * em23Init)

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

Parameters
[in]em23Init

Energy Mode 2 and 3 configuration structure.


Definition at line 799 of file platform/emlib/src/em_emu.c

EMU_EM23PresleepHook#

void EMU_EM23PresleepHook (void )

Energy mode 2/3 pre-sleep hook function.

Parameters
N/A

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.


Definition at line 833 of file platform/emlib/src/em_emu.c

EMU_EM23PostsleepHook#

void EMU_EM23PostsleepHook (void )

Energy mode 2/3 post-sleep hook function.

Parameters
N/A

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.


Definition at line 865 of file platform/emlib/src/em_emu.c

EMU_EFPEM23PresleepHook#

void EMU_EFPEM23PresleepHook (void )

EFP's Energy mode 2/3 pre-sleep hook function.

Parameters
N/A

This function is similar to EMU_EM23PresleepHook() but is reserved for EFP usage.

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.


Definition at line 851 of file platform/emlib/src/em_emu.c

EMU_EFPEM23PostsleepHook#

void EMU_EFPEM23PostsleepHook (void )

EFP's Energy mode 2/3 post-sleep hook function.

Parameters
N/A

This function is similar to EMU_EM23PostsleepHook() but is reserved for EFP usage.

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.


Definition at line 883 of file platform/emlib/src/em_emu.c

EMU_EnterEM2#

void EMU_EnterEM2 (bool restore)

Enter energy mode 2 (EM2).

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.

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.

  • This function is incompatible with the Power Manager module. When the Power Manager module is present, it must be the one deciding at which EM level the device sleeps to ensure the application properly works. Using both at the same time could lead to undefined behavior in the application.

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

  • The restore option should only be used if all clock control is done via the CMU API.


Definition at line 957 of file platform/emlib/src/em_emu.c

EMU_EnterEM3#

void EMU_EnterEM3 (bool restore)

Enter energy mode 3 (EM3).

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.

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.

  • This function is incompatible with the Power Manager module. When the Power Manager module is present, it must be the one deciding at which EM level the device sleeps to ensure the application properly works. Using both at the same time could lead to undefined behavior in the application.

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

  • The restore option should only be used if all clock control is done via the CMU API.


Definition at line 1150 of file platform/emlib/src/em_emu.c

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.

Parameters
N/A

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


Definition at line 1305 of file platform/emlib/src/em_emu.c

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.

Parameters
N/A

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.


Definition at line 1324 of file platform/emlib/src/em_emu.c

EMU_EM4Init#

void EMU_EM4Init (const EMU_EM4Init_TypeDef * em4Init)

Update the EMU module with Energy Mode 4 configuration.

Parameters
[in]em4Init

Energy Mode 4 configuration structure.


Definition at line 1342 of file platform/emlib/src/em_emu.c

EMU_EM4PresleepHook#

void EMU_EM4PresleepHook (void )

Energy mode 4 pre-sleep hook function.

Parameters
N/A

This function is called by EMU_EnterEM4() just prior to the sequence of writes to put the device in EM4. 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.


Definition at line 1406 of file platform/emlib/src/em_emu.c

EMU_EFPEM4PresleepHook#

void EMU_EFPEM4PresleepHook (void )

EFP's Energy mode 4 pre-sleep hook function.

Parameters
N/A

This function is similar to EMU_EM4PresleepHook() but is reserved for EFP usage.

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.


Definition at line 1424 of file platform/emlib/src/em_emu.c

EMU_EnterEM4#

void EMU_EnterEM4 (void )

Enter energy mode 4 (EM4).

Parameters
N/A

Note

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


Definition at line 1435 of file platform/emlib/src/em_emu.c

EMU_EnterEM4Wait#

void EMU_EnterEM4Wait (void )

Enter energy mode 4 (EM4).

Parameters
N/A

This function waits after the EM4 entry request to make sure the CPU is properly shutdown or the EM4 entry failed.

Note

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


Definition at line 1570 of file platform/emlib/src/em_emu.c

EMU_EnterEM4H#

void EMU_EnterEM4H (void )

Enter energy mode 4 hibernate (EM4H).

Parameters
N/A

Note

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


Definition at line 1590 of file platform/emlib/src/em_emu.c

EMU_EnterEM4S#

void EMU_EnterEM4S (void )

Enter energy mode 4 shutoff (EM4S).

Parameters
N/A

Note

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


Definition at line 1606 of file platform/emlib/src/em_emu.c

EMU_MemPwrDown#

void EMU_MemPwrDown (uint32_t blocks)

Power down memory block.

Parameters
[in]blocks

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


Definition at line 1632 of file platform/emlib/src/em_emu.c

EMU_RamPowerDown#

void EMU_RamPowerDown (uint32_t start, uint32_t end)

Power down RAM memory blocks.

Parameters
[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, all RAM blocks contained in the region from start to the upper RAM address will be powered down.

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. The specified memory block(s) will stay off until a call to EMU_RamPowerUp() is done on series 1/2.


Definition at line 1679 of file platform/emlib/src/em_emu.c

EMU_RamPowerUp#

void EMU_RamPowerUp (void )

Power up all available RAM memory blocks.

Parameters
N/A

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.


Definition at line 1770 of file platform/emlib/src/em_emu.c

EMU_PeripheralRetention#

void EMU_PeripheralRetention (EMU_PeripheralRetention_TypeDef periMask, bool enable)

Set EM2 3 peripheral retention control.

Parameters
[in]periMask

A peripheral select mask. Use | operator to select multiple peripherals, for example emuPeripheralRetention_LEUART0 | emuPeripheralRetention_VDAC0.

[in]enable

Peripheral retention enable (true) or disable (false).

Note

  • Only peripheral retention disable is currently supported. Peripherals are enabled by default and can only be disabled.


Definition at line 1805 of file platform/emlib/src/em_emu.c

EMU_UpdateOscConfig#

void EMU_UpdateOscConfig (void )

Update EMU module with CMU oscillator selection/enable status.

Parameters
N/A

Definition at line 1820 of file platform/emlib/src/em_emu.c

EMU_VScaleEM01ByClock#

void EMU_VScaleEM01ByClock (uint32_t clockFrequency, bool wait)

Voltage scale in EM0 and 1 by clock frequency.

Parameters
[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 complete.

Note


Definition at line 1860 of file platform/emlib/src/em_emu.c

EMU_VScaleEM01#

void EMU_VScaleEM01 (EMU_VScaleEM01_TypeDef voltage, bool wait)

Force voltage scaling in EM0 and 1 to a specific voltage level.

Parameters
[in]voltage

Target VSCALE voltage level.

[in]wait

Wait for scaling to complete.

Note


Definition at line 1913 of file platform/emlib/src/em_emu.c

EMU_BUInit#

void EMU_BUInit (const EMU_BUInit_TypeDef * buInit)

Configure Backup Power Domain settings.

Parameters
[in]buInit

Backup power domain initialization structure.


Definition at line 2101 of file platform/emlib/src/em_emu.c

EMU_BUDisMaxCompSet#

void EMU_BUDisMaxCompSet (bool disableMainBuComparator)

Disable Main Backup Power Domain comparator.

Parameters
[in]disableMainBuComparator

True to disable main BU comparator.


Definition at line 2126 of file platform/emlib/src/em_emu.c

EMU_BUBuInactPwrConSet#

void EMU_BUBuInactPwrConSet (EMU_BUBuInactPwrCon_TypeDef inactPwrCon)

Configure power connection configuration when not in Backup mode.

Parameters
[in]inactPwrCon

Inactive power configuration.


Definition at line 2144 of file platform/emlib/src/em_emu.c

EMU_BUBuActPwrConSet#

void EMU_BUBuActPwrConSet (EMU_BUBuActPwrCon_TypeDef actPwrCon)

Configure power connection configuration when in Backup mode.

Parameters
[in]actPwrCon

Active power configuration.


Definition at line 2162 of file platform/emlib/src/em_emu.c

EMU_BUPwrResSet#

void EMU_BUPwrResSet (EMU_BUPwrRes_TypeDef pwrRes)

Power domain resistor selection.

Parameters
[in]pwrRes

Resistor selection.


Definition at line 2180 of file platform/emlib/src/em_emu.c

EMU_BUVoutResSet#

void EMU_BUVoutResSet (EMU_BUVoutRes_TypeDef resistorSel)

B_VOUT resistor select.

Parameters
[in]resistorSel

Resistor selection.


Definition at line 2198 of file platform/emlib/src/em_emu.c

EMU_BUBuVinProbeEnSet#

void EMU_BUBuVinProbeEnSet (bool enable)

Enable BU_VIN probing.

Parameters
[in]enable

True to enable BU_VIN probing. False to disable.


Definition at line 2216 of file platform/emlib/src/em_emu.c

EMU_BUStatEnSet#

void EMU_BUStatEnSet (bool enable)

Enable backup mode status export.

Parameters
[in]enable

True to enable status export. False to disable.


Definition at line 2234 of file platform/emlib/src/em_emu.c

EMU_BUEnableSet#

void EMU_BUEnableSet (bool enable)

Enable backup mode.

Parameters
[in]enable

True to enable backup mode. False to disable.


Definition at line 2252 of file platform/emlib/src/em_emu.c

EMU_DCDCModeSet#

void EMU_DCDCModeSet (EMU_DcdcMode_TypeDef dcdcMode)

Set DCDC regulator operating mode.

Parameters
[in]dcdcMode

DCDC mode.


Definition at line 2858 of file platform/emlib/src/em_emu.c

EMU_DCDCInit#

bool EMU_DCDCInit (const EMU_DCDCInit_TypeDef * dcdcInit)

Configure the DCDC regulator.

Parameters
[in]dcdcInit

The DCDC initialization structure.

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

Returns

  • True if initialization parameters are valid.


Definition at line 2717 of file platform/emlib/src/em_emu.c

EMU_DCDCPowerOff#

bool EMU_DCDCPowerOff (void )

Power off the DCDC regulator.

Parameters
N/A

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.


Definition at line 2969 of file platform/emlib/src/em_emu.c

EMU_DCDCModeEM23Set#

void EMU_DCDCModeEM23Set (EMU_DcdcModeEM23_TypeDef dcdcModeEM23)

Set DCDC Mode EM23 operating mode.

Parameters
[in]dcdcModeEM23

DCDC mode EM23.


Definition at line 2937 of file platform/emlib/src/em_emu.c

EMU_DCDCConductionModeSet#

void EMU_DCDCConductionModeSet (EMU_DcdcConductionMode_TypeDef conductionMode, bool rcoDefaultSet)

Set DCDC LN regulator conduction mode.

Parameters
[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 3007 of file platform/emlib/src/em_emu.c

EMU_DCDCOutputVoltageSet#

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

Set the DCDC output voltage.

Parameters
[in]mV

Target DCDC output voltage in mV.

[in]setLpVoltage

Update LP voltage

[in]setLnVoltage

Update LN 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.

Returns

  • True if the mV parameter is valid.


Definition at line 3066 of file platform/emlib/src/em_emu.c

EMU_DCDCOptimizeSlice#

void EMU_DCDCOptimizeSlice (uint32_t em0LoadCurrentmA)

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

Parameters
[in]em0LoadCurrentmA

Estimated average EM0 load current in mA.


Definition at line 3216 of file platform/emlib/src/em_emu.c

EMU_DCDCLnRcoBandSet#

void EMU_DCDCLnRcoBandSet (EMU_DcdcLnRcoBand_TypeDef band)

Set DCDC Low-noise RCO band.

Parameters
[in]band

RCO band to set.


Definition at line 3275 of file platform/emlib/src/em_emu.c

EMU_VmonInit#

void EMU_VmonInit (const EMU_VmonInit_TypeDef * vmonInit)

Initialize a VMON channel.

Parameters
[in]vmonInit

The VMON initialization structure.

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.


Definition at line 3842 of file platform/emlib/src/em_emu.c

EMU_VmonHystInit#

void EMU_VmonHystInit (const EMU_VmonHystInit_TypeDef * vmonInit)

Initialize a VMON channel with hysteresis (separate rise and fall triggers).

Parameters
[in]vmonInit

The VMON hysteresis initialization structure.

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.


Definition at line 3929 of file platform/emlib/src/em_emu.c

EMU_VmonEnable#

void EMU_VmonEnable (EMU_VmonChannel_TypeDef channel, bool enable)

Enable or disable a VMON channel.

Parameters
[in]channel

A VMON channel to enable/disable.

[in]enable

Indicates whether to enable or disable.


Definition at line 3969 of file platform/emlib/src/em_emu.c

EMU_VmonChannelStatusGet#

bool EMU_VmonChannelStatusGet (EMU_VmonChannel_TypeDef channel)

Get the status of a voltage monitor channel.

Parameters
[in]channel

A VMON channel to get the status for.

Returns

  • A status of the selected VMON channel. True if the channel is triggered.


Definition at line 4021 of file platform/emlib/src/em_emu.c

EMU_TemperatureGet#

float EMU_TemperatureGet (void )

Get temperature in degrees Celsius.

Parameters
N/A

Returns

  • Temperature in degrees Celsius


Definition at line 4110 of file platform/emlib/src/em_emu.c

EMU_LDOStatusGet#

bool EMU_LDOStatusGet (void )

Check status of the internal LDO regulator.

Parameters
N/A

Returns

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


Definition at line 1290 of file platform/emlib/inc/em_emu.h

EMU_EnterEM1#

void EMU_EnterEM1 (void )

Enter energy mode 1 (EM1).

Parameters
N/A

Note

  • This function is incompatible with the Power Manager module. When the Power Manager module is present, it must be the one deciding at which EM level the device sleeps to ensure the application properly works. Using both at the same time could lead to undefined behavior in the application.


Definition at line 1310 of file platform/emlib/inc/em_emu.h

EMU_VScaleWait#

void EMU_VScaleWait (void )

Wait for voltage scaling to complete.

Parameters
N/A

Definition at line 1322 of file platform/emlib/inc/em_emu.h

EMU_VScaleGet#

EMU_VScaleEM01_TypeDef EMU_VScaleGet (void )

Get current voltage scaling level.

Parameters
N/A

Returns

  • Current voltage scaling level.


Definition at line 1344 of file platform/emlib/inc/em_emu.h

EMU_VmonStatusGet#

bool EMU_VmonStatusGet (void )

Get the status of the voltage monitor (VMON).

Parameters
N/A

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.


Definition at line 1362 of file platform/emlib/inc/em_emu.h

EMU_IntClear#

void EMU_IntClear (uint32_t flags)

Clear one or more pending EMU interrupts.

Parameters
[in]flags

Pending EMU interrupt sources to clear. Use one or more valid interrupt flags for the EMU module (EMU_IFC_nnn or EMU_IF_nnn).


Definition at line 1377 of file platform/emlib/inc/em_emu.h

EMU_IntDisable#

void EMU_IntDisable (uint32_t flags)

Disable one or more EMU interrupts.

Parameters
[in]flags

EMU interrupt sources to disable. Use one or more valid interrupt flags for the EMU module (EMU_IEN_nnn).


Definition at line 1394 of file platform/emlib/inc/em_emu.h

EMU_IntEnable#

void EMU_IntEnable (uint32_t flags)

Enable one or more EMU interrupts.

Parameters
[in]flags

EMU interrupt sources to enable. Use one or more valid interrupt flags for the EMU module (EMU_IEN_nnn).

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.


Definition at line 1416 of file platform/emlib/inc/em_emu.h

EMU_IntGet#

uint32_t EMU_IntGet (void )

Get pending EMU interrupt flags.

Parameters
N/A

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


Definition at line 1527 of file platform/emlib/inc/em_emu.h

EMU_IntGetEnabled#

uint32_t EMU_IntGetEnabled (void )

Get enabled and pending EMU interrupt flags.

Parameters
N/A

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.


Definition at line 1546 of file platform/emlib/inc/em_emu.h

EMU_IntSet#

void EMU_IntSet (uint32_t flags)

Set one or more pending EMU interrupts.

Parameters
[in]flags

EMU interrupt sources to set to pending. Use one or more valid interrupt flags for the EMU module (EMU_IFS_nnn).


Definition at line 1562 of file platform/emlib/inc/em_emu.h

EMU_BUReady#

void EMU_BUReady (void )

Halts until backup power functionality is ready.

Parameters
N/A

Definition at line 1590 of file platform/emlib/inc/em_emu.h

EMU_Lock#

void EMU_Lock (void )

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

Parameters
N/A

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.


Definition at line 1622 of file platform/emlib/inc/em_emu.h

EMU_Unlock#

void EMU_Unlock (void )

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

Parameters
N/A

Definition at line 1631 of file platform/emlib/inc/em_emu.h

EMU_PowerLock#

void EMU_PowerLock (void )

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

Parameters
N/A

Definition at line 1642 of file platform/emlib/inc/em_emu.h

EMU_PowerUnlock#

void EMU_PowerUnlock (void )

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

Parameters
N/A

Definition at line 1652 of file platform/emlib/inc/em_emu.h

EMU_EM2Block#

void EMU_EM2Block (void )

Block entering EM2 or higher number energy modes.

Parameters
N/A

Definition at line 1663 of file platform/emlib/inc/em_emu.h

EMU_EM2UnBlock#

void EMU_EM2UnBlock (void )

Unblock entering EM2 or higher number energy modes.

Parameters
N/A

Definition at line 1672 of file platform/emlib/inc/em_emu.h

EMU_UnlatchPinRetention#

void EMU_UnlatchPinRetention (void )

When EM4 pin retention is set to emuPinRetentionLatch, then pins are retained through EM4 entry and wakeup.

Parameters
N/A

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.


Definition at line 1687 of file platform/emlib/inc/em_emu.h

EMU_TemperatureReady#

bool EMU_TemperatureReady (void )

Temperature measurement ready status.

Parameters
N/A

Returns

  • True if temperature measurement is ready


Definition at line 1703 of file platform/emlib/inc/em_emu.h

dcdcConstCalibrationLoad#

static bool dcdcConstCalibrationLoad (void )

Load DCDC calibration constants from the DI page.

Parameters
N/A

A constant means that calibration data that does not change depending on other configuration parameters.

Returns

  • False if calibration registers are locked.


Definition at line 2283 of file platform/emlib/src/em_emu.c

dcdcValidatedConfigSet#

static void dcdcValidatedConfigSet (void )

Set recommended and validated current optimization and timing settings.

Parameters
N/A

Definition at line 2338 of file platform/emlib/src/em_emu.c

currentLimitersUpdate#

static void currentLimitersUpdate (void )

Compute current limiters: LNCLIMILIMSEL: LN current limiter threshold LPCLIMILIMSEL: LP current limiter threshold DCDCZDETCTRL: zero detector limiter threshold.

Parameters
N/A

Definition at line 2397 of file platform/emlib/src/em_emu.c

userCurrentLimitsSet#

static void userCurrentLimitsSet (uint32_t maxCurrent_mA, EMU_DcdcLnReverseCurrentControl_TypeDef reverseCurrentControl)

Set static variables that hold the user set maximum peak current and reverse current.

Parameters
[in]maxCurrent_mA

Set the maximum peak current that the DCDC can draw from the power source.

[in]reverseCurrentControl

Reverse the current control as defined by EMU_DcdcLnReverseCurrentControl_TypeDef. Positive values have unit mA.

Update limiters.


Definition at line 2477 of file platform/emlib/src/em_emu.c

compCtrlSet#

static void compCtrlSet (EMU_DcdcLnCompCtrl_TypeDef comp)

Set DCDC low noise compensator control register.

Parameters
[in]comp

Low-noise mode compensator trim setpoint.


Definition at line 2491 of file platform/emlib/src/em_emu.c

lpCmpHystCalibrationLoad#

static bool lpCmpHystCalibrationLoad (bool lpAttenuation, uint8_t lpCmpBias, dcdcTrimMode_TypeDef trimMode)

Load EMU_DCDCLPCTRL_LPCMPHYSSEL depending on LP bias, LP feedback attenuation, and DEVINFOREV.

Parameters
[in]lpAttenuation

LP feedback attenuation.

[in]lpCmpBias

lpCmpBias selection.

[in]trimMode

DCDC trim mode.


Definition at line 2520 of file platform/emlib/src/em_emu.c

lpGetDevinfoVrefLowHigh#

static void lpGetDevinfoVrefLowHigh (uint32_t * vrefL, uint32_t * vrefH, bool lpAttenuation, uint8_t lpcmpBias)

Load LPVREF low and high from DEVINFO.

Parameters
[out]vrefL

LPVREF low from DEVINFO.

[out]vrefH

LPVREF high from DEVINFO.

[in]lpAttenuation

LP feedback attenuation.

[in]lpcmpBias

lpcmpBias to look up in DEVINFO.


Definition at line 2618 of file platform/emlib/src/em_emu.c

vmonCalibratedThreshold#

static uint32_t vmonCalibratedThreshold (EMU_VmonChannel_TypeDef channel, int threshold)

Get the calibrated threshold value.

Parameters
[in]channel

A VMON channel.

[in]threshold

A desired threshold in millivolts.

All VMON channels have two calibration fields in the DI page that describes the threshold at 1.86 V and 2.98 V. This function will convert the uncalibrated input voltage threshold in millivolts into a calibrated threshold.

Returns

  • A calibrated threshold value to use. The first digit of the return value is placed in the "fine" register fields while the next digits are placed in the "coarse" register fields.


Definition at line 3723 of file platform/emlib/src/em_emu.c

Macro Definition Documentation#

EMU_VSCALE_PRESENT#

#define EMU_VSCALE_PRESENT

Voltage scaling present.


Definition at line 58 of file platform/emlib/inc/em_emu.h

EMU_VSCALE_EM01_PRESENT#

#define EMU_VSCALE_EM01_PRESENT

Voltage scaling for EM01 present.


Definition at line 61 of file platform/emlib/inc/em_emu.h

EMU_SERIES1_DCDC_BUCK_PRESENT#

#define EMU_SERIES1_DCDC_BUCK_PRESENT

DC-DC buck converter present.


Definition at line 67 of file platform/emlib/inc/em_emu.h

emuDcdcLnHighEfficiency#

#define emuDcdcLnHighEfficiency
Value:
-1

High efficiency mode.

EMU_DCDCZDETCTRL_ZDETILIMSEL is "don't care".


Definition at line 285 of file platform/emlib/inc/em_emu.h

emuDcdcLnFastTransient#

#define emuDcdcLnFastTransient
Value:
160

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



Definition at line 288 of file platform/emlib/inc/em_emu.h

EMU_EM01INIT_DEFAULT#

#define EMU_EM01INIT_DEFAULT
Value:
{ \
false /* Do not scale down in EM0/1.*/ \
}

Default initialization of EM0 and 1 configuration.


Definition at line 718 of file platform/emlib/inc/em_emu.h

EMU_EM23INIT_DEFAULT#

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

Default initialization of EM2 and 3 configuration.


Definition at line 734 of file platform/emlib/inc/em_emu.h

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. */ \
emuVScaleEM4H_FastWakeup, /* Do not scale down in EM4H. */ \
}

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


Definition at line 783 of file platform/emlib/inc/em_emu.h

EMU_BUINIT_DEFAULT#

#define EMU_BUINIT_DEFAULT
Value:
{ \
false, /* MAIN-BU Comparator is not disabled */ \
emuBuBuInactPwrCon_None, /* No power connection wen not in backup mode */ \
emuBuBuActPwrCon_None, /* No power connection when in backup mode */ \
emuBuPwrRes_Res0, /* RES0 series resistance between main and backup power. */ \
emuBuVoutRes_Dis, /* Vout resistor is set to not connected */ \
false, /* BU_VIN probe is disabled */ \
false, /* Status export is disabled */ \
true /* Enable backup mode */ \
}

Default Backup Power Domain configuration.


Definition at line 866 of file platform/emlib/inc/em_emu.h

EMU_DCDCINIT_DEFAULT#

#define EMU_DCDCINIT_DEFAULT
Value:
{ \
emuPowerConfig_DcdcToDvdd, /* DCDC to DVDD. */ \
emuDcdcMode_LowPower, /* Low-power mode in EM0. */ \
1800, /* Nominal output voltage for DVDD mode, 1.8V. */ \
5, /* Nominal EM0/1 load current of less than 5mA. */ \
10, /* Nominal EM2/3/4 load current less than 10uA. */ \
200, /* Maximum average current of 200mA
(assume strong battery or other power source). */ \
emuDcdcAnaPeripheralPower_AVDD,/* Select AVDD as analog power supply). */ \
emuDcdcLnHighEfficiency, /* Use high-efficiency mode. */ \
emuDcdcLnCompCtrl_4u7F, /* 4.7uF DCDC capacitor. */ \
}

Default DCDC initialization.


Definition at line 1010 of file platform/emlib/inc/em_emu.h

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.


Definition at line 1069 of file platform/emlib/inc/em_emu.h

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.


Definition at line 1090 of file platform/emlib/inc/em_emu.h

EMU_TEMP_ZERO_C_IN_KELVIN#

#define EMU_TEMP_ZERO_C_IN_KELVIN
Value:
(273.15f)

Zero degrees Celcius in Kelvin.


Definition at line 1696 of file platform/emlib/inc/em_emu.h