MCUXpresso SDK API Reference Manual  Rev 2.16.000
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
MCX_SPC: System Power Control driver

Overview

The MCUXpresso SDK provides a peripheral driver for the System Power Control (SPC) module of MCUXpresso SDK devices. The SPC module contains and controls two LDOs and one DCDC used for regulating System Core.

API functions are provided to configure on-chip regulators in active mode and low power modes. For Active modes, SPC_ConfigActiveModeRegulators() function accepts different parameters to config the voltage level and drive strength for each on-chip regulator. For Active mode, Some APIs also provided individually to config each on-chip regulator's voltage level and drive strength. For low power modes, SPC_ConfigLowPowerModeRegulators() function accepts different parameters to config the voltage level and drive strength for each on-chip regulator. For low power mode, some APIs also provided individually to config each on-chip regulator's voltage level and driver strength. For gating each Voltage detector for each voltage domain, there are also some APIs provided.

#SPC Status It includes functions for querying and manipulating various power-related states and requests, such as:

SPC_GetPeriphIOIsolationStatus: Retrieves the isolation status for each power domain, indicating if specific peripherals and IO pads are in a latched state due to being in POWERDOWN mode.

SPC_ClearPeriphIOIsolationFlag: Clears isolation flags for peripherals and IO pads across power domains after recovery from POWERDOWN mode, releasing them back to their normal run mode state. This should be invoked after restoring chip configuration, particularly for enabled WUU wakeup pins.

SPC_GetBusyStatusFlag: Returns the SPC busy status flag. The flag is set and the function returns true when the SPC is executing any power mode transition in ACTIVE mode or during SOC low power modes, or when adjusting CORE LDO and DCDC voltage levels in ACTIVE mode.

SPC_CheckLowPowerReqest: Checks if all power domains have requested a low power mode entry. If so, the SPC enters a low power state, with its regulators controlled by the LP_CFG register. The function returns true in this case; otherwise, it returns false, indicating that the SPC is in active #SRAM Retention LDO Control APIs

#Low Power Request configuration SPC_SetLowPowerRequestConfig: Configure low power request pin.

#Integrated Power Switch Control APIs It includes functions to control integrated power switch. Please note that not all device supported this function group. #VDD Core Glitch Detector Control APIs It includes functions to control glitch detector. #SRAM Control APIs SPC_SetSRAMOperateVoltage: Set SRAM operate voltage. #Active Mode configuration It includes serval functions to set/read ACTIVE_CFG register. SPC_SetActiveModeRegulatorsConfig: Configs all settings of regulators in Active mode at a time. If this function can not satisfy some tricky settings, please invoke other APIs in low level function group.

#Low Power mode configuration It includes serval functions to set/read LP_CFG register. SPC_SetActiveModeRegulatorsConfig: Configs all settings of regulators in Active mode at a time. If this function can not satisfy some tricky settings, please invoke other APIs in low level function group. #Voltage Detect Status

#Voltage Detect configuration for Core voltage domain. It includes functions to set voltage detect features for Core VDD. #Voltage detect configuration for System Voltage domain It includes functions to set voltage detect features for System VDD. #Voltage detect configuration for IO voltage domain It includes functions to set voltage detect features for I/O VDD. #External Voltage domains configuration SPC_SetExternalVoltageDomainsConfig: Configs external voltage domains isolation. SPC_GetExternalDomainsStatus: Gets External Domains status. #Low Level APIs To Set CORE LDO Regulator It contains low level APIs to set Core LDO regulator, it is more flexible than some one-time configuration APIs. #Low Level APIs To Set System LDO Regulator It contains low level APIs to set System LDO regulator, it is more flexible than some one-time configuration APIs. #Low Level APIs To Set DCDC Regulator It contains low level APIs to set DCDC regulator, it is more flexible than some one-time configuration APIs.

Data Structures

struct  spc_lowpower_request_config_t
 Low Power Request output pin configuration. More...
 
struct  spc_active_mode_core_ldo_option_t
 Core LDO regulator options in Active mode. More...
 
struct  spc_lowpower_mode_core_ldo_option_t
 Core LDO regulator options in Low Power mode. More...
 
struct  spc_voltage_detect_option_t
 CORE/SYS/IO VDD Voltage Detect options. More...
 
struct  spc_core_voltage_detect_config_t
 Core Voltage Detect configuration. More...
 
struct  spc_system_voltage_detect_config_t
 System Voltage Detect Configuration. More...
 
struct  spc_active_mode_regulators_config_t
 Active mode configuration. More...
 
struct  spc_lowpower_mode_regulators_config_t
 Low Power Mode configuration. More...
 

Enumerations

enum  {
  kStatus_SPC_Busy = MAKE_STATUS(kStatusGroup_SPC, 0U),
  kStatus_SPC_CORELDOLowDriveStrengthIgnore = MAKE_STATUS(kStatusGroup_SPC, 5U),
  kStatus_SPC_CORELDOVoltageWrong = MAKE_STATUS(kStatusGroup_SPC, 7U),
  kStatus_SPC_CORELDOVoltageSetFail = MAKE_STATUS(kStatusGroup_SPC, 8U),
  kStatus_SPC_BandgapModeWrong = MAKE_STATUS(kStatusGroup_SPC, 6U)
}
 SPC status enumeration. More...
 
enum  _spc_voltage_detect_flags {
  kSPC_SystemVDDHighVoltageDetectFlag = SPC_VD_STAT_SYSVDD_HVDF_MASK,
  kSPC_SystemVDDLowVoltageDetectFlag = SPC_VD_STAT_SYSVDD_LVDF_MASK,
  kSPC_CoreVDDLowVoltageDetectFlag = SPC_VD_STAT_COREVDD_LVDF_MASK
}
 Voltage Detect Status Flags. More...
 
enum  _spc_power_domains {
  kSPC_MAINPowerDomainRetain = 1UL << 16U,
  kSPC_WAKEPowerDomainRetain = 1UL << 17U
}
 SPC power domain isolation status. More...
 
enum  _spc_analog_module_control {
  kSPC_controlVref = 1UL << 0UL,
  kSPC_controlUsb3vDet = 1UL << 1UL,
  kSPC_controlDac0 = 1UL << 4UL,
  kSPC_controlDac1 = 1UL << 5UL,
  kSPC_controlDac2 = 1UL << 6UL,
  kSPC_controlOpamp0 = 1UL << 8UL,
  kSPC_controlOpamp1 = 1UL << 9UL,
  kSPC_controlOpamp2 = 1UL << 10UL,
  kSPC_controlCmp0 = 1UL << 16UL,
  kSPC_controlCmp1 = 1UL << 17UL,
  kSPC_controlCmp2 = 1UL << 18UL,
  kSPC_controlCmp0Dac = 1UL << 20UL,
  kSPC_controlCmp1Dac = 1UL << 21UL,
  kSPC_controlCmp2Dac = 1UL << 22UL,
  kSPC_controlAllModules = 0x770773UL
}
 The enumeration of all analog module that can be controlled by SPC in active or low-power modes. More...
 
enum  spc_power_domain_id_t {
  kSPC_PowerDomain0 = 0U,
  kSPC_PowerDomain1 = 1U
}
 The enumeration of spc power domain, the connected power domain is chip specfic, please refer to chip's RM for details. More...
 
enum  spc_power_domain_low_power_mode_t {
  kSPC_SleepWithSYSClockRunning = 0U,
  kSPC_DeepSleepWithSysClockOff = 1U,
  kSPC_PowerDownWithSysClockOff = 2U,
  kSPC_DeepPowerDownWithSysClockOff = 4U
}
 The enumeration of Power domain's low power mode. More...
 
