Data Structures | Macros | Enumerations | Functions
PowerCC32XX.h File Reference

Detailed Description

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.

Implementation

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>
Include dependency graph for PowerCC32XX.h:
This graph shows which files directly or indirectly include this file:

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...
 

Macros

#define PowerCC32XX_RESUMETIMELPDS   2500
 
#define PowerCC32XX_TOTALTIMELPDS   20000
 
#define PowerCC32XX_TOTALTIMESHUTDOWN   500000
 
#define PowerCC32XX_PERIPH_CAMERA   0
 
#define PowerCC32XX_PERIPH_I2S   1
 
#define PowerCC32XX_PERIPH_SDHOST   2
 
#define PowerCC32XX_PERIPH_GSPI   3
 
#define PowerCC32XX_PERIPH_LSPI   4
 
#define PowerCC32XX_PERIPH_UDMA   5
 
#define PowerCC32XX_PERIPH_GPIOA0   6
 
#define PowerCC32XX_PERIPH_GPIOA1   7
 
#define PowerCC32XX_PERIPH_GPIOA2   8
 
#define PowerCC32XX_PERIPH_GPIOA3   9
 
#define PowerCC32XX_PERIPH_GPIOA4   10
 
#define PowerCC32XX_PERIPH_WDT   11
 
#define PowerCC32XX_PERIPH_UARTA0   12
 
#define PowerCC32XX_PERIPH_UARTA1   13
 
#define PowerCC32XX_PERIPH_TIMERA0   14
 
#define PowerCC32XX_PERIPH_TIMERA1   15
 
#define PowerCC32XX_PERIPH_TIMERA2   16
 
#define PowerCC32XX_PERIPH_TIMERA3   17
 
#define PowerCC32XX_PERIPH_DTHE   18
 
#define PowerCC32XX_PERIPH_SSPI   19
 
#define PowerCC32XX_PERIPH_I2CA0   20
 
#define PowerCC32XX_DISALLOW_LPDS   0
 
#define PowerCC32XX_DISALLOW_SHUTDOWN   1
 
#define PowerCC32XX_ENTERING_LPDS   0x1
 
#define PowerCC32XX_ENTERING_SHUTDOWN   0x2
 
#define PowerCC32XX_AWAKE_LPDS   0x4
 
#define PowerCC32XX_LPDS   0x1
 

Enumerations

enum  PowerCC32XX_ParkState {
  PowerCC32XX_NO_PULL_HIZ = PIN_TYPE_STD, PowerCC32XX_WEAK_PULL_UP_STD = PIN_TYPE_STD_PU, PowerCC32XX_WEAK_PULL_DOWN_STD = PIN_TYPE_STD_PD, PowerCC32XX_WEAK_PULL_UP_OPENDRAIN = PIN_TYPE_OD_PU,
  PowerCC32XX_WEAK_PULL_DOWN_OPENDRAIN = PIN_TYPE_OD_PD, PowerCC32XX_DRIVE_LOW, PowerCC32XX_DRIVE_HIGH, PowerCC32XX_DONT_PARK
}
 Enumeration of states a pin can be parked in. More...
 
enum  PowerCC32XX_Pin {
  PowerCC32XX_PIN01 = PIN_01, PowerCC32XX_PIN02 = PIN_02, PowerCC32XX_PIN03 = PIN_03, PowerCC32XX_PIN04 = PIN_04,
  PowerCC32XX_PIN05 = PIN_05, PowerCC32XX_PIN06 = PIN_06, PowerCC32XX_PIN07 = PIN_07, PowerCC32XX_PIN08 = PIN_08,
  PowerCC32XX_PIN11 = PIN_11, PowerCC32XX_PIN12 = PIN_12, PowerCC32XX_PIN13 = PIN_13, PowerCC32XX_PIN14 = PIN_14,
  PowerCC32XX_PIN15 = PIN_15, PowerCC32XX_PIN16 = PIN_16, PowerCC32XX_PIN17 = PIN_17, PowerCC32XX_PIN18 = PIN_18,
  PowerCC32XX_PIN19 = PIN_19, PowerCC32XX_PIN20 = PIN_20, PowerCC32XX_PIN21 = PIN_21, PowerCC32XX_PIN29 = 0x1C,
  PowerCC32XX_PIN30 = 0x1D, PowerCC32XX_PIN45 = PIN_45, PowerCC32XX_PIN50 = PIN_50, PowerCC32XX_PIN52 = PIN_52,
  PowerCC32XX_PIN53 = PIN_53, PowerCC32XX_PIN55 = PIN_55, PowerCC32XX_PIN57 = PIN_57, PowerCC32XX_PIN58 = PIN_58,
  PowerCC32XX_PIN59 = PIN_59, PowerCC32XX_PIN60 = PIN_60, PowerCC32XX_PIN61 = PIN_61, PowerCC32XX_PIN62 = PIN_62,
  PowerCC32XX_PIN63 = PIN_63, PowerCC32XX_PIN64 = PIN_64
}
 Enumeration of pins that can be parked. 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...
 

