MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
SPM: System Power Manager

Overview

The firmware lib provides a Peripheral driver for the System Power Manager (SPM) module of Kinetis devices. The SPM module contains internal voltage regulator, power on reset, low-voltage detect system, and high-voltage detect system.

#Typical use case {#SPMTpyUC}

LDO->DCDC

It is recommended to switch to DCDC first before enabling the peripheral's power attached to it. Otherwise, it might cause Vdd_core undershooting during the switch if Vdd_rf domain loading is added. Switching to DCDC with less loading on Vdd_core domain is always perferred.

For Example 1: Vdd_rf = 1.8V, Vdd_core_1.2V

Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/spm

DCDC RUN->HSRUN

DCDC HSRUN is only supported while LDO->DCDC is done in RUN mode. We should avoid entering HSRUN mode with LDO(RCTRL[REGSEL]=3’b011) then LDO->DCDC(RCTRL[REGSEL]=3’b100) in HSRUN mode.

For example 2:

Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/spm

Data Structures

struct  spm_version_id_t
 IP version ID definition. More...
 
struct  spm_regulator_status_t
 Keep the regulator status information. More...
 
struct  spm_low_volt_detect_config_t
 Low-voltage Detect Configuration Structure. More...
 
struct  spm_low_volt_warning_config_t
 Low-voltage Warning Configuration Structure. More...
 
struct  spm_high_volt_detect_config_t
 High-voltage Detect Configuration Structure. More...
 
struct  spm_rf_ldo_config_t
 RF LDO configuration structure. More...
 
struct  spm_dcdc_integrator_config_t
 Configuration for setting DCDC integrator value. More...
 
struct  spm_power_switch_delay_config_t
 Configuration of power switch delay. More...
 
struct  spm_low_power_req_out_pin_config_t
 Configuration structure of low power request out pin. More...
 

Enumerations

enum  spm_radio_low_power_mode_status_t {
  kSPM_RadioLowPowerModeReserved = 0x0,
  kSPM_RadioLowPowerModeVLPS = 0x1,
  kSPM_RadioLowPowerModeLLS = 0x2,
  kSPM_RadioLowPowerModeVLLS = 0x4
}
 Status of last RADIO Power Mode Configuration. More...
 
enum  spm_mcu_low_power_mode_status_t {
  kSPM_McuLowPowerModeReserved = 0U,
  kSPM_McuLowPowerModeSTOP = 1U,
  kSPM_McuLowPowerModeVLPS = (1U << 1),
  kSPM_McuLowPowerModeLLS = (1U << 2),
  kSPM_McuLowPowerModeVLLS23 = (1U << 3),
  kSPM_McuLowPowerModeVLLS01 = (1U << 4)
}
 Status of last MCU STOP Mode Power Configuration. More...
 
enum  _spm_ldo_regulator {
  kSPM_CoreLdo = 1U,
  kSPM_RfLdo = (1U << 1),
  kSPM_DcdcLdo = (1U << 2)
}
 define the mask code for LDO regulators. More...
 
enum  _spm_core_ldo_run_mode_config {
  kSPM_CoreLdoRunModeEnableRtcPowerMonitor,
  kSPM_CoreLdoRunModeEnableUsbPowerMonitor,
  kSPM_CoreLdoRunModeEnableVddioPowerMonitor
}
 Configure the CORE LDO in run modes. More...
 
enum  _spm_core_ldo_low_power_mode_config {
  kSPM_CoreLdoLowPowerModeEnableRtcPowerMonitor,
  kSPM_CoreLdoLowPowerModeEnableUsbPowerMonitor,
  kSPM_CoreLdoLowPowerModeEnableVddioPowerMonitor,
  kSPM_CoreLdoLowPowerModeEnableAllReference,
  kSPM_CoreLdoLowPowerModeEnableHighDrive = SPM_CORELPCNFG_LPHIDRIVE_MASK,
  kSPM_CoreLdoLowPowerModeEnableLVD,
  kSPM_CoreLdoLowPowerModeEnablePOR = SPM_CORELPCNFG_POREN_MASK,
  kSPM_CoreLdoLowPowerModeEnableLPO = SPM_CORELPCNFG_LPOEN_MASK,
  kSPM_CoreLdoLowPowerModeEnableBandgapBufferHightDrive,
  kSPM_CoreLdoLowPowerModeEnableBandgapBuffer = SPM_CORELPCNFG_BGBEN_MASK,
  kSPM_CoreLdoLowPowerModeEnableBandgapInVLPx = SPM_CORELPCNFG_BGEN_MASK,
  kSPM_CoreLdoLowPowerModeRemainInHighPower
}
 Configure the CORE LDO in low power modes. More...
 
enum  spm_core_ldo_volt_select_t {
  kSPM_CoreLdoVoltLevel1P2 = 0U,
  kSPM_CoreLdoVoltLevel1P1 = 1U,
  kSPM_CoreLdoVoltLevelOffset = 3U
}
 Sets the Core LDO voltage level. More...
 
enum  spm_low_volt_detect_volt_select_t {
  kSPM_LowVoltDetectLowTrip = 0U,
  kSPM_LowVoltDetectHighTrip = 1U
}
 Low-voltage Detect Voltage Select. More...
 
enum  spm_low_volt_warning_volt_select_t {
  kSPM_LowVoltWarningLowTrip = 0U,
  kSPM_LowVoltWarningMID1Trip = 1U,
  kSPM_LowVoltWarningMID2Trip = 2U,
  kSPM_LowVoltWarningHighTrip = 3U
}
 Low-voltage Warning Voltage Select. More...
 
enum  spm_high_volt_detect_volt_select_t {
  kSPM_HighVoltDetectLowTrip = 0U,
  kSPM_HighVoltDetectHighTrip = 1U
}
 High-voltage Detect Voltage Select. More...
 
enum  spm_rf_ldo_low_power_mode_t {
  kSPM_RfLdoEnterLowPowerInLowPowerModes = 0U,
  kSPM_RfLdoRemainInHighPowerInLowPowerModes
}
 Defines the RF LDO low power behiavior when in low power modes. More...
 
enum  spm_rf_ldo_soft_start_duration_t {
  kSPM_RfLdoSoftStartDuration110us = 0U,
  kSPM_RfLdoSoftStartDuration95us = 1U,
  kSPM_RfLdoSoftStartDuration60us = 2U,
  kSPM_RfLdoSoftStartDuration48us = 3U,
  kSPM_RfLdoSoftStartDuration38us = 4U,
  kSPM_RfLdoSoftStartDuration30us = 5U,
  kSPM_RfLdoSoftStartDuration24us = 6U,
  kSPM_RfLdoSoftStartDuration17us = 7U
}
 Selects the soft start duration delay for the IO 1.8 full power regulator. More...
 
enum  spm_rf_io_regulator_volt_select_t {
  kSPM_RfIoRegulatorVoltLevel1p8 = 0U,
  kSPM_RfIoRegulatorVoltLevel1p5 = 1U
}
 IO Regulator Voltage Select. More...
 
enum  spm_rf_vdd_1p8_sns_pin_select_t {
  kSPM_RfVdd1p8Sns0 = 0U,
  kSPM_RfVdd1p8Sns1 = 1U
}
 Selects which sns 1p8 vdd pin is used. More...
 
enum  spm_rf_ldo_volt_trim_select_t {
  kSPM_RfLdoLowPowerVolt1p8Trim,
  kSPM_RfLdoLowPowerVlot1p5Trim,
  kSPM_RfLdoHighPowerVolt1p8Trim,
  kSPM_RfLdoHighPowerVolt1p5Trim
}
 Selects the trim point for RF LDO. More...
 
enum  spm_dcdc_vbat_adc_divider_t {
  kSPM_DcdcVbatAdcOff = 0U,
  kSPM_DcdcVbatAdcDivider1 = 1U,
  kSPM_DcdcVbatAdcDivider2 = 2U,
  kSPM_DcdcVbatAdcDivider4 = 3U
}
 Defines the selection of DCDC vbat voltage divider for ADC measure. More...
 
enum  spm_low_power_req_out_pin_pol_t {
  kSPM_LowPowerReqOutPinHighTruePol = 0U,
  kSPM_LowPowerReqOutPinLowTruePol = 1U
}
 Defines the selection of low power request pin out pin polarity. More...
 
enum  spm_dcdc_drive_strength_t {
  kSPM_DcdcDriveStrengthWithNormal = 0U,
  kSPM_DcdcDriveStrengthWithHalfFETs = 0x4,
  kSPM_DcdcDriveStrengthWithDoubleFETs = 0x2,
  kSPM_DcdcDriveStrengthWithExtraHalfFETs = 0x1,
  kSPM_DcdcDriveStrengthWithHalfAndDoubleFETs = 0x6,
  kSPM_DcdcDriveStrengthWithHalfAndExtraDoubleFETs = 0x5,
  kSPM_DcdcDriveStrengthWithDoubleAndExtraDoubleFETs = 0x3,
  kSPM_DcdcDriveStrengthWithAllFETs = 7U
}
 Defines the selection of DCDC driver strength. More...
 
enum  _spm_dcdc_flags {
  kSPM_DcdcStableOKFlag = SPM_DCDCSC_DCDC_STS_DC_OK_MASK,
  kSPM_DcdcClockFaultFlag
}
 DCDC flags. More...
 

Driver version

#define FSL_SPM_DRIVER_VERSION   (MAKE_VERSION(2, 0, 0))
 SPM driver version. More...
 

System Power Manager.

static void SPM_GetVersionId (SPM_Type *base, spm_version_id_t *versionId)
 Gets the SPM version ID. More...
 
void SPM_GetRegulatorStatus (SPM_Type *base, spm_regulator_status_t *info)
 Gets the regulators Status. More...
 
static void SPM_EnableRegulatorInRunMdoe (SPM_Type *base, bool enable, uint32_t ldoMask)
 Controls which regulators are enabled in RUN and HSRUN modes. More...
 
static void SPM_EnableRegulatorInLowPowerMode (SPM_Type *base, bool enable, uint32_t ldoMask)
 Controls which regulators are enabled in low power modes. More...
 