enum  spc_lowpower_request_pin_polarity_t {
  kSPC_HighTruePolarity = 0x0U,
  kSPC_LowTruePolarity = 0x1U
}
 SPC low power request output pin polarity. More...
 
enum  spc_lowpower_request_output_override_t {
  kSPC_LowPowerRequestNotForced = 0x0U,
  kSPC_LowPowerRequestReserved = 0x1U,
  kSPC_LowPowerRequestForcedLow = 0x2U,
  kSPC_LowPowerRequestForcedHigh = 0x3U
}
 SPC low power request output override. More...
 
enum  spc_bandgap_mode_t {
  kSPC_BandgapDisabled = 0x0U,
  kSPC_BandgapEnabledBufferDisabled = 0x1U,
  kSPC_BandgapEnabledBufferEnabled = 0x2U,
  kSPC_BandgapReserved = 0x3U
}
 SPC Bandgap mode enumeration in Active mode or Low Power mode. More...
 
enum  spc_core_ldo_voltage_level_t {
  kSPC_CoreLDO_UnderDriveVoltage = 0x0U,
  kSPC_Core_LDO_RetentionVoltage = 0x0U,
  kSPC_CoreLDO_MidDriveVoltage = 0x1U,
  kSPC_CoreLDO_NormalVoltage = 0x2U,
  kSPC_CoreLDO_OverDriveVoltage = 0x3U
}
 Core LDO regulator voltage level enumeration in Active mode or Low Power mode. More...
 
enum  spc_core_ldo_drive_strength_t {
  kSPC_CoreLDO_LowDriveStrength = 0x0U,
  kSPC_CoreLDO_NormalDriveStrength = 0x1U
}
 CORE LDO VDD regulator Drive Strength enumeration in Low Power mode. More...
 
enum  spc_low_voltage_level_select_t {
  kSPC_LowVoltageNormalLevel = 0x0U,
  kSPC_LowVoltageSafeLevel = 0x1U,
  kSPC_LowVoltageHighRange = 0x0U,
  kSPC_LowVoltageLowRange = 0x1U
}
 IO VDD Low-Voltage Level Select. More...
 
enum  spc_sram_operate_voltage_t {
  kSPC_sramOperateAt1P0V = 0x1U,
  kSPC_sramOperateAt1P1V = 0x2U,
  kSPC_sramOperateAt1P2V = 0x3U
}
 The list of the operating voltage for the SRAM's read/write timing margin. More...
 

Variables

spc_sram_operate_voltage_t spc_sram_voltage_config_t::operateVoltage
 Specifies the operating voltage for the SRAM's read/write timing margin. More...
 
bool spc_sram_voltage_config_t::requestVoltageUpdate
 Used to control whether request an SRAM trim value change. More...
 
bool spc_lowpower_request_config_t::enable
 Low Power Request Output enable. More...
 
spc_lowpower_request_pin_polarity_t spc_lowpower_request_config_t::polarity
 Low Power Request Output pin polarity select. More...
 
spc_lowpower_request_output_override_t spc_lowpower_request_config_t::override
 Low Power Request Output Override. More...
 
spc_core_ldo_voltage_level_t spc_active_mode_core_ldo_option_t::CoreLDOVoltage
 Core LDO Regulator Voltage Level selection in Active mode. More...
 
spc_core_ldo_drive_strength_t spc_active_mode_core_ldo_option_t::CoreLDODriveStrength
 Core LDO Regulator Drive Strength selection in Active mode.
 
spc_core_ldo_voltage_level_t spc_lowpower_mode_core_ldo_option_t::CoreLDOVoltage
 Core LDO Regulator Voltage Level selection in Low Power mode. More...
 
spc_core_ldo_drive_strength_t spc_lowpower_mode_core_ldo_option_t::CoreLDODriveStrength
 Core LDO Regulator Drive Strength selection in Low Power mode.
 
bool spc_voltage_detect_option_t::HVDInterruptEnable
 CORE/SYS/IO VDD High Voltage Detect interrupt enable. More...
 
bool spc_voltage_detect_option_t::HVDResetEnable
 CORE/SYS/IO VDD High Voltage Detect reset enable. More...
 
bool spc_voltage_detect_option_t::LVDInterruptEnable
 CORE/SYS/IO VDD Low Voltage Detect interrupt enable. More...
 
bool spc_voltage_detect_option_t::LVDResetEnable
 CORE/SYS/IO VDD Low Voltage Detect reset enable. More...
 
spc_voltage_detect_option_t spc_core_voltage_detect_config_t::option
 Core VDD Voltage Detect option. More...
 
spc_voltage_detect_option_t spc_system_voltage_detect_config_t::option
 System VDD Voltage Detect option. More...
 
spc_low_voltage_level_select_t spc_system_voltage_detect_config_t::level
 
spc_bandgap_mode_t spc_active_mode_regulators_config_t::bandgapMode
 Specify bandgap mode in active mode. More...
 
spc_active_mode_core_ldo_option_t spc_active_mode_regulators_config_t::CoreLDOOption
 Specify Core LDO configurations in active mode. More...
 
bool spc_lowpower_mode_regulators_config_t::lpIREF
 Enable/disable low power IREF in low power modes. More...
 
spc_bandgap_mode_t spc_lowpower_mode_regulators_config_t::bandgapMode
 Specify bandgap mode in low power modes. More...
 
spc_lowpower_mode_core_ldo_option_t spc_lowpower_mode_regulators_config_t::CoreLDOOption
 Specify core LDO configurations in low power modes. More...
 

Driver version

#define FSL_SPC_DRIVER_VERSION   (MAKE_VERSION(2, 4, 2))
 SPC driver version 2.4.2. More...
 

SPC Status

uint8_t SPC_GetPeriphIOIsolationStatus (SPC_Type *base)
 Gets Isolation status for each power domains. More...
 
static void SPC_ClearPeriphIOIsolationFlag (SPC_Type *base)
 Clears peripherals and I/O pads isolation flags for each power domains. More...
 
static bool SPC_GetBusyStatusFlag (SPC_Type *base)
 Gets SPC busy status flag. More...
 
static bool SPC_CheckLowPowerReqest (SPC_Type *base)
 Checks system low power request. More...
 
static void SPC_ClearLowPowerRequest (SPC_Type *base)
 Clears system low power request, set SPC in active mode. More...
 
static bool SPC_CheckSwitchState (SPC_Type *base)
 Checks whether the power switch is on. More...
 
spc_power_domain_low_power_mode_t SPC_GetPowerDomainLowPowerMode (SPC_Type *base, spc_power_domain_id_t powerDomainId)
 Gets selected power domain's requested low power mode. More...
 
static bool SPC_CheckPowerDomainLowPowerRequest (SPC_Type *base, spc_power_domain_id_t powerDomainId)
 Checks power domain's low power request. More...
 
static void SPC_ClearPowerDomainLowPowerRequestFlag (SPC_Type *base, spc_power_domain_id_t powerDomainId)
 Clears selected power domain's low power request flag. More...
 

SRAM Retention LDO Control APIs

static void SPC_TrimSRAMLdoRefVoltage (SPC_Type *base, uint8_t trimValue)
 Trims SRAM retention regulator reference voltage, trim step is 12 mV, range is around 0.48V to 0.85V. More...
 
static void SPC_EnableSRAMLdo (SPC_Type *base, bool enable)
 Enables/disables SRAM retention LDO. More...
 
static void SPC_RetainSRAMArray (SPC_Type *base, uint8_t mask)
 

Low Power Request configuration

void SPC_SetLowPowerRequestConfig (SPC_Type *base, const spc_lowpower_request_config_t *config)
 Configs Low power request output pin. More...
 

Integrated Power Switch Control APIs

static void SPC_EnableIntegratedPowerSwitchManually (SPC_Type *base, bool enable)
 Enables/disables the integrated power switch manually. More...
 
static void SPC_EnableIntegratedPowerSwitchAutomatically (SPC_Type *base, bool sleepGate, bool wakeupUngate)
 Enables/disables the integrated power switch automatically. More...
 

SRAM Control APIs

void SPC_SetSRAMOperateVoltage (SPC_Type *base, const spc_sram_voltage_config_t *config)
 Set SRAM operate voltage. More...
 

Active Mode configuration

static spc_bandgap_mode_t SPC_GetActiveModeBandgapMode (SPC_Type *base)
 Gets the Bandgap mode in Active mode. More...
 
static uint32_t SPC_GetActiveModeVoltageDetectStatus (SPC_Type *base)
 Gets all voltage detectors status in Active mode. More...
 
status_t SPC_SetActiveModeBandgapModeConfig (SPC_Type *base, spc_bandgap_mode_t mode)
 Configs Bandgap mode in Active mode. More...
 
static void SPC_SetActiveModeVoltageTrimDelay (SPC_Type *base, uint16_t delay)
 Sets the delay when the regulators change voltage level in Active mode. More...
 
status_t SPC_SetActiveModeRegulatorsConfig (SPC_Type *base, const spc_active_mode_regulators_config_t *config)
 Configs all settings of regulators in Active mode at a time. More...
 
static void SPC_EnableActiveModeAnalogModules (SPC_Type *base, uint32_t maskValue)
 Enables analog modules in active mode. More...
 
static void SPC_DisableActiveModeAnalogModules (SPC_Type *base, uint32_t maskValue)
 Disables analog modules in active mode. More...
 
static uint32_t SPC_GetActiveModeEnabledAnalogModules (SPC_Type *base)
 Gets enabled analog modules that enabled in active mode. More...
 

Low Power mode configuration

static spc_bandgap_mode_t SPC_GetLowPowerModeBandgapMode (SPC_Type *base)
 Gets the Bandgap mode in Low Power mode. More...
 
static uint32_t SPC_GetLowPowerModeVoltageDetectStatus (SPC_Type *base)
 Gets the status of all voltage detectors in Low Power mode. More...
 
static void SPC_EnableLowPowerModeLowPowerIREF (SPC_Type *base, bool enable)
 Enables/Disables Low Power IREF in low power modes. More...
 
status_t SPC_SetLowPowerModeBandgapmodeConfig (SPC_Type *base, spc_bandgap_mode_t mode)
 Configs Bandgap mode in Low Power mode. More...
 
static void SPC_EnableSRAMLdOLowPowerModeIREF (SPC_Type *base, bool enable)
 Enables/disables SRAM_LDO deep power low power IREF. More...
 
static void SPC_SetLowPowerWakeUpDelay (SPC_Type *base, uint16_t delay)
 Sets the delay when exit the low power modes. More...
 
status_t SPC_SetLowPowerModeRegulatorsConfig (SPC_Type *base, const spc_lowpower_mode_regulators_config_t *config)
 Configs all settings of regulators in Low power mode at a time. More...
 
static void SPC_EnableLowPowerModeAnalogModules (SPC_Type *base, uint32_t maskValue)
 Enables analog modules in low power modes. More...
 
static void SPC_DisableLowPowerModeAnalogModules (SPC_Type *base, uint32_t maskValue)
 Disables analog modules in low power modes. More...
 
static uint32_t SPC_GetLowPowerModeEnabledAnalogModules (SPC_Type *base)
 Gets enabled analog modules that enabled in low power modes. More...
 

Voltage Detect Status

static uint8_t SPC_GetVoltageDetectStatusFlag (SPC_Type *base)
 Get Voltage Detect Status Flags. More...
 
static void SPC_ClearVoltageDetectStatusFlag (SPC_Type *base, uint8_t mask)
 Clear Voltage Detect Status Flags. More...
 

Voltage Detect configuration for Core voltage domain.

void SPC_SetCoreVoltageDetectConfig (SPC_Type *base, const spc_core_voltage_detect_config_t *config)
 Configs CORE voltage detect options. More...
 
static void SPC_LockCoreVoltageDetectResetSetting (SPC_Type *base)
 Locks Core voltage detect reset setting. More...
 
static void SPC_UnlockCoreVoltageDetectResetSetting (SPC_Type *base)
 Unlocks Core voltage detect reset setting. More...
 
status_t SPC_EnableActiveModeCoreLowVoltageDetect (SPC_Type *base, bool enable)
 Enables/Disables the Core Low Voltage Detector in Active mode. More...
 
status_t SPC_EnableLowPowerModeCoreLowVoltageDetect (SPC_Type *base, bool enable)
 Enables/Disables the Core Low Voltage Detector in Low Power mode. More...
 

Voltage detect configuration for System Voltage domain

void SPC_SetSystemVDDLowVoltageLevel (SPC_Type *base, spc_low_voltage_level_select_t level)
 Set system VDD Low-voltage level selection. More...
 
void SPC_SetSystemVoltageDetectConfig (SPC_Type *base, const spc_system_voltage_detect_config_t *config)
 Configs SYS voltage detect options. More...
 
static void SPC_LockSystemVoltageDetectResetSetting (SPC_Type *base)
 Lock System voltage detect reset setting. More...
 
static void SPC_UnlockSystemVoltageDetectResetSetting (SPC_Type *base)
 Unlock System voltage detect reset setting. More...
 
status_t SPC_EnableActiveModeSystemHighVoltageDetect (SPC_Type *base, bool enable)
 Enables/Disables the System High Voltage Detector in Active mode. More...
 
status_t SPC_EnableActiveModeSystemLowVoltageDetect (SPC_Type *base, bool enable)
 Enables/Disable the System Low Voltage Detector in Active mode. More...
 
status_t SPC_EnableLowPowerModeSystemHighVoltageDetect (SPC_Type *base, bool enable)
 Enables/Disables the System High Voltage Detector in Low Power mode. More...
 
status_t SPC_EnableLowPowerModeSystemLowVoltageDetect (SPC_Type *base, bool enable)
 Enables/Disables the System Low Voltage Detector in Low Power mode. More...
 

External Voltage domains configuration

void SPC_SetExternalVoltageDomainsConfig (SPC_Type *base, uint8_t lowPowerIsoMask, uint8_t IsoMask)
 Configs external voltage domains. More...
 
static uint8_t SPC_GetExternalDomainsStatus (SPC_Type *base)
 Gets External Domains status. More...
 

Low Level APIs To Set CORE LDO Regulator

status_t SPC_SetActiveModeCoreLDORegulatorConfig (SPC_Type *base, const spc_active_mode_core_ldo_option_t *option)
 Configs Core LDO Regulator in Active mode. More...
 
status_t SPC_SetActiveModeCoreLDORegulatorVoltageLevel (SPC_Type *base, spc_core_ldo_voltage_level_t voltageLevel)
 Set Core LDO Regulator Voltage level in Active mode. More...
 
static spc_core_ldo_voltage_level_t SPC_GetActiveModeCoreLDOVDDVoltageLevel (SPC_Type *base)
 Gets CORE LDO Regulator Voltage level. More...
 
status_t SPC_SetActiveModeCoreLDORegulatorDriveStrength (SPC_Type *base, spc_core_ldo_drive_strength_t driveStrength)
 Set Core LDO VDD Regulator Drive Strength in Active mode. More...
 
static
spc_core_ldo_drive_strength_t 
SPC_GetActiveModeCoreLDODriveStrength (SPC_Type *base)
 Gets CORE LDO VDD Regulator Drive Strength in Active mode. More...
 
