Use the System Power Management (SysPm) driver to change power modes and reduce system power consumption in power sensitive designs.
The functions and other declarations used in this driver are in cy_syspm.h. You can include cy_pdl.h to get access to all functions and declarations in the PDL.
For multi-CPU devices, this library allows you to individually enter low power modes for each CPU.
This document contains the following topics:
PSoC 6 MCUs support four system and three CPU power modes. These power modes are intended to minimize average power consumption in an application. System power modes:
The CPU Active, Sleep and Deep Sleep power modes are Arm-defined power modes supported by the Arm CPU instruction set architecture (ISA).
To set system LP mode you need to set LP voltage for the active core regulator:
After switching into system LP mode, the operating frequency and current consumption may now be increased up to LP Limitations. The wait states for flash may be changed to increase device performance by calling SysLib function Cy_SysLib_SetWaitStates(true, hfClkFreqMz), where hfClkFreqMz is the frequency of HfClk0 in MHz.
When the system is in LP mode, the core regulator voltage is set to 1.1 V (nominal) and the following limitations must be met:
Before switching into system ULP mode, ensure that the device meets ULP Limitations. Decrease the clock frequencies, and slow or disable peripherals. Also ensure that appropriate wait state values are set for the flash. Flash wait states can be set by calling SysLib function Cy_SysLib_SetWaitStates(true, hfClkFreqMz), where hfClkFreqMz is the frequency of HfClk0 in MHz.
After the ULP Limitations are met and appropriate wait states are set, you must set ULP voltage for the active core regulator:
When the system is in ULP mode the core regulator voltage is set to 0.9 V (nominal) and the following limitations must be meet:
For multi-CPU devices, the Cy_SysPm_CpuEnterSleep() switches only the CPU that calls the function into the CPU Sleep power mode.
All pending interrupts must be cleared before the CPU is put into a Sleep mode, even if they are masked.
The CPU event register can be set in the past, for example, as a result of internal system calls. So an old event can cause the CPU to not enter Sleep mode upon WFE(). Therefore usually the WFE() is used in an idle loop or polling loop as it might or might not cause entering of CPU Sleep mode. If the idle loop or polling loop is not used, then it is recommended to use WFI() instruction.
For multi-CPU devices, the Cy_SysPm_CpuEnterDeepSleep() function switches only the CPU that calls the function into the CPU Deep Sleep power mode. To set the whole system into Deep Sleep power mode, ensure that all CPUs call the Cy_SysPm_CpuEnterDeepSleep() function.
There are situations when the system does not switch into the Deep Sleep power mode immediately after the last CPU calls Cy_SysPm_CpuEnterDeepSleep(). The system will switch into Deep Sleep mode automatically a short time later, after the low power circuits are ready to switch into Deep Sleep. Refer to the Cy_SysPm_CpuEnterDeepSleep() description for more detail.
All pending interrupts must be cleared before the system is put into a Deep Sleep mode, even if they are masked.
The CPU event register can be set in the past, for example, as a result of internal system calls. So an old event can cause the CPU to not enter Deep Sleep mode upon WFE(). Therefore usually the WFE() is used in an idle loop or polling loop as it might or might not cause entering of CPU Deep Sleep mode. If the idle loop or polling loop is not used, then it is recommended to use WFI() instruction.
For single-CPU devices, SysPm functions that return the status of the unsupported CPU always return CY_SYSPM_STATUS_<CPU>_DEEPSLEEP.
For Arm-based devices, an interrupt is required for the CPU to wake up. For multi-CPU devices, one CPU can wake up the other CPU by sending the event instruction. Use the Cy_SysPm_CpuSendWakeupEvent() function.
If you call Cy_SysPm_SystemEnterHibernate() from either CPU, the system will be switched into the Hibernate power mode directly, because there is no handshake between CPUs.
The system can wake up from Hibernate mode by configuring the following wakeup sources:
Wakeup is supported from device specific pin(s) with programmable polarity. Additionally, unregulated peripherals can wake the system under some conditions. For example, a low power comparator can wake the system by comparing two external voltages, but does not support comparison to an internally-generated voltage. The backup power domain remains functional, and if present it can schedule an alarm to wake the system from Hibernate using the RTC. Alternatively, the Watchdog Timer (WDT) can be configured to wake-up the system by WDT interrupt. Refer to Cy_SysPm_SetHibernateWakeupSource() for more detail.
In addition to system ULP and LP modes, the five different resource power settings can be configured to reduce current consumption:
These five sub features can modify both system LP or ULP modes as they are independent from LP/ULP settings. When all five sub features are set to their low power modes, the system operates in regulator minimum current mode. In regulator minimum current mode, the system current consumption is limited to a device-specific value. Refer to the device datasheet for the exact current consumption value in regulator minimum current mode.
When all five sub features are set to their normal mode, the system operates in regulator normal current mode. When regulator normal current mode is set, the system may operate at device maximum current.
Before setting the regulator minimum current mode ensure that current limits are be met. After current limits are met, call the Cy_SysPm_SystemSetMinRegulatorCurrent() function.
To set regulator normal current mode, call the Cy_SysPm_SystemSetNormalRegulatorCurrent() function. After the function call, the current limits can be increased to a maximum current, depending on what system power mode is set: LP or ULP.
The SysPm driver also provides an API to configure the internal power management integrated circuit (PMIC) controller for an external PMIC that supplies Vddd. Use the API to enable the internal PMIC controller output that is routed to pmic_wakeup_out pin, and configure the polarity of the PMIC controller input (pmic_wakeup_in) that is used to wake up the PMIC.
The PMIC controller is automatically enabled when:
Because a call to Cy_SysPm_PmicLock() automatically enables the PMIC controller, the PMIC can remain disabled only when it is unlocked. See Cy_SysPm_PmicUnlock() for more detail.
Use Cy_SysPm_PmicIsLocked() to read the current PMIC lock status.
To enable the PMIC, use these functions in this order:
To disable the PMIC controller, unlock the PMIC. Then call Cy_SysPm_PmicDisable() with the inverted value of the current active state of the pmic_wakeup_in pin. For example, assume the current state of the pmic_wakeup_in pin is active low. To disable the PMIC controller, call these functions in this order:
Note that you do not call Cy_SysPm_PmicLock(), because that automatically enables the PMIC.
While disabled, the PMIC controller is automatically enabled when the pmic_wakeup_in pin state is changed into a high state.
To disable the PMIC controller output, call these functions in this order: Cy_SysPm_PmicUnlock(); Cy_SysPm_PmicDisableOutput();
Do not call Cy_SysPm_PmicLock() (which automatically enables the PMIC controller output).
When disabled, the PMIC controller output is enabled when the PMIC is locked, or by calling Cy_SysPm_PmicEnableOutput().
The SysPm driver provide functions to:
Refer to the Backup Domain functions for more detail.
The SysPm driver handles low power callbacks declared in the application.
If there are no callbacks registered, the device executes the power mode transition. However, frequently your application firmware must make modifications for low power mode. For example, you may need to disable a peripheral, or ensure that a message is not being transmitted or received.
To enable this, the SysPm driver implements a callback mechanism. When a lower power mode transition is about to take place (either entering or exiting System Power Modes), the registered callbacks for that transition are called.
The SysPm driver organizes all the callbacks into a linked list. While entering a low power mode, SysPm goes through that linked list from first to last, executing the callbacks one after another. While exiting low power mode, SysPm goes through that linked list again, but in the opposite direction from last to first. This ordering supports prioritization of callbacks relative to the transition event.
For example, the picture below shows three callback structures organized into a linked list: myDeepSleep1, myDeepSleep2, myDeepSleep3 (represented with the cy_stc_syspm_callback_t configuration structure). Each structure contains, among other fields, the address of the callback function. The code snippets below set this up so that myDeepSleep1 is called first when entering the low power mode. This also means that myDeepSleep1 will be the last one to execute when exiting the low power mode.
The callback structures after registration:
Your application must register each callback, so that SysPm can execute it. Upon registration, the linked list is built by the SysPm driver. Notice the &myDeepSleep1 address in the myDeepSleep1 cy_stc_syspm_callback_t structure. This is filled in by the SysPm driver, when you register myDeepSleep1. The cy_stc_syspm_callback_t.order element defines the order of their execution by the SysPm driver. Call Cy_SysPm_RegisterCallback() to register each callback function.
A callback function is typically associated with a particular driver that handles the peripheral. So the callback mechanism enables a peripheral to prepare for a low power mode (for instance, shutting down the analog part); or to perform tasks while exiting a low power mode (like enabling the analog part again).
With the callback mechanism you can prevent switching into a low power mode if a peripheral is not ready. For example, driver X is in the process of receiving a message. In the callback function implementation simply return CY_SYSPM_FAIL in a response to CY_SYSPM_CHECK_READY.
If success is returned while executing a callback, the SysPm driver calls the next callback and so on to the end of the list. If at some point a callback returns CY_SYSPM_FAIL in response to the CY_SYSPM_CHECK_READY step, all the callbacks that have already executed are executed in reverse order, with the CY_SYSPM_CHECK_FAIL mode parameter. This allows each callback to know that entering the low power mode has failed. The callback can then undo whatever it did to prepare for low power mode, if required. For example, if the driver X callback shut down the analog part, it can re-enable the analog part.
Let's switch to an example explaining the implementation, setup, and registration of three callbacks (myDeepSleep1, myDeepSleep2, myDeepSleep2) in the application. The Callback Configuration Considerations are provided after the SysPm Callbacks Example.
The following code snippets demonstrate how use the SysPm callbacks mechanism. We will build the prototype for an application that registers three callback functions:
We set things up so that the myDeepSleep1 and myDeepSleep2 callbacks do nothing while entering the low power mode (skip on CY_SYSPM_SKIP_BEFORE_TRANSITION - see Callback Function Implementation in Callback Configuration Considerations). Skipping the actions while entering low power might be useful if you need to save time while switching low power modes. This is because the callback function with a skipped mode is not even called avoiding the call and return overhead.
Let's first declare the callback functions. Each gets the pointer to the cy_stc_syspm_callback_params_t structure as the argument.
Now we setup the cy_stc_syspm_callback_params_t structures that we will pass to the callback functions. Note that for the myDeepSleep2 and myDeepSleep3 callbacks we also pass pointers to the peripherals related to that callback (see PDL Design section to learn about base hardware addresses). The configuration considerations related to this structure are described in Callback Function Parameters in Callback Configuration Considerations.
Now we setup the actual callback configuration structures. Each of these contains, among the other fields, the address of the cy_stc_syspm_callback_params_t we just set up. We will use the callback configuration structures later in the code to register the callbacks in the SysPm driver. Again, we set things up so that the myDeepSleep1 and myDeepSleep2 callbacks do nothing while entering the low power mode (skip on CY_SYSPM_SKIP_BEFORE_TRANSITION) - see Callback Function Implementation in Callback Configuration Considerations.
Note that in each case the last two fields are NULL. These are fields used by the SysPm driver to set up the linked list of callback functions.
The callback structures are now defined and allocated in the user's memory space:
Now we implement the callback functions. See Callback Function Implementation in Callback Configuration Considerations for the instructions on how the callback functions should be implemented.
Finally, we register the callbacks so that the SysPm driver knows about them. The order in which the callbacks will be called depends upon the order in which the callbacks are registered. If there are no callbacks registered, the device just executes the power mode transition.
Callbacks that reconfigure global resources, such as clock frequencies, should be registered last. They then modify global resources as the final step before entering the low power mode, and restore those resources first, as the system returns from low power mode.
We are done configuring three callbacks. Now the SysPm driver will execute the callbacks appropriately whenever there is a call to a power mode transition function: Cy_SysPm_CpuEnterSleep(), Cy_SysPm_CpuEnterDeepSleep(), Cy_SysPm_SystemEnterUlp(), Cy_SysPm_SystemEnterLp(), and Cy_SysPm_SystemEnterHibernate().
Refer to Callback Unregistering in Callback Configuration Considerations to learn what to do if you need to remove the callback from the linked list. You might want to unregister the callback for debug purposes.
Refer to Callbacks Execution Flow in Callback Configuration Considerations to learn about how the SysPm processes the callbacks.
The callbackParams parameter of the callback function is a cy_stc_syspm_callback_params_t structure. The second parameter (mode) is for internal use. In the example code we used a dummy value CY_SYSPM_CHECK_READY to eliminate compilation errors associated with the enumeration. The driver sets the mode field to the correct value when calling the callback functions (the mode is referred to as step in the Callback Function Implementation). The callback function reads the value and executes code based on the mode set by the SysPm driver. The base and context fields are optional and can be NULL. Some drivers require a base hardware address and context to store information about the mode transition. If your callback routine requires access to the driver registers or context, provide those values (see PDL Design section to learn about Base Hardware Address). Be aware of MISRA warnings if these parameters are NULL.
For each callback, provide a cy_stc_syspm_callback_t structure. Some fields in this structure are maintained by the driver. Use NULL for cy_stc_syspm_callback_t.prevItm and cy_stc_syspm_callback_t.nextItm. Driver uses these fields to build a linked list of callback functions. The value of cy_stc_syspm_callback_t.order element is used to define the order how the callbacks are put into linked list, and sequentially, how the callbacks are executed. See Callback Registering section.
Every callback function should handle four possible steps (referred to as "mode") defined in cy_en_syspm_callback_mode_t :
A callback function can skip steps (see Defines to skip the callbacks modes). In our example myDeepSleep1 and myDeepSleep2 callbacks do nothing while entering the low power mode (skip on CY_SYSPM_BEFORE_TRANSITION). If there is anything preventing low power mode entry - return CY_SYSPM_FAIL in response to CY_SYSPM_CHECK_READY in your callback implementation. Note that the callback should return CY_SYSPM_FAIL only in response to CY_SYSPM_CHECK_READY. The callback function should always return CY_SYSPM_PASS for other modes: CY_SYSPM_CHECK_FAIL, CY_SYSPM_BEFORE_TRANSITION, and CY_SYSPM_AFTER_TRANSITION (see Callbacks Execution Flow).
This section explains what happens during a power transition, when callbacks are implemented and set up correctly. The following discussion assumes:
User calls one of the power mode transition functions: Cy_SysPm_CpuEnterSleep(), Cy_SysPm_CpuEnterDeepSleep(), Cy_SysPm_SystemEnterUlp(), Cy_SysPm_SystemEnterLp(), or Cy_SysPm_SystemEnterHibernate(). It calls each callback with the mode set to CY_SYSPM_CHECK_READY. This triggers execution of the code for that mode inside of each user callback.
The intent of CY_SYSPM_CHECK_READY is to only signal if the resources is ready to transition. Ideally, no transition changes should be made at this time. In some cases a small change may be required. For example a communication resource callback may set a flag telling firmware not to start any new transition.
If that process is successful for all callbacks, then Cy_SysPm_ExecuteCallback() calls each callback with the mode set to CY_SYSPM_BEFORE_TRANSITION. This triggers execution of the code for that mode inside each user callback. We then enter the low power mode after all callback are executed.
When exiting the low power mode, the SysPm driver executes Cy_SysPm_ExecuteCallback() again. This time it calls each callback in reverse order, with the mode set to CY_SYSPM_AFTER_TRANSITION. This triggers execution of the code for that mode inside each user callback. The final execution of callbacks depends on the low power mode in which callbacks were called:
A callback can return CY_SYSPM_FAIL only while executing the CY_SYSPM_CHECK_READY mode. If that happens, then the remaining callbacks are not executed. Any callbacks that have already executed are called again, in reverse order, with CY_SYSPM_CHECK_FAIL. This allows the system to return to the previous state. If a callback returns a fail then any of the functions (Cy_SysPm_CpuEnterSleep(), Cy_SysPm_CpuEnterDeepSleep(), Cy_SysPm_SystemEnterUlp(), Cy_SysPm_SystemEnterLp(), or Cy_SysPm_SystemEnterHibernate()) that attempt to switch the device into a low power mode will also return CY_SYSPM_FAIL.
Callbacks that reconfigure global resources, such as clock frequencies, should be registered last. They then modify global resources as the final step before entering the low power mode, and restore those resources first, as the system returns from low power mode.
While registration the callback is put into the linked list. The place where the callback structure is put into the linked list is based on cy_stc_syspm_callback_t.order. The callback with the lowest cy_stc_syspm_callback_t.order value will be placed at the beginning of linked list. The callback with the highest cy_stc_syspm_callback_t.order value will be placed at the end of the linked list. If there is already a callback structure in the linked list with the same cy_stc_syspm_callback_t.order value as you attend to register, then your callback will be placed right after such a callback.
Such a registration order defines how the callbacks are executed:
Callbacks with equal cy_stc_syspm_callback_t.order values are registered in the same order as they are registered:
Callbacks with a different cy_stc_syspm_callback_t.order value will be stored based on the cy_stc_syspm_callback_t.order value, with no matter when they when registered:
This can be useful to ensure that system resources (clock dividers, etc) are changed right before entering low power mode and immediately after exiting from low power.
Unregistering the callback might be useful when you need to dynamically manage the callbacks.
The callback structures after myDeepSleep2 callback is unregistered:
Term | Definition |
---|---|
LDO | Low dropout linear regulator. The functions that manage this block are grouped as LDO under Core Voltage Regulation |
SIMO Buck | Single inductor multiple Output Buck regulator, referred as "Buck regulator" throughout the documentation. The functions that manage this block are grouped as Buck under Core Voltage Regulation |
SISO Buck | Single inductor single output Buck regulator, referred as "Buck regulator" throughout the documentation. The functions that manage this block are grouped as Buck under Core Voltage Regulation |
PMIC | Power management integrated circuit. The functions that manage this block are grouped as PMIC |
LP | System low power mode. See the Switching the System into Low Power section for details. |
ULP | System ultra low power mode. See the Switching the System into Ultra Low Power section for details. |
For more information on the SysPm driver, refer to the technical reference manual (TRM).
The SysPm driver does not have any specific deviations.
Version | Changes | Reason for Change |
---|---|---|
5.20 | Updated Cy_SysPm_CpuEnterDeepSleep() function for the CYB06xx7 devices. | Added CYB06xx7 device support. |
5.10 | Updated the following functions for the PSoC 64 devices: Cy_SysPm_CpuEnterDeepSleep(), Cy_SysPm_SystemEnterLp(), Cy_SysPm_SystemEnterUlp, Cy_SysPm_SystemEnterHibernate, Cy_SysPm_SetHibernateWakeupSource, Cy_SysPm_ClearHibernateWakeupSource, Cy_SysPm_SystemSetMinRegulatorCurrent, Cy_SysPm_SystemSetNormalRegulatorCurrent, Cy_SysPm_LdoSetVoltage, Cy_SysPm_LdoSetMode, Cy_SysPm_BuckEnable, Cy_SysPm_BuckSetVoltage1, Following functions are updated as unavailble for PSoC 64 devices: Cy_SysPm_WriteVoltageBitForFlash, Cy_SysPm_SaveRegisters, Cy_SysPm_RestoreRegisters, Cy_SysPm_BuckSetVoltage2, Cy_SysPm_BuckEnableVoltage2, Cy_SysPm_BuckDisableVoltage2, Cy_SysPm_BuckSetVoltage2HwControl, SetReadMarginTrimUlp, SetReadMarginTrimLp, SetWriteAssistTrimUlp, IsVoltageChangePossible. | Added PSoC 64 device support. |
For PSoC 64 devices the following functions can return PRA driver status value: Cy_SysPm_CpuEnterDeepSleep(), Cy_SysPm_SystemEnterHibernate(), Cy_SysPm_SystemEnterLp(), Cy_SysPm_SystemEnterUlp(), Cy_SysPm_SystemSetMinRegulatorCurrent(), Cy_SysPm_SystemSetNormalRegulatorCurrent(), Cy_SysPm_LdoSetVoltage(), Cy_SysPm_LdoSetMode(), Cy_SysPm_BuckEnable(), Cy_SysPm_BuckSetVoltage1(), | For PSoC 64 devices the SysPm driver uses the PRA driver to change the protected registers. A SysPm driver function that calls a PRA driver function will return the PRA error status code if the called PRA function returns an error. In these cases, refer to PRA return statuses cy_en_pra_status_t. | |
Minor documentation updates. | Documentation enhancement. | |
5.0 | Updated the internal IsVoltageChangePossible() function (Cy_SysPm_LdoSetVoltage(), Cy_SysPm_BuckEnable(), Cy_SysPm_BuckSetVoltage1(), Cy_SysPm_SystemEnterUlp() and Cy_SysPm_SystemEnterLp() functions are affected). For all the devices except CY8C6xx6 and CY8C6xx7 added the check if modifying the RAM trim register is allowed. | Protecting the system from a possible CPU hard-fault cause. If you are using PC > 0 in your project and you want to switch the power modes (LP<->ULP), you need to unprotect the CPUSS_TRIM_RAM_CTL and CPUSS_TRIM_ROM_CTL registers and can use a programmable PPU for that. |
4.50 | Updated the Cy_SysPm_CpuEnterDeepSleep() function. | Updated the mechanism for saving/restoring not retained UDB and clock registers in the Cy_SysPm_CpuEnterDeepSleep() function. |
Updated the Cy_SysPm_CpuEnterDeepSleep() function to use values stored into the variable instead of reading them directly from SFLASH memory. | SFLASH memory can be unavailable to read the correct value after a Deep sleep state on the CY8C6xx6 and CY8C6xx7 devices. | |
4.40 | Fixed Cy_SysPm_LdoSetVoltage(), Cy_SysPm_BuckEnable(), and Cy_SysPm_BuckSetVoltage1() functions. Corrected the sequence for setting the RAM trim value. This behavior is applicable for all devices, except CY8C6xx6 and CY8C6xx7. | For all devices, except CY8C6xx6 and CY8C6xx7, the trim sequence was setting incorrect trim values for RAM. This could cause a CPU hard fault. |
4.30 | Corrected the Cy_SysPm_CpuEnterDeepSleep() function. Removed early access to flash values after system Deep Sleep, when flash is not ready to be used. Now the Cy_SysPm_CpuEnterDeepSleep() function does not access flash until the flash is ready. This behavior is applicable only on multi-CPU devices CY8C6xx6 and CY8C6xx7. | For CY8C6xx6 and CY8C6xx7 early access to flash values after system Deep Sleep could potentially cause hard fault. Now after system Deep Sleep only ram values are used before flash is ready. |
4.20 | Updated the Cy_SysPm_RegisterCallback() function. Added a new element to callback structure - cy_stc_syspm_callback_t.order | Enhanced the mechanism of callbacks registration and execution. Now callbacks can be ordered during registration. This means the execution flow now is based on cy_stc_syspm_callback_t.order. For more details, see the Callback Registering section. |
Updated SysPm Callbacks section. Added Callback Registering section | Added explanations how to use updated callbacks registration mechanism. | |
Added new function Cy_SysPm_GetFailedCallback() | Added new functionality to support callback debugging | |
4.10.1 | Updated the Cy_SysPm_BackupEnableVoltageMeasurement() description | Changed the scale number from 40% to 10% to correctly reflect a real value. |
4.10 | Updated the Cy_SysPm_CpuEnterDeepSleep() function. | Corrected the mechanism for saving/restoring not retained UDB registers in the Cy_SysPm_CpuEnterDeepSleep() function. Now, the Cy_SysPm_CpuEnterDeepSleep() function does not put CM0+ CPU into Deep Sleep and returns CY_SYSPM_SYSCALL_PENDING status, if a syscall operation is pending. This behavior is applicable on multi-CPU devices except CY8C6xx6 and CY8C6xx7. |
Updated the Cy_SysPm_CpuEnterSleep() function. | Removed the redundant second call of the WFE() instruction on CM4 CPU. This change is applicable for all devices except CY8C6xx6, CY8C6xx7. | |
Added a new CY_SYSPM_SYSCALL_PENDING return status. | Expanded driver return statuses for indicating new possible events in the driver. | |
4.0 | Flattened the organization of the driver source code into the single source directory and the single include directory. | Driver library directory-structure simplification. |
Changed power modes names. See System Power Modes. Renamed the following functions:
For all renamed functions, added BWC macros to simplify migration. | Device power modes simplification | |
Added the following functions:
| Added new functionality to configure device power modes | |
Callback mechanism changes:
| Callback mechanism enhancements | |
Added register access layer. Use register access macros instead of direct register access using dereferenced pointers. | Makes register access device-independent, so that the PDL does not need to be recompiled for each supported part number. | |
Added Migration Guide: Moving to SysPm v4.0. | Provided a guidance for migrating to the latest SysPm driver version | |
3.0 | Removed three functions:
Removed the following macros:
| Removed the two functions Cy_SysPm_Cm4IsLowPower, Cy_SysPm_Cm0IsLowPower because low power mode is related to the device and not to the CPU. The function Cy_SysPm_IsSystemUlp must be used instead of these two functions. Removed Cy_SysPm_IoFreeze because the are no known use cases with IOs freeze in power modes, except Hibernate. In Hibernate power mode, the IOs are frozen automatically. |
Corrected the syspm callback mechanism behavior. Now callbacks with CY_SYSPM_AFTER_TRANSITION mode are executed from the last registered to the first registered. Previously callbacks with CY_SYSPM_AFTER_TRANSITION mode were executed from last executed to the first registered. | Corrected the syspm callbacks execution sequence | |
2.21 | Removed saving/restoring the SysClk measurement counters while in Deep Sleep routine | Removed possible corruption of SysClk measurement counters if the core wakes up from the Deep Sleep. |
2.20 |
| Added support for changing the core voltage in protection context higher than zero (PC > 0). Documentation update and clarification |
2.10 |
|
|
2.0 | Enhancement and defect fixes:
| |
1.0 | Initial version |
This section provides a guideline to migrate from v2.21 to v4.0 of the SysPm driver.
If your application currently uses SysPm v2.21 APIs, you must migrate to SysPm v4.0 so that your application continues to operate.
Take a few minutes to review the following information:
The table below shows the new APIs names that should be used in the application instead of old names:
SysPm v2.21 API name | SysPm v4.0 API name | Comment |
---|---|---|
Cy_SysPm_Sleep | Cy_SysPm_CpuEnterSleep | Renamed, no functional changes |
Cy_SysPm_DeepSleep | Cy_SysPm_CpuEnterDeepSleep | Renamed, no functional changes |
Cy_SysPm_Hibernate | Cy_SysPm_SystemEnterHibernate | Renamed, no functional changes |
Cy_SysPm_SleepOnExit | Cy_SysPm_CpuSleepOnExit | Renamed, no functional changes |
Cy_SysPm_IsLowPower | Cy_SysPm_IsSystemUlp | Now this function checks whether the device is in ULP mode |
Cy_SysPm_EnterLowPowerMode | Cy_SysPm_SystemSetMinRegulatorCurrent | The low power active mode does not exist anymore. The System Regulator Current Mode is implemented instead |
Cy_SysPm_ExitLowPowerMode | Cy_SysPm_SystemSetNormalRegulatorCurrent | The low power active mode does not exist anymore. The System Regulator Current Mode is implemented instead |
Cy_SysPm_Cm4IsLowPower | Removed | This function is removed because low power mode is related to the system and not to the CPU |
Cy_SysPm_Cm0IsLowPower | Removed | This function is removed because low power mode is related to the system and not to the CPU |
Cy_SysPm_IoFreeze | Removed | This function is removed because there are no known use cases to freeze in power modes other than Hibernate |
In addition to renamed power modes APIs, the following defines and enum elements names are changed:
SysPm v2.21 defines | SysPm v4.0 defines | Comment |
---|---|---|
CY_SYSPM_ENTER_LP_MODE | CY_SYSPM_ULP | The cy_en_syspm_callback_type_t element is renamed to align callback types names to new power modes names |
CY_SYSPM_EXIT_LP_MODE | CY_SYSPM_LP | The cy_en_syspm_callback_type_t element is renamed to align callback types names to new power modes names |
CY_SYSPM_STATUS_SYSTEM_LOWPOWER | CY_SYSPM_STATUS_SYSTEM_ULP | Status define, renamed to align new power modes names and abbreviations |
Review this section if your application is using the syspm callback mechanism.
To migrate to SysPm v4.0 callbacks you need to perform the following steps:
Remove mode element from all cy_stc_syspm_callback_params_t structures defined in your application. In SysPm v2.21 this structure is:
In SysPm v4.0 this structure should be:
Do not forget to review newly added functionality for SysPm v4.0 in the Changelog.
API Reference | |
Macros | |
Functions | |
Data Structures | |
Enumerated Types | |