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.
|
enum | {
kStatus_SPC_Busy,
kStatus_SPC_DCDCLowDriveStrengthIgnore,
kStatus_SPC_DCDCPulseRefreshModeIgnore,
kStatus_SPC_SYSLDOOverDriveVoltageFail,
kStatus_SPC_SYSLDOLowDriveStrengthIgnore,
kStatus_SPC_CORELDOLowDriveStrengthIgnore,
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_IOVDDHighVoltageDetectFlag = SPC_VD_STAT_IOVDD_HVDF_MASK,
kSPC_SystemVDDHighVoltageDetectFlag = SPC_VD_STAT_SYSVDD_HVDF_MASK,
kSPC_CoreVDDHighVoltageDetectFlag = SPC_VD_STAT_COREVDD_HVDF_MASK,
kSPC_IOVDDLowVoltageDetectFlag = SPC_VD_STAT_IOVDD_LVDF_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,
kSPC_2P4GPowerDoaminRetain = 1UL << 18U
} |
| SPC power domain isolation status. More...
|
|
enum | spc_power_domain_id_t {
kSPC_PowerDomain0 = 0U,
kSPC_PowerDomain1 = 1U,
kSPC_PowerDomain2 = 2U
} |
| 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_SleepWithSysClockOff = 1U,
kSPC_DeepSleepSysClockOff = 2U,
kSPC_PowerDownWithSysClockOff = 4U,
kSPC_DeepPowerDownWithSysClockOff = 8U
} |
| 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_dcdc_voltage_level_t {
kSPC_DCDC_LowUnderVoltage = 0x0U,
kSPC_DCDC_MidVoltage = 0x1U,
kSPC_DCDC_NormalVoltage = 0x2U,
kSPC_DCDC_SafeModeVoltage = 0x3U
} |
| DCDC regulator voltage level enumeration in Active mode or Low Power Mode. More...
|
|
enum | spc_dcdc_drive_strength_t {
kSPC_DCDC_PulseRefreshMode = 0x0U,
kSPC_DCDC_LowDriveStrength = 0x1U,
kSPC_DCDC_NormalDriveStrength = 0x2U,
kSPC_DCDC_Reserved = 0x3U
} |
| DCDC regulator Drive Strength enumeration in Active mode or Low Power Mode. More...
|
|
enum | spc_sys_ldo_voltage_level_t {
kSPC_SysLDO_NormalVoltage = 0x0U,
kSPC_SysLDO_OverDriveVoltage = 0x1U
} |
| SYS LDO regulator voltage level enumeration in Active mode. More...
|
|
enum | spc_sys_ldo_drive_strength_t {
kSPC_SysLDO_LowDriveStrength = 0x0U,
kSPC_SysLDO_NormalDriveStrength = 0x1U
} |
| SYS LDO regulator Drive Strength enumeration in Active mode or Low Power mode. More...
|
|
enum | spc_core_ldo_voltage_level_t {
kSPC_CoreLDO_UnderDriveVoltage = 0x0U,
kSPC_CoreLDO_MidDriveVoltage = 0x1U,
kSPC_CoreLDO_NormalVoltage = 0x2U,
kSPC_CoreLDO_SafeModeVoltage = 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
} |
| System/IO VDD Low-Voltage Level Select. More...
|
|
|
static void | SPC_SetWakeUpValue (SPC_Type *base, uint32_t data) |
| Set the address of the function/image to be executed if chip wake from power down or deep power down mode. More...
|
|
static uint32_t | SPC_GetWakeUpValue (SPC_Type *base) |
| Gets back the WakeUp value. More...
|
|
struct spc_lowpower_request_config_t |
bool spc_lowpower_request_config_t::enable |
struct spc_intergrated_power_switch_config_t |
- Note
- Legacy structure, will be removed.
Data Fields |
bool | wakeup |
| Assert an output pin to un-gate the integrated power switch. More...
|
|
bool | sleep |
| Assert an output pin to power gate the intergrated power switch. More...
|
|
bool spc_intergrated_power_switch_config_t::wakeup |
bool spc_intergrated_power_switch_config_t::sleep |
struct spc_active_mode_core_ldo_option_t |
struct spc_active_mode_sys_ldo_option_t |
struct spc_active_mode_dcdc_option_t |
struct spc_lowpower_mode_core_ldo_option_t |
struct spc_lowpower_mode_sys_ldo_option_t |
struct spc_lowpower_mode_dcdc_option_t |
struct spc_voltage_detect_option_t |
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 |
struct spc_dcdc_burst_config_t |
bool spc_dcdc_burst_config_t::sofwareBurstRequest |
bool spc_dcdc_burst_config_t::externalBurstRequest |
bool spc_dcdc_burst_config_t::stabilizeBurstFreq |
uint8_t spc_dcdc_burst_config_t::freq |
struct spc_core_voltage_detect_config_t |
struct spc_system_voltage_detect_config_t |
struct spc_io_voltage_detect_config_t |
struct spc_active_mode_regulators_config_t |
struct spc_lowpower_mode_regulators_config_t |
Enumerator |
---|
kStatus_SPC_Busy |
The SPC instance is busy executing any type of power mode transition.
|
kStatus_SPC_DCDCLowDriveStrengthIgnore |
DCDC Low drive strength setting be ignored for LVD/HVD enabled.
|
kStatus_SPC_DCDCPulseRefreshModeIgnore |
DCDC Pulse Refresh Mode drive strength setting be ignored for LVD/HVD enabled.
|
kStatus_SPC_SYSLDOOverDriveVoltageFail |
SYS LDO regulate to Over drive voltage failed for SYS LDO HVD must be disabled.
|
kStatus_SPC_SYSLDOLowDriveStrengthIgnore |
SYS LDO Low driver strength setting be ignored for LDO LVD/HVD enabled.
|
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_IOVDDHighVoltageDetectFlag |
IO VDD High-Voltage detect flag.
|
kSPC_SystemVDDHighVoltageDetectFlag |
System VDD High-Voltage detect flag.
|
kSPC_CoreVDDHighVoltageDetectFlag |
Core VDD High-Voltage detect flag.
|
kSPC_IOVDDLowVoltageDetectFlag |
IO VDD Low-Voltage detect flag.
|
kSPC_SystemVDDLowVoltageDetectFlag |
System VDD Low-Voltage detect flag.
|
kSPC_CoreVDDLowVoltageDetectFlag |
Core VDD Low-Voltage detect flag.
|
Enumerator |
---|
kSPC_MAINPowerDomainRetain |
Peripherals and IO pads retain in MAIN Power Domain.
|
kSPC_WAKEPowerDomainRetain |
Peripherals and IO pads retain in WAKE Power Domain.
|
kSPC_2P4GPowerDoaminRetain |
Peripherals and IO pads retion in 2.4G Power Domain.
|
Enumerator |
---|
kSPC_PowerDomain0 |
Power domain0, the connected power domain is chip specific.
|
kSPC_PowerDomain1 |
Power domain1, the connected power domain is chip specific.
|
kSPC_PowerDomain2 |
Power domain2, the connected power domain is chip specific.
|
Enumerator |
---|
kSPC_SleepWithSYSClockRunning |
Power domain request SLEEP mode with SYS clock running.
|
kSPC_SleepWithSysClockOff |
Power domain request SLEEP mode with SYS clock off.
|
kSPC_DeepSleepSysClockOff |
Power domain request DEEP SLEEP mode with SYS clock off.
|
kSPC_PowerDownWithSysClockOff |
Power domain request POWER DOWN mode with SYS clock off.
|
kSPC_DeepPowerDownWithSysClockOff |
Power domain request DEEP POWER DOWN mode with SYS 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_DCDC_LowUnderVoltage |
DCDC VDD Regulator regulate to Low Under Voltage.
|
kSPC_DCDC_MidVoltage |
DCDC VDD Regulator regulate to Mid Voltage.
|
kSPC_DCDC_NormalVoltage |
DCDC VDD Regulator regulate to Normal Voltage.
|
kSPC_DCDC_SafeModeVoltage |
DCDC VDD Regulator regulate to Safe-Mode Voltage.
|
Enumerator |
---|
kSPC_DCDC_PulseRefreshMode |
DCDC VDD Regulator Drive Strength set to Pulse Refresh Mode.
This enum member is only useful for Low Power Mode config.
|
kSPC_DCDC_LowDriveStrength |
DCDC VDD regulator Drive Strength set to low.
|
kSPC_DCDC_NormalDriveStrength |
DCDC VDD regulator Drive Strength set to Normal.
|
kSPC_DCDC_Reserved |
Reserved.
|
Enumerator |
---|
kSPC_SysLDO_NormalVoltage |
SYS LDO VDD Regulator regulate to Normal Voltage(1.8V).
|
kSPC_SysLDO_OverDriveVoltage |
SYS LDO VDD Regulator regulate to Over Drive Voltage(2.5V).
|
Enumerator |
---|
kSPC_SysLDO_LowDriveStrength |
SYS LDO VDD regulator Drive Strength set to low.
|
kSPC_SysLDO_NormalDriveStrength |
SYS LDO VDD regulator Drive Strength set to Normal.
|
Enumerator |
---|
kSPC_CoreLDO_UnderDriveVoltage |
Core LDO VDD regulator regulate to Under Drive Voltage.
|
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_SafeModeVoltage |
Core LDO VDD regulator regulate to Safe-Mode Voltages.
|
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 |
Trip point set to Normal level.
|
kSPC_LowVoltageSafeLevel |
Trip point set to Safe level.
|
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_CheckPowerSwitchState |
( |
SPC_Type * |
base | ) |
|
|
inlinestatic |
- Parameters
-
base | SPC peripheral base address. |
- Returns
- The state(ON/OFF) of power switch.
- true Indicates the power switch is ON.
- false Indicates 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 |
This function config the low power request output pin
- Parameters
-
static void SPC_SoftwareGatePowerSwitch |
( |
SPC_Type * |
base, |
|
|
bool |
gate |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | SPC peripheral base address. |
gate | Used to gate/ungate power switch
- true The power switch will be gated.
- false The power switch will be un-gated.
|
static void SPC_PowerModeControlPowerSwitch |
( |
SPC_Type * |
base | ) |
|
|
inlinestatic |
- Parameters
-
base | SPC peripheral base address. |
static void SPC_SetWakeUpValue |
( |
SPC_Type * |
base, |
|
|
uint32_t |
data |
|
) |
| |
|
inlinestatic |
- Note
- Data written by this function is used by BootROM to quickly retore ARM Core context, or to switch execution to a defined address in Flash/SRAM on WakeUp.
-
The first word must be SP, and the second word must be PC.
-
Please remember to calculate the CRC value of the first 48 bytes of image/function and save the result to REGFILE1->REG[0]. The BootROM will check this CRC value, if authenticated successfully then the image/function will be executed.
- Parameters
-
base | SPC peripheral base address. |
data | The address of the function/image to be executed if wakeup from low power mode. |
static uint32_t SPC_GetWakeUpValue |
( |
SPC_Type * |
base | ) |
|
|
inlinestatic |
- Parameters
-
base | SPC peripheral base address. |
- Returns
- The WakeUp value.
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. |
- 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
- Legacy API and will be removed.
- Parameters
-
- Note
- In active mode, beacause CORELDO_VDD_DS is reserved and set to Normal, so it is impossible to disable Bandgap in active mode
- Parameters
-
base | SPC peripheral base address. |
mode | The Bandgap mode be selected. |
- Return values
-
static void SPC_EnableActiveModeCMPBandgapBuffer |
( |
SPC_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | SPC peripheral base address. |
enable | Enable/Disable CMP Bandgap buffer. true - Enable Buffer Stored Reference voltage to CMP. false - Disable Buffer Stored Reference voltage to CMP. |
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. |
This function provides the method to config all on-chip regulators in active mode.
- Parameters
-
- Return values
-
- Note
- Legacy API, will be removed.
- Parameters
-
- Parameters
-
base | SPC peripheral base address. |
- Returns
- The CORE LDO's VDD Drive Strength.
- Parameters
-
base | SPC peripheral base address. |
- Returns
- The CORE LDO VDD Regulator's voltage level.
- 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. |
This function configs Bandgap mode in Low Power mode. IF user want to disable Bandgap while keeping any of the Regulator in Normal Driver Strength or if any of the High voltage detectors/Low voltage detectors are kept enabled, the Bandgap mode will be set as Bandgap Enabled with Buffer Disabled.
- Note
- This API shall be invoked following set HVDs/LVDs and regulators' driver strength.
- Parameters
-
base | SPC peripheral base address. |
mode | The Bandgap mode be selected. |
- Return values
-
static void SPC_EnableLowPowerModeCMPBandgapBufferMode |
( |
SPC_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
|
inlinestatic |
This function gates CMP bandgap buffer. CMP bandgap buffer is automatically disabled and turned off in Deep Power Down mode.
- Parameters
-
base | SPC peripheral base address. |
enable | Enable/Disable CMP Bandgap buffer. true - Enable Buffer Stored Reference Voltage to CMP. false - Disable Buffer Stored Reference Voltage to CMP. |
static void SPC_EnableLowPowerModeCoreVDDInternalVoltageScaling |
( |
SPC_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
|
inlinestatic |
This function gates CORE VDD IVS. When enabled, the IVS regulator will scale the external input CORE VDD to a lower voltage level to reduce internal leakage. IVS is invalid in Sleep or Deep power down mode.
- Parameters
-
base | SPC peripheral base address. |
enable | Enable/Disable IVS. true - enable CORE VDD IVS in Deep Sleep mode or Power Down mode. false - disable CORE VDD IVS in Deep Sleep mode or Power Down mode. |
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. |
This function provides the method to config all on-chip regulators in Low Power mode.
- Parameters
-
- Return values
-
static uint8_t SPC_GetVoltageDetectStatusFlag |
( |
SPC_Type * |
base | ) |
|
|
inlinestatic |
static void SPC_ClearVoltageDetectStatusFlag |
( |
SPC_Type * |
base, |
|
|
uint8_t |
mask |
|
) |
| |
|
inlinestatic |
This function config CORE 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_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_EnableActiveModeCoreHighVoltageDetect |
( |
SPC_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
- Note
- If the CORE_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.
- Parameters
-
base | SPC peripheral base address. |
enable | Enable/Disable Core HVD. true - Enable Core High voltage detector in active mode. false - Disable Core High voltage detector in active mode. |
- Return values
-
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_EnableLowPowerModeCoreHighVoltageDetect |
( |
SPC_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
This function enables/disables the Core High Voltage Detector. If enabled the Core High Voltage detector. The Bandgap mode in low power mode must be programmed so that Bandgap is enabled.
- Note
- If the CORE_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 Core HVD. true - Enable Core High voltage detector in low power mode. false - Disable Core High voltage detector in low power mode. |
- Return values
-
kStatus_Success | Enable/Disable Core High Voltage Detect in low power mode 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
-
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.
- 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. |
This function selects the IO VDD Low-voltage level. Changing IO VDD low-voltage level must be done after disabling the IO VDD low voltage reset and interrupt.
- Parameters
-
base | SPC peripheral base address. |
level | IO VDD Low-voltage level selection. |
This function config IO 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
-
base | SPC peripheral base address. |
config | Pointer to spc_voltage_detect_config_t structure. |
static void SPC_LockIOVoltageDetectResetSetting |
( |
SPC_Type * |
base | ) |
|
|
inlinestatic |
This function locks IO 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_UnlockIOVoltageDetectResetSetting |
( |
SPC_Type * |
base | ) |
|
|
inlinestatic |
This function unlocks IO voltage detect reset setting. If locks the IO voltage detect reset setting, invoking this function to unlock.
- Parameters
-
base | SPC peripheral base address. |
status_t SPC_EnableActiveModeIOHighVoltageDetect |
( |
SPC_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
- Note
- If the IO 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 IO HVD. true - Enable IO High voltage detector in active mode. false - Disable IO High voltage detector in active mode. |
- Return values
-
status_t SPC_EnableActiveModeIOLowVoltageDetect |
( |
SPC_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
- Note
- If the IO 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 IO LVD. true - Enable IO Low voltage detector in active mode. false - Disable IO Low voltage detector in active mode. |
- Return values
-
status_t SPC_EnableLowPowerModeIOHighVoltageDetect |
( |
SPC_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
- Note
- If the IO 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 IO HVD. true - Enable IO High voltage detector in low power mode. false - Disable IO High voltage detector in low power mode. |
- Return values
-
kStatus_Success | Enable IO High Voltage Detect in low power mode successfully. |
status_t SPC_EnableLowPowerModeIOLowVoltageDetect |
( |
SPC_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
- Note
- If the IO 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 IO LVD. true - Enable IO Low voltage detector in low power mode. false - Disable IO Low voltage detector in low power mode. |
- Return values
-
kStatus_Success | Enable/Disable IO 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 |
This function configs external voltage domains status.
- Parameters
-
base | SPC peripheral base address. |
- Returns
- The status of each external domain.
static void SPC_EnableCoreLDORegulator |
( |
SPC_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
|
inlinestatic |
- Note
- The CORE LDO enable bit is write-once.
- Parameters
-
base | SPC peripheral base address. |
enable | Enable/Disable CORE LDO Regulator. true - Enable CORE LDO Regulator. false - Disable CORE LDO Regulator. |
static void SPC_PullDownCoreLDORegulator |
( |
SPC_Type * |
base, |
|
|
bool |
pulldown |
|
) |
| |
|
inlinestatic |
- Note
- This function only useful when enabled the CORE LDO Regulator.
- Parameters
-
base | SPC peripheral base address. |
pulldown | Enable/Disable CORE LDO pulldown in Deep Power Down mode. true - CORE LDO Regulator will discharge in Deep Power Down mode. false - CORE LDO Regulator will not discharge in Deep Power Down mode. |
- Note
- If any voltage detect feature is enabled in Active mode, then CORE_LDO's drive strength must not set to low.
-
Core VDD level for the Core LDO low power regulator can only be changed when CORELDO_VDD_DS is normal
- Parameters
-
- Return values
-
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
-
static void SPC_EnableSystemLDORegulator |
( |
SPC_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
|
inlinestatic |
- Note
- The SYSTEM LDO enable bit is write-once.
- Parameters
-
base | SPC peripheral base address. |
enable | Enable/Disable System LDO Regulator. true - Enable System LDO Regulator. false - Disable System LDO Regulator. |
static void SPC_EnableSystemLDOSinkFeature |
( |
SPC_Type * |
base, |
|
|
bool |
sink |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | SPC peripheral base address. |
sink | Enable/Disable current sink feature. true - Enable current sink feature of System LDO Regulator. false - Disable current sink feature of System LDO Regulator. |
This function configs System LDO VDD Regulator in Active mode. If System LDO VDD Drive Strength is set to Normal, the Bandgap mode in Active mode must be programmed to a value that enables the bandgap. If any voltage detects are kept enabled, configuration to set System LDO VDD drive strength to low will be ignored. If select System LDO VDD Regulator voltage level to Over Drive Voltage, the Drive Strength of System LDO VDD Regulator must be set to Normal otherwise the regulator Drive Strength will be forced to Normal. If select System LDO VDD Regulator voltage level to Over Drive Voltage, the High voltage detect must be disabled. Otherwise it will be fail to regulator to Over Drive Voltage.
- Parameters
-
- Return values
-
This function configs System LDO regulator in low power modes. If System LDO VDD Regulator Drive strength is set to normal, bandgap mode in low power mode must be programmed to a value that enables the Bandgap. If any High voltage detectors or Low Voltage detectors are kept enabled, configuration to set System LDO Regulator drive strength as Low will be ignored.
- Parameters
-
- Return values
-
static void SPC_EnableDCDCRegulator |
( |
SPC_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
|
inlinestatic |
- Note
- The DCDC enable bit is write-once.
- Parameters
-
base | SPC peripheral base address. |
enable | Enable/Disable DCDC Regulator. true - Enable DCDC Regulator. false - Disable DCDC Regulator. |
void SPC_SetDCDCRefreshCount |
( |
SPC_Type * |
base, |
|
|
uint16_t |
count |
|
) |
| |
This function set the count value of the reference clock to control the frequency of dcdc refresh when dcdc is configured in Pulse Refresh mode.
- Parameters
-
base | SPC peripheral base address. |
count | The count value, 16 bit width. |
This function configs DCDC VDD Regulator in Active mode. If DCDDC VDD Drive Strength is set to Normal, the Bandgap mode in Active mode must be programmed to a value that enable the bandgap. If any voltage detects are kept enabled, configuration to set DCDC VDD drive strength to low will be ignored. When switching DCDC from low drive strength to Normal driver strength, make sure the DCDC high VDD LVL setting to the same level that was set prior to switching the DCDC to low drive strength.
- Parameters
-
- Return values
-
This function configs DCDC VDD Regulator in Low Power modes. If DCDC VDD Drive Strength is set to Normal, the Bandgap mode in Low Power mode must be programmed to a value that enables the Bandgap. If any of voltage detectors are kept enabled, configuration to set DCDC VDD Drive Strength to Low or Pulse mode will be ignored. In Deep Power Down mode, DCDC regulator is always turned off.
- Parameters
-
- Return values
-