status_t SPC_SetLowPowerModeCoreLDORegulatorConfig (SPC_Type *base, const spc_lowpower_mode_core_ldo_option_t *option)
 Configs CORE LDO Regulator in low power mode. More...
 
status_t SPC_SetLowPowerModeCoreLDORegulatorVoltageLevel (SPC_Type *base, spc_core_ldo_voltage_level_t voltageLevel)
 Set Core LDO VDD Regulator Voltage level in Low power mode. More...
 
static spc_core_ldo_voltage_level_t SPC_GetLowPowerCoreLDOVDDVoltageLevel (SPC_Type *base)
 Gets the CORE LDO VDD Regulator Voltage Level for Low Power modes. More...
 
status_t SPC_SetLowPowerModeCoreLDORegulatorDriveStrength (SPC_Type *base, spc_core_ldo_drive_strength_t driveStrength)
 Set Core LDO VDD Regulator Drive Strength in Low power mode. More...
 
static
spc_core_ldo_drive_strength_t 
SPC_GetLowPowerCoreLDOVDDDriveStrength (SPC_Type *base)
 Gets CORE LDO VDD Drive Strength for Low Power modes. More...
 

Data Structure Documentation

struct spc_lowpower_request_config_t

Data Fields

bool enable
 Low Power Request Output enable. More...
 
spc_lowpower_request_pin_polarity_t polarity
 Low Power Request Output pin polarity select. More...
 
spc_lowpower_request_output_override_t override
 Low Power Request Output Override. More...
 
struct spc_active_mode_core_ldo_option_t

Data Fields

spc_core_ldo_voltage_level_t CoreLDOVoltage
 Core LDO Regulator Voltage Level selection in Active mode. More...
 
spc_core_ldo_drive_strength_t CoreLDODriveStrength
 Core LDO Regulator Drive Strength selection in Active mode.
 
struct spc_lowpower_mode_core_ldo_option_t

Data Fields

spc_core_ldo_voltage_level_t CoreLDOVoltage
 Core LDO Regulator Voltage Level selection in Low Power mode. More...
 
spc_core_ldo_drive_strength_t CoreLDODriveStrength
 Core LDO Regulator Drive Strength selection in Low Power mode.
 
struct spc_voltage_detect_option_t

Data Fields

bool HVDInterruptEnable
 CORE/SYS/IO VDD High Voltage Detect interrupt enable. More...
 
bool HVDResetEnable
 CORE/SYS/IO VDD High Voltage Detect reset enable. More...
 
bool LVDInterruptEnable
 CORE/SYS/IO VDD Low Voltage Detect interrupt enable. More...
 
bool LVDResetEnable
 CORE/SYS/IO VDD Low Voltage Detect reset enable. More...
 
struct spc_core_voltage_detect_config_t

Data Fields

spc_voltage_detect_option_t option
 Core VDD Voltage Detect option. More...
 
struct spc_system_voltage_detect_config_t

Data Fields

spc_voltage_detect_option_t option
 System VDD Voltage Detect option. More...
 
spc_low_voltage_level_select_t level
 
struct spc_active_mode_regulators_config_t

Data Fields

spc_bandgap_mode_t bandgapMode
 Specify bandgap mode in active mode. More...
 
spc_active_mode_core_ldo_option_t CoreLDOOption
 Specify Core LDO configurations in active mode. More...
 
struct spc_lowpower_mode_regulators_config_t

Data Fields

bool lpIREF
 Enable/disable low power IREF in low power modes. More...
 
spc_bandgap_mode_t bandgapMode
 Specify bandgap mode in low power modes. More...
 
spc_lowpower_mode_core_ldo_option_t CoreLDOOption
 Specify core LDO configurations in low power modes. More...
 

Macro Definition Documentation

#define FSL_SPC_DRIVER_VERSION   (MAKE_VERSION(2, 4, 2))

Enumeration Type Documentation

anonymous enum
Note
Some device(such as MCXA family) do not equip DCDC or System LDO, please refer to the reference manual to check.
Enumerator
kStatus_SPC_Busy 

The SPC instance is busy executing any type of power mode transition.

kStatus_SPC_CORELDOLowDriveStrengthIgnore 

CORE LDO Low driver strength setting be ignored for LDO LVD/HVD enabled.

kStatus_SPC_CORELDOVoltageWrong 

Core LDO voltage is wrong.

kStatus_SPC_CORELDOVoltageSetFail 

Core LDO voltage set fail.

kStatus_SPC_BandgapModeWrong 

Selected Bandgap Mode wrong.

Enumerator
kSPC_SystemVDDHighVoltageDetectFlag 

System VDD High-Voltage detect flag.

kSPC_SystemVDDLowVoltageDetectFlag 

System VDD Low-Voltage detect flag.

kSPC_CoreVDDLowVoltageDetectFlag 

Core VDD Low-Voltage detect flag.

Note
Some devices(such as MCXA family) do not contain WAKE Power Domain, please refer to the reference manual to check.
Enumerator
kSPC_MAINPowerDomainRetain 

Peripherals and IO pads retain in MAIN Power Domain.

kSPC_WAKEPowerDomainRetain 

Peripherals and IO pads retain in WAKE Power Domain.

Enumerator
kSPC_controlVref 

Enable/disable VREF in active or low-power modes.

kSPC_controlUsb3vDet 

Enable/disable USB3V_Det in active or low-power modes.

kSPC_controlDac0 

Enable/disable DAC0 in active or low-power modes.

kSPC_controlDac1 

Enable/disable DAC1 in active or low-power modes.

kSPC_controlDac2 

Enable/disable DAC2 in active or low-power modes.

kSPC_controlOpamp0 

Enable/disable OPAMP0 in active or low-power modes.

kSPC_controlOpamp1 

Enable/disable OPAMP1 in active or low-power modes.

kSPC_controlOpamp2 

Enable/disable OPAMP2 in active or low-power modes.

kSPC_controlCmp0 

Enable/disable CMP0 in active or low-power modes.

kSPC_controlCmp1 

Enable/disable CMP1 in active or low-power modes.

kSPC_controlCmp2 

Enable/disable CMP2 in active or low-power modes.

kSPC_controlCmp0Dac 

Enable/disable CMP0_DAC in active or low-power modes.

kSPC_controlCmp1Dac 

Enable/disable CMP1_DAC in active or low-power modes.

kSPC_controlCmp2Dac 

Enable/disable CMP2_DAC in active or low-power modes.

kSPC_controlAllModules 

Enable/disable all modules in active or low-power modes.

Enumerator
kSPC_PowerDomain0 

Power domain0, the connected power domain is chip specific.

kSPC_PowerDomain1 

Power domain1, the connected power domain is chip specific.

Enumerator
kSPC_SleepWithSYSClockRunning 

Power domain request SLEEP mode with SYS clock running.

kSPC_DeepSleepWithSysClockOff 

Power domain request deep sleep mode with system clock off.

kSPC_PowerDownWithSysClockOff 

Power domain request power down mode with system clock off.

kSPC_DeepPowerDownWithSysClockOff 

Power domain request deep power down mode with system clock off.

Enumerator
kSPC_HighTruePolarity 

Control the High Polarity of the Low Power Reqest Pin.

kSPC_LowTruePolarity 

Control the Low Polarity of the Low Power Reqest Pin.

Enumerator
kSPC_LowPowerRequestNotForced 

Not Forced.

kSPC_LowPowerRequestReserved 

Reserved.

kSPC_LowPowerRequestForcedLow 

Forced Low (Ignore LowPower request output polarity setting.)

kSPC_LowPowerRequestForcedHigh 

Forced High (Ignore LowPower request output polarity setting.)

Enumerator
kSPC_BandgapDisabled 

Bandgap disabled.

kSPC_BandgapEnabledBufferDisabled 

Bandgap enabled with Buffer disabled.

kSPC_BandgapEnabledBufferEnabled 

Bandgap enabled with Buffer enabled.

kSPC_BandgapReserved 

Reserved.

Enumerator
kSPC_CoreLDO_UnderDriveVoltage 
Deprecated:
, to align with description of latest RM, please use kSPC_Core_LDO_RetentionVoltage as instead.
kSPC_Core_LDO_RetentionVoltage 

Core LDO VDD regulator regulate to retention voltage, please note that only useful in low power modes and not all devices support this options please refer to devices' RM for details.

kSPC_CoreLDO_MidDriveVoltage 

Core LDO VDD regulator regulate to Mid Drive Voltage.

kSPC_CoreLDO_NormalVoltage 

Core LDO VDD regulator regulate to Normal Voltage.

kSPC_CoreLDO_OverDriveVoltage 

Core LDO VDD regulator regulate to overdrive Voltage.

Enumerator
kSPC_CoreLDO_LowDriveStrength 

Core LDO VDD regulator Drive Strength set to low.

kSPC_CoreLDO_NormalDriveStrength 

Core LDO VDD regulator Drive Strength set to Normal.

Enumerator
kSPC_LowVoltageNormalLevel 
Deprecated:
, please use kSPC_LowVoltageHighRange as instead.
kSPC_LowVoltageSafeLevel 
Deprecated:
, please use kSPC_LowVoltageLowRange as instead.
kSPC_LowVoltageHighRange 

High range LVD threshold.

kSPC_LowVoltageLowRange 

Low range LVD threshold.

Enumerator
kSPC_sramOperateAt1P0V 

SRAM configured for 1.0V operation.

kSPC_sramOperateAt1P1V 

SRAM configured for 1.1V operation.

kSPC_sramOperateAt1P2V 

SRAM configured for 1.2V operation.

Function Documentation

uint8_t SPC_GetPeriphIOIsolationStatus ( SPC_Type *  base)

This function gets the status which indicates whether certain peripheral and the IO pads are in a latched state as a result of having been in POWERDOWN mode.

Parameters
baseSPC peripheral base address.
Returns
Current isolation status for each power domains. See _spc_power_domains for details.
static void SPC_ClearPeriphIOIsolationFlag ( SPC_Type *  base)
inlinestatic

This function clears peripherals and I/O pads isolation flags for each power domains. After recovering from the POWERDOWN mode, user must invoke this function to release the I/O pads and certain peripherals to their normal run mode state. Before invoking this function, user must restore chip configuration in particular pin configuration for enabled WUU wakeup pins.

Parameters
baseSPC peripheral base address.
static bool SPC_GetBusyStatusFlag ( SPC_Type *  base)
inlinestatic

This function gets SPC busy status flag. When SPC executing any type of power mode transition in ACTIVE mode or any of the SOC low power mode, the SPC busy status flag is set and this function returns true. When changing CORE LDO voltage level and DCDC voltage level in ACTIVE mode, the SPC busy status flag is set and this function return true.

Parameters
baseSPC peripheral base address.
Returns
Ack busy flag. true - SPC is busy. false - SPC is not busy.
static bool SPC_CheckLowPowerReqest ( SPC_Type *  base)
inlinestatic
Note
Only when all power domains request low power mode entry, the result of this function is true. That means when all power domains request low power mode entry, the SPC regulators will be controlled by LP_CFG register.
Parameters
baseSPC peripheral base address.
Returns
The system low power request check result.
  • true All power domains have requested low power mode and SPC has entered a low power state and power mode configuration are based on the LP_CFG configuration register.
  • false SPC in active mode and ACTIVE_CFG register control system power supply.
static void SPC_ClearLowPowerRequest ( SPC_Type *  base)
inlinestatic
Parameters
baseSPC peripheral base address.
static bool SPC_CheckSwitchState ( SPC_Type *  base)
inlinestatic
Parameters
baseSPC peripheral base address.
Return values
trueThe power switch is on.
falseThe power switch is off.
spc_power_domain_low_power_mode_t SPC_GetPowerDomainLowPowerMode ( SPC_Type *  base,
spc_power_domain_id_t  powerDomainId 
)
Parameters
baseSPC peripheral base address.
powerDomainIdPower Domain Id, please refer to spc_power_domain_id_t.
Returns
The selected power domain's requested low power mode, please refer to spc_power_domain_low_power_mode_t.
static bool SPC_CheckPowerDomainLowPowerRequest ( SPC_Type *  base,
spc_power_domain_id_t  powerDomainId 
)
inlinestatic
Parameters
baseSPC peripheral base address.
powerDomainIdPower Domain Id, please refer to spc_power_domain_id_t.
Returns
The result of power domain's low power request.
  • true The selected power domain requests low power mode entry.
  • false The selected power domain does not request low power mode entry.
static void SPC_ClearPowerDomainLowPowerRequestFlag ( SPC_Type *  base,
spc_power_domain_id_t  powerDomainId 
)
inlinestatic
Parameters
baseSPC peripheral base address.
powerDomainIdPower Domain Id, please refer to spc_power_domain_id_t.
static void SPC_TrimSRAMLdoRefVoltage ( SPC_Type *  base,
uint8_t  trimValue 
)
inlinestatic
Parameters
baseSPC peripheral base address.
trimValueReference voltage trim value.
static void SPC_EnableSRAMLdo ( SPC_Type *  base,
bool  enable 
)
inlinestatic
Parameters
baseSPC peripheral base address.
enableUsed to enable/disable SRAM LDO :
  • true Enable SRAM LDO;
  • false Disable SRAM LDO.
static void SPC_RetainSRAMArray ( SPC_Type *  base,
uint8_t  mask 
)
inlinestatic
Parameters
baseSPC peripheral base address.
maskThe OR'ed value of SRAM Array.
void SPC_SetLowPowerRequestConfig ( SPC_Type *  base,
const spc_lowpower_request_config_t config 
)

This function config the low power request output pin

Parameters
baseSPC peripheral base address.
configPointer the spc_lowpower_request_config_t structure.
static void SPC_EnableIntegratedPowerSwitchManually ( SPC_Type *  base,
bool  enable 
)
inlinestatic
Parameters
baseSPC peripheral base address.
enableUsed to enable/disable the integrated power switch:
  • true Enable the integrated power switch;
  • false Disable the integrated power switch.
static void SPC_EnableIntegratedPowerSwitchAutomatically ( SPC_Type *  base,
bool  sleepGate,
bool  wakeupUngate 
)
inlinestatic

To gate the integrated power switch when chip enter low power modes, and ungate the switch after wake-up from low power modes:

Parameters
baseSPC peripheral base address.
sleepGateEnable the integrated power switch when chip enter low power modes:
  • true SPC asserts an output pin at low-power entry to power-gate the switch;
  • false SPC does not assert an output pin at low-power entry to power-gate the switch.
wakeupUngateEnables the switch after wake-up from low power modes:
  • true SPC asserts an output pin at low-power exit to power-ungate the switch;
  • false SPC does not assert an output pin at low-power exit to power-ungate the switch.
void SPC_SetSRAMOperateVoltage ( SPC_Type *  base,
const spc_sram_voltage_config_t *  config 
)
Parameters
baseSPC peripheral base address.
configThe pointer to spc_sram_voltage_config_t, specifies the configuration of sram voltage.
static spc_bandgap_mode_t SPC_GetActiveModeBandgapMode ( SPC_Type *  base)
inlinestatic
Parameters
baseSPC peripheral base address.
Returns
Bandgap mode in the type of spc_bandgap_mode_t enumeration.
static uint32_t SPC_GetActiveModeVoltageDetectStatus ( SPC_Type *  base)
inlinestatic
Parameters
baseSPC peripheral base address.
Returns
All voltage detectors status in Active mode.
status_t SPC_SetActiveModeBandgapModeConfig ( SPC_Type *  base,
spc_bandgap_mode_t  mode 
)
Note
To disable bandgap in Active mode:
  1. Disable all LVD's and HVD's in active mode;
  2. Disable Glitch detect;
  3. Configrue LDO's and DCDC to low drive strength in active mode;
  4. Invoke this function to disable bandgap in active mode; otherwise the error status will be reported.
