3.17.14 Low Power Modes (Power)

PIC32 devices offer various methods and modes that allow the user to balance power consumption with device performance. Power plib provides interface to get into such low power modes. Some of the devices which supports deep sleep mode, it also provides additional functions to be used in deep sleep mode.

Using The Library

To enter into any of the power saving mode, user can call the API POWER_LowPowerModeEnter, in case the device supports deep sleep mode and user wants to use that, then the same can be first configured in MCC power plib configuration and then corresponding APIs can be used as needed.

Library Interface

Low Power Modes peripheral library provides the following interfaces:

Functions

NameDescription
POWER_LowPowerModeEnterPuts the device in selected low power mode
POWER_InitializeInitializes Deep Sleep controller of Power module
POWER_WakeupSourceGetReturns the source of wakeup from deep sleep
POWER_ReleaseGPIORelease GPIO pins
POWER_WakeupSourceClearClears the wakeup source
POWER_DSGPR_WriteSaves critical data in deep sleep state
POWER_DSGPR_ReadReads saved data
POWER_DS_ExtendedSemaphoreDisable FunctionDisables the general purpose register retention in the Deep Sleep mode
POWER_DS_ExtendedSemaphoreEnable FunctionEnables the general purpose register retention in the Deep Sleep mode
POWER_DS_RTCC_PowerDisable FunctionDisables the RTCC module in the Deep Sleep mode.
POWER_DS_RTCC_PowerEnable FunctionEnables the RTCC module in the Deep Sleep mode
POWER_DS_RTCC_WakeupDisable FunctionDisables the wake-up from RTCC
POWER_DS_RTCC_WakeupEnable FunctionEnables the wake-up from RTCC
POWER_DS_SoftwareRestore FunctionReleases I/O pins and allow their respective TRIS and LAT bits to control their states

Data types and constants

NameTypeDescription
POWER_LOW_POWER_MODEEnumIdentifies low power mode options
POWER_WAKEUP_SOURCEEnumIdentifies wake up sources from deep sleep mode
POWER_DSGPREnumIdentifies deep sleep GPRs