static void SPM_SetCoreLdoRunModeConfig (SPM_Type *base, uint32_t configMask)
 Configures the CORE LDO working in run modes. More...
 
static void SPM_SetCoreLdoLowPowerModeConfig (SPM_Type *base, uint32_t configMask)
 Configures the CORE LDO working in low power modes. More...
 
static bool SPM_GetCoreLdoInRunRegulationFlag (SPM_Type *base)
 Check if the CORE LDO is in run regulation. More...
 
static bool SPM_GetPeriphIOIsolationFlag (SPM_Type *base)
 Gets the acknowledge Peripherals and I/O pads isolation flag. More...
 
static void SPM_ClearPeriphIOIsolationFlag (SPM_Type *base)
 Acknowledges the isolation flag to Peripherals and I/O pads. More...
 

VDD Low voltage detection APIs

void SPM_SetLowVoltDetectConfig (SPM_Type *base, const spm_low_volt_detect_config_t *config)
 Configures the low-voltage detect setting. More...
 
static bool SPM_GetVddLowVoltDetectFlag (SPM_Type *base)
 Gets VDD Low-voltage Detect Flag status. More...
 
static void SPM_ClearVddLowVoltDetectFlag (SPM_Type *base)
 Acknowledges clearing the Low-voltage Detect flag. More...
 

CORE LDO Low voltage detection APIs

static bool SPM_GetCoreLowVoltDetectFlag (SPM_Type *base)
 Gets the COREVdds Low-voltage Detect Flag status. More...
 
static void SPM_ClearCoreLowVoltDetectFlag (SPM_Type *base)
 Acknowledges clearing the CORE VDD Low-voltage Detect flag. More...
 
void SPM_SetLowVoltWarningConfig (SPM_Type *base, const spm_low_volt_warning_config_t *config)
 Configures the low-voltage warning setting. More...
 
static bool SPM_GetVddLowVoltWarningFlag (SPM_Type *base)
 Gets Vdd Low-voltage Warning Flag status. More...
 
static void SPM_ClearLowVoltWarningFlag (SPM_Type *base)
 Acknowledges the Low-voltage Warning flag. More...
 

VDD high voltage detection APIs.

void SPM_SetHighVoltDetectConfig (SPM_Type *base, const spm_high_volt_detect_config_t *config)
 Configures the high-voltage detect setting. More...
 
static bool SPM_GetHighVoltDetectFlag (SPM_Type *base)
 Gets the High-voltage Detect Flag status. More...
 
static void SPM_ClearHighVoltDetectFlag (SPM_Type *base)
 Acknowledges clearing the High-voltage Detect flag. More...
 

RF LDO Low voltage detection APIs

void SPM_SetRfLdoConfig (SPM_Type *base, const spm_rf_ldo_config_t *config)
 Configures the RF LDO. More...
 
static void SPM_SelectVdd1p8SnsPin (SPM_Type *base, spm_rf_vdd_1p8_sns_pin_select_t pin)
 Selects which SNS 1p8 vdd pin is used. More...
 

DCDC Control APIs

void SPM_SetDcdcBattMonitor (SPM_Type *base, uint32_t batAdcVal)
 Sets DCDC battery monitor with its ADC value. More...
 
static void SPM_SetDcdcVbatAdcMeasure (SPM_Type *base, spm_dcdc_vbat_adc_divider_t divider)
 Sets DCDC VBAT voltage divider. More...
 
static void SPM_EnablePowerDownCmpOffset (SPM_Type *base, bool enable)
 Power down output range comparator. More...
 
static uint32_t SPM_GetDcdcStatusFlags (SPM_Type *base)
 Get the status flags of DCDC module. More...
 
void SPM_EnableVddxStepLock (SPM_Type *base, bool enable)
 Disable stepping for VDD1P8 and VDD1P2. More...
 
static void SPM_SetDcdcDriveStrength (SPM_Type *base, spm_dcdc_drive_strength_t strength)
 Set the DCDC drive strength. More...
 
void SPM_BypassDcdcBattMonitor (SPM_Type *base, bool enable, uint32_t value)
 Bypasses the ADC measure value. More...
 
void SPM_SetDcdcIntegratorConfig (SPM_Type *base, const spm_dcdc_integrator_config_t *config)
 Configure the DCDC integrator value. More...
 
static void SPM_SetDcdcVdd1p2ValueHsrun (SPM_Type *base, uint32_t value)
 Sets the target value of VDD1P2 in buck HSRUN mode. More...
 
static void SPM_SetDcdcVdd1p2ValueBuck (SPM_Type *base, uint32_t value)
 Sets the target value of VDD1P2 in buck mode. More...
 
static void SPM_SetDcdcVdd1p8Value (SPM_Type *base, uint32_t value)
 Sets the target value of VDD1P8. More...
 

Misc

void SPM_SetLowPowerReqOutPinConfig (SPM_Type *base, const spm_low_power_req_out_pin_config_t *config)
 Configures the low power requeset output pin. More...
 

Data Structure Documentation

struct spm_version_id_t

Data Fields