Macro Definition Documentation

§ PowerCC32XX_RESUMETIMELPDS

#define PowerCC32XX_RESUMETIMELPDS   2500

The latency to reserve for resuming from LPDS (usec)

§ PowerCC32XX_TOTALTIMELPDS

#define PowerCC32XX_TOTALTIMELPDS   20000

The total latency to reserve for entry to and exit from LPDS (usec)

§ PowerCC32XX_TOTALTIMESHUTDOWN

#define PowerCC32XX_TOTALTIMESHUTDOWN   500000

The total latency to reserve for entry to and exit from Shutdown (usec)

§ PowerCC32XX_PERIPH_CAMERA

#define PowerCC32XX_PERIPH_CAMERA   0

Resource ID: Camera

§ PowerCC32XX_PERIPH_I2S

#define PowerCC32XX_PERIPH_I2S   1

Resource ID: I2S

§ PowerCC32XX_PERIPH_SDHOST

#define PowerCC32XX_PERIPH_SDHOST   2

Resource ID: SDHost

§ PowerCC32XX_PERIPH_GSPI

#define PowerCC32XX_PERIPH_GSPI   3

Resource ID: General Purpose SPI (GSPI)

§ PowerCC32XX_PERIPH_LSPI

#define PowerCC32XX_PERIPH_LSPI   4

Resource ID: LSPI

§ PowerCC32XX_PERIPH_UDMA

#define PowerCC32XX_PERIPH_UDMA   5

Resource ID: uDMA Controller

§ PowerCC32XX_PERIPH_GPIOA0

#define PowerCC32XX_PERIPH_GPIOA0   6

Resource ID: General Purpose I/O Port A0

§ PowerCC32XX_PERIPH_GPIOA1

#define PowerCC32XX_PERIPH_GPIOA1   7

Resource ID: General Purpose I/O Port A1

§ PowerCC32XX_PERIPH_GPIOA2

#define PowerCC32XX_PERIPH_GPIOA2   8

Resource ID: General Purpose I/O Port A2

§ PowerCC32XX_PERIPH_GPIOA3

#define PowerCC32XX_PERIPH_GPIOA3   9

Resource ID: General Purpose I/O Port A3

§ PowerCC32XX_PERIPH_GPIOA4

#define PowerCC32XX_PERIPH_GPIOA4   10

Resource ID: General Purpose I/O Port A4

§ PowerCC32XX_PERIPH_WDT

#define PowerCC32XX_PERIPH_WDT   11

Resource ID: Watchdog module

§ PowerCC32XX_PERIPH_UARTA0

#define PowerCC32XX_PERIPH_UARTA0   12

Resource ID: UART 0

§ PowerCC32XX_PERIPH_UARTA1

#define PowerCC32XX_PERIPH_UARTA1   13

Resource ID: UART 1

§ PowerCC32XX_PERIPH_TIMERA0

#define PowerCC32XX_PERIPH_TIMERA0   14

Resource ID: General Purpose Timer A0

§ PowerCC32XX_PERIPH_TIMERA1

#define PowerCC32XX_PERIPH_TIMERA1   15

Resource ID: General Purpose Timer A1

§ PowerCC32XX_PERIPH_TIMERA2

#define PowerCC32XX_PERIPH_TIMERA2   16

Resource ID: General Purpose Timer A2

§ PowerCC32XX_PERIPH_TIMERA3

#define PowerCC32XX_PERIPH_TIMERA3   17

Resource ID: General Purpose Timer A3

§ PowerCC32XX_PERIPH_DTHE

#define PowerCC32XX_PERIPH_DTHE   18

Resource ID: Cryptography Accelerator (DTHE)

§ PowerCC32XX_PERIPH_SSPI

#define PowerCC32XX_PERIPH_SSPI   19

Resource ID: Serial Flash SPI (SSPI)

§ PowerCC32XX_PERIPH_I2CA0

#define PowerCC32XX_PERIPH_I2CA0   20

Resource ID: I2C

§ PowerCC32XX_DISALLOW_LPDS

#define PowerCC32XX_DISALLOW_LPDS   0

Constraint: Disallow entry to Low Power Deep Sleep (LPDS)

§ PowerCC32XX_DISALLOW_SHUTDOWN

#define PowerCC32XX_DISALLOW_SHUTDOWN   1

Constraint: Disallow entry to Shutdown

§ PowerCC32XX_ENTERING_LPDS

#define PowerCC32XX_ENTERING_LPDS   0x1

Power event: The device is entering the LPDS sleep state

§ PowerCC32XX_ENTERING_SHUTDOWN

#define PowerCC32XX_ENTERING_SHUTDOWN   0x2

Power event: The device is entering the Shutdown state

§ PowerCC32XX_AWAKE_LPDS

#define PowerCC32XX_AWAKE_LPDS   0x4

