TI-RTOS for SimpleLink Wireless MCUs  2.14.03.28
PowerCC3200.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
75 #ifndef ti_drivers_power_PowerCC3200__include
76 #define ti_drivers_power_PowerCC3200__include
77 
78 #include <stdint.h>
79 #include <ti/drivers/utils/List.h>
80 
81 /* driverlib header files */
82 #include <inc/hw_types.h>
83 #include <driverlib/pin.h>
84 #include <driverlib/rom_map.h>
85 
86 #ifdef __cplusplus
87 extern "C" {
88 #endif
89 
90 /* values were gathered from a logic analyzer and rounded up */
92 #define PowerCC3200_RESUMETIMEDEEPSLEEP 500
93 
95 #define PowerCC3200_RESUMETIMELPDS 2500
96 
98 #define PowerCC3200_TOTALTIMEDEEPSLEEP 1000
99 
101 #define PowerCC3200_TOTALTIMELPDS 5000
102 
104 #define PowerCC3200_TOTALTIMESHUTDOWN 500000
105 
106 /* Power resources */
107 #define PowerCC3200_PERIPH_CAMERA 0
108 #define PowerCC3200_PERIPH_I2S 1
109 #define PowerCC3200_PERIPH_SDHOST 2
110 #define PowerCC3200_PERIPH_GSPI 3
111 #define PowerCC3200_PERIPH_LSPI 4
112 #define PowerCC3200_PERIPH_UDMA 5
113 #define PowerCC3200_PERIPH_GPIOA0 6
114 #define PowerCC3200_PERIPH_GPIOA1 7
115 #define PowerCC3200_PERIPH_GPIOA2 8
116 #define PowerCC3200_PERIPH_GPIOA3 9
117 #define PowerCC3200_PERIPH_GPIOA4 10
118 #define PowerCC3200_PERIPH_WDT 11
119 #define PowerCC3200_PERIPH_UARTA0 12
120 #define PowerCC3200_PERIPH_UARTA1 13
121 #define PowerCC3200_PERIPH_TIMERA0 14
122 #define PowerCC3200_PERIPH_TIMERA1 15
123 #define PowerCC3200_PERIPH_TIMERA2 16
124 #define PowerCC3200_PERIPH_TIMERA3 17
125 #define PowerCC3200_PERIPH_DTHE 18
126 #define PowerCC3200_PERIPH_SSPI 19
127 #define PowerCC3200_PERIPH_I2CA0 20
128 #define PowerCC3200_NUMRESOURCES 21
129 
130 /*
131  * Power constraints on the CC3200 device
132  */
133 #define PowerCC3200_DISALLOW_DEEPSLEEP 0
134 #define PowerCC3200_DISALLOW_LPDS 1
135 #define PowerCC3200_DISALLOW_SHUTDOWN 2
136 #define PowerCC3200_NUMCONSTRAINTS 3
138 /*
139  * Power events on the CC3200 device
140  *
141  * Each event must be a power of two and must be sequential
142  * without any gaps.
143  */
144 #define PowerCC3200_ENTERING_DEEPSLEEP 0x1
145 #define PowerCC3200_ENTERING_LPDS 0x2
146 #define PowerCC3200_ENTERING_SHUTDOWN 0x4
147 #define PowerCC3200_AWAKE_DEEPSLEEP 0x8
148 #define PowerCC3200_AWAKE_LPDS 0x10
149 #define PowerCC3200_NUMEVENTS 5
151 /* Power sleep states */
152 #define PowerCC3200_DEEPSLEEP 0x1
153 #define PowerCC3200_LPDS 0x2
155 /* Use by NVIC Register structure */
156 #define PowerCC3200_numNVICSetEnableRegs 6
157 #define PowerCC3200_numNVICIntPriority 49
158 
160 typedef struct PowerCC3200_Config {
166  void (*enterLPDSHookFxn)(void);
173  void (*resumeLPDSHookFxn)(void);
233 
235 typedef struct PowerCC3200_ModuleState {
236  List_List notifyList;
237  uint32_t constraintMask;
238  uint32_t state;
244 
247  uint32_t vectorTable;
248  uint32_t auxCtrl;
249  uint32_t intCtrlState;
250  uint32_t appInt;
251  uint32_t sysCtrl;
252  uint32_t configCtrl;
253  uint32_t sysPri1;
254  uint32_t sysPri2;
255  uint32_t sysPri3;
256  uint32_t sysHcrs;
257  uint32_t systickCtrl;
258  uint32_t systickReload;
259  uint32_t systickCalib;
263 
265 typedef struct PowerCC3200_MCURegisters {
266  uint32_t msp;
267  uint32_t psp;
268  uint32_t psr;
269  uint32_t primask;
270  uint32_t faultmask;
271  uint32_t basepri;
272  uint32_t control;
274 
280 
282 typedef enum {
283  PowerCC3200_NO_PULL_HIZ = PIN_TYPE_STD,
284  PowerCC3200_WEAK_PULL_UP_STD = PIN_TYPE_STD_PU,
289 
291 typedef enum {
325 
327 typedef struct PowerCC3200_Wakeup {
336 
349 
351 void PowerCC3200_initPolicy(void);
352 
355 
357 void PowerCC3200_sleepPolicy(void);
358 
359 #define Power_getPerformanceLevel(void) 0
360 #define Power_setPerformanceLevel(level) Power_EFAIL
361 
362 #ifdef __cplusplus
363 }
364 #endif
365 
366 #endif /* ti_drivers_power_PowerCC3200__include */
struct PowerCC3200_SaveRegisters PowerCC3200_SaveRegisters
struct of context registers to save on entering LPDS
struct PowerCC3200_ModuleState PowerCC3200_ModuleState
Internal module state.
uint32_t configCtrl
Definition: PowerCC3200.h:252
bool enableNetworkWakeupLPDS
Definition: PowerCC3200.h:330
uint32_t msp
Definition: PowerCC3200.h:266
void PowerCC3200_configureWakeup(PowerCC3200_Wakeup *wakeup)
Function configures wakeup for LPDS and shutdown.
uint32_t control
Definition: PowerCC3200.h:272
Definition: PowerCC3200.h:312
Internal module state.
Definition: PowerCC3200.h:235
Definition: PowerCC3200.h:287
Definition: PowerCC3200.h:301
NVIC registers that need to be save on entering LPDS.
Definition: PowerCC3200.h:246
MCU core registers that need to be save on entering LPDS.
Definition: PowerCC3200.h:265
uint8_t refCount[PowerCC3200_NUMRESOURCES]
Definition: PowerCC3200.h:241
uint32_t wakeupGPIOTypeShutdown
The GPIO trigger type for wakeup from shutdown.
Definition: PowerCC3200.h:223
Definition: PowerCC3200.h:306
Power_PolicyInitFxn policyInitFxn
Definition: PowerCC3200.h:162
bool enableNetworkWakeupLPDS
Definition: PowerCC3200.h:181
bool enableGPIOWakeupShutdown
Definition: PowerCC3200.h:179
#define PowerCC3200_numNVICSetEnableRegs
Definition: PowerCC3200.h:156
uint32_t primask
Definition: PowerCC3200.h:269
uint32_t wakeupGPIOTypeLPDS
Definition: PowerCC3200.h:332
Definition: PowerCC3200.h:285
uint32_t wakeupGPIOSourceShutdown
Definition: PowerCC3200.h:333
struct of context registers to save on entering LPDS
Definition: PowerCC3200.h:276
uint32_t intSetEn[PowerCC3200_numNVICSetEnableRegs]
Definition: PowerCC3200.h:260
uint32_t wakeupGPIOTypeShutdown
Definition: PowerCC3200.h:334
uint32_t systickCalib
Definition: PowerCC3200.h:259
uint32_t wakeupGPIOTypeLPDS
The GPIO trigger type for wakeup from LPDS.
Definition: PowerCC3200.h:202
Definition: PowerCC3200.h:283
void(* Power_PolicyInitFxn)(void)
Power policy initialization function pointer.
Definition: Power.h:91
Definition: PowerCC3200.h:310
uint32_t intCtrlState
Definition: PowerCC3200.h:249
uint32_t wakeupGPIOSourceShutdown
The GPIO sources for wakeup from shutdown.
Definition: PowerCC3200.h:215
Power_PolicyFxn policyFxn
Definition: PowerCC3200.h:164
uint32_t sysPri2
Definition: PowerCC3200.h:254
Definition: PowerCC3200.h:293
Definition: PowerCC3200.h:318
Definition: PowerCC3200.h:292
uint16_t dbRecords[PowerCC3200_NUMRESOURCES]
Definition: PowerCC3200.h:239
uint32_t vectorTable
Definition: PowerCC3200.h:247
Definition: PowerCC3200.h:320
void(* enterLPDSHookFxn)(void)
Definition: PowerCC3200.h:166
Definition: PowerCC3200.h:314
Definition: PowerCC3200.h:303
#define PowerCC3200_NUMRESOURCES
Definition: PowerCC3200.h:128
Definition: PowerCC3200.h:323
uint32_t sysPri1
Definition: PowerCC3200.h:253
uint32_t basepri
Definition: PowerCC3200.h:271
void PowerCC3200_sleepPolicy(void)
Definition: PowerCC3200.h:305
uint32_t sysHcrs
Definition: PowerCC3200.h:256
uint32_t appInt
Definition: PowerCC3200.h:250
void(* Power_PolicyFxn)(void)
Power policy function pointer.
Definition: Power.h:96
bool enablePolicy
Definition: PowerCC3200.h:240
Definition: PowerCC3200.h:317
Definition: PowerCC3200.h:284
Definition: PowerCC3200.h:313
uint8_t constraintCounts[PowerCC3200_NUMCONSTRAINTS]
Definition: PowerCC3200.h:242
uint32_t systickReload
Definition: PowerCC3200.h:258
Definition: PowerCC3200.h:295
struct PowerCC3200_NVICRegisters PowerCC3200_NVICRegisters
NVIC registers that need to be save on entering LPDS.
bool enableGPIOWakeupLPDS
Definition: PowerCC3200.h:177
Definition: PowerCC3200.h:307
Definition: PowerCC3200.h:321
Definition: PowerCC3200.h:297
uint32_t psr
Definition: PowerCC3200.h:268
Definition: PowerCC3200.h:294
#define PowerCC3200_numNVICIntPriority
Definition: PowerCC3200.h:157
Definition: PowerCC3200.h:286
List_List notifyList
Definition: PowerCC3200.h:236
uint32_t psp
Definition: PowerCC3200.h:267
PowerCC3200_Pin
enumeration of pins that can be parked
Definition: PowerCC3200.h:291
Definition: PowerCC3200.h:308
uint32_t wakeupGPIOSourceLPDS
The GPIO source for wakeup from LPDS.
Definition: PowerCC3200.h:194
void PowerCC3200_initPolicy(void)
PowerCC3200_ParkState
enumeration of states for parked pins
Definition: PowerCC3200.h:282
Definition: PowerCC3200.h:315
#define PowerCC3200_NUMCONSTRAINTS
Definition: PowerCC3200.h:136
Definition: PowerCC3200.h:298
struct PowerCC3200_MCURegisters PowerCC3200_MCURegisters
MCU core registers that need to be save on entering LPDS.
Definition: PowerCC3200.h:302
struct PowerCC3200_Config PowerCC3200_Config
Power global configuration.
PowerCC3200_MCURegisters m4Regs
Definition: PowerCC3200.h:277
uint32_t wakeupGPIOSourceLPDS
Definition: PowerCC3200.h:331
void PowerCC3200_parkPin(PowerCC3200_Pin pin, PowerCC3200_ParkState parkState)
struct PowerCC3200_Wakeup PowerCC3200_Wakeup
For wakeup from LPDS or shutdown configuration.
uint32_t systickCtrl
Definition: PowerCC3200.h:257
uint32_t state
Definition: PowerCC3200.h:238
bool enableGPIOWakeupShutdown
Definition: PowerCC3200.h:329
uint32_t auxCtrl
Definition: PowerCC3200.h:248
Definition: PowerCC3200.h:316
uint32_t constraintMask
Definition: PowerCC3200.h:237
Definition: PowerCC3200.h:322
Definition: PowerCC3200.h:319
void(* resumeLPDSHookFxn)(void)
Hook function called when resuming from LPDS.
Definition: PowerCC3200.h:173
Definition: PowerCC3200.h:309
Definition: PowerCC3200.h:296
bool enableGPIOWakeupLPDS
Definition: PowerCC3200.h:328
bool enablePolicy
Definition: PowerCC3200.h:175
Definition: PowerCC3200.h:304
PowerCC3200_NVICRegisters nvicRegs
Definition: PowerCC3200.h:278
uint32_t faultmask
Definition: PowerCC3200.h:270
uint32_t intPriority[PowerCC3200_numNVICIntPriority]
Definition: PowerCC3200.h:261
Definition: PowerCC3200.h:311
For wakeup from LPDS or shutdown configuration.
Definition: PowerCC3200.h:327
uint32_t sysPri3
Definition: PowerCC3200.h:255
Power global configuration.
Definition: PowerCC3200.h:160
uint32_t ramRetentionMaskLPDS
SRAM retention mask for LPDS.
Definition: PowerCC3200.h:231
Definition: PowerCC3200.h:300
Definition: PowerCC3200.h:299
uint32_t sysCtrl
Definition: PowerCC3200.h:251
Copyright 2015, Texas Instruments Incorporated