PowerCC26X2.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-2021, 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 #include <ti/drivers/dpl/HwiP.h>
56 #include <ti/drivers/dpl/ClockP.h>
57 #include <ti/drivers/Power.h>
59 #include <ti/drivers/Temperature.h>
60 
61 #include <ti/devices/DeviceFamily.h>
62 
63 #ifdef __cplusplus
64 extern "C" {
65 #endif
66 
68 #define PowerCC26X2_RESUMETIMESTANDBY 750
69 
71 #define PowerCC26X2_TOTALTIMESTANDBY 1000
72 
74 #define PowerCC26X2_WAKEDELAYSTANDBY 240
75 
77 #define PowerCC26X2_INITIALWAITRCOSC_LF 1000
78 
80 #define PowerCC26X2_RETRYWAITRCOSC_LF 1000
81 
83 #define PowerCC26X2_INITIALWAITXOSC_HF 50
84 
86 #define PowerCC26X2_RETRYWAITXOSC_HF 50
87 
89 #define PowerCC26X2_INITIALWAITXOSC_LF 10000
90 
92 #define PowerCC26X2_RETRYWAITXOSC_LF 5000
93 
94 /* Power peripheral IDs.
95  * See PowerCC26XX.h for peripheral IDs. Some are redefined here for compatibility.
96  */
97 
98 /* The PKA and UART1 peripherals are not available on CC13X1 and CC26X1 devices */
99 #if (DeviceFamily_PARENT == DeviceFamily_PARENT_CC13X2_CC26X2 || \
100  DeviceFamily_PARENT == DeviceFamily_PARENT_CC13X4_CC26X3_CC26X4)
101 
103 #define PowerCC26X2_PERIPH_PKA PowerCC26XX_PERIPH_PKA
104 
106 #define PowerCC26X2_PERIPH_UART1 PowerCC26XX_PERIPH_UART1
107 
108 #endif
109 
110 /* The peripherals below are only available on CC13X4 and CC26X4 devices */
111 #if (DeviceFamily_PARENT == DeviceFamily_PARENT_CC13X4_CC26X3_CC26X4)
112 
114 #define PowerCC26X2_PERIPH_UART2 PowerCC26XX_PERIPH_UART2
115 
117 #define PowerCC26X2_PERIPH_UART3 PowerCC26XX_PERIPH_UART3
118 
120 #define PowerCC26X2_PERIPH_SSI2 PowerCC26XX_PERIPH_SSI2
121 
123 #define PowerCC26X2_PERIPH_SSI3 PowerCC26XX_PERIPH_SSI3
124 
126 #define PowerCC26X2_PERIPH_I2C1 PowerCC26XX_PERIPH_I2C1
127 
128 #endif
129 
133 #define PowerCC26X2_HPOSC_RTC_COMPENSATION_DELTA 3
134 
135 /* \cond */
136 #define PowerCC26X2_NUMRESOURCES PowerCC26XX_NUMRESOURCES
137 /* \endcond */
138 
139 /* \cond */
140 #define PowerCC26X2_NUMCONSTRAINTS (PowerCC26XX_NUMCONSTRAINTS + 0) /* Number of constraints supported */
141 /* \endcond */
142 
143 /* \cond */
144 /*
145  * Calibration stages
146  */
147 #define PowerCC26X2_SETUP_CALIBRATE 1
148 #define PowerCC26X2_INITIATE_CALIBRATE 2
149 #define PowerCC26X2_DO_CALIBRATE 3
150 /* \endcond */
151 
152 
154 typedef struct {
195  bool (*calibrateFxn)(unsigned int);
233  void (*enableTCXOFxn)(bool);
235 
242 typedef struct {
244  uint32_t constraintMask;
245  ClockP_Struct clockObj;
246  ClockP_Struct calibrationClock;
247  ClockP_Struct tcxoEnableClock;
248  HwiP_Struct oscHwi;
249  HwiP_Struct tdcHwi;
250  int32_t nDeltaFreqCurr;
251  int32_t nCtrimCurr;
252  int32_t nCtrimFractCurr;
253  int32_t nCtrimNew;
254  int32_t nCtrimFractNew;
255  int32_t nRtrimNew;
256  int32_t nRtrimCurr;
257  int32_t nDeltaFreqNew;
258  bool bRefine;
259  uint32_t state;
260  bool xoscPending;
261  bool calLF;
262  uint8_t auxHwiState;
263  bool busyCal;
264  uint32_t calStep;
265  bool firstLF;
267  bool initialized;
268  uint8_t constraintCounts[PowerCC26X2_NUMCONSTRAINTS];
270  uint8_t resourceCounts[PowerCC26X2_NUMRESOURCES];
272  unsigned int (*resourceHandlers[3])(unsigned int);
276 
289 
290 #ifdef __cplusplus
291 }
292 #endif
293 
294 #endif /* POWER_CC26X2_ */
uint8_t auxHwiState
Definition: PowerCC26X2.h:262
Temperature driver.
HwiP_Struct oscHwi
Definition: PowerCC26X2.h:248
List_List notifyList
Definition: PowerCC26X2.h:243
Definition: List.h:131
int32_t nCtrimNew
Definition: PowerCC26X2.h:253
int32_t nCtrimFractCurr
Definition: PowerCC26X2.h:252
void(* Power_PolicyInitFxn)(void)
Power policy initialization function pointer.
Definition: Power.h:402
Power Manager.
bool xoscPending
Definition: PowerCC26X2.h:260
bool busyCal
Definition: PowerCC26X2.h:263
Power manager interface for CC26XX/CC13XX.
bool initialized
Definition: PowerCC26X2.h:267
int32_t nDeltaFreqNew
Definition: PowerCC26X2.h:257
bool calibrateRCOSC_HF
Boolean specifying whether the high frequency RC oscillator (RCOSC_HF) should be calibrated.
Definition: PowerCC26X2.h:226
bool enablePolicy
Definition: PowerCC26X2.h:266
void(* Power_PolicyFxn)(void)
Power policy function pointer.
Definition: Power.h:407
int32_t nRtrimNew
Definition: PowerCC26X2.h:255
ClockP_Struct tcxoEnableClock
Definition: PowerCC26X2.h:247
int32_t nDeltaFreqCurr
Definition: PowerCC26X2.h:250
uint32_t calStep
Definition: PowerCC26X2.h:264
Global configuration structure.
Definition: PowerCC26X2.h:154
Power_PolicyInitFxn policyInitFxn
The Power Policy&#39;s initialization function.
Definition: PowerCC26X2.h:161
bool calibrateRCOSC_LF
Boolean specifying whether the low frequency RC oscillator (RCOSC_LF) should be calibrated.
Definition: PowerCC26X2.h:217
ClockP_Struct calibrationClock
Definition: PowerCC26X2.h:246
PowerCC26X2_ModuleState.
Definition: PowerCC26X2.h:242
uint32_t state
Definition: PowerCC26X2.h:259
int32_t nRtrimCurr
Definition: PowerCC26X2.h:256
Power_PolicyFxn policyFxn
Definition: PowerCC26X2.h:274
int32_t nCtrimCurr
Definition: PowerCC26X2.h:251
void PowerCC26X2_enableHposcRtcCompensation(void)
Enable RTC compensation when SCLK_LF is derived from HPOSC.
uint32_t constraintMask
Definition: PowerCC26X2.h:244
bool enablePolicy
Boolean specifying if the Power Policy function is enabled.
Definition: PowerCC26X2.h:208
Power_PolicyFxn policyFxn
The Power Policy function.
Definition: PowerCC26X2.h:183
ClockP_Struct clockObj
Definition: PowerCC26X2.h:245
int32_t nCtrimFractNew
Definition: PowerCC26X2.h:254
HwiP_Struct tdcHwi
Definition: PowerCC26X2.h:249
bool bRefine
Definition: PowerCC26X2.h:258
bool firstLF
Definition: PowerCC26X2.h:265
bool calLF
Definition: PowerCC26X2.h:261
© Copyright 1995-2021, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale