1 /******************************************************************************
2  *
3  * Copyright (C) 2023-2025 Analog Devices, Inc.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  ******************************************************************************/
18 
19 #ifndef LIBRARIES_ZEPHYR_MAX_INCLUDE_WRAP_MAX32_LP_H_
20 #define LIBRARIES_ZEPHYR_MAX_INCLUDE_WRAP_MAX32_LP_H_
21 
22 /***** Includes *****/
23 #include <lp.h>
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 /*
30  *  MAX32665, MAX32666 related mapping
31  */
32 #if defined(CONFIG_SOC_MAX32665) || defined(CONFIG_SOC_MAX32666) || \
33     defined(CONFIG_SOC_MAX32670) || defined(CONFIG_SOC_MAX32672) || \
34     defined(CONFIG_SOC_MAX32662) || defined(CONFIG_SOC_MAX32675) || defined(CONFIG_SOC_MAX32650)
35 
Wrap_MXC_LP_EnterLowPowerMode(void)36 static inline void Wrap_MXC_LP_EnterLowPowerMode(void)
37 {
38     MXC_LP_EnterDeepSleepMode();
39 }
40 
Wrap_MXC_LP_EnterMicroPowerMode(void)41 static inline void Wrap_MXC_LP_EnterMicroPowerMode(void)
42 {
43     MXC_LP_EnterDeepSleepMode();
44 }
45 
Wrap_MXC_LP_EnterStandbyMode(void)46 static inline void Wrap_MXC_LP_EnterStandbyMode(void)
47 {
48     MXC_LP_EnterDeepSleepMode();
49 }
50 
Wrap_MXC_LP_EnterPowerDownMode(void)51 static inline void Wrap_MXC_LP_EnterPowerDownMode(void)
52 {
53 #if defined(CONFIG_SOC_MAX32650)
54     MXC_LP_EnterBackupMode();
55 #else
56     MXC_LP_EnterShutDownMode();
57 #endif
58 }
59 
60 /*
61  *  MAX32690, MAX32655 related mapping
62  */
63 #elif defined(CONFIG_SOC_MAX32690) || defined(CONFIG_SOC_MAX32655) || \
64     defined(CONFIG_SOC_MAX32680) || defined(CONFIG_SOC_MAX78002) ||   \
65     defined(CONFIG_SOC_MAX78000)
66 
67 static inline void Wrap_MXC_LP_EnterLowPowerMode(void)
68 {
69     MXC_LP_EnterLowPowerMode();
70 }
71 
72 static inline void Wrap_MXC_LP_EnterMicroPowerMode(void)
73 {
74     MXC_LP_EnterMicroPowerMode();
75 }
76 
77 static inline void Wrap_MXC_LP_EnterStandbyMode(void)
78 {
79     MXC_LP_EnterStandbyMode();
80 }
81 
82 static inline void Wrap_MXC_LP_EnterPowerDownMode(void)
83 {
84     MXC_LP_EnterPowerDownMode();
85 }
86 
87 #endif // part number
88 
89 #ifdef __cplusplus
90 }
91 #endif
92 
93 #endif // LIBRARIES_ZEPHYR_MAX_INCLUDE_WRAP_MAX32_LP_H_
94