PowerWFF3.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2022-2025, 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  */
51 #ifndef ti_drivers_power_PowerWFF3__include
52 #define ti_drivers_power_PowerWFF3__include
53 
54 #include <ti/drivers/dpl/HwiP.h>
55 #include <ti/drivers/dpl/ClockP.h>
56 #include <ti/drivers/Power.h>
57 
58 #include <ti/devices/DeviceFamily.h>
59 
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
63 
65 #define PowerWFF3_RESUMETIMESLEEP 15000
66 
68 #define PowerWFF3_TOTALTIMESLEEP 16000
69 
71 #define PowerWFF3_WAKEDELAYSLEEP 15000
72 
73 /* Resource IDs */
74 
76 #define PowerWFF3_PERIPH_DCAN 0
77 
79 #define PowerWFF3_PERIPH_GPTIMER0 1
80 
82 #define PowerWFF3_PERIPH_GPTIMER1 2
83 
85 #define PowerWFF3_PERIPH_I2C0 3
86 
88 #define PowerWFF3_PERIPH_I2C1 4
89 
91 #define PowerWFF3_PERIPH_I2S 5
92 
94 #define PowerWFF3_PERIPH_SDMMC 6
95 
97 #define PowerWFF3_PERIPH_SPI0 7
98 
100 #define PowerWFF3_PERIPH_SPI1 8
101 
103 #define PowerWFF3_PERIPH_SYSTIMER 9
104 
106 #define PowerWFF3_PERIPH_UARTLIN0 10
107 
109 #define PowerWFF3_PERIPH_UARTLIN1 11
110 
112 #define PowerWFF3_PERIPH_SDIO 12
113 
115 #define PowerWFF3_PERIPH_ADC0 13
116 
118 #define PowerWFF3_PERIPH_UARTLIN2 14
119 
120 /* \cond */
121 /* Number of resources in database.
122  */
123 #define PowerWFF3_NUMRESOURCES 15
124 /* \endcond */
125 
126 #define PowerWFF3_SLEEP 0x1
127 /* \cond */
128 /* Internal flags for enabling/disabling resources */
129 #define PowerWFF3_ENABLE 1
130 #define PowerWFF3_DISABLE 0
131 /* \endcond */
132 
133 /* Constraints
134  *
135  * Constraints restrict a specific system behavior from occurring or guarantee
136  * a specified effect until released.
137  * TODO: Update list of constraints for WFF3
138  */
139 
141 #define PowerWFF3_DISALLOW_SHUTDOWN 0
142 
144 #define PowerWFF3_DISALLOW_SLEEP 1
145 
147 #define PowerWFF3_DISALLOW_IDLE 2
148 
149 /* \cond */
150 #define PowerWFF3_NUMCONSTRAINTS 3 /* Number of constraints supported */
151 /* \endcond */
152 
153 /*
154  * Events
155  *
156  * Each event must be a power of two and must be sequential
157  * without any gaps.
158  * TODO: Update list of events for WFF3
159  */
160 
162 #define PowerWFF3_ENTERING_SLEEP (1 << 0)
163 
165 #define PowerWFF3_ENTERING_SHUTDOWN (1 << 1)
166 
168 #define PowerWFF3_AWAKE_SLEEP (1 << 2)
169 
170 /* \cond */
171 #define PowerWFF3_NUMEVENTS 3 /* Number of events supported */
172 /* \endcond */
173 
174 /* \cond */
175 typedef uint8_t PowerWFF3_Resource; /* Power resource identifier */
176 /* \endcond */
177 
179 typedef struct
180 {
218 
222 typedef enum
223 {
225  PowerWFF3_RESET_PIN = 0, // PMCTL_RSTSTA_RESETSRC_PINRESET, // TODO: Implement for WFF3
227  PowerWFF3_RESET_POR = 1, // PMCTL_RSTSTA_RESETSRC_PWRON, // TODO: Implement for WFF3
229 
240 void PowerWFF3_doWFI(void);
241 
250 {
251  // TODO: Implement
252  return PowerWFF3_RESET_PIN;
253 }
254 
278 void PowerWFF3_sleepPolicy(void);
279 void PowerWFF3_schedulerDisable(void);
280 void PowerWFF3_schedulerRestore(void);
281 
282 #ifdef __cplusplus
283 }
284 #endif
285 
286 #endif /* ti_drivers_power_PowerWFF3__include */
Global configuration structure.
Definition: PowerWFF3.h:179
PowerWFF3_ResetReason
Reasons the device has booted or rebooted.
Definition: PowerWFF3.h:222
Power_PolicyInitFxn policyInitFxn
The Power Policy&#39;s initialization function.
Definition: PowerWFF3.h:187
Clock interface for the RTOS Porting Interface.
void(* Power_PolicyInitFxn)(void)
Power policy initialization function pointer.
Definition: Power.h:401
Power Manager.
void PowerWFF3_schedulerRestore(void)
Definition: PowerWFF3.h:227
void(* Power_PolicyFxn)(void)
Power policy function pointer.
Definition: Power.h:406
void PowerWFF3_doWFI(void)
The wait for interrupt (WFI) policy.
void PowerWFF3_sleepPolicy(void)
The SLEEP Power Policy.
static PowerWFF3_ResetReason PowerWFF3_getResetReason(void)
Returns the reason for the most recent reset or wakeup.
Definition: PowerWFF3.h:249
Power_PolicyFxn policyFxn
The Power Policy function.
Definition: PowerWFF3.h:216
void PowerWFF3_schedulerDisable(void)
Hardware Interrupt module for the RTOS Porting Interface.
Definition: PowerWFF3.h:225
© Copyright 1995-2026, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale