PowerCC26X2.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-2023, 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  */
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 #include DeviceFamily_constructPath(driverlib/sys_ctrl.h)
63 
64 #ifdef __cplusplus
65 extern "C" {
66 #endif
67 
69 #define PowerCC26X2_RESUMETIMESTANDBY 750
70 
72 #define PowerCC26X2_TOTALTIMESTANDBY 1000
73 
75 #define PowerCC26X2_WAKEDELAYSTANDBY 240
76 
78 #define PowerCC26X2_INITIALWAITRCOSC_LF 1000
79 
81 #define PowerCC26X2_RETRYWAITRCOSC_LF 1000
82 
84 #define PowerCC26X2_INITIALWAITXOSC_HF 50
85 
87 #define PowerCC26X2_RETRYWAITXOSC_HF 50
88 
90 #define PowerCC26X2_INITIALWAITXOSC_LF 10000
91 
93 #define PowerCC26X2_RETRYWAITXOSC_LF 5000
94 
95 /* Power peripheral IDs.
96  * See PowerCC26XX.h for peripheral IDs. Some are redefined here for compatibility.
97  */
98 
99 /* The PKA, UART1 and SSI1 peripherals are not available on CC13X1 and CC26X1 devices */
100 #if (DeviceFamily_PARENT == DeviceFamily_PARENT_CC13X2_CC26X2 || \
101  DeviceFamily_PARENT == DeviceFamily_PARENT_CC13X4_CC26X3_CC26X4)
102 
104  #define PowerCC26X2_PERIPH_PKA PowerCC26XX_PERIPH_PKA
105 
107  #define PowerCC26X2_PERIPH_UART1 PowerCC26XX_PERIPH_UART1
108 
110  #define PowerCC26X2_PERIPH_SSI1 PowerCC26XX_PERIPH_SSI1
111  #if (DeviceFamily_PARENT == DeviceFamily_PARENT_CC13X4_CC26X3_CC26X4)
112 
113  #define PowerCC26X2_PERIPH_SPI1 PowerCC26X2_PERIPH_SSI1
114  #endif
115 
116 #endif
117 
118 /* The peripherals below are only available on CC13X4, CC26X3 and CC26X4 devices */
119 #if (DeviceFamily_PARENT == DeviceFamily_PARENT_CC13X4_CC26X3_CC26X4)
120 
122  #define PowerCC26X2_PERIPH_UART2 PowerCC26XX_PERIPH_UART2
123 
125  #define PowerCC26X2_PERIPH_UART3 PowerCC26XX_PERIPH_UART3
126 
128  #define PowerCC26X2_PERIPH_SPI2 PowerCC26XX_PERIPH_SPI2
129 
130  #define PowerCC26X2_PERIPH_SSI2 PowerCC26X2_PERIPH_SPI2
131 
133  #define PowerCC26X2_PERIPH_SPI3 PowerCC26XX_PERIPH_SPI3
134 
135  #define PowerCC26X2_PERIPH_SSI3 PowerCC26X2_PERIPH_SPI3
136 
138  #define PowerCC26X2_PERIPH_I2C1 PowerCC26XX_PERIPH_I2C1
139 
140 #endif
141 
145 #define PowerCC26X2_HPOSC_RTC_COMPENSATION_DELTA 3
146 
150 #define PowerCC26X2_XOSC_LF_RTC_COMPENSATION_DELTA 2
151 
152 /* \cond */
153 #define PowerCC26X2_NUMRESOURCES PowerCC26XX_NUMRESOURCES
154 /* \endcond */
155 
156 /* \cond */
157 #define PowerCC26X2_NUMCONSTRAINTS (PowerCC26XX_NUMCONSTRAINTS + 0) /* Number of constraints supported */
158 /* \endcond */
159 
160 /* \cond */
161 /*
162  * Calibration stages
163  */
164 #define PowerCC26X2_SETUP_CALIBRATE 1
165 #define PowerCC26X2_INITIATE_CALIBRATE 2
166 #define PowerCC26X2_DO_CALIBRATE 3
167 /* \endcond */
168 
172 typedef enum
173 {
175  PowerCC26X2_RESET_SHUTDOWN_IO = RSTSRC_WAKEUP_FROM_SHUTDOWN,
177  PowerCC26X2_RESET_TCK_NOISE = RSTSRC_WAKEUP_FROM_TCK_NOISE,
179  PowerCC26X2_RESET_SYSTEM = RSTSRC_SYSRESET,
181  PowerCC26X2_RESET_WARM_RESET = RSTSRC_WARMRESET,
183  PowerCC26X2_RESET_CLK = RSTSRC_CLK_LOSS,
185  PowerCC26X2_RESET_VDDR = RSTSRC_VDDR_LOSS,
187  PowerCC26X2_RESET_VDDS = RSTSRC_VDDS_LOSS,
189  PowerCC26X2_RESET_PIN = RSTSRC_PIN_RESET,
191  PowerCC26X2_RESET_POR = RSTSRC_PWR_ON,
193 
195 typedef struct
196 {
237  bool (*calibrateFxn)(unsigned int calibrationStage);
275  void (*enableTCXOFxn)(bool arg);
277 
284 typedef struct
285 {
287  uint32_t constraintMask;
293  int32_t nDeltaFreqCurr;
294  int32_t nCtrimCurr;
295  int32_t nCtrimFractCurr;
296  int32_t nCtrimNew;
297  int32_t nCtrimFractNew;
298  int32_t nRtrimNew;
299  int32_t nRtrimCurr;
300  int32_t nDeltaFreqNew;
301  bool bRefine;
302  uint32_t state;
303  bool xoscPending;
304  bool calLF;
305  uint8_t auxHwiState;
306  bool busyCal;
307  uint32_t calStep;
308  bool firstLF;
310  bool initialized;
311  uint8_t constraintCounts[PowerCC26X2_NUMCONSTRAINTS];
313  uint8_t resourceCounts[PowerCC26X2_NUMRESOURCES];
315  unsigned int (*resourceHandlers[3])(unsigned int arg);
318  PowerCC26X2_ResetReason lastResetReason;
320 
333 
346 
354 PowerCC26X2_ResetReason PowerCC26X2_getResetReason(void);
355 
370 static inline void PowerCC26X2_releaseLatches(void)
371 {
372  PowerCtrlPadSleepDisable();
373 }
374 
375 #ifdef __cplusplus
376 }
377 #endif
378 
379 #endif /* POWER_CC26X2_ */
uint8_t auxHwiState
Definition: PowerCC26X2.h:305
Temperature driver.
HwiP structure.
Definition: HwiP.h:78
HwiP_Struct oscHwi
Definition: PowerCC26X2.h:291
List_List notifyList
Definition: PowerCC26X2.h:286
Definition: List.h:132
int32_t nCtrimNew
Definition: PowerCC26X2.h:296
Definition: PowerCC26X2.h:183
PowerCC26X2_ResetReason PowerCC26X2_getResetReason(void)
Returns the reason for the most recent reset.
Definition: PowerCC26X2.h:181
Definition: PowerCC26X2.h:179
static void PowerCC26X2_releaseLatches(void)
Unlatch all IOs.
Definition: PowerCC26X2.h:370
ClockP structure.
Definition: ClockP.h:81
Clock interface for the RTOS Porting Interface.
int32_t nCtrimFractCurr
Definition: PowerCC26X2.h:295
void(* Power_PolicyInitFxn)(void)
Power policy initialization function pointer.
Definition: Power.h:401
void PowerCC26X2_enableXoscLfRtcCompensation(void)
Enable RTC compensation when SCLK_LF is derived from XOSC_LF.
Power Manager.
bool xoscPending
Definition: PowerCC26X2.h:303
Definition: PowerCC26X2.h:191
bool busyCal
Definition: PowerCC26X2.h:306
Power manager interface for CC26XX/CC13XX.
bool initialized
Definition: PowerCC26X2.h:310
Definition: PowerCC26X2.h:177
int32_t nDeltaFreqNew
Definition: PowerCC26X2.h:300
bool calibrateRCOSC_HF
Boolean specifying whether the high frequency RC oscillator (RCOSC_HF) should be calibrated.
Definition: PowerCC26X2.h:268
bool enablePolicy
Definition: PowerCC26X2.h:309
void(* Power_PolicyFxn)(void)
Power policy function pointer.
Definition: Power.h:406
int32_t nRtrimNew
Definition: PowerCC26X2.h:298
Definition: PowerCC26X2.h:185
PowerCC26X2_ResetReason
Reasons the device has booted or rebooted.
Definition: PowerCC26X2.h:172
ClockP_Struct tcxoEnableClock
Definition: PowerCC26X2.h:290
int32_t nDeltaFreqCurr
Definition: PowerCC26X2.h:293
uint32_t calStep
Definition: PowerCC26X2.h:307
Global configuration structure.
Definition: PowerCC26X2.h:195
PowerCC26X2_ResetReason lastResetReason
Definition: PowerCC26X2.h:318
Power_PolicyInitFxn policyInitFxn
The Power Policy&#39;s initialization function.
Definition: PowerCC26X2.h:203
bool calibrateRCOSC_LF
Boolean specifying whether the low frequency RC oscillator (RCOSC_LF) should be calibrated.
Definition: PowerCC26X2.h:259
ClockP_Struct calibrationClock
Definition: PowerCC26X2.h:289
PowerCC26X2_ModuleState.
Definition: PowerCC26X2.h:284
uint32_t state
Definition: PowerCC26X2.h:302
int32_t nRtrimCurr
Definition: PowerCC26X2.h:299
Definition: PowerCC26X2.h:189
Power_PolicyFxn policyFxn
Definition: PowerCC26X2.h:317
int32_t nCtrimCurr
Definition: PowerCC26X2.h:294
void PowerCC26X2_enableHposcRtcCompensation(void)
Enable RTC compensation when SCLK_LF is derived from HPOSC.
uint32_t constraintMask
Definition: PowerCC26X2.h:287
bool enablePolicy
Boolean specifying if the Power Policy function is enabled.
Definition: PowerCC26X2.h:250
Power_PolicyFxn policyFxn
The Power Policy function.
Definition: PowerCC26X2.h:225
Definition: PowerCC26X2.h:187
ClockP_Struct clockObj
Definition: PowerCC26X2.h:288
int32_t nCtrimFractNew
Definition: PowerCC26X2.h:297
HwiP_Struct tdcHwi
Definition: PowerCC26X2.h:292
bool bRefine
Definition: PowerCC26X2.h:301
bool firstLF
Definition: PowerCC26X2.h:308
Hardware Interrupt module for the RTOS Porting Interface.
Definition: PowerCC26X2.h:175
bool calLF
Definition: PowerCC26X2.h:304
© Copyright 1995-2023, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale