Power manager interface for the CC32XX.
============================================================================
The Power header file should be included in an application as follows:
Refer to Power.h for a complete description of APIs.
This module defines the power resources, constraints, events, sleep states and transition latencies for CC32XX.
A reference power policy is provided which can transition the MCU from the active state to one of two sleep states: Low-Power Deep Sleep (LPDS) or Sleep. The policy looks at the estimated idle time remaining, and the active constraints, and determine which sleep state to transition to. The policy will give first preference to choosing LPDS, but if that is not appropriate (e.g., not enough idle time), it will choose Sleep.
#include <stdint.h>
#include <ti/drivers/utils/List.h>
#include <ti/drivers/Power.h>
#include <ti/devices/cc32xx/inc/hw_types.h>
#include <ti/devices/cc32xx/driverlib/rom.h>
#include <ti/devices/cc32xx/driverlib/rom_map.h>
#include <ti/devices/cc32xx/driverlib/pin.h>
Go to the source code of this file.
Data Structures | |
struct | PowerCC32XX_ParkInfo |
Used to specify parking of a pin during LPDS. More... | |
struct | PowerCC32XX_ConfigV1 |
Power global configuration. More... | |
struct | PowerCC32XX_Wakeup |
Specify the wakeup sources for LPDS and Shutdown. More... | |
Typedefs | |
typedef struct PowerCC32XX_ParkInfo | PowerCC32XX_ParkInfo |
Used to specify parking of a pin during LPDS. More... | |
typedef struct PowerCC32XX_ConfigV1 | PowerCC32XX_ConfigV1 |
Power global configuration. More... | |
typedef struct PowerCC32XX_Wakeup | PowerCC32XX_Wakeup |
Specify the wakeup sources for LPDS and Shutdown. More... | |
Functions | |
void | PowerCC32XX_configureWakeup (PowerCC32XX_Wakeup *wakeup) |
Function configures wakeup for LPDS and shutdown. More... | |
void | PowerCC32XX_initPolicy (void) |
void | PowerCC32XX_getWakeup (PowerCC32XX_Wakeup *wakeup) |
Function to get wakeup configuration settings. More... | |
PowerCC32XX_ParkState | PowerCC32XX_getParkState (PowerCC32XX_Pin pin) |
void | PowerCC32XX_restoreParkState (PowerCC32XX_Pin pin, PowerCC32XX_ParkState state) |
void | PowerCC32XX_setParkState (PowerCC32XX_Pin pin, uint32_t level) |
void | PowerCC32XX_disableIORetention (unsigned long groupFlags) |
Function to disable IO retention and unlock pin groups following exit from Shutdown. More... | |
void | PowerCC32XX_sleepPolicy (void) |
A reference power policy is provided which can transition the MCU from the active state to one of two sleep states: Low-Power Deep Sleep (LPDS) or Sleep. More... | |
int_fast16_t | PowerCC32XX_reset (uint_fast16_t resourceId) |
Software reset of a resource. More... | |
#define PowerCC32XX_RESUMETIMELPDS 2500 |
The latency to reserve for resuming from LPDS (usec)
#define PowerCC32XX_TOTALTIMELPDS 20000 |
The total latency to reserve for entry to and exit from LPDS (usec)
#define PowerCC32XX_TOTALTIMESHUTDOWN 500000 |
The total latency to reserve for entry to and exit from Shutdown (usec)
#define PowerCC32XX_PERIPH_CAMERA 0 |
Resource ID: Camera
#define PowerCC32XX_PERIPH_I2S 1 |
Resource ID: I2S
#define PowerCC32XX_PERIPH_SDHOST 2 |
Resource ID: SDHost
#define PowerCC32XX_PERIPH_GSPI 3 |
Resource ID: General Purpose SPI (GSPI)
#define PowerCC32XX_PERIPH_LSPI 4 |
Resource ID: LSPI
#define PowerCC32XX_PERIPH_UDMA 5 |
Resource ID: uDMA Controller
#define PowerCC32XX_PERIPH_GPIOA0 6 |
Resource ID: General Purpose I/O Port A0
#define PowerCC32XX_PERIPH_GPIOA1 7 |
Resource ID: General Purpose I/O Port A1
#define PowerCC32XX_PERIPH_GPIOA2 8 |
Resource ID: General Purpose I/O Port A2
#define PowerCC32XX_PERIPH_GPIOA3 9 |
Resource ID: General Purpose I/O Port A3
#define PowerCC32XX_PERIPH_GPIOA4 10 |
Resource ID: General Purpose I/O Port A4
#define PowerCC32XX_PERIPH_WDT 11 |
Resource ID: Watchdog module
#define PowerCC32XX_PERIPH_UARTA0 12 |
Resource ID: UART 0
#define PowerCC32XX_PERIPH_UARTA1 13 |
Resource ID: UART 1
#define PowerCC32XX_PERIPH_TIMERA0 14 |
Resource ID: General Purpose Timer A0
#define PowerCC32XX_PERIPH_TIMERA1 15 |
Resource ID: General Purpose Timer A1
#define PowerCC32XX_PERIPH_TIMERA2 16 |
Resource ID: General Purpose Timer A2
#define PowerCC32XX_PERIPH_TIMERA3 17 |
Resource ID: General Purpose Timer A3
#define PowerCC32XX_PERIPH_DTHE 18 |
Resource ID: Cryptography Accelerator (DTHE)
#define PowerCC32XX_PERIPH_SSPI 19 |
Resource ID: Serial Flash SPI (SSPI)
#define PowerCC32XX_PERIPH_I2CA0 20 |
Resource ID: I2C
#define PowerCC32XX_DISALLOW_LPDS 0 |
Constraint: Disallow entry to Low Power Deep Sleep (LPDS)
#define PowerCC32XX_DISALLOW_SHUTDOWN 1 |
Constraint: Disallow entry to Shutdown
#define PowerCC32XX_ENTERING_LPDS 0x1 |
Power event: The device is entering the LPDS sleep state
#define PowerCC32XX_ENTERING_SHUTDOWN 0x2 |
Power event: The device is entering the Shutdown state
#define PowerCC32XX_AWAKE_LPDS 0x4 |
Power event: The device is waking from the LPDS sleep state
#define PowerCC32XX_LPDS 0x1 |
The LPDS sleep state
typedef struct PowerCC32XX_ParkInfo PowerCC32XX_ParkInfo |
Used to specify parking of a pin during LPDS.
typedef struct PowerCC32XX_ConfigV1 PowerCC32XX_ConfigV1 |
Power global configuration.
typedef struct PowerCC32XX_Wakeup PowerCC32XX_Wakeup |
Specify the wakeup sources for LPDS and Shutdown.
The wakeup sources for LPDS and Shutdown can be dynamically changed at runtime, via PowerCC32XX_configureWakeup(). The application should fill a structure of this type, and pass it as the parameter to PowerCC32XX_configureWakeup() to specify the new wakeup settings.
Enumeration of states a pin can be parked in.
enum PowerCC32XX_Pin |
Enumeration of pins that can be parked.
void PowerCC32XX_configureWakeup | ( | PowerCC32XX_Wakeup * | wakeup | ) |
Function configures wakeup for LPDS and shutdown.
This function allows the app to configure the GPIO source and type for waking up from LPDS and shutdown and the network host as a wakeup source for LPDS. This overwrites any previous wakeup settings.
[in] | wakeup | Settings applied to wakeup configuration |
void PowerCC32XX_initPolicy | ( | void | ) |
OS-specific power policy initialization function
void PowerCC32XX_getWakeup | ( | PowerCC32XX_Wakeup * | wakeup | ) |
Function to get wakeup configuration settings.
This function allows an app to query the current LPDS and shutdown wakeup configuration settings.
[in] | wakeup | A PowerCC32XX_Wakeup structure to be written into |
PowerCC32XX_ParkState PowerCC32XX_getParkState | ( | PowerCC32XX_Pin | pin | ) |
CC32XX-specific function to query the LPDS park state for a pin
void PowerCC32XX_restoreParkState | ( | PowerCC32XX_Pin | pin, |
PowerCC32XX_ParkState | state | ||
) |
CC32XX-specific function to restore the LPDS park state for a pin
void PowerCC32XX_setParkState | ( | PowerCC32XX_Pin | pin, |
uint32_t | level | ||
) |
CC32XX-specific function to dynamically set the LPDS park state for a pin
void PowerCC32XX_disableIORetention | ( | unsigned long | groupFlags | ) |
Function to disable IO retention and unlock pin groups following exit from Shutdown.
PowerCC32XX_ConfigV1.ioRetentionShutdown can be used to specify locking and retention of pin groups during Shutdown. Upon exit from Shutdown, and when appropriate, an application can call this function, to correspondingly disable IO retention, and unlock the specified pin groups.
[in] | groupFlags | A logical OR of one or more of the following flags (defined in driverlib/prcm.h):
|
void PowerCC32XX_sleepPolicy | ( | void | ) |
A reference power policy is provided which can transition the MCU from the active state to one of two sleep states: Low-Power Deep Sleep (LPDS) or Sleep.
The policy looks at the estimated idle time remaining, and the active constraints, and determine which sleep state to transition to. The policy will give first preference to choosing LPDS, but if that is not appropriate (e.g., not enough idle time), it will choose Sleep.
int_fast16_t PowerCC32XX_reset | ( | uint_fast16_t | resourceId | ) |
Software reset of a resource.
This function performs a software reset of a resource.
Resource identifiers are device specific, and defined in the device-specific Power include file. For example, the resources for CC32XX are defined in PowerCC32XX.h.
[in] | resourceId | resource id |
Power_SOK | on success, |
Power_EINVALIDINPUT | if the reseourceId is invalid. |