uint16_t feature
 Feature Specification Number. More...
 
uint8_t minor
 Minor version number. More...
 
uint8_t major
 Major version number. More...
 

Field Documentation

uint16_t spm_version_id_t::feature
uint8_t spm_version_id_t::minor
uint8_t spm_version_id_t::major
struct spm_regulator_status_t

Data Fields

bool isRadioRunForcePowerModeOn
 RADIO Run Force Power Mode Status. More...
 
spm_radio_low_power_mode_status_t radioLowPowerModeStatus
 Status of last RADIO Power Mode Configuration. More...
 
spm_mcu_low_power_mode_status_t mcuLowPowerModeStatus
 Status of last MCU STOP Mode Power Configuration. More...
 
bool isDcdcLdoOn
 DCDC LDO regulator enabled. More...
 
bool isRfLdoOn
 RF LDO regulator enabled. More...
 
bool isCoreLdoOn
 Core LDO regulator enabled. More...
 

Field Documentation

bool spm_regulator_status_t::isRadioRunForcePowerModeOn
spm_radio_low_power_mode_status_t spm_regulator_status_t::radioLowPowerModeStatus
spm_mcu_low_power_mode_status_t spm_regulator_status_t::mcuLowPowerModeStatus
bool spm_regulator_status_t::isDcdcLdoOn
bool spm_regulator_status_t::isRfLdoOn
bool spm_regulator_status_t::isCoreLdoOn
struct spm_low_volt_detect_config_t

This structure reuses the configuration structure from legacy PMC module.

Data Fields

bool enableIntOnVddLowVolt
 Enable interrupt when VDD Low-voltage detect. More...
 
bool enableResetOnVddLowVolt
 Enable forcing a system reset when VDD Low-voltage detect. More...
 
spm_low_volt_detect_volt_select_t vddLowVoltDetectSelect
 Low-voltage detect trip point voltage selection. More...
 
bool enableIntOnCoreLowVolt
 Enable interrupt when Core Low-voltage detect. More...
 
bool enableResetOnCoreLowVolt
 Enable forcing a system reset when Core Low-voltage detect. More...
 

Field Documentation

bool spm_low_volt_detect_config_t::enableIntOnVddLowVolt
bool spm_low_volt_detect_config_t::enableResetOnVddLowVolt
spm_low_volt_detect_volt_select_t spm_low_volt_detect_config_t::vddLowVoltDetectSelect
bool spm_low_volt_detect_config_t::enableIntOnCoreLowVolt
bool spm_low_volt_detect_config_t::enableResetOnCoreLowVolt
struct spm_low_volt_warning_config_t

Data Fields

bool enableIntOnVddLowVolt
 Enable interrupt when low-voltage warning.
 
spm_low_volt_warning_volt_select_t vddLowVoltDetectSelect
 Low-voltage warning trip point voltage selection.
 
struct spm_high_volt_detect_config_t

This structure reuses the configuration structure from legacy PMC module.

Data Fields

bool enableIntOnVddHighVolt
 Enable interrupt when high-voltage detect.
 
bool enableResetOnVddHighVolt
 Enable system reset when high-voltage detect.
 
spm_high_volt_detect_volt_select_t vddHighVoltDetectSelect
 High-voltage detect trip point voltage selection.
 
struct spm_rf_ldo_config_t

Data Fields

spm_rf_ldo_low_power_mode_t lowPowerMode
 RF LDO low power behaviour when in low power modes. More...
 
spm_rf_ldo_soft_start_duration_t softStartDuration
 Selects the soft start duration delay for the IO 1.8 full power regulator. More...
 
bool enableCurSink
 Enables current sink feature of low power regulator. More...
 
spm_rf_io_regulator_volt_select_t rfIoRegulatorVolt
 IO Regulator Voltage Select. More...
 

Field Documentation

spm_rf_ldo_low_power_mode_t spm_rf_ldo_config_t::lowPowerMode
spm_rf_ldo_soft_start_duration_t spm_rf_ldo_config_t::softStartDuration
bool spm_rf_ldo_config_t::enableCurSink
spm_rf_io_regulator_volt_select_t spm_rf_ldo_config_t::rfIoRegulatorVolt
struct spm_dcdc_integrator_config_t

Data Fields

double vdd1p2Value
 VDD1P2 output voltage value. More...
 
double vBatValue
 Battery input voltage value, or the Vdd_dcdcin voltage value. More...
 

Field Documentation

double spm_dcdc_integrator_config_t::vdd1p2Value
double spm_dcdc_integrator_config_t::vBatValue
struct spm_power_switch_delay_config_t

Data Fields

uint32_t coreRegFromDeepPowerDownToIso
 Deep Power Down Wakeup Switch to ISO Delay. More...
 
uint32_t coreRegFromLowPowerToIso
 Low Power Wakeup Switch to ISO Delay. More...
 
uint32_t lowPowerToBandgapOn
 Low Power Wake Up Delay. More...
 
uint32_t dcdcStartupDelay
 Configures the number of cycles for DCDC startup before the Core LDO or RF LDO can be disabled. More...
 
