MCUXpresso SDK API Reference Manual  Rev 2.15.000
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

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 Vout_aux domain loading is added. Switching to DCDC with less loading on Vdd_core domain is always preferred.

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

Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/demo_apps/dcdc_framework

Data Structures

struct  _spm_version_id
 IP version ID definition. More...
 
struct  _spm_regulator_status
 Keep the regulator status information. More...
 
struct  _spm_low_volt_detect_config
 Low-voltage Detect Configuration Structure. More...
 
struct  _spm_low_volt_warning_config
 Low-voltage Warning Configuration Structure. More...
 
struct  _spm_high_volt_detect_config
 High-voltage Detect Configuration Structure. More...
 
struct  _spm_aux_ldo_config
 Aux LDO configuration structure. More...
 
struct  _spm_dcdc_integrator_value_config
 Configuration for setting DCDC integrator value. More...
 
struct  _spm_low_power_req_out_pin_config
 Configuration structure of low power request out pin. More...
 
struct  _spm_dcdc_loop_control_config
 Loop control configuration. More...
 

Typedefs

typedef struct _spm_version_id spm_version_id_t
 IP version ID definition.
 
typedef enum
_spm_mcu_low_power_mode_status 
spm_mcu_low_power_mode_status_t
 Status of last MCU STOP Mode Power Configuration.
 
typedef struct
_spm_regulator_status 
spm_regulator_status_t
 Keep the regulator status information.
 
typedef enum
_spm_low_volt_detect_volt_select 
spm_low_volt_detect_volt_select_t
 Low-voltage Detect Voltage Select.
 
typedef struct
_spm_low_volt_detect_config 
spm_low_volt_detect_config_t
 Low-voltage Detect Configuration Structure. More...
 
typedef enum
_spm_low_volt_warning_volt_select 
spm_low_volt_warning_volt_select_t
 Low-voltage Warning Voltage Select.
 
typedef struct
_spm_low_volt_warning_config 
spm_low_volt_warning_config_t
 Low-voltage Warning Configuration Structure.
 
typedef enum
_spm_high_volt_detect_volt_select 
spm_high_volt_detect_volt_select_t
 High-voltage Detect Voltage Select.
 
typedef struct
_spm_high_volt_detect_config 
spm_high_volt_detect_config_t
 High-voltage Detect Configuration Structure. More...
 
typedef enum
_spm_aux_ldo_low_power_mode 
spm_aux_ldo_low_power_mode_t
 Defines the AUX LDO low power behiavior when in low power modes.
 
typedef enum
_spm_aux_ldo_io_soft_start_duration 
spm_aux_ldo_io_soft_start_duration_t
 Selects the soft start duration delay for the IO 1.8 full power regulator.
 
typedef enum
_spm_aux_io_regulator_volt_select 
spm_aux_io_regulator_volt_select_t
 IO Regulator Voltage Select.
 
typedef struct _spm_aux_ldo_config spm_aux_ldo_config_t
 Aux LDO configuration structure.
 
typedef struct
_spm_dcdc_integrator_value_config 
spm_dcdc_integrator_config_t
 Configuration for setting DCDC integrator value.
 
typedef enum
_spm_dcdc_vbat_adc_divider 
spm_dcdc_vbat_adc_divider_t
 Defines the selection of DCDC vbat voltage divider for ADC measure.
 
typedef enum
_spm_low_power_req_out_pin_pol 
spm_low_power_req_out_pin_pol_t
 Defines the selection of low power request pin out pin polarity.
 
typedef struct
_spm_low_power_req_out_pin_config 
spm_low_power_req_out_pin_config_t
 Configuration structure of low power request out pin.
 
typedef enum
_spm_dcdc_drive_strength 
spm_dcdc_drive_strength_t
 Defines the selection of DCDC driver strength. More...
 
typedef struct
_spm_dcdc_loop_control_config 
spm_dcdc_loop_control_config_t
 Loop control configuration.
 

Enumerations

enum  _spm_mcu_low_power_mode_status {
  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_AuxLdo = (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,
  kSPM_CoreLdoLowPowerModeRemainInHighPower
}
 Configure the CORE LDO in low power modes. More...
 
enum  _spm_low_volt_detect_volt_select {
  kSPM_LowVoltDetectLowTrip = 0U,
  kSPM_LowVoltDetectHighTrip = 1U
}
 Low-voltage Detect Voltage Select. More...
 
enum  _spm_low_volt_warning_volt_select {
  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 {
  kSPM_HighVoltDetectLowTrip = 0U,
  kSPM_HighVoltDetectHighTrip = 1U
}
 High-voltage Detect Voltage Select. More...
 
enum  _spm_aux_ldo_low_power_mode {
  kSPM_AuxLdoEnterLowPowerInLowPowerModes = 0U,
  kSPM_AuxLdoRemainInHighPowerInLowPowerModes
}
 Defines the AUX LDO low power behiavior when in low power modes. More...
 
enum  _spm_aux_ldo_io_soft_start_duration {
  kSPM_AuxLdoSoftStartDuration110us = 0U,
  kSPM_AuxLdoSoftStartDuration95us = 1U,
  kSPM_AuxLdoSoftStartDuration60us = 2U,
  kSPM_AuxLdoSoftStartDuration48us = 3U,
  kSPM_AuxLdoSoftStartDuration38us = 4U,
  kSPM_AuxLdoSoftStartDuration30us = 5U,
  kSPM_AuxLdoSoftStartDuration24us = 6U,
  kSPM_AuxLdoSoftStartDuration17us = 7U
}
 Selects the soft start duration delay for the IO 1.8 full power regulator. More...
 
enum  _spm_aux_io_regulator_volt_select {
  kSPM_AuxIoRegulatorVoltLevel1p8 = 0U,
  kSPM_AuxIoRegulatorVoltLevel1p5 = 1U
}
 IO Regulator Voltage Select. More...
 
enum  _spm_dcdc_vbat_adc_divider {
  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 {
  kSPM_LowPowerReqOutPinHighTruePol = 0U,
  kSPM_LowPowerReqOutPinLowTruePol = 1U
}
 Defines the selection of low power request pin out pin polarity. More...
 
enum  _spm_dcdc_drive_strength {
  kSPM_DcdcDriveStrengthWithNormal = 0U,
  kSPM_DcdcDriveStrengthWithHalfFETs = 0x4,
  kSPM_DcdcDriveStrengthWithDoubleFETs = 0x2,
  kSPM_DcdcDriveStrengthWithExtraDoubleFETs = 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 = (int)SPM_DCDCSC_DCDC_STS_DC_OK_MASK,
  kSPM_DcdcClockFaultFlag
}
 DCDC flags. More...
 

Driver version

#define FSL_SPM_DRIVER_VERSION   (MAKE_VERSION(2, 3, 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_EnableRegulatorInRunMode (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 void SPM_ForceCoreLdoOffset (SPM_Type *base, bool enable)
 Force the Core LDO to an offset voltage level. 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...
 

AUX LDO Low voltage detection APIs

void SPM_SetAuxLdoConfig (SPM_Type *base, const spm_aux_ldo_config_t *config)
 Configures the AUX LDO. More...
 
static void SPM_ForceAuxLdoOffset (SPM_Type *base, bool enable)
 Force auxiliary regulator voltage to an offset level. 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_SetDcdcLoopControlConfig (SPM_Type *base, const spm_dcdc_loop_control_config_t *config)
 Set DCDC loop control config. More...
 
static 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...
 
static void SPM_SplitDcdcClockFreq (SPM_Type *base, bool enable)
 Split the frequency of DCDC's clock to min the power of DCDC. 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 SPC_BypassDcdcAdcMeasure (SPM_Type *base, bool bypass)
 Bypass the ADC measure or not. More...
 
static void SPM_SetDcdcVdd1p2ValueHsrun (SPM_Type *base, uint32_t trimCode)
 Sets the target value of VDD1P2 in buck HSRUN mode. More...
 
static void SPM_SetDcdcVdd1p2ValueBuck (SPM_Type *base, uint32_t trimCode)
 Sets the target value of VDD1P2 in buck mode. More...
 
static void SPM_SetDcdcVdd1p8Value (SPM_Type *base, uint32_t trimCode)
 Sets the target value of VDD1P8. More...
 

Misc

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

Data Structure Documentation

struct _spm_version_id

Data Fields

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

Field Documentation

uint16_t _spm_version_id::feature
uint8_t _spm_version_id::minor
uint8_t _spm_version_id::major
struct _spm_regulator_status

Data Fields

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 isAuxLdoOn
 Aux LDO regulator enabled. More...
 
bool isCoreLdoOn
 Core LDO regulator enabled. More...
 

Field Documentation

spm_mcu_low_power_mode_status_t _spm_regulator_status::mcuLowPowerModeStatus
bool _spm_regulator_status::isDcdcLdoOn
bool _spm_regulator_status::isAuxLdoOn
bool _spm_regulator_status::isCoreLdoOn
struct _spm_low_volt_detect_config

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 an MCU 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 an MCU reset when Core Low-voltage detect. More...
 

Field Documentation

bool _spm_low_volt_detect_config::enableIntOnVddLowVolt
bool _spm_low_volt_detect_config::enableResetOnVddLowVolt
spm_low_volt_detect_volt_select_t _spm_low_volt_detect_config::vddLowVoltDetectSelect
bool _spm_low_volt_detect_config::enableIntOnCoreLowVolt
bool _spm_low_volt_detect_config::enableResetOnCoreLowVolt
struct _spm_low_volt_warning_config

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

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_aux_ldo_config

Data Fields

spm_aux_ldo_low_power_mode_t lowPowerMode
 AUX LDO low power behaviour when in low power modes. More...
 
spm_aux_ldo_io_soft_start_duration_t ioSoftStartDuration
 Selects the soft start duration delay for the IO 1.8 full power regulator. More...
 
spm_aux_io_regulator_volt_select_t ioRegulatorVolt
 IO Regulator Voltage Select. More...
 

Field Documentation

spm_aux_ldo_low_power_mode_t _spm_aux_ldo_config::lowPowerMode
spm_aux_ldo_io_soft_start_duration_t _spm_aux_ldo_config::ioSoftStartDuration
spm_aux_io_regulator_volt_select_t _spm_aux_ldo_config::ioRegulatorVolt
struct _spm_dcdc_integrator_value_config

Data Fields

double vddCoreValue
 VDD_CORE output voltage value. More...
 
double vBatValue
 Battery input voltage value, or the Vdd_dcdcin voltage value. More...
 

Field Documentation

double _spm_dcdc_integrator_value_config::vddCoreValue
double _spm_dcdc_integrator_value_config::vBatValue
struct _spm_low_power_req_out_pin_config

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::pinOutPol
bool _spm_low_power_req_out_pin_config::pinOutEnable
struct _spm_dcdc_loop_control_config

Data Fields

bool enableCommonHysteresis
 Enable hysteresis in switching converter differential mode analog comparators. More...
 
bool enableDifferentialHysteresis
 Enable hysteresis in switching converter common mode analog comparators. More...
 
bool invertHysteresisSign
 Invert the sign of the hysteresis in DC-DC analog comparators. More...
 

Field Documentation

bool _spm_dcdc_loop_control_config::enableCommonHysteresis

This feature improves transient supply ripple and efficiency.

bool _spm_dcdc_loop_control_config::enableDifferentialHysteresis

This feature improves transient supply ripple and efficiency.

bool _spm_dcdc_loop_control_config::invertHysteresisSign

Should be enabled when in Pulsed mode.

Macro Definition Documentation

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

Version 2.3.0.

Typedef Documentation

This structure reuses the configuration structure from legacy PMC module.

This structure reuses the configuration structure from legacy PMC module.

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

Enumeration Type Documentation

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_AuxLdo 

Mask code for AUX 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 VLLS0/1.

kSPM_CoreLdoLowPowerModeEnableHighDrive 

Enable high driver in low power.

kSPM_CoreLdoLowPowerModeEnableLVD 

Enable level voltage detect in low power modes.

kSPM_CoreLdoLowPowerModeEnablePOR 

POR brownout remains enabled in VLLS0/1 mode.

kSPM_CoreLdoLowPowerModeEnableLPO 

LPO remains enabled in VLLS0/1 modes.

kSPM_CoreLdoLowPowerModeEnableBandgapBufferHightDrive 

Enable the high drive for Bandgap Buffer.

kSPM_CoreLdoLowPowerModeEnableBandgapBuffer 

Enable Bandgap Buffer.

kSPM_CoreLdoLowPowerModeEnableBandgapInVLPx 

Enable Bandgap in STOP/VLPx/LLS and VLLSx mode.

kSPM_CoreLdoLowPowerModeRemainInHighPower 

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

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_AuxLdoEnterLowPowerInLowPowerModes 

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

kSPM_AuxLdoRemainInHighPowerInLowPowerModes 

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

Enumerator
kSPM_AuxLdoSoftStartDuration110us 

110 us.

kSPM_AuxLdoSoftStartDuration95us 

95 us.

kSPM_AuxLdoSoftStartDuration60us 

60 us.

kSPM_AuxLdoSoftStartDuration48us 

48 us.

kSPM_AuxLdoSoftStartDuration38us 

38 us.

kSPM_AuxLdoSoftStartDuration30us 

30 us.

kSPM_AuxLdoSoftStartDuration24us 

24 us.

kSPM_AuxLdoSoftStartDuration17us 

17 us.

Enumerator
kSPM_AuxIoRegulatorVoltLevel1p8 

Regulate to 1.8V.

kSPM_AuxIoRegulatorVoltLevel1p5 

Regulate to 1.5V.

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_DcdcDriveStrengthWithExtraDoubleFETs 

Extra Double 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_EnableRegulatorInRunMode ( SPM_Type *  base,
bool  enable,
uint32_t  ldoMask 
)
inlinestatic

This function controls which regulator (CORE LDO, AUX 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, AUX 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.
configMaskMask 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.
configMaskMask 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 void SPM_ForceCoreLdoOffset ( SPM_Type *  base,
bool  enable 
)
inlinestatic
Note
Please make sure Core LDO Aux LDO and DCDC regulator both have been enabled before invoking this function.
Parameters
baseSPM peripheral base address.
enableEnable/Disable Core Ldo voltage offset. true - Apply Core LDO offset. false - Don't apply Core LDO offset.
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_SetAuxLdoConfig ( SPM_Type *  base,
const spm_aux_ldo_config_t config 
)
Parameters
baseSPM peripheral base address.
configPointer to configuration structure, see to spm_rf_ldo_config_t.
static void SPM_ForceAuxLdoOffset ( SPM_Type *  base,
bool  enable 
)
inlinestatic
Note
Please make sure DCDC has been enabled before involing this function.
Parameters
baseSPM peripheral base address.
enableEnable/Disable AUX Ldo voltage offset. true - Force auxiliary regulator voltage to an offset level. false - Do not force auxiliary regulator voltage to an offset level.
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_SetDcdcLoopControlConfig ( SPM_Type *  base,
const spm_dcdc_loop_control_config_t config 
)
Parameters
baseSPM peripheral base address.
configThe Pointer to the structure spm_dcdc_loop_control_config_t.
static void SPM_EnableVddxStepLock ( SPM_Type *  base,
bool  enable 
)
inlinestatic

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
static void SPM_SplitDcdcClockFreq ( SPM_Type *  base,
bool  enable 
)
inlinestatic
Note
The function can only be invoked in continous mode.
Parameters
baseSPM peripheral base address.
enableSplit the DCDC clock frequency. true - Set DCDC clock to half frequency for the continous mode. false - Do not set DCDC clock to half frequency for the continous mode.
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 VDDCORE output target value before goes to the pulsed mode.

spm_dcdc_integrator_config_t SpmDcdcIntegratorConfigStruct =
{
.vddCoreValue = 1.25f,
.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 SPC_BypassDcdcAdcMeasure ( SPM_Type *  base,
bool  bypass 
)
inlinestatic
Note
If forced to bypass the ADC measure, please invoke SPM_SetDcdcIntegratorConfig() function to select the integrator value.
Parameters
baseSPM peripheral base address.
bypassBypass or not bypass the ADC measure true - Force DCDC to bypass the ADC measuring state. false - Don't force DCDC to bypass the ADC measuring state.
static void SPM_SetDcdcVdd1p2ValueHsrun ( SPM_Type *  base,
uint32_t  trimCode 
)
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.
trimCodeSetting value of VDD1P2 in buck HSRUN mode. Please refer to the reference mannual for details.
static void SPM_SetDcdcVdd1p2ValueBuck ( SPM_Type *  base,
uint32_t  trimCode 
)
inlinestatic

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

Parameters
baseSPM peripheral base address.
trimCodeSetting value of VDD1P2 in buck mode. Please refer to the reference mannual for details.
static void SPM_SetDcdcVdd1p8Value ( SPM_Type *  base,
uint32_t  trimCode 
)
inlinestatic

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

Parameters
baseSPM peripheral base address.
trimCodeSetting the trimCode of VDD1P8 output. Please refer to the reference mannual for details.
static void SPM_SetLowPowerReqOutPinConfig ( SPM_Type *  base,
const spm_low_power_req_out_pin_config_t config 
)
inlinestatic

param base SPM peripheral base address. param config Pointer to the configuration structure, see to spm_low_power_req_out_pin_config_t.