1
1
/*
2
2
* Copyright (c) 2015, Freescale Semiconductor, Inc.
3
3
* Copyright 2016-2017 NXP
4
+ * All rights reserved.
4
5
*
5
- * Redistribution and use in source and binary forms, with or without modification,
6
- * are permitted provided that the following conditions are met:
7
- *
8
- * o Redistributions of source code must retain the above copyright notice, this list
9
- * of conditions and the following disclaimer.
10
- *
11
- * o Redistributions in binary form must reproduce the above copyright notice, this
12
- * list of conditions and the following disclaimer in the documentation and/or
13
- * other materials provided with the distribution.
14
- *
15
- * o Neither the name of the copyright holder nor the names of its
16
- * contributors may be used to endorse or promote products derived from this
17
- * software without specific prior written permission.
18
- *
19
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
23
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
26
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6
+ * SPDX-License-Identifier: BSD-3-Clause
29
7
*/
30
8
31
9
#ifndef _FSL_SMC_H_
36
14
/*! @addtogroup smc */
37
15
/*! @{ */
38
16
39
-
40
17
/*******************************************************************************
41
18
* Definitions
42
19
******************************************************************************/
43
20
44
21
/*! @name Driver version */
45
22
/*@{*/
46
- /*! @brief SMC driver version 2.0.3 . */
47
- #define FSL_SMC_DRIVER_VERSION (MAKE_VERSION(2, 0, 3 ))
23
+ /*! @brief SMC driver version 2.0.5 . */
24
+ #define FSL_SMC_DRIVER_VERSION (MAKE_VERSION(2, 0, 5 ))
48
25
/*@}*/
49
26
50
27
/*!
@@ -64,18 +41,14 @@ typedef enum _smc_power_mode_protection
64
41
#endif /* FSL_FEATURE_SMC_HAS_HIGH_SPEED_RUN_MODE */
65
42
kSMC_AllowPowerModeAll = (0U
66
43
#if (defined (FSL_FEATURE_SMC_HAS_VERY_LOW_LEAKAGE_STOP_MODE ) && FSL_FEATURE_SMC_HAS_VERY_LOW_LEAKAGE_STOP_MODE )
67
- |
68
- SMC_PMPROT_AVLLS_MASK
44
+ | SMC_PMPROT_AVLLS_MASK
69
45
#endif
70
46
#if (defined (FSL_FEATURE_SMC_HAS_LOW_LEAKAGE_STOP_MODE ) && FSL_FEATURE_SMC_HAS_LOW_LEAKAGE_STOP_MODE )
71
- |
72
- SMC_PMPROT_ALLS_MASK
47
+ | SMC_PMPROT_ALLS_MASK
73
48
#endif /* FSL_FEATURE_SMC_HAS_LOW_LEAKAGE_STOP_MODE */
74
- |
75
- SMC_PMPROT_AVLP_MASK
49
+ | SMC_PMPROT_AVLP_MASK
76
50
#if (defined (FSL_FEATURE_SMC_HAS_HIGH_SPEED_RUN_MODE ) && FSL_FEATURE_SMC_HAS_HIGH_SPEED_RUN_MODE )
77
- |
78
- kSMC_AllowPowerModeHsrun
51
+ | kSMC_AllowPowerModeHsrun
79
52
#endif /* FSL_FEATURE_SMC_HAS_HIGH_SPEED_RUN_MODE */
80
53
) /*!< Allow all power mode. */
81
54
} smc_power_mode_protection_t ;
@@ -85,7 +58,7 @@ typedef enum _smc_power_mode_protection
85
58
*/
86
59
typedef enum _smc_power_state
87
60
{
88
- kSMC_PowerStateRun = 0x01U << 0U , /*!< 0000_0001 - Current power mode is RUN */
61
+ kSMC_PowerStateRun = 0x01U << 0U , /*!< 0000_0001 - Current power mode is RUN */
89
62
kSMC_PowerStateStop = 0x01U << 1U , /*!< 0000_0010 - Current power mode is STOP */
90
63
kSMC_PowerStateVlpr = 0x01U << 2U , /*!< 0000_0100 - Current power mode is VLPR */
91
64
kSMC_PowerStateVlpw = 0x01U << 3U , /*!< 0000_1000 - Current power mode is VLPW */
@@ -107,7 +80,7 @@ typedef enum _smc_power_state
107
80
typedef enum _smc_run_mode
108
81
{
109
82
kSMC_RunNormal = 0U , /*!< Normal RUN mode. */
110
- kSMC_RunVlpr = 2U , /*!< Very-low-power RUN mode. */
83
+ kSMC_RunVlpr = 2U , /*!< Very-low-power RUN mode. */
111
84
#if (defined(FSL_FEATURE_SMC_HAS_HIGH_SPEED_RUN_MODE ) && FSL_FEATURE_SMC_HAS_HIGH_SPEED_RUN_MODE )
112
85
kSMC_Hsrun = 3U /*!< High-speed Run mode (HSRUN). */
113
86
#endif /* FSL_FEATURE_SMC_HAS_HIGH_SPEED_RUN_MODE */
@@ -119,7 +92,7 @@ typedef enum _smc_run_mode
119
92
typedef enum _smc_stop_mode
120
93
{
121
94
kSMC_StopNormal = 0U , /*!< Normal STOP mode. */
122
- kSMC_StopVlps = 2U , /*!< Very-low-power STOP mode. */
95
+ kSMC_StopVlps = 2U , /*!< Very-low-power STOP mode. */
123
96
#if (defined(FSL_FEATURE_SMC_HAS_LOW_LEAKAGE_STOP_MODE ) && FSL_FEATURE_SMC_HAS_LOW_LEAKAGE_STOP_MODE )
124
97
kSMC_StopLls = 3U , /*!< Low-leakage Stop mode. */
125
98
#endif /* FSL_FEATURE_SMC_HAS_LOW_LEAKAGE_STOP_MODE */
@@ -148,7 +121,7 @@ typedef enum _smc_stop_submode
148
121
*/
149
122
typedef enum _smc_partial_stop_mode
150
123
{
151
- kSMC_PartialStop = 0U , /*!< STOP - Normal Stop mode*/
124
+ kSMC_PartialStop = 0U , /*!< STOP - Normal Stop mode*/
152
125
kSMC_PartialStop1 = 1U , /*!< Partial Stop with both system and bus clocks disabled*/
153
126
kSMC_PartialStop2 = 2U , /*!< Partial Stop with system clock disabled and bus clock enabled*/
154
127
} smc_partial_stop_option_t ;
@@ -324,23 +297,15 @@ void SMC_PostExitStopModes(void);
324
297
*
325
298
* This function should be called before entering WAIT/VLPW modes.
326
299
*/
327
- static inline void SMC_PreEnterWaitModes (void )
328
- {
329
- __disable_irq ();
330
- __ISB ();
331
- }
300
+ void SMC_PreEnterWaitModes (void );
332
301
333
302
/*!
334
303
* @brief Recovers after wake up from stop modes.
335
304
*
336
305
* This function should be called after wake up from WAIT/VLPW modes.
337
306
* It is used with @ref SMC_PreEnterWaitModes.
338
307
*/
339
- static inline void SMC_PostExitWaitModes (void )
340
- {
341
- __enable_irq ();
342
- __ISB ();
343
- }
308
+ void SMC_PostExitWaitModes (void );
344
309
345
310
/*!
346
311
* @brief Configures the system to RUN power mode.
0 commit comments