TI-RTOS for SimpleLink Wireless MCUs  2.14.02.22
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);
168  void (*resumeLPDSHookFxn)(void);
228 
230 typedef struct PowerCC3200_ModuleState {
231  List_List notifyList;
232  uint32_t constraintMask;
233  uint32_t state;
239 
242  uint32_t vectorTable;
243  uint32_t auxCtrl;
244  uint32_t intCtrlState;
245  uint32_t appInt;
246  uint32_t sysCtrl;
247  uint32_t configCtrl;
248  uint32_t sysPri1;
249  uint32_t sysPri2;
250  uint32_t sysPri3;
251  uint32_t sysHcrs;
252  uint32_t systickCtrl;
253  uint32_t systickReload;
254  uint32_t systickCalib;
258 
260 typedef struct PowerCC3200_MCURegisters {
261  uint32_t msp;
262  uint32_t psp;
263  uint32_t psr;
264  uint32_t primask;
265  uint32_t faultmask;
266  uint32_t basepri;
267  uint32_t control;
269 
275 
277 typedef enum {
278  PowerCC3200_NO_PULL_HIZ = PIN_TYPE_STD,
279  PowerCC3200_WEAK_PULL_UP_STD = PIN_TYPE_STD_PU,
284 
286 typedef enum {
320 
322 typedef struct PowerCC3200_Wakeup {
331 
344 
346 void PowerCC3200_initPolicy(void);
347 
350 
352 void PowerCC3200_sleepPolicy(void);
353 
354 #define Power_getPerformanceLevel(void) 0
355 #define Power_setPerformanceLevel(level) Power_EFAIL
356 
357 #ifdef __cplusplus
358 }
359 #endif
360 
361 #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:247
bool enableNetworkWakeupLPDS
Definition: PowerCC3200.h:325
uint32_t msp
Definition: PowerCC3200.h:261
void PowerCC3200_configureWakeup(PowerCC3200_Wakeup *wakeup)
Function configures wakeup for LPDS and shutdown.
uint32_t control
Definition: PowerCC3200.h:267
Definition: PowerCC3200.h:307
Internal module state.
Definition: PowerCC3200.h:230
Definition: PowerCC3200.h:282
Definition: PowerCC3200.h:296
NVIC registers that need to be save on entering LPDS.
Definition: PowerCC3200.h:241
MCU core registers that need to be save on entering LPDS.
Definition: PowerCC3200.h:260
uint8_t refCount[PowerCC3200_NUMRESOURCES]
Definition: PowerCC3200.h:236
uint32_t wakeupGPIOTypeShutdown
The GPIO trigger type for wakeup from shutdown.
Definition: PowerCC3200.h:218
Definition: PowerCC3200.h:301
Power_PolicyInitFxn policyInitFxn
Definition: PowerCC3200.h:162
bool enableNetworkWakeupLPDS
Definition: PowerCC3200.h:176
bool enableGPIOWakeupShutdown
Definition: PowerCC3200.h:174
#define PowerCC3200_numNVICSetEnableRegs
Definition: PowerCC3200.h:156
uint32_t primask
Definition: PowerCC3200.h:264
uint32_t wakeupGPIOTypeLPDS
Definition: PowerCC3200.h:327
Definition: PowerCC3200.h:280
uint32_t wakeupGPIOSourceShutdown
Definition: PowerCC3200.h:328
struct of context registers to save on entering LPDS
Definition: PowerCC3200.h:271
uint32_t intSetEn[PowerCC3200_numNVICSetEnableRegs]
Definition: PowerCC3200.h:255
uint32_t wakeupGPIOTypeShutdown
Definition: PowerCC3200.h:329
uint32_t systickCalib
Definition: PowerCC3200.h:254
uint32_t wakeupGPIOTypeLPDS
The GPIO trigger type for wakeup from LPDS.
Definition: PowerCC3200.h:197
Definition: PowerCC3200.h:278
void(* Power_PolicyInitFxn)(void)
Power policy initialization function pointer.
Definition: Power.h:91
Definition: PowerCC3200.h:305
uint32_t intCtrlState
Definition: PowerCC3200.h:244
uint32_t wakeupGPIOSourceShutdown
The GPIO sources for wakeup from shutdown.
Definition: PowerCC3200.h:210
Power_PolicyFxn policyFxn
Definition: PowerCC3200.h:164
uint32_t sysPri2
Definition: PowerCC3200.h:249
Definition: PowerCC3200.h:288
Definition: PowerCC3200.h:313
Definition: PowerCC3200.h:287
uint16_t dbRecords[PowerCC3200_NUMRESOURCES]
Definition: PowerCC3200.h:234
uint32_t vectorTable
Definition: PowerCC3200.h:242
Definition: PowerCC3200.h:315
void(* enterLPDSHookFxn)(void)
Definition: PowerCC3200.h:166
Definition: PowerCC3200.h:309
Definition: PowerCC3200.h:298
#define PowerCC3200_NUMRESOURCES
Definition: PowerCC3200.h:128
Definition: PowerCC3200.h:318
uint32_t sysPri1
Definition: PowerCC3200.h:248
uint32_t basepri
Definition: PowerCC3200.h:266
void PowerCC3200_sleepPolicy(void)
Definition: PowerCC3200.h:300
uint32_t sysHcrs
Definition: PowerCC3200.h:251
uint32_t appInt
Definition: PowerCC3200.h:245
void(* Power_PolicyFxn)(void)
Power policy function pointer.
Definition: Power.h:96
bool enablePolicy
Definition: PowerCC3200.h:235
Definition: PowerCC3200.h:312
Definition: PowerCC3200.h:279
Definition: PowerCC3200.h:308
uint8_t constraintCounts[PowerCC3200_NUMCONSTRAINTS]
Definition: PowerCC3200.h:237
uint32_t systickReload
Definition: PowerCC3200.h:253
Definition: PowerCC3200.h:290
struct PowerCC3200_NVICRegisters PowerCC3200_NVICRegisters
NVIC registers that need to be save on entering LPDS.
bool enableGPIOWakeupLPDS
Definition: PowerCC3200.h:172
Definition: PowerCC3200.h:302
Definition: PowerCC3200.h:316
Definition: PowerCC3200.h:292
uint32_t psr
Definition: PowerCC3200.h:263
Definition: PowerCC3200.h:289
#define PowerCC3200_numNVICIntPriority
Definition: PowerCC3200.h:157
Definition: PowerCC3200.h:281
List_List notifyList
Definition: PowerCC3200.h:231
uint32_t psp
Definition: PowerCC3200.h:262
PowerCC3200_Pin
enumeration of pins that can be parked
Definition: PowerCC3200.h:286
Definition: PowerCC3200.h:303
uint32_t wakeupGPIOSourceLPDS
The GPIO source for wakeup from LPDS.
Definition: PowerCC3200.h:189
void PowerCC3200_initPolicy(void)
PowerCC3200_ParkState
enumeration of states for parked pins
Definition: PowerCC3200.h:277
Definition: PowerCC3200.h:310
#define PowerCC3200_NUMCONSTRAINTS
Definition: PowerCC3200.h:136
Definition: PowerCC3200.h:293
struct PowerCC3200_MCURegisters PowerCC3200_MCURegisters
MCU core registers that need to be save on entering LPDS.
Definition: PowerCC3200.h:297
struct PowerCC3200_Config PowerCC3200_Config
Power global configuration.
PowerCC3200_MCURegisters m4Regs
Definition: PowerCC3200.h:272
uint32_t wakeupGPIOSourceLPDS
Definition: PowerCC3200.h:326
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:252
uint32_t state
Definition: PowerCC3200.h:233
bool enableGPIOWakeupShutdown
Definition: PowerCC3200.h:324
uint32_t auxCtrl
Definition: PowerCC3200.h:243
Definition: PowerCC3200.h:311
uint32_t constraintMask
Definition: PowerCC3200.h:232
Definition: PowerCC3200.h:317
Definition: PowerCC3200.h:314
void(* resumeLPDSHookFxn)(void)
Definition: PowerCC3200.h:168
Definition: PowerCC3200.h:304
Definition: PowerCC3200.h:291
bool enableGPIOWakeupLPDS
Definition: PowerCC3200.h:323
bool enablePolicy
Definition: PowerCC3200.h:170
Definition: PowerCC3200.h:299
PowerCC3200_NVICRegisters nvicRegs
Definition: PowerCC3200.h:273
uint32_t faultmask
Definition: PowerCC3200.h:265
uint32_t intPriority[PowerCC3200_numNVICIntPriority]
Definition: PowerCC3200.h:256
Definition: PowerCC3200.h:306
For wakeup from LPDS or shutdown configuration.
Definition: PowerCC3200.h:322
uint32_t sysPri3
Definition: PowerCC3200.h:250
Power global configuration.
Definition: PowerCC3200.h:160
uint32_t ramRetentionMaskLPDS
SRAM retention mask for LPDS.
Definition: PowerCC3200.h:226
Definition: PowerCC3200.h:295
Definition: PowerCC3200.h:294
uint32_t sysCtrl
Definition: PowerCC3200.h:246
Copyright 2015, Texas Instruments Incorporated