This module covers the functionality of the System Mode Controller (SMC) peripheral.
SMC HAL provides the API for reading and writing register bit-fields belonging to the SMC module.
For higher-level functionality, use the Power Manager driver.
|
enum | power_manager_modes_t {
POWER_MANAGER_HSRUN,
POWER_MANAGER_RUN,
POWER_MANAGER_VLPR,
POWER_MANAGER_STOP,
POWER_MANAGER_VLPS,
POWER_MANAGER_STOP1,
POWER_MANAGER_STOP2,
POWER_MANAGER_MAX
} |
| Power modes enumeration. More...
|
|
enum | power_mode_stat_t {
STAT_RUN = 0x01,
STAT_STOP = 0x02,
STAT_VLPR = 0x04,
STAT_VLPW = 0x08,
STAT_VLPS = 0x10,
STAT_HSRUN = 0x80,
STAT_INVALID = 0xFF
} |
| Power Modes in PMSTAT Implements power_mode_stat_t_Class. More...
|
|
enum | power_modes_protect_t { ALLOW_HSRUN,
ALLOW_VLP,
ALLOW_MAX
} |
| Power Modes Protection Implements power_modes_protect_t_Class. More...
|
|
enum | smc_run_mode_t { SMC_RUN,
SMC_RESERVED_RUN,
SMC_VLPR,
SMC_HSRUN
} |
| Run mode definition Implements smc_run_mode_t_Class. More...
|
|
enum | smc_stop_mode_t { SMC_STOP = 0U,
SMC_RESERVED_STOP1 = 1U,
SMC_VLPS = 2U
} |
| Stop mode definition Implements smc_stop_mode_t_Class. More...
|
|
enum | smc_stop_option_t { SMC_STOP_RESERVED = 0x00,
SMC_STOP1 = 0x01,
SMC_STOP2 = 0x02
} |
| STOP option Implements smc_stop_option_t_Class. More...
|
|
Power modes enumeration.
Defines power modes. Used in the power mode configuration structure (power_manager_user_config_t). From ARM core perspective, Power modes can be generally divided into run modes (High speed run, Run and Very low power run), sleep (Wait and Very low power wait) and deep sleep modes (all Stop modes). List of power modes supported by specific chip along with requirements for entering and exiting of these modes can be found in chip documentation. List of all supported power modes:
- POWER_MANAGER_HSRUN - High speed run mode.
- POWER_MANAGER_RUN - Run mode.
- POWER_MANAGER_VLPR - Very low power run mode.
- POWER_MANAGER_WAIT - Wait mode.
- POWER_MANAGER_VLPW - Very low power wait mode.
- POWER_MANAGER_STOP - Stop mode.
- POWER_MANAGER_VLPS - Very low power stop mode.
- POWER_MANAGER_PSTOP1 - Partial stop 1 mode.
- POWER_MANAGER_PSTOP2 - Partial stop 2 mode. Implements power_manager_modes_t_Class
Enumerator |
---|
POWER_MANAGER_HSRUN |
High speed run mode.
|
POWER_MANAGER_RUN |
Run mode.
|
POWER_MANAGER_VLPR |
Very low power run mode.
|
POWER_MANAGER_STOP |
Stop mode.
|
POWER_MANAGER_VLPS |
Very low power stop mode.
|
POWER_MANAGER_STOP1 |
Stop 1 mode.
|
POWER_MANAGER_STOP2 |
Stop 2 mode.
|
POWER_MANAGER_MAX |
|
Definition at line 76 of file smc_hal.h.
Power Modes in PMSTAT Implements power_mode_stat_t_Class.
Enumerator |
---|
STAT_RUN |
0000_0001 - Current power mode is RUN
|
STAT_STOP |
0000_0010 - Current power mode is STOP
|
STAT_VLPR |
0000_0100 - Current power mode is VLPR
|
STAT_VLPW |
0000_1000 - Current power mode is VLPW
|
STAT_VLPS |
0001_0000 - Current power mode is VLPS
|
STAT_HSRUN |
1000_0000 - Current power mode is HSRUN
|
STAT_INVALID |
1111_1111 - Non-existing power mode
|
Definition at line 125 of file smc_hal.h.
Power Modes Protection Implements power_modes_protect_t_Class.
Enumerator |
---|
ALLOW_HSRUN |
Allow High Speed Run mode
|
ALLOW_VLP |
Allow Very-Low-Power Modes
|
ALLOW_MAX |
|
Definition at line 140 of file smc_hal.h.
Run mode definition Implements smc_run_mode_t_Class.
Enumerator |
---|
SMC_RUN |
normal RUN mode
|
SMC_RESERVED_RUN |
|
SMC_VLPR |
Very-Low-Power RUN mode
|
SMC_HSRUN |
High Speed Run mode (HSRUN)
|
Definition at line 151 of file smc_hal.h.
Stop mode definition Implements smc_stop_mode_t_Class.
Enumerator |
---|
SMC_STOP |
Normal STOP mode
|
SMC_RESERVED_STOP1 |
Reserved
|
SMC_VLPS |
Very-Low-Power STOP mode
|
Definition at line 163 of file smc_hal.h.
STOP option Implements smc_stop_option_t_Class.
Enumerator |
---|
SMC_STOP_RESERVED |
Reserved stop mode
|
SMC_STOP1 |
Stop with both system and bus clocks disabled
|
SMC_STOP2 |
Stop with system clock disabled and bus clock enabled
|
Definition at line 174 of file smc_hal.h.
Gets the current power mode stat.
This function returns the current power mode stat. Once application switches the power mode, it should always check the stat to check whether it runs into the specified mode or not. An application should check this mode before switching to a different mode. The system requires that only certain modes can switch to other specific modes. See the reference manual for details and the _power_mode_stat for information about the power stat.
- Parameters
-
[in] | baseAddr | Base address for current SMC instance. |
- Returns
- stat Current power mode stat Implements SMC_HAL_GetPowerModeStatus_Activity
Definition at line 510 of file smc_hal.h.
Gets the the current power mode protection setting.
This function gets the current power mode protection settings for a specified power mode.
- Parameters
-
baseAddr[in] | Base address for current SMC instance. |
protect[in] | Power mode to set for protection |
- Returns
- state Status of the protection setting
- true: Allowed
- false: Not allowed
Definition at line 305 of file smc_hal.c.
Gets the current RUN mode configuration setting.
This function gets the run mode settings. See the smc_run_mode_t for a supported run mode on the chip family and the reference manual for details about the run mode.
- Parameters
-
[in] | baseAddr | Base address for current SMC instance. |
- Returns
- setting Run mode configuration setting Implements SMC_HAL_GetRunModeControl_Activity
Definition at line 326 of file smc_hal.h.
Gets the current STOP mode control settings.
This function gets the stop mode settings, for example, normal stop mode, very lower power stop mode, etc. See the smc_stop_mode_t for supported stop mode on the chip family and the reference manual for details about the stop mode.
- Parameters
-
[in] | baseAddr | Base address for current SMC instance. |
- Returns
- setting Current stop mode configuration setting Implements SMC_HAL_GetStopModeControl_Activity
Definition at line 412 of file smc_hal.h.
Gets the configuration of the STOPO option.
This function gets the current STOPO option setting. See the configuration function for more details.
- Parameters
-
[in] | baseAddr | Base address for current SMC instance. |
- Returns
- option Current STOPO option setting Implements SMC_HAL_GetStopOption_Activity
Definition at line 466 of file smc_hal.h.
Get the version of the SMC module.
- Parameters
-
[in] | baseAddr | base address of the SMC module |
[out] | versionInfo | Device Version Number |
Definition at line 82 of file smc_hal.c.
Checks whether the last very low power stop sequence has been aborted.
This function checks whether the last very low power stop sequence has been aborted.
- Parameters
-
[in] | baseAddr | Base address for current SMC instance. |
- Returns
- aborted Aborted or not Implements SMC_HAL_GetVlpsaModeControl_Activity
Definition at line 379 of file smc_hal.h.
Configures the power mode.
This function configures the power mode control for both run, stop, and stop sub mode if needed. Also it configures the power options for a specific power mode. An application should follow the proper procedure to configure and switch power modes between different run and stop modes. For proper procedures and supported power modes, see an appropriate chip reference manual. See the smc_power_mode_config_t for required parameters to configure the power mode and the supported options. Other options may need to be individually configured through the HAL driver. See the HAL driver header file for details.
- Parameters
-
baseAddr | Base address for current SMC instance. |
powerModeConfig | Power mode configuration structure smc_power_mode_config_t |
- Returns
- errorCode SMC error code
Power mode transition table Specifies valid power modes for transitioning to the next mode (in comment)
Definition at line 115 of file smc_hal.c.
Configures all power mode protection settings.
This function configures the power mode protection settings for supported power modes in the specified chip family. The available power modes are defined in the smc_power_mode_protection_config_t. An application should provide the protect settings for all supported power modes on the chip. This should be done at an early system level initialization stage. See the reference manual for details. This register can only write once after the power reset. If the user has only a single option to set, either use this function or use the individual set function.
- Parameters
-
[in] | baseAddr | Base address for current SMC instance. |
[in] | protectConfig | Configurations for the supported power mode protect settings
|
Definition at line 273 of file smc_hal.c.
Configures the the RUN mode control setting.
This function sets the run mode settings, for example, normal run mode, very lower power run mode, etc. See the smc_run_mode_t for supported run mode on the chip family and the reference manual for details about the run mode.
- Parameters
-
[in] | baseAddr | Base address for current SMC instance. |
[in] | runMode | Run mode setting defined in smc_run_mode_t Implements SMC_HAL_SetRunModeControl_Activity |
Definition at line 307 of file smc_hal.h.
Configures the STOP mode control setting.
This function sets the stop mode settings, for example, normal stop mode, very lower power stop mode, etc. See the smc_stop_mode_t for supported stop mode on the chip family and the reference manual for details about the stop mode.
- Parameters
-
[in] | baseAddr | Base address for current SMC instance. |
[in] | stopMode | Stop mode defined in smc_stop_mode_t Implements SMC_HAL_SetStopModeControl_Activity |
Definition at line 362 of file smc_hal.h.
Configures the STOPO (Stop Option).
It controls the type of the stop operation when STOPM=STOP. When entering Stop mode from RUN mode, the PMC, SCG and flash remain fully powered, allowing the device to wakeup almost instantaneously at the expense of higher power consumption. In STOP2, only system clocks are gated allowing peripherals running on bus clock to remain fully functional. In STOP1, both system and bus clocks are gated.
- Parameters
-
[in] | baseAddr | Base address for current SMC instance. |
[in] | option | STOPO option setting defined in smc_stop_option_t Implements SMC_HAL_SetStopOption_Activity |
Definition at line 447 of file smc_hal.h.