uint32_t ldoCoreSwitchHsrunDelay
 Configures the number of cycles delay for LDO CORE Regulator in and out of HSRUN mode. More...
 

Field Documentation

uint32_t spm_power_switch_delay_config_t::coreRegFromDeepPowerDownToIso

<= 0xFF

uint32_t spm_power_switch_delay_config_t::coreRegFromLowPowerToIso
uint32_t spm_power_switch_delay_config_t::lowPowerToBandgapOn
uint32_t spm_power_switch_delay_config_t::dcdcStartupDelay
uint32_t spm_power_switch_delay_config_t::ldoCoreSwitchHsrunDelay
struct spm_low_power_req_out_pin_config_t

Data Fields

spm_low_power_req_out_pin_pol_t pinOutPol
 ow power request pin out pin polarity. More...
 
bool pinOutEnable
 Low Power request output pin is enabled or not. More...
 

Field Documentation

spm_low_power_req_out_pin_pol_t spm_low_power_req_out_pin_config_t::pinOutPol
bool spm_low_power_req_out_pin_config_t::pinOutEnable

Macro Definition Documentation

#define FSL_SPM_DRIVER_VERSION   (MAKE_VERSION(2, 0, 0))

Version 2.0.0.

Enumeration Type Documentation

Enumerator
kSPM_RadioLowPowerModeReserved 

Reserved.

kSPM_RadioLowPowerModeVLPS 

Current Power mode is VLPS.

kSPM_RadioLowPowerModeLLS 

Current Power mode is LLS.

kSPM_RadioLowPowerModeVLLS 

Current Power mode is VLLS.

Enumerator
kSPM_McuLowPowerModeReserved 

Reserved.

kSPM_McuLowPowerModeSTOP 

Last Low Power mode is STOP.

kSPM_McuLowPowerModeVLPS 

Last Low Power mode is VLPS.

kSPM_McuLowPowerModeLLS 

Last Low Power mode is LLS.

kSPM_McuLowPowerModeVLLS23 

Last Low Power mode is VLLS23.

kSPM_McuLowPowerModeVLLS01 

Last Low Power mode is VLLS01.

These mask can be combined with 'or' as a parameter to any function.

Enumerator
kSPM_CoreLdo 

Mask code for CORE LDO.

kSPM_RfLdo 

Mask code for RF LDO.

kSPM_DcdcLdo 

Mask code for DCDC LDO.

Enumerator
kSPM_CoreLdoRunModeEnableRtcPowerMonitor 

RTC power monitor enabled in run modes.

kSPM_CoreLdoRunModeEnableUsbPowerMonitor 

USB power monitor enabled in run modes.

kSPM_CoreLdoRunModeEnableVddioPowerMonitor 

VDDIO power monitor enabled in run modes.

Enumerator
kSPM_CoreLdoLowPowerModeEnableRtcPowerMonitor 

RTC power monitor enabled in LP modes.

kSPM_CoreLdoLowPowerModeEnableUsbPowerMonitor 

USB power monitor enabled in LP modes.

kSPM_CoreLdoLowPowerModeEnableVddioPowerMonitor 

VDDIO power monitor enabled in LP modes.

kSPM_CoreLdoLowPowerModeEnableAllReference 

Enable all reference (bandgap, WELL BIAS, 1k clk and LP 25na) in VLLS.

kSPM_CoreLdoLowPowerModeEnableHighDrive 

Enable high driver in low power.

kSPM_CoreLdoLowPowerModeEnableLVD 

Enable level voltage detect in VLP/STOP modes.

kSPM_CoreLdoLowPowerModeEnablePOR 

POR brownout remains enabled in VLLS mode.

kSPM_CoreLdoLowPowerModeEnableLPO 

LPO remains enabled in VLLS modes.

kSPM_CoreLdoLowPowerModeEnableBandgapBufferHightDrive 

Enable the high drive for Bandgap Buffer.

kSPM_CoreLdoLowPowerModeEnableBandgapBuffer 

Enable Bandgap Buffer.

kSPM_CoreLdoLowPowerModeEnableBandgapInVLPx 

Enable Bandgap in VLPx mode.

kSPM_CoreLdoLowPowerModeRemainInHighPower 

Core LDO remains in high power state in VLP/Stop modes.

Enumerator
kSPM_CoreLdoVoltLevel1P2 

Regulate to 1.2V set by the CORETRIM[VTRIM1P2] register.

kSPM_CoreLdoVoltLevel1P1 

Regulate to 1.1V set by the CORETRIM[VTRIM1P1] register.

kSPM_CoreLdoVoltLevelOffset 

Regulate to Offset Voltage set by CORETRIM[OFFVTRIM] register.

Enumerator
kSPM_LowVoltDetectLowTrip 

Low-trip point selected (VLVD = VLVDL )

kSPM_LowVoltDetectHighTrip 

High-trip point selected (VLVD = VLVDH )

Enumerator
kSPM_LowVoltWarningLowTrip 

Low-trip point selected (VLVW = VLVW1)

kSPM_LowVoltWarningMID1Trip 

Mid1-trip point selected (VLVW = VLVW2)

kSPM_LowVoltWarningMID2Trip 