Power event: The device is waking from the LPDS sleep state

§ PowerCC32XX_LPDS

#define PowerCC32XX_LPDS   0x1

The LPDS sleep state

Enumeration Type Documentation

§ PowerCC32XX_ParkState

Enumeration of states a pin can be parked in.

Enumerator
PowerCC32XX_NO_PULL_HIZ 

No pull resistor, leave pin in a HIZ state

PowerCC32XX_WEAK_PULL_UP_STD 

Pull-up resistor for standard pin type

PowerCC32XX_WEAK_PULL_DOWN_STD 

Pull-down resistor for standard pin type

PowerCC32XX_WEAK_PULL_UP_OPENDRAIN 

Pull-up resistor for open drain pin type

PowerCC32XX_WEAK_PULL_DOWN_OPENDRAIN 

Pull-down resistor for open drain pin type

PowerCC32XX_DRIVE_LOW 

Drive pin to a low logic state

PowerCC32XX_DRIVE_HIGH 

Drive pin to a high logic state

PowerCC32XX_DONT_PARK 

Take no action; do not park the pin

§ PowerCC32XX_Pin

Enumeration of pins that can be parked.

Enumerator
PowerCC32XX_PIN01 

PIN_01

PowerCC32XX_PIN02 

PIN_02

PowerCC32XX_PIN03 

PIN_03

PowerCC32XX_PIN04 

PIN_04

PowerCC32XX_PIN05 

PIN_05

PowerCC32XX_PIN06 

PIN_06

PowerCC32XX_PIN07 

PIN_07

PowerCC32XX_PIN08 

PIN_08

PowerCC32XX_PIN11 

PIN_11

PowerCC32XX_PIN12 

PIN_12

PowerCC32XX_PIN13 

PIN_13

PowerCC32XX_PIN14 

PIN_14

PowerCC32XX_PIN15 

PIN_15

PowerCC32XX_PIN16 

PIN_16

PowerCC32XX_PIN17 

PIN_17

PowerCC32XX_PIN18 

PIN_18

PowerCC32XX_PIN19 

PIN_19

PowerCC32XX_PIN20 

PIN_20

PowerCC32XX_PIN21 

PIN_21

PowerCC32XX_PIN29 

PIN_29

PowerCC32XX_PIN30 

PIN_30

PowerCC32XX_PIN45 

PIN_45

PowerCC32XX_PIN50 

PIN_50

PowerCC32XX_PIN52 

PIN_52

PowerCC32XX_PIN53 

PIN_53

PowerCC32XX_PIN55 

PIN_55

PowerCC32XX_PIN57 

PIN_57

PowerCC32XX_PIN58 

PIN_58

PowerCC32XX_PIN59 

PIN_59

PowerCC32XX_PIN60 

PIN_60

PowerCC32XX_PIN61 

PIN_61

PowerCC32XX_PIN62 

PIN_62

PowerCC32XX_PIN63 

PIN_63

PowerCC32XX_PIN64 

PIN_64

Function Documentation

§ PowerCC32XX_configureWakeup()

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.

Parameters
[in]wakeupSettings applied to wakeup configuration

§ PowerCC32XX_initPolicy()

void PowerCC32XX_initPolicy ( void  )

OS-specific power policy initialization function

§ PowerCC32XX_getWakeup()

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.

Parameters
[in]wakeupA PowerCC32XX_Wakeup structure to be written into

§ PowerCC32XX_getParkState()

PowerCC32XX_ParkState PowerCC32XX_getParkState ( PowerCC32XX_Pin  pin)

CC32XX-specific function to query the LPDS park state for a pin

§ PowerCC32XX_restoreParkState()

void PowerCC32XX_restoreParkState ( PowerCC32XX_Pin  pin,
PowerCC32XX_ParkState  state 
)

CC32XX-specific function to restore the LPDS park state for a pin

§ PowerCC32XX_setParkState()

void PowerCC32XX_setParkState ( PowerCC32XX_Pin  pin,
uint32_t  level 
)

CC32XX-specific function to dynamically set the LPDS park state for a pin

§ PowerCC32XX_disableIORetention()

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.

Parameters
[in]groupFlagsA logical OR of one or more of the following flags (defined in driverlib/prcm.h):
  • PRCM_IO_RET_GRP_0 - all pins except sFlash and JTAG interface
  • PRCM_IO_RET_GRP_1 - sFlash interface pins 11,12,13,14
  • PRCM_IO_RET_GRP_2 - JTAG TDI and TDO interface pins 16,17
  • PRCM_IO_RET_GRP_3 - JTAG TCK and TMS interface pins 19,20

§ PowerCC32XX_sleepPolicy()

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.

§ PowerCC32XX_reset()

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.

Parameters
[in]resourceIdresource id
Return values
Power_SOKon success,
Power_EINVALIDINPUTif the reseourceId is invalid.
© Copyright 1995-2019, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale