1 /*
2  * Copyright 2022, NXP
3  * All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 #include "fsl_common.h"
8 #include "fsl_power.h"
9 /* Component ID definition, used by tools. */
10 #ifndef FSL_COMPONENT_ID
11 #define FSL_COMPONENT_ID "platform.drivers.power"
12 #endif
13 
14 /*******************************************************************************
15  * Variables
16  ******************************************************************************/
17 
18 /*******************************************************************************
19  * Definitions
20  ******************************************************************************/
21 
22 /*******************************************************************************
23  * Codes
24  ******************************************************************************/
25 
26 /*******************************************************************************
27  * LOCAL FUNCTIONS PROTOTYPES
28  ******************************************************************************/
29 
30 /**
31  * brief    PMC Sleep function call
32  * return   nothing
33  */
POWER_EnterSleep(void)34 void POWER_EnterSleep(void)
35 {
36     uint32_t pmsk;
37     pmsk = __get_PRIMASK();
38     __disable_irq();
39     SCB->SCR &= ~SCB_SCR_SLEEPDEEP_Msk;
40     __WFI();
41     __set_PRIMASK(pmsk);
42 }
43 
44 /**
45  * brief    PMC Deep Sleep function call
46  * return   nothing
47  */
POWER_EnterDeepSleep(uint32_t exclude_from_pd,uint32_t sram_retention_ctrl,uint64_t wakeup_interrupts,uint32_t hardware_wake_ctrl)48 void POWER_EnterDeepSleep(uint32_t exclude_from_pd,
49                           uint32_t sram_retention_ctrl,
50                           uint64_t wakeup_interrupts,
51                           uint32_t hardware_wake_ctrl)
52 {
53 }
54 
55 /**
56  * brief    PMC power Down function call
57  * return   nothing
58  */
POWER_EnterPowerDown(uint32_t exclude_from_pd,uint32_t sram_retention_ctrl,uint64_t wakeup_interrupts,uint32_t cpu_retention_ctrl)59 void POWER_EnterPowerDown(uint32_t exclude_from_pd,
60                           uint32_t sram_retention_ctrl,
61                           uint64_t wakeup_interrupts,
62                           uint32_t cpu_retention_ctrl)
63 {
64 }
65 
66 /**
67  * brief    PMC Deep Sleep Power Down function call
68  * return   nothing
69  */
POWER_EnterDeepPowerDown(uint32_t exclude_from_pd,uint32_t sram_retention_ctrl,uint64_t wakeup_interrupts,uint32_t wakeup_io_ctrl)70 void POWER_EnterDeepPowerDown(uint32_t exclude_from_pd,
71                               uint32_t sram_retention_ctrl,
72                               uint64_t wakeup_interrupts,
73                               uint32_t wakeup_io_ctrl)
74 {
75 }
76 
77 /**
78  * @brief             Described in fsl_common.h
79  * @param
80  * @return
81  */
POWER_SetVoltageForFreq(uint32_t system_freq_hz)82 void POWER_SetVoltageForFreq(uint32_t system_freq_hz)
83 {
84 }
85