The Power Management Controller (PMC) contains the internal voltage regulator, power on reset (POR), and low voltage detect system.
The PMC HAL driver provides these APIs:
- APIs for low voltage detection
- APIs for band gap setting
- APIs for I/O latch state
The low voltage detection can be configured by these functions: PMC_HAL_LowVoltDetectConfig() and PMC_HAL_LowVoltWarnConfig().
Use the function PMC_HAL_GetLowVoltDetectFlag()/PMC_HAL_GetLowVoltWarnFlag() to check the low voltage detection state. Use the function PMC_HAL_SetLowVoltDetectAck()/PMC_HAL_SetLowVoltWarnAck() to clear the flags.
To configure the band gap, use the PMC_HAL_BandgapBufferConfig()function. For I/O latch state, use the PMC_HAL_GetAckIsolation()/PMC_HAL_ClearAckIsolation() function.
struct pmc_bandgap_buffer_config_t |
bool pmc_bandgap_buffer_config_t::enable |
Enumerator |
---|
kPmcLowVoltWarnVoltLowTrip |
Low trip point selected (VLVW = VLVW1)
|
kPmcLowVoltWarnVoltMid1Trip |
Mid 1 trip point selected (VLVW = VLVW2)
|
kPmcLowVoltWarnVoltMid2Trip |
Mid 2 trip point selected (VLVW = VLVW3)
|
kPmcLowVoltWarnVoltHighTrip |
High trip point selected (VLVW = VLVW4)
|
Enumerator |
---|
kPmcLowVoltDetectVoltLowTrip |
Low trip point selected (V LVD = V LVDL )
|
kPmcLowVoltDetectVoltHighTrip |
High trip point selected (V LVD = V LVDH )
|
This function configures the low voltage detect setting, including the trip point voltage setting, enable interrupt or not, enable MCU reset or not.
- Parameters
-
base | Base address for current PMC instance. |
enableInt | Enable interrupt or not when low voltage detect. |
enableReset | Enable MCU reset or not when low voltage detect. |
voltSelect | Low voltage detect trip point voltage. |
static void PMC_HAL_SetLowVoltDetectAck |
( |
PMC_Type * |
base | ) |
|
|
inlinestatic |
This function acknowledges the low voltage detection errors (write 1 to clear LVDF).
- Parameters
-
base | Base address for current PMC instance. |
static bool PMC_HAL_GetLowVoltDetectFlag |
( |
PMC_Type * |
base | ) |
|
|
inlinestatic |
This function reads the current LVDF status. If it returns 1, a low voltage event is detected.
- Parameters
-
base | Base address for current PMC instance. |
- Returns
- Current low voltage detect flag
- true: Low-Voltage detected
- false: Low-Voltage not detected
This function configures the low voltage warning setting, including the trip point voltage setting and enable interrupt or not.
- Parameters
-
base | Base address for current PMC instance. |
enableInt | Enable interrupt or not when low voltage detect. |
voltSelect | Low voltage detect trip point voltage. |
static void PMC_HAL_SetLowVoltWarnAck |
( |
PMC_Type * |
base | ) |
|
|
inlinestatic |
This function acknowledges the low voltage warning errors (write 1 to clear LVWF).
- Parameters
-
base | Base address for current PMC instance. |
static bool PMC_HAL_GetLowVoltWarnFlag |
( |
PMC_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 | Base address for current PMC instance. |
- Returns
- Current LVWF status
- true: Low-Voltage Warning Flag is set.
- false: the Low-Voltage Warning does not happen.
This function configures the PMC bandgap, including the drive select and behavior in low power mode.
- Parameters
-
base | Base address for current PMC instance. |
config | Pointer to the configuration. |
static uint8_t PMC_HAL_GetAckIsolation |
( |
PMC_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 | Base address for current PMC instance. |
- 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 PMC_HAL_ClearAckIsolation |
( |
PMC_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 | Base address for current PMC instance. |
static uint8_t PMC_HAL_GetRegulatorStatus |
( |
PMC_Type * |
base | ) |
|
|
inlinestatic |
This function returns the regulator to a run regulation status. It provides the current status of the internal voltage regulator.
- Parameters
-
base | Base address for current PMC instance. |
- Returns
- Regulation status 0 - Regulator is in a stop regulation or in transition to/from the regulation. 1 - Regulator is in a run regulation.