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.
|
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...
|
|
struct spc_lowpower_request_config_t |
struct spc_active_mode_core_ldo_option_t |
struct spc_lowpower_mode_core_ldo_option_t |
struct spc_voltage_detect_option_t |
struct spc_core_voltage_detect_config_t |
struct spc_system_voltage_detect_config_t |
struct spc_active_mode_regulators_config_t |
struct spc_lowpower_mode_regulators_config_t |
- 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.
|
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
-
base | SPC 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
-
base | SPC 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
-
base | SPC 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
-
base | SPC 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
-
base | SPC peripheral base address. |
static bool SPC_CheckSwitchState |
( |
SPC_Type * |
base | ) |
|
|
inlinestatic |
- Parameters
-
base | SPC peripheral base address. |
- Return values
-
true | The power switch is on. |
false | The power switch is off. |
- Parameters
-
- 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 |
static void SPC_TrimSRAMLdoRefVoltage |
( |
SPC_Type * |
base, |
|
|
uint8_t |
trimValue |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | SPC peripheral base address. |
trimValue | Reference voltage trim value. |
static void SPC_EnableSRAMLdo |
( |
SPC_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | SPC peripheral base address. |
enable | Used 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
-
base | SPC peripheral base address. |
mask | The OR'ed value of SRAM Array. |
This function config the low power request output pin
- Parameters
-
static void SPC_EnableIntegratedPowerSwitchManually |
( |
SPC_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | SPC peripheral base address. |
enable | Used 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
-
base | SPC peripheral base address. |
sleepGate | Enable 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.
|
wakeupUngate | Enables 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
-
base | SPC peripheral base address. |
config | The pointer to spc_sram_voltage_config_t, specifies the configuration of sram voltage. |
- Parameters
-
base | SPC 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
-
base | SPC peripheral base address. |
- Returns
- All voltage detectors status in Active mode.
- Note
- To disable bandgap in Active mode:
- Disable all LVD's and HVD's in active mode;
- Disable Glitch detect;
- Configrue LDO's and DCDC to low drive strength in active mode;
- 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
-
base | SPC peripheral base address. |
mode | The Bandgap mode be selected. |
- Return values
-
static void SPC_SetActiveModeVoltageTrimDelay |
( |
SPC_Type * |
base, |
|
|
uint16_t |
delay |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | SPC peripheral base address. |
delay | The number of SPC timer clock cycles. |
- 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:
- 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.
- 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
-
- Return values
-
static void SPC_EnableActiveModeAnalogModules |
( |
SPC_Type * |
base, |
|
|
uint32_t |
maskValue |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | SPC peripheral base address. |
maskValue | The 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
-
base | SPC peripheral base address. |
maskValue | The 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
-
base | SPC peripheral base address. |
- Returns
- The mask of enabled analog modules that enabled in active mode.
- Parameters
-
base | SPC 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
-
base | SPC 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
-
base | SPC peripheral base address. |
enable | Enable/Disable Low Power IREF. true - Enable Low Power IREF for Low Power modes. false - Disable Low Power IREF for Deep Power Down mode. |
- Note
- To disable Bandgap in Low-power mode:
- Disable all LVD's ad HVD's in low power mode;
- Disable Glitch detect in low power mode;
- Configure LDO's and DCDC to low drive strength in low power mode;
- 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
-
base | SPC peripheral base address. |
mode | The Bandgap mode be selected. |
- Return values
-
static void SPC_EnableSRAMLdOLowPowerModeIREF |
( |
SPC_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | SPC peripheral base address. |
enable | Used 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
-
base | SPC peripheral base address. |
delay | The number of SPC timer clock cycles that the SPC waits on exit from low power modes. |
- 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:
- 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.
- 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
-
- Return values
-
static void SPC_EnableLowPowerModeAnalogModules |
( |
SPC_Type * |
base, |
|
|
uint32_t |
maskValue |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | SPC peripheral base address. |
maskValue | The 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
-
base | SPC peripheral base address. |
maskValue | The 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
-
base | SPC 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 |
static void SPC_ClearVoltageDetectStatusFlag |
( |
SPC_Type * |
base, |
|
|
uint8_t |
mask |
|
) |
| |
|
inlinestatic |
- 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
-
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
-
base | SPC 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
-
base | SPC 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
-
base | SPC peripheral base address. |
enable | Enable/Disable Core LVD. true - Enable Core Low voltage detector in active mode. false - Disable Core Low voltage detector in active mode. |
- Return values
-
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
-
base | SPC peripheral base address. |
enable | Enable/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_Success | Enable/Disable Core Low Voltage Detect in low power mode successfully. |
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
-
base | SPC peripheral base address. |
level | System VDD Low-Voltage level selection. |
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
-
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
-
base | SPC 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
-
base | SPC 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
-
base | SPC peripheral base address. |
enable | Enable/Disable System HVD. true - Enable System High voltage detector in active mode. false - Disable System High voltage detector in active mode. |
- Return values
-
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
-
base | SPC peripheral base address. |
enable | Enable/Disable System LVD. true - Enable System Low voltage detector in active mode. false - Disable System Low voltage detector in active mode. |
- Return values
-
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
-
base | SPC peripheral base address. |
enable | Enable/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_Success | Enable/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
-
base | SPC peripheral base address. |
enable | Enable/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_Success | Enables 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
-
base | SPC peripheral base address. |
lowPowerIsoMask | The mask of external domains isolate enable during low power mode. Please read the Reference Manual for the Bitmap. |
IsoMask | The mask of external domains isolate. Please read the Reference Manual for the Bitmap. |
static uint8_t SPC_GetExternalDomainsStatus |
( |
SPC_Type * |
base | ) |
|
|
inlinestatic |
- Parameters
-
base | SPC peripheral base address. |
- Returns
- The status of each external domain.
- 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
-
- Return values
-
kStatus_Success | Config Core LDO regulator in Active power mode successful. |
kStatus_SPC_Busy | The SPC instance is busy to execute any type of power mode transition. |
kStatus_SPC_BandgapModeWrong | Bandgap should be enabled before invoking this function. |
kStatus_SPC_CORELDOLowDriveStrengthIgnore | To set Core LDO as low drive strength, all LVDs/HVDs must be disabled before invoking this function. |
- Parameters
-
base | SPC peripheral base address. |
voltageLevel | Specify 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_CORELDOVoltageSetFail | The drive strength of Core LDO is not normal. |
kStatus_Success | Set Core LDO regulator voltage level in Active power mode successful. |
This function returns the voltage level of CORE LDO Regulator in Active mode.
- Parameters
-
base | SPC peripheral base address. |
- Returns
- Voltage level of CORE LDO in type of spc_core_ldo_voltage_level_t enumeration.
- Parameters
-
base | SPC peripheral base address. |
driveStrength | Specify the drive strength of CORE LDO Regulator in Active mode, please refer to spc_core_ldo_drive_strength_t. |
- Return values
-
- Parameters
-
base | SPC peripheral base address. |
- Returns
- Drive Strength of CORE LDO regulator in Active mode, please refer to spc_core_ldo_drive_strength_t.
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
-
- Return values
-
- 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
-
base | SPC peripheral base address. |
voltageLevel | Voltage level of CORE LDO Regulator in Low power mode, please refer to spc_core_ldo_voltage_level_t. |
- Return values
-
- Parameters
-
base | SPC peripheral base address. |
- Returns
- The CORE LDO VDD Regulator's voltage level.
- Parameters
-
base | SPC peripheral base address. |
driveStrength | Specify drive strength of CORE LDO in low power mode. |
- Return values
-
- Parameters
-
base | SPC peripheral base address. |
- Returns
- The CORE LDO's VDD Drive Strength.
bool spc_sram_voltage_config_t::requestVoltageUpdate |
bool spc_lowpower_request_config_t::enable |
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 |
- Deprecated:
- , reserved for all devices, will removed in next release.
bool spc_lowpower_mode_regulators_config_t::lpIREF |