PowerCC26X2.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017, 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 CONSEQueueNTIAL 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  */
52 #ifndef ti_drivers_power_PowerCC26X2_
53 #define ti_drivers_power_PowerCC26X2_
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
59 #include <ti/drivers/dpl/HwiP.h>
60 #include <ti/drivers/dpl/ClockP.h>
61 #include <ti/drivers/Power.h>
63 
65 #define PowerCC26X2_RESUMETIMESTANDBY 750
66 
68 #define PowerCC26X2_TOTALTIMESTANDBY 1000
69 
71 #define PowerCC26X2_WAKEDELAYSTANDBY 240
72 
74 #define PowerCC26X2_INITIALWAITRCOSC_LF 1000
75 
77 #define PowerCC26X2_RETRYWAITRCOSC_LF 1000
78 
80 #define PowerCC26X2_INITIALWAITXOSC_HF 50
81 
83 #define PowerCC26X2_RETRYWAITXOSC_HF 50
84 
86 #define PowerCC26X2_INITIALWAITXOSC_LF 10000
87 
89 #define PowerCC26X2_RETRYWAITXOSC_LF 5000
90 
91 #define PowerCC26X2_PERIPH_PKA PowerCC26XX_NUMRESOURCES
93 /* \cond */
94 #define PowerCC26X2_NUMRESOURCES (PowerCC26XX_NUMRESOURCES + 1) /* Number of resources in database */
95 /* \endcond */
96 
97 /* \cond */
98 #define PowerCC26X2_NUMCONSTRAINTS (PowerCC26XX_NUMCONSTRAINTS + 0) /* Number of constraints supported */
99 /* \endcond */
100 
101 /* \cond */
102 /*
103  * Calibration stages
104  */
105 #define PowerCC26X2_SETUP_CALIBRATE 1
106 #define PowerCC26X2_INITIATE_CALIBRATE 2
107 #define PowerCC26X2_DO_CALIBRATE 3
108 /* \endcond */
109 
110 
112 typedef struct PowerCC26X2_Config {
153  bool (*calibrateFxn)(unsigned int);
186 
193 typedef struct PowerCC26X2_ModuleState {
195  uint32_t constraintMask;
196  ClockP_Struct clockObj;
197  ClockP_Struct xoscClockObj;
198  ClockP_Struct lfClockObj;
199  ClockP_Struct calClockStruct;
200  HwiP_Struct hwiStruct;
201  int32_t nDeltaFreqCurr;
202  int32_t nCtrimCurr;
203  int32_t nCtrimFractCurr;
204  int32_t nCtrimNew;
205  int32_t nCtrimFractNew;
206  int32_t nRtrimNew;
207  int32_t nRtrimCurr;
208  int32_t nDeltaFreqNew;
209  bool bRefine;
210  uint32_t state;
211  bool xoscPending;
212  bool calLF;
213  uint8_t hwiState;
214  bool busyCal;
215  uint8_t calStep;
216  bool firstLF;
218  bool initialized;
219  uint8_t constraintCounts[PowerCC26X2_NUMCONSTRAINTS];
221  uint8_t resourceCounts[PowerCC26X2_NUMRESOURCES];
223  unsigned int (*resourceHandlers[3])(unsigned int);
227 
228 
229 #ifdef __cplusplus
230 }
231 #endif
232 
233 #endif /* POWER_CC26X2_ */
struct PowerCC26X2_ModuleState PowerCC26X2_ModuleState
PowerCC26X2_ModuleState.
List_List notifyList
Definition: PowerCC26X2.h:194
struct PowerCC26X2_Config PowerCC26X2_Config
Global configuration structure.
Definition: List.h:131
int32_t nCtrimNew
Definition: PowerCC26X2.h:204
uint8_t calStep
Definition: PowerCC26X2.h:215
int32_t nCtrimFractCurr
Definition: PowerCC26X2.h:203
void(* Power_PolicyInitFxn)(void)
Power policy initialization function pointer.
Definition: Power.h:94
Power manager interface.
ClockP_Struct xoscClockObj
Definition: PowerCC26X2.h:197
bool xoscPending
Definition: PowerCC26X2.h:211
bool busyCal
Definition: PowerCC26X2.h:214
Power manager interface for CC26XX/CC13XX.
bool initialized
Definition: PowerCC26X2.h:218
int32_t nDeltaFreqNew
Definition: PowerCC26X2.h:208
bool calibrateRCOSC_HF
Boolean specifying whether the high frequency RC oscillator (RCOSC_HF) should be calibrated.
Definition: PowerCC26X2.h:184
bool enablePolicy
Definition: PowerCC26X2.h:217
void(* Power_PolicyFxn)(void)
Power policy function pointer.
Definition: Power.h:99
int32_t nRtrimNew
Definition: PowerCC26X2.h:206
ClockP_Struct calClockStruct
Definition: PowerCC26X2.h:199
uint8_t hwiState
Definition: PowerCC26X2.h:213
ClockP_Struct lfClockObj
Definition: PowerCC26X2.h:198
int32_t nDeltaFreqCurr
Definition: PowerCC26X2.h:201
bool(* calibrateFxn)(unsigned int)
The function to be used for activating RC Oscillator (RCOSC) calibration.
Definition: PowerCC26X2.h:153
Global configuration structure.
Definition: PowerCC26X2.h:112
Power_PolicyInitFxn policyInitFxn
The Power Policy&#39;s initialization function.
Definition: PowerCC26X2.h:119
bool calibrateRCOSC_LF
Boolean specifying whether the low frequency RC oscillator (RCOSC_LF) should be calibrated.
Definition: PowerCC26X2.h:175
HwiP_Struct hwiStruct
Definition: PowerCC26X2.h:200
PowerCC26X2_ModuleState.
Definition: PowerCC26X2.h:193
uint32_t state
Definition: PowerCC26X2.h:210
int32_t nRtrimCurr
Definition: PowerCC26X2.h:207
Power_PolicyFxn policyFxn
Definition: PowerCC26X2.h:225
int32_t nCtrimCurr
Definition: PowerCC26X2.h:202
uint32_t constraintMask
Definition: PowerCC26X2.h:195
bool enablePolicy
Boolean specifying if the Power Policy function is enabled.
Definition: PowerCC26X2.h:166
Power_PolicyFxn policyFxn
The Power Policy function.
Definition: PowerCC26X2.h:141
ClockP_Struct clockObj
Definition: PowerCC26X2.h:196
int32_t nCtrimFractNew
Definition: PowerCC26X2.h:205
bool bRefine
Definition: PowerCC26X2.h:209
bool firstLF
Definition: PowerCC26X2.h:216
bool calLF
Definition: PowerCC26X2.h:212
Copyright 2017, Texas Instruments Incorporated