xWRL684x MMWAVE-L-SDK  06.00.05
power_xwrL68xx.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2022 Texas Instruments Incorporated
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * 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
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  *
32  */
33 
59 #ifndef POWER_XWRL68XX_H
60 #define POWER_XWRL68XX_H
61 
62 #include <stdint.h>
63 #include <drivers/utils/List.h>
64 #include <drivers/hw_include/hw_types.h>
65 #include <drivers/pinmux.h>
66 #include <drivers/power.h>
67 
68 #ifdef __cplusplus
69 extern "C" {
70 #endif
71 
72 /*
73  * Power events on the 64XX device
74  *
75  * Each event must be a power of two, and the event IDs must be sequential
76  * without any gaps.
77  */
78 #define POWER_ENTERING_LPDS 0x1
79 
81 #define POWER_ENTERING_IDLE 0x4
82 
84 #define POWER_AWAKE_LPDS 0x8
85 
87 #define POWER_AWAKE_IDLE 0x20
88 
90 /* \cond */
91 /* Number of pins that can be parked in LPDS */
92 #define POWER_NUMPINS 32U
93 /* \endcond */
94 
96 typedef struct {
97  uint32_t pin;
99  uint32_t parkState;
102 
104 typedef enum {
108 
110 typedef struct {
121  void (*enterLPDSHookFxn)(void);
128  void (*resumeLPDSHookFxn)(void);
129 
136  void (*enteridle3HookFxn)(void);
143  void (*resumeidle3HookFxn)(void);
144 
147 
150 
153 
156 
159 
162 
179 
187 
194 
204  uint32_t numPins;
208  uint32_t LPDSThreshold;
213 
215 
219  uint32_t idleThreshold;
224 
226 
228 
229 
231 typedef enum {
241 
245 typedef enum {
247  POWER_PIN_PAD_AA = PIN_PAD_AA,
249  POWER_PIN_PAD_AB = PIN_PAD_AB,
251  POWER_PIN_PAD_AC = PIN_PAD_AC,
253  POWER_PIN_PAD_AD = PIN_PAD_AD,
255  POWER_PIN_PAD_AE = PIN_PAD_AE,
257  POWER_PIN_PAD_AF = PIN_PAD_AF,
259  POWER_PIN_PAD_AG = PIN_PAD_AG,
261  POWER_PIN_PAD_AH = PIN_PAD_AH,
263  POWER_PIN_PAD_AI = PIN_PAD_AI,
265  POWER_PIN_PAD_AJ = PIN_PAD_AJ,
267  POWER_PIN_PAD_AK = PIN_PAD_AK,
269  POWER_PIN_PAD_AL = PIN_PAD_AL,
271  POWER_PIN_PAD_AM = PIN_PAD_AM,
273  POWER_PIN_PAD_AN = PIN_PAD_AN,
275  POWER_PIN_PAD_AO = PIN_PAD_AO,
277  POWER_PIN_PAD_AP = PIN_PAD_AP,
279  POWER_PIN_PAD_AQ = PIN_PAD_AQ,
281  POWER_PIN_PAD_AR = PIN_PAD_AR,
283  POWER_PIN_PAD_AS = PIN_PAD_AS,
285  POWER_PIN_PAD_AT = PIN_PAD_AT,
287  POWER_PIN_PAD_AU = PIN_PAD_AU,
289  POWER_PIN_PAD_AV = PIN_PAD_AV,
291  POWER_PIN_PAD_AW = PIN_PAD_AW,
293  POWER_PIN_PAD_AX = PIN_PAD_AX,
295  POWER_PIN_PAD_AY = PIN_PAD_AY,
297  POWER_PIN_PAD_AZ = PIN_PAD_AZ,
299  POWER_PIN_PAD_BA = PIN_PAD_BA,
301  POWER_PIN_PAD_BB = PIN_PAD_BB,
303  POWER_PIN_PAD_BC = PIN_PAD_BC,
305  POWER_PIN_PAD_BD = PIN_PAD_BD,
307  POWER_PIN_PAD_BE = PIN_PAD_BE,
309  POWER_PIN_PAD_BF = PIN_PAD_BF,
310 
311 } Power_Pin;
322 typedef struct {
323 
357 } Power_Wakeup;
358 
363 typedef struct {
364  List_List notifyList;
365  uint32_t state;
366  bool enablePolicy;
367  bool initialized;
368  Power_PolicyFxn policyFxn;
369  Power_Wakeup wakeupConfig;
370 } Power_ModuleState;
382 
384 void Power_initPolicy(void);
385 
395 
406 void Power_sleepPolicy(unsigned long long sleepTimeus);
407 
419  void Power_Idle3();
420 
421 void Power_parkPins(uint32_t powerState);
422 
425 /* \cond */
426 #define Power_getPerformanceLevel(void) 0
427 #define Power_setPerformanceLevel(level) Power_EFAIL
428 /* \endcond */
429 
430 #ifdef __cplusplus
431 }
432 #endif
433 
434 #endif /* POWER_XWRL68XX_H */
435 
Power_PolicyFxn
void(* Power_PolicyFxn)(unsigned long long sleepTimeus)
Power policy function pointer.
Definition: power.h:413
Power_ConfigV1
Power global configuration.
Definition: power_xwrL68xx.h:110
Power_Wakeup::enableGPIOSyncIOWakeupLPDS
bool enableGPIOSyncIOWakeupLPDS
Definition: power_xwrL68xx.h:325
Power_ConfigV1::wakeupGPIOEdgeLPDS
uint32_t wakeupGPIOEdgeLPDS
The GPIO (WU_REQIN) trigger type for wakeup from LPDS.
Definition: power_xwrL68xx.h:171
POWER_GPIO_WAKEUP_LPDS
@ POWER_GPIO_WAKEUP_LPDS
Definition: power_xwrL68xx.h:105
POWER_DONT_PARK
@ POWER_DONT_PARK
Definition: power_xwrL68xx.h:235
Power_Wakeup::enableSleepCounterWakeupLPDS
bool enableSleepCounterWakeupLPDS
Definition: power_xwrL68xx.h:329
Power_ConfigV1::selectGpioSyncIOLpds
Power_GPIO_SYNCIO_Wakeup_Enable selectGpioSyncIOLpds
Definition: power_xwrL68xx.h:164
Power_ConfigV1::ramRetentionMaskLPDS
uint32_t ramRetentionMaskLPDS
SRAM retention mask for LPDS.
Definition: power_xwrL68xx.h:193
Power_ConfigV1::idleThreshold
uint32_t idleThreshold
Threshold for entry to Idle in microseconds.
Definition: power_xwrL68xx.h:219
Power_ConfigV1::enableUARTWakeupLPDS
bool enableUARTWakeupLPDS
Definition: power_xwrL68xx.h:155
Power_ConfigV1::totalLatencyForIdle
uint32_t totalLatencyForIdle
Latency for entry to and exit from Idle in microseconds.
Definition: power_xwrL68xx.h:223
power.h
Power_Idle3
void Power_Idle3()
Device Idle mode.
Power_Wakeup::wakeupGPIOEdgeLPDS
uint32_t wakeupGPIOEdgeLPDS
The GPIO trigger type for wakeup from LPDS.
Definition: power_xwrL68xx.h:342
Power_Wakeup::wakeupUartEdgeLPDS
uint32_t wakeupUartEdgeLPDS
The UART Rx trigger type for wakeup from LPDS.
Definition: power_xwrL68xx.h:356
Power_Wakeup::enableRTCWakeupLPDS
bool enableRTCWakeupLPDS
Definition: power_xwrL68xx.h:333
Power_Wakeup
Specify the wakeup sources for LPDS and Shutdown.
Definition: power_xwrL68xx.h:322
Power_Wakeup::selectGpioSyncIOLpds
Power_GPIO_SYNCIO_Wakeup_Enable selectGpioSyncIOLpds
Definition: power_xwrL68xx.h:327
Power_ConfigV1::pinParkDefs
Power_ParkInfo * pinParkDefs
Pointer to an array of pins to be parked during LPDS.
Definition: power_xwrL68xx.h:200
Power_ConfigV1::enableSleepCounterWakeupLPDS
bool enableSleepCounterWakeupLPDS
Definition: power_xwrL68xx.h:152
Power_ConfigV1::enableRTCWakeupLPDS
bool enableRTCWakeupLPDS
Definition: power_xwrL68xx.h:158
Power_ConfigV1::wakeupUartEdgeLPDS
uint32_t wakeupUartEdgeLPDS
The UART RX (WU_REQIN) trigger type for wakeup from LPDS.
Definition: power_xwrL68xx.h:186
POWER_PARK_IDLE_AND_LPDS
@ POWER_PARK_IDLE_AND_LPDS
Definition: power_xwrL68xx.h:239
Power_ParkInfo::pin
uint32_t pin
Definition: power_xwrL68xx.h:97
POWER_PARK_IDLE
@ POWER_PARK_IDLE
Definition: power_xwrL68xx.h:237
Power_ConfigV1::numPins
uint32_t numPins
Number of pins to be parked during LPDS.
Definition: power_xwrL68xx.h:204
Power_ParkInfo::parkState
uint32_t parkState
Definition: power_xwrL68xx.h:99
Power_parkPins
void Power_parkPins(uint32_t powerState)
Power_Wakeup::enableFRCWakeupLPDS
bool enableFRCWakeupLPDS
Definition: power_xwrL68xx.h:335
Power_configureWakeup
void Power_configureWakeup(Power_Wakeup *wakeup)
Function configures wakeup for LPDS and shutdown.
Power_Wakeup::wakeupSyncIOEdgeLPDS
uint32_t wakeupSyncIOEdgeLPDS
The GPIO trigger type for wakeup from LPDS.
Definition: power_xwrL68xx.h:349
Power_ConfigV1::LPDSThreshold
uint32_t LPDSThreshold
Threshold for entry to LPDS in microseconds.
Definition: power_xwrL68xx.h:208
Power_ConfigV1::resumeLatencyForLPDS
uint32_t resumeLatencyForLPDS
Definition: power_xwrL68xx.h:214
Power_ConfigV1::policyFxn
Power_PolicyFxn policyFxn
Definition: power_xwrL68xx.h:114
pinmux.h
Power_ParkState
Power_ParkState
Enumeration of states a pin can be parked in.
Definition: power_xwrL68xx.h:231
Power_initPolicy
void Power_initPolicy(void)
Power_ConfigV1::enableFRCWakeupLPDS
bool enableFRCWakeupLPDS
Definition: power_xwrL68xx.h:161
Power_GPIO_SYNCIO_Wakeup_Enable
Power_GPIO_SYNCIO_Wakeup_Enable
Source of Wake-up can be either GPIO (WU_REQIN) or SYNC_IN.
Definition: power_xwrL68xx.h:104
Power_ConfigV1::policyInitFxn
Power_PolicyInitFxn policyInitFxn
Definition: power_xwrL68xx.h:112
Power_PolicyInitFxn
void(* Power_PolicyInitFxn)(void)
Power policy initialization function pointer.
Definition: power.h:408
Power_ConfigV1::totalLatencyForLPDS
uint32_t totalLatencyForLPDS
Latency for entry to and exit from LPDS in microseconds.
Definition: power_xwrL68xx.h:212
Power_Wakeup::enableUARTWakeupLPDS
bool enableUARTWakeupLPDS
Definition: power_xwrL68xx.h:331
Power_ConfigV1::resumeLatencyForIdle
uint32_t resumeLatencyForIdle
Definition: power_xwrL68xx.h:225
Power_getWakeup
void Power_getWakeup(Power_Wakeup *wakeup)
Function to get wakeup configuration settings.
Power_ParkInfo
Used to specify parking of a pin during LPDS.
Definition: power_xwrL68xx.h:96
POWER_SYNCIN_IO_WAKEUP_LPDS
@ POWER_SYNCIN_IO_WAKEUP_LPDS
Definition: power_xwrL68xx.h:106
Power_ConfigV1::wakeupSyncIOEdgeLPDS
uint32_t wakeupSyncIOEdgeLPDS
The SYNC-IN trigger type for wakeup from LPDS.
Definition: power_xwrL68xx.h:178
POWER_PARK_LPDS
@ POWER_PARK_LPDS
Definition: power_xwrL68xx.h:233
Power_ConfigV1::enablePolicy
bool enablePolicy
Definition: power_xwrL68xx.h:146
Power_sleepPolicy
void Power_sleepPolicy(unsigned long long sleepTimeus)
A reference power policy is provided which can transition the MCU from the active state to one of two...
Power_ConfigV1::enableGPIOSyncIOWakeupLPDS
bool enableGPIOSyncIOWakeupLPDS
Definition: power_xwrL68xx.h:149