Mid2-trip point selected (VLVW = VLVW3)

kSPM_LowVoltWarningHighTrip 

High-trip point selected (VLVW = VLVW4)

Enumerator
kSPM_HighVoltDetectLowTrip 

Low-trip point selected (VHVD = VHVDL )

kSPM_HighVoltDetectHighTrip 

High-trip point selected (VHVD = VHVDH )

Enumerator
kSPM_RfLdoEnterLowPowerInLowPowerModes 

RF LDO regulator enters low power state in VLP/Stop modes.

kSPM_RfLdoRemainInHighPowerInLowPowerModes 

RF LDO regulator remains in high power state in VLP/Stop modes.

Enumerator
kSPM_RfLdoSoftStartDuration110us 

110 us.

kSPM_RfLdoSoftStartDuration95us 

95 us.

kSPM_RfLdoSoftStartDuration60us 

60 us.

kSPM_RfLdoSoftStartDuration48us 

48 us.

kSPM_RfLdoSoftStartDuration38us 

38 us.

kSPM_RfLdoSoftStartDuration30us 

30 us.

kSPM_RfLdoSoftStartDuration24us 

24 us.

kSPM_RfLdoSoftStartDuration17us 

17 us.

Enumerator
kSPM_RfIoRegulatorVoltLevel1p8 

Regulate to 1.8V.

kSPM_RfIoRegulatorVoltLevel1p5 

Regulate to 1.5V.

Enumerator
kSPM_RfVdd1p8Sns0 

VDD1p8_SNS0 selected.

kSPM_RfVdd1p8Sns1 

VDD1p8_SNS1 selected.

Enumerator
kSPM_RfLdoLowPowerVolt1p8Trim 

RF LDO Low Power 1.8V trim point value.

kSPM_RfLdoLowPowerVlot1p5Trim 

RF LDO Low Power 1.5V trim point value.

kSPM_RfLdoHighPowerVolt1p8Trim 

RF LDO High Power 1.8V trim point value.

kSPM_RfLdoHighPowerVolt1p5Trim 

RF LDO High Power 1.5V trim point value/.

Enumerator
kSPM_DcdcVbatAdcOff 

OFF.

kSPM_DcdcVbatAdcDivider1 

VBAT.

kSPM_DcdcVbatAdcDivider2 

VBAT /2.

kSPM_DcdcVbatAdcDivider4 

VBAT /4.

Enumerator
kSPM_LowPowerReqOutPinHighTruePol 

High true polarity.

kSPM_LowPowerReqOutPinLowTruePol 

Low true polarity.

The more FETs are enabled, the more drive strength DCDC would provide.

Enumerator
kSPM_DcdcDriveStrengthWithNormal 

No additional FET setting.

kSPM_DcdcDriveStrengthWithHalfFETs 

Half FETs.

kSPM_DcdcDriveStrengthWithDoubleFETs 

Double FETs.

kSPM_DcdcDriveStrengthWithExtraHalfFETs 

Half FETs.

kSPM_DcdcDriveStrengthWithHalfAndDoubleFETs 

Half + Double FETs.

kSPM_DcdcDriveStrengthWithHalfAndExtraDoubleFETs 

Half + Extra Double FETs.

kSPM_DcdcDriveStrengthWithDoubleAndExtraDoubleFETs 

Double + Extra Double FETs.

kSPM_DcdcDriveStrengthWithAllFETs 

Half + Double + Extra Double FETs.

Enumerator
kSPM_DcdcStableOKFlag 

Status flag to indicate DCDC lock.

kSPM_DcdcClockFaultFlag 

Asserts if DCDC detect a clk fault.

Will cause a system lvd reset to assert.

Function Documentation

static void SPM_GetVersionId ( SPM_Type *  base,
spm_version_id_t versionId 
)
inlinestatic

This function gets the SPM version ID, including major version number, minor version number, and a feature specification number.

Parameters
baseSPM peripheral base address.
versionIdPointer to version ID structure.
void SPM_GetRegulatorStatus ( SPM_Type *  base,
spm_regulator_status_t info 
)
Parameters
baseSPM peripheral base address.
infoPointer to status structure, see to spm_regulator_status_t.
static void SPM_EnableRegulatorInRunMdoe ( SPM_Type *  base,
bool  enable,
uint32_t  ldoMask 
)
inlinestatic

This function controls which regulator (CORE LDO, RF LDO, and DCDC) are enabled in RUN and HSRUN modes. It sets the SPM_RCTRL register. Note that the RCTRL bits are reset solely on a POR/LVD only event.

Parameters
baseSPM peripheral base address.
enableEnable or disable the LDOs list in ldoMask.
ldoMaskMask value of LDO list. See to _spm_ldo_regulator.
static void SPM_EnableRegulatorInLowPowerMode ( SPM_Type *  base,
bool  enable,
uint32_t  ldoMask 
)
inlinestatic

This function controls which regulator (CORE LDO, RF LDO, and DCDC) are enabled in low power modes. It sets the SPM_LPCTRL register. Note that the SPM_LPCTRL bits are reset solely on a POR/LVD only event.

