The firmware lib provides a Peripheral driver for the System Power Manager (SPM) module of Kinetis devices. The SPM module contains internal voltage regulator, power on reset, low-voltage detect system, and high-voltage detect system.
#Typical use case {#SPMTpyUC}
LDO->DCDC
It is recommended to switch to DCDC first before enabling the peripheral's power attached to it. Otherwise, it might cause Vdd_core undershooting during the switch if Vdd_rf domain loading is added. Switching to DCDC with less loading on Vdd_core domain is always perferred.
For Example 1: Vdd_rf = 1.8V, Vdd_core_1.2V
Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/spm
DCDC RUN->HSRUN
DCDC HSRUN is only supported while LDO->DCDC is done in RUN mode. We should avoid entering HSRUN mode with LDO(RCTRL[REGSEL]=3’b011) then LDO->DCDC(RCTRL[REGSEL]=3’b100) in HSRUN mode.
For example 2:
Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/spm
|
enum | spm_radio_low_power_mode_status_t {
kSPM_RadioLowPowerModeReserved = 0x0,
kSPM_RadioLowPowerModeVLPS = 0x1,
kSPM_RadioLowPowerModeLLS = 0x2,
kSPM_RadioLowPowerModeVLLS = 0x4
} |
| Status of last RADIO Power Mode Configuration. More...
|
|
enum | spm_mcu_low_power_mode_status_t {
kSPM_McuLowPowerModeReserved = 0U,
kSPM_McuLowPowerModeSTOP = 1U,
kSPM_McuLowPowerModeVLPS = (1U << 1),
kSPM_McuLowPowerModeLLS = (1U << 2),
kSPM_McuLowPowerModeVLLS23 = (1U << 3),
kSPM_McuLowPowerModeVLLS01 = (1U << 4)
} |
| Status of last MCU STOP Mode Power Configuration. More...
|
|
enum | _spm_ldo_regulator {
kSPM_CoreLdo = 1U,
kSPM_RfLdo = (1U << 1),
kSPM_DcdcLdo = (1U << 2)
} |
| define the mask code for LDO regulators. More...
|
|
enum | _spm_core_ldo_run_mode_config {
kSPM_CoreLdoRunModeEnableRtcPowerMonitor,
kSPM_CoreLdoRunModeEnableUsbPowerMonitor,
kSPM_CoreLdoRunModeEnableVddioPowerMonitor
} |
| Configure the CORE LDO in run modes. More...
|
|
enum | _spm_core_ldo_low_power_mode_config {
kSPM_CoreLdoLowPowerModeEnableRtcPowerMonitor,
kSPM_CoreLdoLowPowerModeEnableUsbPowerMonitor,
kSPM_CoreLdoLowPowerModeEnableVddioPowerMonitor,
kSPM_CoreLdoLowPowerModeEnableAllReference,
kSPM_CoreLdoLowPowerModeEnableHighDrive = SPM_CORELPCNFG_LPHIDRIVE_MASK,
kSPM_CoreLdoLowPowerModeEnableLVD,
kSPM_CoreLdoLowPowerModeEnablePOR = SPM_CORELPCNFG_POREN_MASK,
kSPM_CoreLdoLowPowerModeEnableLPO = SPM_CORELPCNFG_LPOEN_MASK,
kSPM_CoreLdoLowPowerModeEnableBandgapBufferHightDrive,
kSPM_CoreLdoLowPowerModeEnableBandgapBuffer = SPM_CORELPCNFG_BGBEN_MASK,
kSPM_CoreLdoLowPowerModeEnableBandgapInVLPx = SPM_CORELPCNFG_BGEN_MASK,
kSPM_CoreLdoLowPowerModeRemainInHighPower
} |
| Configure the CORE LDO in low power modes. More...
|
|
enum | spm_core_ldo_volt_select_t {
kSPM_CoreLdoVoltLevel1P2 = 0U,
kSPM_CoreLdoVoltLevel1P1 = 1U,
kSPM_CoreLdoVoltLevelOffset = 3U
} |
| Sets the Core LDO voltage level. More...
|
|
enum | spm_low_volt_detect_volt_select_t {
kSPM_LowVoltDetectLowTrip = 0U,
kSPM_LowVoltDetectHighTrip = 1U
} |
| Low-voltage Detect Voltage Select. More...
|
|
enum | spm_low_volt_warning_volt_select_t {
kSPM_LowVoltWarningLowTrip = 0U,
kSPM_LowVoltWarningMID1Trip = 1U,
kSPM_LowVoltWarningMID2Trip = 2U,
kSPM_LowVoltWarningHighTrip = 3U
} |
| Low-voltage Warning Voltage Select. More...
|
|
enum | spm_high_volt_detect_volt_select_t {
kSPM_HighVoltDetectLowTrip = 0U,
kSPM_HighVoltDetectHighTrip = 1U
} |
| High-voltage Detect Voltage Select. More...
|
|
enum | spm_rf_ldo_low_power_mode_t {
kSPM_RfLdoEnterLowPowerInLowPowerModes = 0U,
kSPM_RfLdoRemainInHighPowerInLowPowerModes
} |
| Defines the RF LDO low power behiavior when in low power modes. More...
|
|
enum | spm_rf_ldo_soft_start_duration_t {
kSPM_RfLdoSoftStartDuration110us = 0U,
kSPM_RfLdoSoftStartDuration95us = 1U,
kSPM_RfLdoSoftStartDuration60us = 2U,
kSPM_RfLdoSoftStartDuration48us = 3U,
kSPM_RfLdoSoftStartDuration38us = 4U,
kSPM_RfLdoSoftStartDuration30us = 5U,
kSPM_RfLdoSoftStartDuration24us = 6U,
kSPM_RfLdoSoftStartDuration17us = 7U
} |
| Selects the soft start duration delay for the IO 1.8 full power regulator. More...
|
|
enum | spm_rf_io_regulator_volt_select_t {
kSPM_RfIoRegulatorVoltLevel1p8 = 0U,
kSPM_RfIoRegulatorVoltLevel1p5 = 1U
} |
| IO Regulator Voltage Select. More...
|
|
enum | spm_rf_vdd_1p8_sns_pin_select_t {
kSPM_RfVdd1p8Sns0 = 0U,
kSPM_RfVdd1p8Sns1 = 1U
} |
| Selects which sns 1p8 vdd pin is used. More...
|
|
enum | spm_rf_ldo_volt_trim_select_t {
kSPM_RfLdoLowPowerVolt1p8Trim,
kSPM_RfLdoLowPowerVlot1p5Trim,
kSPM_RfLdoHighPowerVolt1p8Trim,
kSPM_RfLdoHighPowerVolt1p5Trim
} |
| Selects the trim point for RF LDO. More...
|
|
enum | spm_dcdc_vbat_adc_divider_t {
kSPM_DcdcVbatAdcOff = 0U,
kSPM_DcdcVbatAdcDivider1 = 1U,
kSPM_DcdcVbatAdcDivider2 = 2U,
kSPM_DcdcVbatAdcDivider4 = 3U
} |
| Defines the selection of DCDC vbat voltage divider for ADC measure. More...
|
|
enum | spm_low_power_req_out_pin_pol_t {
kSPM_LowPowerReqOutPinHighTruePol = 0U,
kSPM_LowPowerReqOutPinLowTruePol = 1U
} |
| Defines the selection of low power request pin out pin polarity. More...
|
|
enum | spm_dcdc_drive_strength_t {
kSPM_DcdcDriveStrengthWithNormal = 0U,
kSPM_DcdcDriveStrengthWithHalfFETs = 0x4,
kSPM_DcdcDriveStrengthWithDoubleFETs = 0x2,
kSPM_DcdcDriveStrengthWithExtraHalfFETs = 0x1,
kSPM_DcdcDriveStrengthWithHalfAndDoubleFETs = 0x6,
kSPM_DcdcDriveStrengthWithHalfAndExtraDoubleFETs = 0x5,
kSPM_DcdcDriveStrengthWithDoubleAndExtraDoubleFETs = 0x3,
kSPM_DcdcDriveStrengthWithAllFETs = 7U
} |
| Defines the selection of DCDC driver strength. More...
|
|
enum | _spm_dcdc_flags {
kSPM_DcdcStableOKFlag = SPM_DCDCSC_DCDC_STS_DC_OK_MASK,
kSPM_DcdcClockFaultFlag
} |
| DCDC flags. More...
|
|
|
void | SPM_SetDcdcBattMonitor (SPM_Type *base, uint32_t batAdcVal) |
| Sets DCDC battery monitor with its ADC value. More...
|
|
static void | SPM_SetDcdcVbatAdcMeasure (SPM_Type *base, spm_dcdc_vbat_adc_divider_t divider) |
| Sets DCDC VBAT voltage divider. More...
|
|
static void | SPM_EnablePowerDownCmpOffset (SPM_Type *base, bool enable) |
| Power down output range comparator. More...
|
|
static uint32_t | SPM_GetDcdcStatusFlags (SPM_Type *base) |
| Get the status flags of DCDC module. More...
|
|
void | SPM_EnableVddxStepLock (SPM_Type *base, bool enable) |
| Disable stepping for VDD1P8 and VDD1P2. More...
|
|
static void | SPM_SetDcdcDriveStrength (SPM_Type *base, spm_dcdc_drive_strength_t strength) |
| Set the DCDC drive strength. More...
|
|
void | SPM_BypassDcdcBattMonitor (SPM_Type *base, bool enable, uint32_t value) |
| Bypasses the ADC measure value. More...
|
|
void | SPM_SetDcdcIntegratorConfig (SPM_Type *base, const spm_dcdc_integrator_config_t *config) |
| Configure the DCDC integrator value. More...
|
|
static void | SPM_SetDcdcVdd1p2ValueHsrun (SPM_Type *base, uint32_t value) |
| Sets the target value of VDD1P2 in buck HSRUN mode. More...
|
|
static void | SPM_SetDcdcVdd1p2ValueBuck (SPM_Type *base, uint32_t value) |
| Sets the target value of VDD1P2 in buck mode. More...
|
|
static void | SPM_SetDcdcVdd1p8Value (SPM_Type *base, uint32_t value) |
| Sets the target value of VDD1P8. More...
|
|
uint16_t spm_version_id_t::feature |
uint8_t spm_version_id_t::minor |
uint8_t spm_version_id_t::major |
struct spm_regulator_status_t |
bool spm_regulator_status_t::isRadioRunForcePowerModeOn |
bool spm_regulator_status_t::isDcdcLdoOn |
bool spm_regulator_status_t::isRfLdoOn |
bool spm_regulator_status_t::isCoreLdoOn |
struct spm_low_volt_detect_config_t |
This structure reuses the configuration structure from legacy PMC module.
bool spm_low_volt_detect_config_t::enableIntOnVddLowVolt |
bool spm_low_volt_detect_config_t::enableResetOnVddLowVolt |
bool spm_low_volt_detect_config_t::enableIntOnCoreLowVolt |
bool spm_low_volt_detect_config_t::enableResetOnCoreLowVolt |
struct spm_low_volt_warning_config_t |
struct spm_high_volt_detect_config_t |
This structure reuses the configuration structure from legacy PMC module.
struct spm_rf_ldo_config_t |
bool spm_rf_ldo_config_t::enableCurSink |
struct spm_dcdc_integrator_config_t |
double spm_dcdc_integrator_config_t::vdd1p2Value |
double spm_dcdc_integrator_config_t::vBatValue |
struct spm_power_switch_delay_config_t |
uint32_t spm_power_switch_delay_config_t::coreRegFromDeepPowerDownToIso |
uint32_t spm_power_switch_delay_config_t::coreRegFromLowPowerToIso |
uint32_t spm_power_switch_delay_config_t::lowPowerToBandgapOn |
uint32_t spm_power_switch_delay_config_t::dcdcStartupDelay |
uint32_t spm_power_switch_delay_config_t::ldoCoreSwitchHsrunDelay |
struct spm_low_power_req_out_pin_config_t |
bool spm_low_power_req_out_pin_config_t::pinOutEnable |
Enumerator |
---|
kSPM_RadioLowPowerModeReserved |
Reserved.
|
kSPM_RadioLowPowerModeVLPS |
Current Power mode is VLPS.
|
kSPM_RadioLowPowerModeLLS |
Current Power mode is LLS.
|
kSPM_RadioLowPowerModeVLLS |
Current Power mode is VLLS.
|
Enumerator |
---|
kSPM_McuLowPowerModeReserved |
Reserved.
|
kSPM_McuLowPowerModeSTOP |
Last Low Power mode is STOP.
|
kSPM_McuLowPowerModeVLPS |
Last Low Power mode is VLPS.
|
kSPM_McuLowPowerModeLLS |
Last Low Power mode is LLS.
|
kSPM_McuLowPowerModeVLLS23 |
Last Low Power mode is VLLS23.
|
kSPM_McuLowPowerModeVLLS01 |
Last Low Power mode is VLLS01.
|
These mask can be combined with 'or' as a parameter to any function.
Enumerator |
---|
kSPM_CoreLdo |
Mask code for CORE LDO.
|
kSPM_RfLdo |
Mask code for RF LDO.
|
kSPM_DcdcLdo |
Mask code for DCDC LDO.
|
Enumerator |
---|
kSPM_CoreLdoRunModeEnableRtcPowerMonitor |
RTC power monitor enabled in run modes.
|
kSPM_CoreLdoRunModeEnableUsbPowerMonitor |
USB power monitor enabled in run modes.
|
kSPM_CoreLdoRunModeEnableVddioPowerMonitor |
VDDIO power monitor enabled in run modes.
|
Enumerator |
---|
kSPM_CoreLdoLowPowerModeEnableRtcPowerMonitor |
RTC power monitor enabled in LP modes.
|
kSPM_CoreLdoLowPowerModeEnableUsbPowerMonitor |
USB power monitor enabled in LP modes.
|
kSPM_CoreLdoLowPowerModeEnableVddioPowerMonitor |
VDDIO power monitor enabled in LP modes.
|
kSPM_CoreLdoLowPowerModeEnableAllReference |
Enable all reference (bandgap, WELL BIAS, 1k clk and LP 25na) in VLLS.
|
kSPM_CoreLdoLowPowerModeEnableHighDrive |
Enable high driver in low power.
|
kSPM_CoreLdoLowPowerModeEnableLVD |
Enable level voltage detect in VLP/STOP modes.
|
kSPM_CoreLdoLowPowerModeEnablePOR |
POR brownout remains enabled in VLLS mode.
|
kSPM_CoreLdoLowPowerModeEnableLPO |
LPO remains enabled in VLLS modes.
|
kSPM_CoreLdoLowPowerModeEnableBandgapBufferHightDrive |
Enable the high drive for Bandgap Buffer.
|
kSPM_CoreLdoLowPowerModeEnableBandgapBuffer |
Enable Bandgap Buffer.
|
kSPM_CoreLdoLowPowerModeEnableBandgapInVLPx |
Enable Bandgap in VLPx mode.
|
kSPM_CoreLdoLowPowerModeRemainInHighPower |
Core LDO remains in high power state in VLP/Stop modes.
|
Enumerator |
---|
kSPM_CoreLdoVoltLevel1P2 |
Regulate to 1.2V set by the CORETRIM[VTRIM1P2] register.
|
kSPM_CoreLdoVoltLevel1P1 |
Regulate to 1.1V set by the CORETRIM[VTRIM1P1] register.
|
kSPM_CoreLdoVoltLevelOffset |
Regulate to Offset Voltage set by CORETRIM[OFFVTRIM] register.
|
Enumerator |
---|
kSPM_LowVoltDetectLowTrip |
Low-trip point selected (VLVD = VLVDL )
|
kSPM_LowVoltDetectHighTrip |
High-trip point selected (VLVD = VLVDH )
|
Enumerator |
---|
kSPM_LowVoltWarningLowTrip |
Low-trip point selected (VLVW = VLVW1)
|
kSPM_LowVoltWarningMID1Trip |
Mid1-trip point selected (VLVW = VLVW2)
|
kSPM_LowVoltWarningMID2Trip |
Mid2-trip point selected (VLVW = VLVW3)
|
kSPM_LowVoltWarningHighTrip |
High-trip point selected (VLVW = VLVW4)
|
Enumerator |
---|
kSPM_HighVoltDetectLowTrip |
Low-trip point selected (VHVD = VHVDL )
|
kSPM_HighVoltDetectHighTrip |
High-trip point selected (VHVD = VHVDH )
|
Enumerator |
---|
kSPM_RfLdoEnterLowPowerInLowPowerModes |
RF LDO regulator enters low power state in VLP/Stop modes.
|
kSPM_RfLdoRemainInHighPowerInLowPowerModes |
RF LDO regulator remains in high power state in VLP/Stop modes.
|
Enumerator |
---|
kSPM_RfLdoSoftStartDuration110us |
110 us.
|
kSPM_RfLdoSoftStartDuration95us |
95 us.
|
kSPM_RfLdoSoftStartDuration60us |
60 us.
|
kSPM_RfLdoSoftStartDuration48us |
48 us.
|
kSPM_RfLdoSoftStartDuration38us |
38 us.
|
kSPM_RfLdoSoftStartDuration30us |
30 us.
|
kSPM_RfLdoSoftStartDuration24us |
24 us.
|
kSPM_RfLdoSoftStartDuration17us |
17 us.
|
Enumerator |
---|
kSPM_RfIoRegulatorVoltLevel1p8 |
Regulate to 1.8V.
|
kSPM_RfIoRegulatorVoltLevel1p5 |
Regulate to 1.5V.
|
Enumerator |
---|
kSPM_RfVdd1p8Sns0 |
VDD1p8_SNS0 selected.
|
kSPM_RfVdd1p8Sns1 |
VDD1p8_SNS1 selected.
|
Enumerator |
---|
kSPM_RfLdoLowPowerVolt1p8Trim |
RF LDO Low Power 1.8V trim point value.
|
kSPM_RfLdoLowPowerVlot1p5Trim |
RF LDO Low Power 1.5V trim point value.
|
kSPM_RfLdoHighPowerVolt1p8Trim |
RF LDO High Power 1.8V trim point value.
|
kSPM_RfLdoHighPowerVolt1p5Trim |
RF LDO High Power 1.5V trim point value/.
|
Enumerator |
---|
kSPM_DcdcVbatAdcOff |
OFF.
|
kSPM_DcdcVbatAdcDivider1 |
VBAT.
|
kSPM_DcdcVbatAdcDivider2 |
VBAT /2.
|
kSPM_DcdcVbatAdcDivider4 |
VBAT /4.
|
Enumerator |
---|
kSPM_LowPowerReqOutPinHighTruePol |
High true polarity.
|
kSPM_LowPowerReqOutPinLowTruePol |
Low true polarity.
|
The more FETs are enabled, the more drive strength DCDC would provide.
Enumerator |
---|
kSPM_DcdcDriveStrengthWithNormal |
No additional FET setting.
|
kSPM_DcdcDriveStrengthWithHalfFETs |
Half FETs.
|
kSPM_DcdcDriveStrengthWithDoubleFETs |
Double FETs.
|
kSPM_DcdcDriveStrengthWithExtraHalfFETs |
Half FETs.
|
kSPM_DcdcDriveStrengthWithHalfAndDoubleFETs |
Half + Double FETs.
|
kSPM_DcdcDriveStrengthWithHalfAndExtraDoubleFETs |
Half + Extra Double FETs.
|
kSPM_DcdcDriveStrengthWithDoubleAndExtraDoubleFETs |
Double + Extra Double FETs.
|
kSPM_DcdcDriveStrengthWithAllFETs |
Half + Double + Extra Double FETs.
|
Enumerator |
---|
kSPM_DcdcStableOKFlag |
Status flag to indicate DCDC lock.
|
kSPM_DcdcClockFaultFlag |
Asserts if DCDC detect a clk fault.
Will cause a system lvd reset to assert.
|
This function gets the SPM version ID, including major version number, minor version number, and a feature specification number.
- Parameters
-
base | SPM peripheral base address. |
versionId | Pointer to version ID structure. |
static void SPM_EnableRegulatorInRunMdoe |
( |
SPM_Type * |
base, |
|
|
bool |
enable, |
|
|
uint32_t |
ldoMask |
|
) |
| |
|
inlinestatic |
This function controls which regulator (CORE LDO, RF LDO, and DCDC) are enabled in RUN and HSRUN modes. It sets the SPM_RCTRL register. Note that the RCTRL bits are reset solely on a POR/LVD only event.
- Parameters
-
base | SPM peripheral base address. |
enable | Enable or disable the LDOs list in ldoMask. |
ldoMask | Mask value of LDO list. See to _spm_ldo_regulator. |
static void SPM_EnableRegulatorInLowPowerMode |
( |
SPM_Type * |
base, |
|
|
bool |
enable, |
|
|
uint32_t |
ldoMask |
|
) |
| |
|
inlinestatic |
This function controls which regulator (CORE LDO, RF LDO, and DCDC) are enabled in low power modes. It sets the SPM_LPCTRL register. Note that the SPM_LPCTRL bits are reset solely on a POR/LVD only event.
- Parameters
-
base | SPM peripheral base address. |
enable | Enable or disable the LDOs list in ldoMask. |
ldoMask | Mask value of LDO list. |
static void SPM_SetCoreLdoRunModeConfig |
( |
SPM_Type * |
base, |
|
|
uint32_t |
configMask |
|
) |
| |
|
inlinestatic |
static void SPM_SetCoreLdoLowPowerModeConfig |
( |
SPM_Type * |
base, |
|
|
uint32_t |
configMask |
|
) |
| |
|
inlinestatic |
static bool SPM_GetCoreLdoInRunRegulationFlag |
( |
SPM_Type * |
base | ) |
|
|
inlinestatic |
- Parameters
-
base | SPM peripheral base address. |
- Return values
-
true | Regulator is in run regulation. |
false | Regulator is in stop regulation or in transition to/from it. |
static bool SPM_GetPeriphIOIsolationFlag |
( |
SPM_Type * |
base | ) |
|
|
inlinestatic |
This function reads the Acknowledge Isolation setting that indicates whether certain peripherals and the I/O pads are in a latched state as a result of having been in the VLLS mode.
- Parameters
-
base | SPM peripheral base address. |
- Returns
- ACK isolation 0 - Peripherals and I/O pads are in a normal run state. 1 - Certain peripherals and I/O pads are in an isolated and latched state.
static void SPM_ClearPeriphIOIsolationFlag |
( |
SPM_Type * |
base | ) |
|
|
inlinestatic |
This function clears the ACK Isolation flag. Writing one to this setting when it is set releases the I/O pads and certain peripherals to their normal run mode state.
- Parameters
-
base | SPM peripheral base address. |
This function configures the low-voltage detect setting, including the trip point voltage setting, enables or disables the interrupt, enables or disables the system reset.
- Parameters
-
static bool SPM_GetVddLowVoltDetectFlag |
( |
SPM_Type * |
base | ) |
|
|
inlinestatic |
- Parameters
-
base | SPM peripheral base address. |
- Returns
- Current low-voltage detect flag
- true: Low-voltage detected
- false: Low-voltage not detected
static void SPM_ClearVddLowVoltDetectFlag |
( |
SPM_Type * |
base | ) |
|
|
inlinestatic |
This function acknowledges the low-voltage detection errors.
- Parameters
-
base | SPM peripheral base address. |
static bool SPM_GetCoreLowVoltDetectFlag |
( |
SPM_Type * |
base | ) |
|
|
inlinestatic |
This function reads the current LVDF status. If it returns 1, a low-voltage event is detected.
- Parameters
-
base | SPM peripheral base address. |
- Returns
- Current low-voltage detect flag
- true: Low-voltage detected
- false: Low-voltage not detected
static void SPM_ClearCoreLowVoltDetectFlag |
( |
SPM_Type * |
base | ) |
|
|
inlinestatic |
This function acknowledges the CORE VDD low-voltage detection errors.
- Parameters
-
base | SPM peripheral base address. |
This function configures the low-voltage warning setting, including the trip point voltage setting and enabling or disabling the interrupt.
- Parameters
-
static bool SPM_GetVddLowVoltWarningFlag |
( |
SPM_Type * |
base | ) |
|
|
inlinestatic |
This function polls the current LVWF status. When 1 is returned, it indicates a low-voltage warning event. LVWF is set when V Supply transitions below the trip point or after reset and V Supply is already below the V LVW.
- Parameters
-
base | SPM peripheral base address. |
- Returns
- Current LVWF status
- true: Low-voltage Warning Flag is set.
- false: the Low-voltage Warning does not happen.
static void SPM_ClearLowVoltWarningFlag |
( |
SPM_Type * |
base | ) |
|
|
inlinestatic |
This function acknowledges the low voltage warning errors (write 1 to clear LVWF).
- Parameters
-
base | SPM peripheral base address. |
This function configures the high-voltage detect setting, including the trip point voltage setting, enabling or disabling the interrupt, enabling or disabling the system reset.
- Parameters
-
static bool SPM_GetHighVoltDetectFlag |
( |
SPM_Type * |
base | ) |
|
|
inlinestatic |
This function reads the current HVDF status. If it returns 1, a low voltage event is detected.
- Parameters
-
base | SPM peripheral base address. |
- Returns
- Current high-voltage detect flag
- true: High-voltage detected
- false: High-voltage not detected
static void SPM_ClearHighVoltDetectFlag |
( |
SPM_Type * |
base | ) |
|
|
inlinestatic |
This function acknowledges the high-voltage detection errors (write 1 to clear HVDF).
- Parameters
-
base | SPM peripheral base address. |
- Parameters
-
base | SPM peripheral base address. |
config | Pointer to configuration structure, see to spm_rf_ldo_config_t. |
void SPM_SetDcdcBattMonitor |
( |
SPM_Type * |
base, |
|
|
uint32_t |
batAdcVal |
|
) |
| |
For better accuracy, software would call this function to set the battery voltage value into DCDC measured by ADC.
- Parameters
-
base | SPM peripheral base address. |
batAdcVal | ADC measured battery value with an 8mV LSB resolution. Value 0 would disable the battery monitor. |
The divided VBAT output is input to an ADC channel which allows the battery voltage to be measured.
- Parameters
-
static void SPM_EnablePowerDownCmpOffset |
( |
SPM_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | SPM peripheral base address. |
enable | Power down the CMP or not. |
static uint32_t SPM_GetDcdcStatusFlags |
( |
SPM_Type * |
base | ) |
|
|
inlinestatic |
- Parameters
-
base | SPM peripheral base address. |
- Returns
- Mask value of flags. See to _spm_dcdc_flags.
void SPM_EnableVddxStepLock |
( |
SPM_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
Must lock the step for VDD1P8 and VDD1p2 before enteing low power modes.
- Parameters
-
base | SPM peripheral base address. |
enable | Enable the lock or not to VDDx stepping. |
Do set the DCDC drive strength according to actuall loading. The related register bits are:
- DCDCC3[DCDC_MINPWR_HALF_FETS]
- DCDCC3[DCDC_MINPWR_DOUBLE_FETS]
- DCDCC3[DCDC_MINPWR_EXTRA_DOUBLE_FETS] The more FETs are enabled, the more drive strength DCDC would provide.
- Parameters
-
void SPM_BypassDcdcBattMonitor |
( |
SPM_Type * |
base, |
|
|
bool |
enable, |
|
|
uint32_t |
value |
|
) |
| |
Forces DCDC to bypass the adc measuring state and loads the user-defined value in this function.
- Parameters
-
base | SPM peripheral base address. |
enable | Enable the bypass or not. |
value | User-setting value to be available instead of ADC measured value. |
Integrator value can be loaded in pulsed mode. Software can program this value according to battery voltage and VDD1P2 output target value before goes to the pulsed mode.
- Parameters
-
base | SPM peripheral base address. |
config | Pointer to configuration structure, see to spm_dcdc_integrator_config_t. Passing NULL would clear all user-defined setting and use hardware default setting. |
static void SPM_SetDcdcVdd1p2ValueHsrun |
( |
SPM_Type * |
base, |
|
|
uint32_t |
value |
|
) |
| |
|
inlinestatic |
Sets target value of VDD1P2 in buck HSRUN mode. 25 mV each step from 0x00 to 0x0F. This value is automatically selected on entry into HSRUN. On exit from HSRUN, DCDC VDD1P2 trim values will default back to values set by DCDC_VDD1P2CTRL_TRG_BUCK register, which is operated with the API of SPM_SetDcdcVdd1p2ValueBuck().
- Parameters
-
base | SPM peripheral base address. |
value | Setting value of VDD1P2 in buck HSRUN mode. |
static void SPM_SetDcdcVdd1p2ValueBuck |
( |
SPM_Type * |
base, |
|
|
uint32_t |
value |
|
) |
| |
|
inlinestatic |
Sets the target value of VDD1P2 in buck mode, 25 mV each step from 0x00 to 0x0F.
- Parameters
-
base | SPM peripheral base address. |
value | Setting value of VDD1P2 in buck mode. |
static void SPM_SetDcdcVdd1p8Value |
( |
SPM_Type * |
base, |
|
|
uint32_t |
value |
|
) |
| |
|
inlinestatic |
Sets the target value of VDD1P8 in buck mode, 25 mV each step from 0x00 to 0x3F.
- Parameters
-
base | SPM peripheral base address. |
value | Setting value of VDD1P8 output. |