Some other system resources(such as PLL, CMP) require bandgap to be enabled, to disable bandgap please take care of other system resources.
Parameters
baseSPC peripheral base address.
modeThe Bandgap mode be selected.
Return values
kStatus_SPC_BandgapModeWrongThe Bandgap can not be disabled in active mode.
kStatus_SuccessConfig Bandgap mode in Active power mode successful.
static void SPC_SetActiveModeVoltageTrimDelay ( SPC_Type *  base,
uint16_t  delay 
)
inlinestatic
Parameters
baseSPC peripheral base address.
delayThe number of SPC timer clock cycles.
status_t SPC_SetActiveModeRegulatorsConfig ( SPC_Type *  base,
const spc_active_mode_regulators_config_t config 
)
Note
This function is used to overwrite all settings of regulators(including bandgap mode, regulators' drive strength and voltage level) in active mode at a time.
Enable/disable LVDs/HVDs before invoking this function.
This function will check input parameters based on hardware restrictions before setting registers, if input parameters do not satisfy hardware restrictions the specific error will be reported.
Some hardware restrictions not covered, application should be aware of this and follow this hardware restrictions otherwise some unkown issue may occur:
  1. If Core LDO's drive strength are set to same value in both Active mode and low power mode, the voltage level should also set to same value.
  2. When switching Core LDO's drive strength from low to normal, ensure the LDO_CORE high voltage level is set to same level that was set prior to switching to the LDO_CORE drive strength. Otherwise, if the LVDs are enabled, an unexpected LVD can occur.
If this function can not satisfy some tricky settings, please invoke other APIs in low-level function group.
Parameters
baseSPC peripheral base address.
configPointer to spc_active_mode_regulators_config_t structure.
Return values
kStatus_SuccessConfig regulators in Active power mode successful.
kStatus_SPC_BandgapModeWrongBased on input setting, bandgap can not be disabled.
kStatus_SPC_BusyThe SPC instance is busy to execute any type of power mode transition.
kStatus_SPC_CORELDOLowDriveStrengthIgnoreAny of LVDs/HVDs kept enabled before invoking this function.
#kStatus_SPC_SYSLDOOverDriveVoltageFailFail to regulator to Over Drive Voltage due to System VDD HVD is not disabled.
#kStatus_SPC_SYSLDOLowDriveStrengthIgnoreAny of LVDs/HVDs kept enabled before invoking this function.
kStatus_SPC_CORELDOVoltageWrongCore LDO and System LDO do not have same voltage level.
static void SPC_EnableActiveModeAnalogModules ( SPC_Type *  base,
uint32_t  maskValue 
)
inlinestatic
Parameters
baseSPC peripheral base address.
maskValueThe mask of analog modules to enable in active mode, should be the OR'ed value of spc_analog_module_control.
static void SPC_DisableActiveModeAnalogModules ( SPC_Type *  base,
uint32_t  maskValue 
)
inlinestatic
Parameters
baseSPC peripheral base address.
maskValueThe mask of analog modules to disable in active mode, should be the OR'ed value of spc_analog_module_control.
static uint32_t SPC_GetActiveModeEnabledAnalogModules ( SPC_Type *  base)
inlinestatic
Parameters
baseSPC peripheral base address.
Returns
The mask of enabled analog modules that enabled in active mode.
static spc_bandgap_mode_t SPC_GetLowPowerModeBandgapMode ( SPC_Type *  base)
inlinestatic
Parameters
baseSPC peripheral base address.
Returns
Bandgap mode in the type of spc_bandgap_mode_t enumeration.
static uint32_t SPC_GetLowPowerModeVoltageDetectStatus ( SPC_Type *  base)
inlinestatic
Parameters
baseSPC peripheral base address.
Returns
The status of all voltage detectors in low power mode.
static void SPC_EnableLowPowerModeLowPowerIREF ( SPC_Type *  base,
bool  enable 
)
inlinestatic

This function enables/disables Low Power IREF. Low Power IREF can only get disabled in Deep power down mode. In other low power modes, the Low Power IREF is always enabled.

Parameters
baseSPC peripheral base address.
enableEnable/Disable Low Power IREF. true - Enable Low Power IREF for Low Power modes. false - Disable Low Power IREF for Deep Power Down mode.
status_t SPC_SetLowPowerModeBandgapmodeConfig ( SPC_Type *  base,
spc_bandgap_mode_t  mode 
)
Note
To disable Bandgap in Low-power mode:
  1. Disable all LVD's ad HVD's in low power mode;
  2. Disable Glitch detect in low power mode;
  3. Configure LDO's and DCDC to low drive strength in low power mode;
  4. Disable bandgap in low power mode; Otherwise, the error status will be reported.
Some other system resources(such as PLL, CMP) require bandgap to be enabled, to disable bandgap please take care of other system resources.
Parameters
baseSPC peripheral base address.
modeThe Bandgap mode be selected.
Return values
kStatus_SPC_BandgapModeWrongThe bandgap mode setting in Low Power mode is wrong.
kStatus_SuccessConfig Bandgap mode in Low Power power mode successful.
static void SPC_EnableSRAMLdOLowPowerModeIREF ( SPC_Type *  base,
bool  enable 
)
inlinestatic
Parameters
baseSPC peripheral base address.
enableUsed to enable/disable low power IREF :
  • true: Low Power IREF is enabled ;
  • false: Low Power IREF is disabled for power saving.
static void SPC_SetLowPowerWakeUpDelay ( SPC_Type *  base,
uint16_t  delay 
)
inlinestatic
Parameters
baseSPC peripheral base address.
delayThe number of SPC timer clock cycles that the SPC waits on exit from low power modes.
status_t SPC_SetLowPowerModeRegulatorsConfig ( SPC_Type *  base,
const spc_lowpower_mode_regulators_config_t config 
)
Note
This function is used to overwrite all settings of regulators(including bandgap mode, regulators' drive strength and voltage level) in low power mode at a time.
Enable/disable LVDs/HVDs before invoking this function.
This function will check input parameters based on hardware restrictions before setting registers, if input parameters do not satisfy hardware restrictions the specific error will be reported.
Some hardware restrictions not covered, application should be aware of this and follow this hardware restrictions otherwise some unkown issue may occur:
  1. If Core LDO's drive strength are set to same value in both Active mode and low power mode, the voltage level should also set to same value.
  2. When switching Core LDO's drive strength from low to normal, ensure the LDO_CORE high voltage level is set to same level that was set prior to switching to the LDO_CORE drive strength. Otherwise, if the LVDs are enabled, an unexpected LVD can occur.
If this function can not satisfy some tricky settings, please invoke other APIs in low-level function group.
Parameters
baseSPC peripheral base address.
configPointer to spc_lowpower_mode_regulators_config_t structure.
Return values
kStatus_SuccessConfig regulators in Low power mode successful.
kStatus_SPC_BandgapModeWrongThe bandgap should not be disabled based on input settings.
kStatus_SPC_CORELDOLowDriveStrengthIgnoreSet driver strength to low will be ignored.
#kStatus_SPC_SYSLDOLowDriveStrengthIgnoreSet driver strength to low will be ignored.
kStatus_SPC_CORELDOVoltageWrongCore LDO and System LDO do not have same voltage level.
static void SPC_EnableLowPowerModeAnalogModules ( SPC_Type *  base,
uint32_t  maskValue 
)
inlinestatic
Parameters
baseSPC peripheral base address.
maskValueThe mask of analog modules to enable in low power modes, should be OR'ed value of spc_analog_module_control.
static void SPC_DisableLowPowerModeAnalogModules ( SPC_Type *  base,
uint32_t  maskValue 
)
inlinestatic
Parameters
baseSPC peripheral base address.
maskValueThe mask of analog modules to disable in low power modes, should be OR'ed value of spc_analog_module_control.
static uint32_t SPC_GetLowPowerModeEnabledAnalogModules ( SPC_Type *  base)
inlinestatic
Parameters
baseSPC peripheral base address.
Returns
The mask of enabled analog modules that enabled in low power modes.
static uint8_t SPC_GetVoltageDetectStatusFlag ( SPC_Type *  base)
inlinestatic
Parameters
baseSPC peripheral base address.
Returns
Voltage Detect Status Flags. See _spc_voltage_detect_flags for details.
static void SPC_ClearVoltageDetectStatusFlag ( SPC_Type *  base,
uint8_t  mask 
)
inlinestatic
Parameters
baseSPC peripheral base address.
maskThe mask of the voltage detect status flags. See _spc_voltage_detect_flags for details.
void SPC_SetCoreVoltageDetectConfig ( SPC_Type *  base,
const spc_core_voltage_detect_config_t config 
)
Note
: Setting both the voltage detect interrupt and reset enable will cause interrupt to be generated on exit from reset. If those conditioned is not desired, interrupt/reset so only one is enabled.
Parameters
baseSPC peripheral base address.
configPointer to spc_core_voltage_detect_config_t structure.
static void SPC_LockCoreVoltageDetectResetSetting ( SPC_Type *  base)
inlinestatic

This function locks core voltage detect reset setting. After invoking this function any configuration of Core voltage detect reset will be ignored.

Parameters
baseSPC peripheral base address.
static void SPC_UnlockCoreVoltageDetectResetSetting ( SPC_Type *  base)
inlinestatic

This function unlocks core voltage detect reset setting. If locks the Core voltage detect reset setting, invoking this function to unlock.

Parameters
baseSPC peripheral base address.
status_t SPC_EnableActiveModeCoreLowVoltageDetect ( SPC_Type *  base,
bool  enable 
)
Note
If the CORE_LDO low voltage detect is enabled in Active mode, please note that the bandgap must be enabled and the drive strength of each regulator must not set to low.
Parameters
baseSPC peripheral base address.
enableEnable/Disable Core LVD. true - Enable Core Low voltage detector in active mode. false - Disable Core Low voltage detector in active mode.
Return values
kStatus_SuccessEnable/Disable Core Low Voltage Detect successfully.
status_t SPC_EnableLowPowerModeCoreLowVoltageDetect ( SPC_Type *  base,
bool  enable 
)

This function enables/disables the Core Low Voltage Detector. If enabled the Core Low Voltage detector. The Bandgap mode in low power mode must be programmed so that Bandgap is enabled.

Note
If the CORE_LDO low voltage detect is enabled in Low Power mode, please note that the bandgap must be enabled and the drive strength of each regulator must not set to low in Low Power mode.
Parameters
baseSPC peripheral base address.
enableEnable/Disable Core HVD. true - Enable Core Low voltage detector in low power mode. false - Disable Core Low voltage detector in low power mode.
Return values
kStatus_SuccessEnable/Disable Core Low Voltage Detect in low power mode successfully.
void SPC_SetSystemVDDLowVoltageLevel ( SPC_Type *  base,
spc_low_voltage_level_select_t  level 
)

This function selects the system VDD low-voltage level. Changing system VDD low-voltage level must be done after disabling the System VDD low voltage reset and interrupt.

Deprecated:
In latest RM, reserved for all devices, will removed in next release.
Parameters
baseSPC peripheral base address.
levelSystem VDD Low-Voltage level selection.
void SPC_SetSystemVoltageDetectConfig ( SPC_Type *  base,
const spc_system_voltage_detect_config_t config 
)

This function config SYS voltage detect options.

Note
: Setting both the voltage detect interrupt and reset enable will cause interrupt to be generated on exit from reset. If those conditioned is not desired, interrupt/reset so only one is enabled.
Parameters
baseSPC peripheral base address.
configPointer to spc_system_voltage_detect_config_t structure.
static void SPC_LockSystemVoltageDetectResetSetting ( SPC_Type *  base)
inlinestatic

This function locks system voltage detect reset setting. After invoking this function any configuration of System Voltage detect reset will be ignored.

Parameters
baseSPC peripheral base address.
static void SPC_UnlockSystemVoltageDetectResetSetting ( SPC_Type *  base)
inlinestatic

This function unlocks system voltage detect reset setting. If locks the System voltage detect reset setting, invoking this function to unlock.

Parameters
baseSPC peripheral base address.
status_t SPC_EnableActiveModeSystemHighVoltageDetect ( SPC_Type *  base,
bool  enable 
)
Note
If the System_LDO high voltage detect is enabled in Active mode, please note that the bandgap must be enabled and the drive strength of each regulator must not set to low in Active mode.
Parameters
baseSPC peripheral base address.
enableEnable/Disable System HVD. true - Enable System High voltage detector in active mode. false - Disable System High voltage detector in active mode.
Return values
kStatus_SuccessEnable/Disable System High Voltage Detect successfully.
status_t SPC_EnableActiveModeSystemLowVoltageDetect ( SPC_Type *  base,
bool  enable 
)
Note
If the System_LDO low voltage detect is enabled in Active mode, please note that the bandgap must be enabled and the drive strength of each regulator must not set to low in Active mode.
Parameters
baseSPC peripheral base address.
enableEnable/Disable System LVD. true - Enable System Low voltage detector in active mode. false - Disable System Low voltage detector in active mode.
Return values
kStatus_SuccessEnable/Disable the System Low Voltage Detect successfully.
status_t SPC_EnableLowPowerModeSystemHighVoltageDetect ( SPC_Type *  base,
bool  enable 
)
Note
If the System_LDO high voltage detect is enabled in Low Power mode, please note that the bandgap must be enabled and the drive strength of each regulator must not set to low in Low Power mode.
Parameters
baseSPC peripheral base address.
enableEnable/Disable System HVD. true - Enable System High voltage detector in low power mode. false - Disable System High voltage detector in low power mode.
Return values
kStatus_SuccessEnable/Disable System High Voltage Detect in low power mode successfully.
status_t SPC_EnableLowPowerModeSystemLowVoltageDetect ( SPC_Type *  base,
bool  enable 
)
Note
If the System_LDO low voltage detect is enabled in Low Power mode, please note that the bandgap must be enabled and the drive strength of each regulator must not set to low in Low Power mode.
Parameters
baseSPC peripheral base address.
enableEnable/Disable System HVD. true - Enable System Low voltage detector in low power mode. false - Disable System Low voltage detector in low power mode.
Return values
kStatus_SuccessEnables System Low Voltage Detect in low power mode successfully.
void SPC_SetExternalVoltageDomainsConfig ( SPC_Type *  base,
uint8_t  lowPowerIsoMask,
uint8_t  IsoMask 
)

This function configs external voltage domains isolation.

Parameters
baseSPC peripheral base address.
lowPowerIsoMaskThe mask of external domains isolate enable during low power mode. Please read the Reference Manual for the Bitmap.
IsoMaskThe mask of external domains isolate. Please read the Reference Manual for the Bitmap.
static uint8_t SPC_GetExternalDomainsStatus ( SPC_Type *  base)
inlinestatic
Parameters
baseSPC peripheral base address.
Returns
The status of each external domain.
status_t SPC_SetActiveModeCoreLDORegulatorConfig ( SPC_Type *  base,
const spc_active_mode_core_ldo_option_t option 
)
Note
The bandgap must be enabled before invoking this function.
To set Core LDO as low drive strength, all HVDs/LVDs must be disabled previously.
Parameters
baseSPC peripheral base address.
optionPointer to the spc_active_mode_core_ldo_option_t structure.
Return values
kStatus_SuccessConfig Core LDO regulator in Active power mode successful.
kStatus_SPC_BusyThe SPC instance is busy to execute any type of power mode transition.
kStatus_SPC_BandgapModeWrongBandgap should be enabled before invoking this function.
kStatus_SPC_CORELDOLowDriveStrengthIgnoreTo set Core LDO as low drive strength, all LVDs/HVDs must be disabled before invoking this function.
status_t SPC_SetActiveModeCoreLDORegulatorVoltageLevel ( SPC_Type *  base,
spc_core_ldo_voltage_level_t  voltageLevel 
)
Parameters
baseSPC peripheral base address.
voltageLevelSpecify the voltage level of CORE LDO Regulator in Active mode, please refer to spc_core_ldo_voltage_level_t.
Note
In active mode, the Core LDO voltage level should only be changed when the Core LDO is in normal drive strength.
Update Core LDO voltage level will set Busy flag, this function return only when busy flag is cleared by hardware
Return values
kStatus_SPC_CORELDOVoltageSetFailThe drive strength of Core LDO is not normal.
kStatus_SuccessSet Core LDO regulator voltage level in Active power mode successful.
static spc_core_ldo_voltage_level_t SPC_GetActiveModeCoreLDOVDDVoltageLevel ( SPC_Type *  base)
inlinestatic

This function returns the voltage level of CORE LDO Regulator in Active mode.

Parameters
baseSPC peripheral base address.
Returns
Voltage level of CORE LDO in type of spc_core_ldo_voltage_level_t enumeration.
status_t SPC_SetActiveModeCoreLDORegulatorDriveStrength ( SPC_Type *  base,
spc_core_ldo_drive_strength_t  driveStrength 
)
Parameters
baseSPC peripheral base address.
driveStrengthSpecify the drive strength of CORE LDO Regulator in Active mode, please refer to spc_core_ldo_drive_strength_t.
Return values
kStatus_SuccessSet Core LDO regulator drive strength in Active power mode successful.
kStatus_SPC_CORELDOLowDriveStrengthIgnoreIf any voltage detect enabled, core_ldo's drive strength can not set to low.
kStatus_SPC_BandgapModeWrongThe selected bandgap mode is not allowed.
static spc_core_ldo_drive_strength_t SPC_GetActiveModeCoreLDODriveStrength ( SPC_Type *  base)
inlinestatic
Parameters
baseSPC peripheral base address.
Returns
Drive Strength of CORE LDO regulator in Active mode, please refer to spc_core_ldo_drive_strength_t.
status_t SPC_SetLowPowerModeCoreLDORegulatorConfig ( SPC_Type *  base,
const spc_lowpower_mode_core_ldo_option_t option 
)

This function configs CORE LDO Regulator in Low Power mode. If CORE LDO VDD Drive Strength is set to Normal, the CORE LDO VDD regulator voltage level in Active mode must be equal to the voltage level in Low power mode. And the Bandgap must be programmed to select bandgap enabled. Core VDD voltage levels for the Core LDO low power regulator can only be changed when the CORE LDO Drive Strength set as Normal.

Parameters
baseSPC peripheral base address.
optionPointer to the spc_lowpower_mode_core_ldo_option_t structure.
Return values
kStatus_SuccessConfig Core LDO regulator in power mode successfully.
kStatus_SPC_BusyThe SPC instance is busy to execute any type of power mode transition.
kStatus_SPC_CORELDOLowDriveStrengthIgnoreSet driver strength to low will be ignored.
#kStatus_SPC_CORELDOVoltageSetFail.Fail to change Core LDO voltage level.
status_t SPC_SetLowPowerModeCoreLDORegulatorVoltageLevel ( SPC_Type *  base,
spc_core_ldo_voltage_level_t  voltageLevel 
)
Note
If CORE LDO's drive strength is set to Normal, the CORE LDO VDD regulator voltage in active mode and low power mode must be same.
Voltage level for the CORE LDO in low power mode can only be changed when the CORE LDO Drive Strength set as Normal.
Parameters
baseSPC peripheral base address.
voltageLevelVoltage level of CORE LDO Regulator in Low power mode, please refer to spc_core_ldo_voltage_level_t.
Return values
kStatus_SPC_CORELDOVoltageWrongVoltage level in active mode and low power mode is not same.
kStatus_SuccessSet Core LDO regulator voltage level in Low power mode successful.
kStatus_SPC_CORELDOVoltageSetFailFail to update voltage level because drive strength is incorrect.
static spc_core_ldo_voltage_level_t SPC_GetLowPowerCoreLDOVDDVoltageLevel ( SPC_Type *  base)
inlinestatic
Parameters
baseSPC peripheral base address.
Returns
The CORE LDO VDD Regulator's voltage level.
status_t SPC_SetLowPowerModeCoreLDORegulatorDriveStrength ( SPC_Type *  base,
spc_core_ldo_drive_strength_t  driveStrength 
)
Parameters
baseSPC peripheral base address.
driveStrengthSpecify drive strength of CORE LDO in low power mode.
Return values
kStatus_SPC_CORELDOLowDriveStrengthIgnoreSome voltage detect enabled, CORE LDO's drive strength can not set as low.
kStatus_SuccessSet Core LDO regulator drive strength in Low power mode successful.
kStatus_SPC_BandgapModeWrongBandgap is disabled when attempt to set CORE LDO work as normal drive strength.
static spc_core_ldo_drive_strength_t SPC_GetLowPowerCoreLDOVDDDriveStrength ( SPC_Type *  base)
inlinestatic
Parameters
baseSPC peripheral base address.
Returns
The CORE LDO's VDD Drive Strength.

Variable Documentation

spc_sram_operate_voltage_t spc_sram_voltage_config_t::operateVoltage
bool spc_sram_voltage_config_t::requestVoltageUpdate
bool spc_lowpower_request_config_t::enable
spc_lowpower_request_pin_polarity_t spc_lowpower_request_config_t::polarity
spc_lowpower_request_output_override_t spc_lowpower_request_config_t::override
spc_core_ldo_voltage_level_t spc_active_mode_core_ldo_option_t::CoreLDOVoltage
spc_core_ldo_voltage_level_t spc_lowpower_mode_core_ldo_option_t::CoreLDOVoltage
bool spc_voltage_detect_option_t::HVDInterruptEnable
bool spc_voltage_detect_option_t::HVDResetEnable
bool spc_voltage_detect_option_t::LVDInterruptEnable
bool spc_voltage_detect_option_t::LVDResetEnable
spc_voltage_detect_option_t spc_core_voltage_detect_config_t::option
spc_voltage_detect_option_t spc_system_voltage_detect_config_t::option
spc_low_voltage_level_select_t spc_system_voltage_detect_config_t::level
Deprecated:
, reserved for all devices, will removed in next release.
spc_bandgap_mode_t spc_active_mode_regulators_config_t::bandgapMode
spc_active_mode_core_ldo_option_t spc_active_mode_regulators_config_t::CoreLDOOption
bool spc_lowpower_mode_regulators_config_t::lpIREF
spc_bandgap_mode_t spc_lowpower_mode_regulators_config_t::bandgapMode
spc_lowpower_mode_core_ldo_option_t spc_lowpower_mode_regulators_config_t::CoreLDOOption