Parameters
baseSPM peripheral base address.
enableEnable or disable the LDOs list in ldoMask.
ldoMaskMask value of LDO list.
static void SPM_SetCoreLdoRunModeConfig ( SPM_Type *  base,
uint32_t  configMask 
)
inlinestatic
Parameters
baseSPM peripheral base address.
conifgMaskMask value of configuration items. See to _spm_core_ldo_run_mode_config.
static void SPM_SetCoreLdoLowPowerModeConfig ( SPM_Type *  base,
uint32_t  configMask 
)
inlinestatic
Parameters
baseSPM peripheral base address.
conifgMaskMask value of configuration items. See to _spm_core_ldo_low_power_mode_config.
static bool SPM_GetCoreLdoInRunRegulationFlag ( SPM_Type *  base)
inlinestatic
Parameters
baseSPM peripheral base address.
Return values
trueRegulator is in run regulation.
falseRegulator is in stop regulation or in transition to/from it.
static bool SPM_GetPeriphIOIsolationFlag ( SPM_Type *  base)
inlinestatic

This function reads the Acknowledge Isolation setting that indicates whether certain peripherals and the I/O pads are in a latched state as a result of having been in the VLLS mode.

Parameters
baseSPM peripheral base address.
Returns
ACK isolation 0 - Peripherals and I/O pads are in a normal run state. 1 - Certain peripherals and I/O pads are in an isolated and latched state.
static void SPM_ClearPeriphIOIsolationFlag ( SPM_Type *  base)
inlinestatic

This function clears the ACK Isolation flag. Writing one to this setting when it is set releases the I/O pads and certain peripherals to their normal run mode state.

Parameters
baseSPM peripheral base address.
void SPM_SetLowVoltDetectConfig ( SPM_Type *  base,
const spm_low_volt_detect_config_t config 
)

This function configures the low-voltage detect setting, including the trip point voltage setting, enables or disables the interrupt, enables or disables the system reset.

Parameters
baseSPM peripheral base address.
configPointer to low-voltage detect configuration structure, see to spm_low_volt_detect_config_t.
static bool SPM_GetVddLowVoltDetectFlag ( SPM_Type *  base)
inlinestatic
Parameters
baseSPM peripheral base address.
Returns
Current low-voltage detect flag
  • true: Low-voltage detected
  • false: Low-voltage not detected
static void SPM_ClearVddLowVoltDetectFlag ( SPM_Type *  base)
inlinestatic

This function acknowledges the low-voltage detection errors.

Parameters
baseSPM peripheral base address.
static bool SPM_GetCoreLowVoltDetectFlag ( SPM_Type *  base)
inlinestatic

This function reads the current LVDF status. If it returns 1, a low-voltage event is detected.

Parameters
baseSPM peripheral base address.
Returns
Current low-voltage detect flag
  • true: Low-voltage detected
  • false: Low-voltage not detected
static void SPM_ClearCoreLowVoltDetectFlag ( SPM_Type *  base)
inlinestatic

This function acknowledges the CORE VDD low-voltage detection errors.

Parameters
baseSPM peripheral base address.
void SPM_SetLowVoltWarningConfig ( SPM_Type *  base,
const spm_low_volt_warning_config_t config 
)

This function configures the low-voltage warning setting, including the trip point voltage setting and enabling or disabling the interrupt.

Parameters
baseSPM peripheral base address.
configPointer to Low-voltage warning configuration structure, see to spm_low_volt_warning_config_t.
static bool SPM_GetVddLowVoltWarningFlag ( SPM_Type *  base)
inlinestatic

This function polls the current LVWF status. When 1 is returned, it indicates a low-voltage warning event. LVWF is set when V Supply transitions below the trip point or after reset and V Supply is already below the V LVW.

Parameters
baseSPM peripheral base address.
Returns
Current LVWF status
  • true: Low-voltage Warning Flag is set.
  • false: the Low-voltage Warning does not happen.
static void SPM_ClearLowVoltWarningFlag ( SPM_Type *  base)
inlinestatic

This function acknowledges the low voltage warning errors (write 1 to clear LVWF).

Parameters
baseSPM peripheral base address.
void SPM_SetHighVoltDetectConfig ( SPM_Type *  base,
const spm_high_volt_detect_config_t config 
)

This function configures the high-voltage detect setting, including the trip point voltage setting, enabling or disabling the interrupt, enabling or disabling the system reset.

Parameters
baseSPM peripheral base address.
configHigh-voltage detect configuration structure, see to spm_high_volt_detect_config_t.
static bool SPM_GetHighVoltDetectFlag ( SPM_Type *  base)
inlinestatic

This function reads the current HVDF status. If it returns 1, a low voltage event is detected.

Parameters
baseSPM peripheral base address.
Returns
Current high-voltage detect flag
  • true: High-voltage detected
  • false: High-voltage not detected
static void SPM_ClearHighVoltDetectFlag ( SPM_Type *  base)
inlinestatic

This function acknowledges the high-voltage detection errors (write 1 to clear HVDF).

