![]() |
MCUXpresso SDK API Reference Manual
Rev 2.16.000
NXP Semiconductors
|
The MCUXpresso SDK provides a peripheral driver for the General Power Controller (GPC) module of MCUXpresso SDK devices.
API functions are provided to configure the system about working in dedicated power mode. There are mainly about enabling the power for memory, enabling the wakeup sources for Partial Sleep mode, and power up/down operations.
Data Structures | |
struct | _gpc_tran_step_config |
Configuration for GPC transition step. More... | |
Typedefs | |
typedef enum _gpc_cm_standby_mode_status | gpc_cm_standby_mode_status_t |
CPU standby mode status. More... | |
typedef enum _gpc_cm_tran_step | gpc_cm_tran_step_t |
CPU mode transition step in sleep/wakeup sequence. More... | |
typedef enum _gpc_tran_step_counter_mode | gpc_tran_step_counter_mode_t |
Step counter work mode. More... | |
typedef enum _gpc_sp_tran_step | gpc_sp_tran_step_t |
GPC set point transition steps. More... | |
typedef enum _gpc_cpu_mode | gpc_cpu_mode_t |
CPU mode. More... | |
typedef struct _gpc_tran_step_config | gpc_tran_step_config_t |
Configuration for GPC transition step. More... | |
typedef enum _gpc_cm_wakeup_sp_sel | gpc_cm_wakeup_sp_sel_t |
CPU wakeup sequence setpoint options. More... | |
typedef enum _gpc_stby_tran_step | gpc_stby_tran_step_t |
GPC standby mode transition steps. More... | |
typedef enum _gpc_cpu_domain_name | gpc_cpu_domain_name_t |
GPC CPU domain name, used to select the CPU domain. | |
Driver version | |
#define | FSL_GPC_RIVER_VERSION (MAKE_VERSION(2, 3, 1)) |
GPC driver version 2.3.1. More... | |
CPU mode control | |
static void | GPC_CM_EnableCpuSleepHold (GPC_CPU_MODE_CTRL_Type *base, bool enable) |
static void | GPC_CM_SetNextCpuMode (GPC_CPU_MODE_CTRL_Type *base, gpc_cpu_mode_t mode) |
Set the CPU mode on the next sleep event. More... | |
static gpc_cpu_mode_t | GPC_CM_GetCurrentCpuMode (GPC_CPU_MODE_CTRL_Type *base) |
Get current CPU mode. More... | |
static gpc_cpu_mode_t | GPC_CM_GetPreviousCpuMode (GPC_CPU_MODE_CTRL_Type *base) |
Get previous CPU mode. More... | |
void | GPC_CM_EnableIrqWakeup (GPC_CPU_MODE_CTRL_Type *base, uint32_t irqId, bool enable) |
Enable IRQ wakeup request. More... | |
static void | GPC_CM_EnableNonIrqWakeup (GPC_CPU_MODE_CTRL_Type *base, uint32_t mask, bool enable) |
Enable Non-IRQ wakeup request. More... | |
bool | GPC_CM_GetIrqWakeupStatus (GPC_CPU_MODE_CTRL_Type *base, uint32_t irqId) |
Get the status of the IRQ wakeup request. More... | |
static bool | GPC_CM_GetNonIrqWakeupStatus (GPC_CPU_MODE_CTRL_Type *base, uint32_t mask) |
Get the status of the Non-IRQ wakeup request. More... | |
void | GPC_CM_ConfigCpuModeTransitionStep (GPC_CPU_MODE_CTRL_Type *base, gpc_cm_tran_step_t step, const gpc_tran_step_config_t *config) |
Config the cpu mode transition step. More... | |
void | GPC_CM_RequestSleepModeSetPointTransition (GPC_CPU_MODE_CTRL_Type *base, uint8_t setPointSleep, uint8_t setPointWakeup, gpc_cm_wakeup_sp_sel_t wakeupSel) |
Request a set point transition before the CPU transfers into a sleep mode. More... | |
void | GPC_CM_RequestRunModeSetPointTransition (GPC_CPU_MODE_CTRL_Type *base, uint8_t setPointRun) |
Request a set point transition during run mode. More... | |
static void | GPC_CM_SetSetPointMapping (GPC_CPU_MODE_CTRL_Type *base, uint32_t setPoint, uint32_t setpoint_map) |
Set the set point mapping value for each set point. More... | |
void | GPC_CM_SetCpuModeSetPointMapping (GPC_CPU_MODE_CTRL_Type *base, gpc_cpu_mode_t mode, uint32_t setpoint_map) |
Set the set point mapping value for each cpu mode. More... | |
void | GPC_CM_RequestStandbyMode (GPC_CPU_MODE_CTRL_Type *base, const gpc_cpu_mode_t mode) |
Request the chip into standby mode. More... | |
void | GPC_CM_ClearStandbyModeRequest (GPC_CPU_MODE_CTRL_Type *base, const gpc_cpu_mode_t mode) |
Clear the standby mode request. More... | |
static bool | GPC_CM_GetStandbyModeStatus (GPC_CPU_MODE_CTRL_Type *base, uint32_t mask) |
Get the status of the CPU standby mode transition. More... | |
static uint32_t | GPC_CM_GetInterruptStatusFlags (GPC_CPU_MODE_CTRL_Type *base) |
Get the status flags of the GPC CPU module. More... | |
void | GPC_CM_ClearInterruptStatusFlags (GPC_CPU_MODE_CTRL_Type *base, uint32_t mask) |
Clears CPU module interrut status flags. More... | |
Set point request control | |
static void | GPC_SP_SetSetpointPriority (GPC_SET_POINT_CTRL_Type *base, uint32_t setPoint, uint32_t priority) |
Set the priority of set point. More... | |
void | GPC_SP_ConfigSetPointTransitionStep (GPC_SET_POINT_CTRL_Type *base, gpc_sp_tran_step_t step, const gpc_tran_step_config_t *config) |
Config the set point transition step. More... | |
static uint8_t | GPC_SP_GetCurrentSetPoint (GPC_SET_POINT_CTRL_Type *base) |
Get system current setpoint, only valid when setpoint trans not busy. More... | |
static uint8_t | GPC_SP_GetPreviousSetPoint (GPC_SET_POINT_CTRL_Type *base) |
Get system previous setpoint, only valid when setpoint trans not busy. More... | |
static uint8_t | GPC_SP_GetTargetSetPoint (GPC_SET_POINT_CTRL_Type *base) |
Get target setpoint. More... | |
Standby mode control | |
void | GPC_STBY_ConfigStandbyTransitionStep (GPC_STBY_CTRL_Type *base, gpc_stby_tran_step_t step, const gpc_tran_step_config_t *config) |
Config the standby transition step. More... | |
static void | GPC_STBY_ForceCoreRequestStandbyMode (GPC_STBY_CTRL_Type *base, gpc_cpu_domain_name_t cpuName) |
Force selected CPU requesting standby mode. More... | |
Driver version | |
#define | FSL_GPC_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) |
GPC driver version 2.0.0. More... | |
Memory power Control | |
static void | GPC_EnableMemoryGate (GPC_Type *base, uint32_t modules, bool enable) |
Control power for memory. More... | |
Partial sleep source | |
void | GPC_EnablePartialSleepWakeupSource (GPC_Type *base, gpc_wakeup_source_t source, bool enable) |
Enable the modules as wakeup sources of PSLEEP (Partial Sleep) mode. More... | |
bool | GPC_GetPartialSleepWakeupFlag (GPC_Type *base, gpc_wakeup_source_t source) |
Get if indicated wakeup module just caused the wakeup event to exit PSLEEP mode. More... | |
static void | GPC_EnablePartialSleepMode (GPC_Type *base, bool enable) |
Switch to the Partial Sleep mode. More... | |
Power gate control | |
static void | GPC_ConfigPowerUpSequence (GPC_Type *base, uint32_t sw, uint32_t sw2iso) |
Configure the power up sequence. More... | |
static void | GPC_ConfigPowerDownSequence (GPC_Type *base, uint32_t iso, uint32_t iso2w) |
Configure the power down sequence. More... | |
static uint32_t | GPC_GetStatusFlags (GPC_Type *base) |
Get the status flags of GPC. More... | |
static void | GPC_ClearStatusFlags (GPC_Type *base, uint32_t flags) |
Clear the status flags of GPC. More... | |
struct _gpc_tran_step_config |
Data Fields | |
uint32_t | stepCount |
Step count, which is depended on the value of cntMode. More... | |
gpc_tran_step_counter_mode_t | cntMode |
Step counter working mode. More... | |
bool | enableStep |
Enable the step. More... | |
uint32_t _gpc_tran_step_config::stepCount |
gpc_tran_step_counter_mode_t _gpc_tran_step_config::cntMode |
bool _gpc_tran_step_config::enableStep |
#define FSL_GPC_RIVER_VERSION (MAKE_VERSION(2, 3, 1)) |
#define FSL_GPC_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) |
typedef enum _gpc_cm_standby_mode_status gpc_cm_standby_mode_status_t |
typedef enum _gpc_cm_tran_step gpc_cm_tran_step_t |
typedef enum _gpc_tran_step_counter_mode gpc_tran_step_counter_mode_t |
typedef enum _gpc_sp_tran_step gpc_sp_tran_step_t |
typedef enum _gpc_cpu_mode gpc_cpu_mode_t |
typedef struct _gpc_tran_step_config gpc_tran_step_config_t |
typedef enum _gpc_cm_wakeup_sp_sel gpc_cm_wakeup_sp_sel_t |
typedef enum _gpc_stby_tran_step gpc_stby_tran_step_t |
anonymous enum |
anonymous enum |
enum _gpc_cm_tran_step |
enum _gpc_sp_tran_step |
enum _gpc_cpu_mode |
enum _gpc_stby_tran_step |
enum _gpc_cpu_domain_name |
enum _gpc_status_flags |
|
inlinestatic |
This function configures the CPU mode that the CPU core will transmit to on next sleep event.
base | GPC CPU module base address. |
mode | The CPU mode that the core will transmit to, refer to "gpc_cpu_mode_t". |
|
inlinestatic |
base | GPC CPU module base address. |
|
inlinestatic |
base | GPC CPU module base address. |
void GPC_CM_EnableIrqWakeup | ( | GPC_CPU_MODE_CTRL_Type * | base, |
uint32_t | irqId, | ||
bool | enable | ||
) |
This function enables the IRQ request which can wakeup the CPU platform.
base | GPC CPU module base address. |
irqId | ID of the IRQ, accessible range is 0-255. |
enable | Enable the IRQ request or not. |
|
inlinestatic |
This function enables the non-IRQ request which can wakeup the CPU platform.
base | GPC CPU module base address. |
mask | Non-IRQ type, refer to "_gpc_cm_non_irq_wakeup_request". |
enable | Enable the Non-IRQ request or not. |
bool GPC_CM_GetIrqWakeupStatus | ( | GPC_CPU_MODE_CTRL_Type * | base, |
uint32_t | irqId | ||
) |
base | GPC CPU module base address. |
irqId | ID of the IRQ, accessible range is 0-255. |
|
inlinestatic |
base | GPC CPU module base address. |
mask | Non-IRQ type, refer to "_gpc_cm_non_irq_wakeup_request". |
void GPC_CM_ConfigCpuModeTransitionStep | ( | GPC_CPU_MODE_CTRL_Type * | base, |
gpc_cm_tran_step_t | step, | ||
const gpc_tran_step_config_t * | config | ||
) |
base | GPC CPU module base address. |
step | step type, refer to "gpc_cm_tran_step_t". |
config | transition step configuration, refer to "gpc_tran_step_config_t". |
void GPC_CM_RequestSleepModeSetPointTransition | ( | GPC_CPU_MODE_CTRL_Type * | base, |
uint8_t | setPointSleep, | ||
uint8_t | setPointWakeup, | ||
gpc_cm_wakeup_sp_sel_t | wakeupSel | ||
) |
This function triggers the set point transition during a CPU Sleep/wakeup event and selects which one the CMC want to transfer to.
base | GPC CPU module base address. |
setPointSleep | The set point CPU want the system to transit to on next CPU platform sleep sequence. |
setPointWakeup | The set point CPU want the system to transit to on next CPU platform wakeup sequence. |
wakeupSel | Select the set point transition on the next CPU platform wakeup sequence. |
void GPC_CM_RequestRunModeSetPointTransition | ( | GPC_CPU_MODE_CTRL_Type * | base, |
uint8_t | setPointRun | ||
) |
This function triggers the set point transition and selects which one the CMC want to transfer to.
base | GPC CPU module base address. |
setPointRun | The set point CPU want the system to transit in the run mode. |
|
inlinestatic |
This function configures which set point is allowed after current set point. If there are multiple setpoints, use:
base | GPC CPU module base address. |
setPoint | Set point index, available range is 0-15. |
setpoint_map | Map value of the set point. Refer to "_gpc_setpoint_map". |
void GPC_CM_SetCpuModeSetPointMapping | ( | GPC_CPU_MODE_CTRL_Type * | base, |
gpc_cpu_mode_t | mode, | ||
uint32_t | setpoint_map | ||
) |
This function configures which set point is allowed when CPU enters RUN/WAIT/STOP/SUSPEND. If there are multiple setpoints, use:
base | GPC CPU module base address. |
mode | CPU mode. Refer to "gpc_cpu_mode_t". |
setpoint_map | Map value of the set point. Refer to "_gpc_setpoint_map". |
void GPC_CM_RequestStandbyMode | ( | GPC_CPU_MODE_CTRL_Type * | base, |
const gpc_cpu_mode_t | mode | ||
) |
base | GPC CPU module base address. |
mode | CPU mode. Refer to "gpc_cpu_mode_t". |
void GPC_CM_ClearStandbyModeRequest | ( | GPC_CPU_MODE_CTRL_Type * | base, |
const gpc_cpu_mode_t | mode | ||
) |
base | GPC CPU module base address. |
mode | CPU mode. Refer to "gpc_cpu_mode_t". |
|
inlinestatic |
base | GPC CPU module base address. |
mask | Standby mode transition status mask, refer to "gpc_cm_standby_mode_status_t". |
|
inlinestatic |
base | GPC CPU module base address. |
void GPC_CM_ClearInterruptStatusFlags | ( | GPC_CPU_MODE_CTRL_Type * | base, |
uint32_t | mask | ||
) |
base | GPC CPU module base address. |
mask | The interrupt status flags to be cleared. Should be the OR'ed value of _gpc_cm_interrupt_status_flag. |
|
inlinestatic |
This function will configure the priority of the set point. If the result of API GPC_SP_GetAllowedSetPointMap() has more than one valid bit, high priority set point will be taken.
base | GPC Setpoint controller base address. |
setPoint | Set point index, available range is 0-15. |
priority | Priority level, available range is 0-15. |
void GPC_SP_ConfigSetPointTransitionStep | ( | GPC_SET_POINT_CTRL_Type * | base, |
gpc_sp_tran_step_t | step, | ||
const gpc_tran_step_config_t * | config | ||
) |
base | GPC Setpoint controller base address. |
step | step type, refer to "gpc_sp_tran_step_t". |
config | transition step configuration, refer to "gpc_tran_step_config_t". |
|
inlinestatic |
base | GPC Setpoint controller base address. |
|
inlinestatic |
base | GPC Setpoint controller base address. |
|
inlinestatic |
base | GPC Setpoint controller base address. |
void GPC_STBY_ConfigStandbyTransitionStep | ( | GPC_STBY_CTRL_Type * | base, |
gpc_stby_tran_step_t | step, | ||
const gpc_tran_step_config_t * | config | ||
) |
base | GPC standby controller base address. |
step | step type, refer to "gpc_stby_tran_step_t". |
config | transition step configuration, refer to "gpc_tran_step_config_t". |
|
inlinestatic |
base | GPC standby controller base address. |
cpuName | The CPU name, refer to gpc_cpu_domain_name_t. |
|
inlinestatic |
base | GPC peripheral base address. |
modules | Mask value for Modules to be operated, see to _gpc_memory_power_gate. |
enable | Enable the power or not. |
void GPC_EnablePartialSleepWakeupSource | ( | GPC_Type * | base, |
gpc_wakeup_source_t | source, | ||
bool | enable | ||
) |
In PSLEEP mode, HP domain is powered down, while LP domain remains powered on so peripherals in LP domain can wakeup the system from PSLEEP mode via interrupts. In PSLEEP mode, system clocks are stopped and peripheral clocks of LP domain can be optionally on. LP domain peripherals can generate interrupt either asynchronously or need its peripheral clock on, depending on what kind of wakeup event is expected. Refer to the corresponding module description about what kind of interrupts are supported by the module.
base | GPC peripheral base address. |
source | Wakeup source for responding module, see to gpc_wakeup_source_t. |
enable | Enable the wakeup source or not. |
bool GPC_GetPartialSleepWakeupFlag | ( | GPC_Type * | base, |
gpc_wakeup_source_t | source | ||
) |
This function returns if the responding wakeup module just caused the MCU to exit PSLEEP mode. In hardware level, the flags of wakeup source are read only and will be cleared by cleaning the interrupt status of the corresponding wakeup module.
base | GPC peripheral base address. |
source | Wakeup source for responding module, see to gpc_wakeup_source_t. |
true | - Indicated wakeup flag is asserted. |
false | - Indicated wakeup flag is not asserted. |
|
inlinestatic |
This function controls if the system will enter Partial SLEEP mode or remain in STOP mode.
base | GPC peripheral base address. |
enable | Enable the gate or not. |
|
inlinestatic |
There will be two steps for power up sequence:
base | GPC peripheral base address. |
sw | Count of IP BUS clocks before disabling the isolation of HP domain. |
sw2iso | Count of IP BUS clocks before turning on the power of HP domain. |
|
inlinestatic |
There will be two steps for power down sequence:
base | GPC peripheral base address. |
iso | Count of IP BUS clocks before it enables the isolation of HP domain. |
iso2w | Count of IP BUS clocks before it turning off the power of HP domain. |
|
inlinestatic |
base | GPC peripheral base address. |
|
inlinestatic |
base | GPC peripheral base address. |
flags | Mask value of flags to be cleared, see to _gpc_status_flags. |