Parameters
baseSPM peripheral base address.
void SPM_SetRfLdoConfig ( SPM_Type *  base,
const spm_rf_ldo_config_t config 
)
Parameters
baseSPM peripheral base address.
configPointer to configuration structure, see to spm_rf_ldo_config_t.
static void SPM_SelectVdd1p8SnsPin ( SPM_Type *  base,
spm_rf_vdd_1p8_sns_pin_select_t  pin 
)
inlinestatic
Parameters
baseSPM peripheral base address.
pinSelection of SNS 1p8 Vdd pin to be used, see to spm_rf_vdd_1p8_sns_pin_select_t.
void SPM_SetDcdcBattMonitor ( SPM_Type *  base,
uint32_t  batAdcVal 
)

For better accuracy, software would call this function to set the battery voltage value into DCDC measured by ADC.

Parameters
baseSPM peripheral base address.
batAdcValADC measured battery value with an 8mV LSB resolution. Value 0 would disable the battery monitor.
static void SPM_SetDcdcVbatAdcMeasure ( SPM_Type *  base,
spm_dcdc_vbat_adc_divider_t  divider 
)
inlinestatic

The divided VBAT output is input to an ADC channel which allows the battery voltage to be measured.

Parameters
baseSPM peripheral base address.
dividerSetting divider, see to spm_dcdc_vbat_adc_divider_t.
static void SPM_EnablePowerDownCmpOffset ( SPM_Type *  base,
bool  enable 
)
inlinestatic
Parameters
baseSPM peripheral base address.
enablePower down the CMP or not.
static uint32_t SPM_GetDcdcStatusFlags ( SPM_Type *  base)
inlinestatic
Parameters
baseSPM peripheral base address.
Returns
Mask value of flags. See to _spm_dcdc_flags.
void SPM_EnableVddxStepLock ( SPM_Type *  base,
bool  enable 
)

Must lock the step for VDD1P8 and VDD1p2 before enteing low power modes.

Parameters
baseSPM peripheral base address.
enableEnable the lock or not to VDDx stepping.
static void SPM_SetDcdcDriveStrength ( SPM_Type *  base,
spm_dcdc_drive_strength_t  strength 
)
inlinestatic

Do set the DCDC drive strength according to actuall loading. The related register bits are:

  • DCDCC3[DCDC_MINPWR_HALF_FETS]
  • DCDCC3[DCDC_MINPWR_DOUBLE_FETS]
  • DCDCC3[DCDC_MINPWR_EXTRA_DOUBLE_FETS] The more FETs are enabled, the more drive strength DCDC would provide.
Parameters
baseSPM peripheral base address.
strengthSelection of setting, see to spm_dcdc_drive_strength_t
void SPM_BypassDcdcBattMonitor ( SPM_Type *  base,
bool  enable,
uint32_t  value 
)

Forces DCDC to bypass the adc measuring state and loads the user-defined value in this function.

Parameters
baseSPM peripheral base address.
enableEnable the bypass or not.
valueUser-setting value to be available instead of ADC measured value.
void SPM_SetDcdcIntegratorConfig ( SPM_Type *  base,
const spm_dcdc_integrator_config_t config 
)

Integrator value can be loaded in pulsed mode. Software can program this value according to battery voltage and VDD1P2 output target value before goes to the pulsed mode.

spm_dcdc_integrator_config_t SpmDcdcIntegratorConfigStruct =
{
.vdd1p2Value = 1.2f,
.vBatValue = 3.34f
};
Parameters
baseSPM peripheral base address.
configPointer to configuration structure, see to spm_dcdc_integrator_config_t. Passing NULL would clear all user-defined setting and use hardware default setting.
static void SPM_SetDcdcVdd1p2ValueHsrun ( SPM_Type *  base,
uint32_t  value 
)
inlinestatic

Sets target value of VDD1P2 in buck HSRUN mode. 25 mV each step from 0x00 to 0x0F. This value is automatically selected on entry into HSRUN. On exit from HSRUN, DCDC VDD1P2 trim values will default back to values set by DCDC_VDD1P2CTRL_TRG_BUCK register, which is operated with the API of SPM_SetDcdcVdd1p2ValueBuck().

Parameters
baseSPM peripheral base address.
valueSetting value of VDD1P2 in buck HSRUN mode.
static void SPM_SetDcdcVdd1p2ValueBuck ( SPM_Type *  base,
uint32_t  value 
)
inlinestatic

Sets the target value of VDD1P2 in buck mode, 25 mV each step from 0x00 to 0x0F.

Parameters
baseSPM peripheral base address.
valueSetting value of VDD1P2 in buck mode.
static void SPM_SetDcdcVdd1p8Value ( SPM_Type *  base,
uint32_t  value 
)
inlinestatic

Sets the target value of VDD1P8 in buck mode, 25 mV each step from 0x00 to 0x3F.

Parameters
baseSPM peripheral base address.
valueSetting value of VDD1P8 output.
void SPM_SetLowPowerReqOutPinConfig ( SPM_Type *  base,
const spm_low_power_req_out_pin_config_t config 
)
Parameters
baseSPM peripheral base address.
configPointer to the configuration structure, see to spm_low_power_req_out_pin_config_t.