/TARGET_K64F/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_KPSDK_CODE/hal/adc/fsl_adc_hal.h substitute line 894 extern } by }
Fork of mbed by
TARGET_K64F/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_KPSDK_CODE/hal/smc/fsl_smc_hal.h@82:6473597d706e, 2014-04-07 (annotated)
- Committer:
- bogdanm
- Date:
- Mon Apr 07 18:28:36 2014 +0100
- Revision:
- 82:6473597d706e
- Child:
- 90:cb3d968589d8
Release 82 of the mbed library
Main changes:
- support for K64F
- Revisited Nordic code structure
- Test infrastructure improvements
- various bug fixes
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bogdanm | 82:6473597d706e | 1 | /* |
bogdanm | 82:6473597d706e | 2 | * Copyright (c) 2013 - 2014, Freescale Semiconductor, Inc. |
bogdanm | 82:6473597d706e | 3 | * All rights reserved. |
bogdanm | 82:6473597d706e | 4 | * |
bogdanm | 82:6473597d706e | 5 | * Redistribution and use in source and binary forms, with or without modification, |
bogdanm | 82:6473597d706e | 6 | * are permitted provided that the following conditions are met: |
bogdanm | 82:6473597d706e | 7 | * |
bogdanm | 82:6473597d706e | 8 | * o Redistributions of source code must retain the above copyright notice, this list |
bogdanm | 82:6473597d706e | 9 | * of conditions and the following disclaimer. |
bogdanm | 82:6473597d706e | 10 | * |
bogdanm | 82:6473597d706e | 11 | * o Redistributions in binary form must reproduce the above copyright notice, this |
bogdanm | 82:6473597d706e | 12 | * list of conditions and the following disclaimer in the documentation and/or |
bogdanm | 82:6473597d706e | 13 | * other materials provided with the distribution. |
bogdanm | 82:6473597d706e | 14 | * |
bogdanm | 82:6473597d706e | 15 | * o Neither the name of Freescale Semiconductor, Inc. nor the names of its |
bogdanm | 82:6473597d706e | 16 | * contributors may be used to endorse or promote products derived from this |
bogdanm | 82:6473597d706e | 17 | * software without specific prior written permission. |
bogdanm | 82:6473597d706e | 18 | * |
bogdanm | 82:6473597d706e | 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
bogdanm | 82:6473597d706e | 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
bogdanm | 82:6473597d706e | 21 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
bogdanm | 82:6473597d706e | 22 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR |
bogdanm | 82:6473597d706e | 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
bogdanm | 82:6473597d706e | 24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
bogdanm | 82:6473597d706e | 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
bogdanm | 82:6473597d706e | 26 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
bogdanm | 82:6473597d706e | 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
bogdanm | 82:6473597d706e | 28 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
bogdanm | 82:6473597d706e | 29 | */ |
bogdanm | 82:6473597d706e | 30 | |
bogdanm | 82:6473597d706e | 31 | #if !defined(__FSL_SMC_HAL_H__) |
bogdanm | 82:6473597d706e | 32 | #define __FSL_SMC_HAL_H__ |
bogdanm | 82:6473597d706e | 33 | |
bogdanm | 82:6473597d706e | 34 | #include <stdint.h> |
bogdanm | 82:6473597d706e | 35 | #include <stdbool.h> |
bogdanm | 82:6473597d706e | 36 | #include <assert.h> |
bogdanm | 82:6473597d706e | 37 | #include "fsl_device_registers.h" |
bogdanm | 82:6473597d706e | 38 | #include "fsl_smc_features.h" |
bogdanm | 82:6473597d706e | 39 | |
bogdanm | 82:6473597d706e | 40 | /*! @addtogroup smc_hal*/ |
bogdanm | 82:6473597d706e | 41 | /*! @{*/ |
bogdanm | 82:6473597d706e | 42 | |
bogdanm | 82:6473597d706e | 43 | /*! @file fsl_smc_hal.h */ |
bogdanm | 82:6473597d706e | 44 | |
bogdanm | 82:6473597d706e | 45 | /******************************************************************************* |
bogdanm | 82:6473597d706e | 46 | * Definitions |
bogdanm | 82:6473597d706e | 47 | ******************************************************************************/ |
bogdanm | 82:6473597d706e | 48 | |
bogdanm | 82:6473597d706e | 49 | |
bogdanm | 82:6473597d706e | 50 | /*! @brief Power Modes in PMSTAT*/ |
bogdanm | 82:6473597d706e | 51 | typedef enum _power_mode_stat { |
bogdanm | 82:6473597d706e | 52 | kStatRun = 0x01, /*!< 0000_0001 - Current power mode is RUN*/ |
bogdanm | 82:6473597d706e | 53 | kStatStop = 0x02, /*!< 0000_0010 - Current power mode is STOP*/ |
bogdanm | 82:6473597d706e | 54 | kStatVlpr = 0x04, /*!< 0000_0100 - Current power mode is VLPR*/ |
bogdanm | 82:6473597d706e | 55 | kStatVlpw = 0x08, /*!< 0000_1000 - Current power mode is VLPW*/ |
bogdanm | 82:6473597d706e | 56 | kStatVlps = 0x10, /*!< 0001_0000 - Current power mode is VLPS*/ |
bogdanm | 82:6473597d706e | 57 | kStatLls = 0x20, /*!< 0010_0000 - Current power mode is LLS*/ |
bogdanm | 82:6473597d706e | 58 | kStatVlls = 0x40, /*!< 0100_0000 - Current power mode is VLLS*/ |
bogdanm | 82:6473597d706e | 59 | kStatHsrun = 0x80 /*!< 1000_0000 - Current power mode is HSRUN*/ |
bogdanm | 82:6473597d706e | 60 | } power_mode_stat_t; |
bogdanm | 82:6473597d706e | 61 | |
bogdanm | 82:6473597d706e | 62 | /*! @brief Power Modes Protection*/ |
bogdanm | 82:6473597d706e | 63 | typedef enum _power_modes_protect { |
bogdanm | 82:6473597d706e | 64 | kAllowHsrun, /*!< Allow High Speed Run mode*/ |
bogdanm | 82:6473597d706e | 65 | kAllowVlp, /*!< Allow Very-Low-Power Modes*/ |
bogdanm | 82:6473597d706e | 66 | kAllowLls, /*!< Allow Low-Leakage Stop Mode*/ |
bogdanm | 82:6473597d706e | 67 | kAllowVlls, /*!< Allow Very-Low-Leakage Stop Mode*/ |
bogdanm | 82:6473597d706e | 68 | kAllowMax |
bogdanm | 82:6473597d706e | 69 | } power_modes_protect_t; |
bogdanm | 82:6473597d706e | 70 | |
bogdanm | 82:6473597d706e | 71 | /*! |
bogdanm | 82:6473597d706e | 72 | * @brief Run mode definition |
bogdanm | 82:6473597d706e | 73 | */ |
bogdanm | 82:6473597d706e | 74 | typedef enum _smc_run_mode { |
bogdanm | 82:6473597d706e | 75 | kSmcRun, /*!< normal RUN mode*/ |
bogdanm | 82:6473597d706e | 76 | kSmcReservedRun, |
bogdanm | 82:6473597d706e | 77 | kSmcVlpr, /*!< Very-Low-Power RUN mode*/ |
bogdanm | 82:6473597d706e | 78 | kSmcHsrun /*!< High Speed Run mode (HSRUN)*/ |
bogdanm | 82:6473597d706e | 79 | } smc_run_mode_t; |
bogdanm | 82:6473597d706e | 80 | |
bogdanm | 82:6473597d706e | 81 | /*! |
bogdanm | 82:6473597d706e | 82 | * @brief Stop mode definition |
bogdanm | 82:6473597d706e | 83 | */ |
bogdanm | 82:6473597d706e | 84 | typedef enum _smc_stop_mode { |
bogdanm | 82:6473597d706e | 85 | kSmcStop, /*!< Normal STOP mode*/ |
bogdanm | 82:6473597d706e | 86 | kSmcReservedStop1, /*!< Reserved*/ |
bogdanm | 82:6473597d706e | 87 | kSmcVlps, /*!< Very-Low-Power STOP mode*/ |
bogdanm | 82:6473597d706e | 88 | kSmcLls, /*!< Low-Leakage Stop mode*/ |
bogdanm | 82:6473597d706e | 89 | kSmcVlls /*!< Very-Low-Leakage Stop mode*/ |
bogdanm | 82:6473597d706e | 90 | } smc_stop_mode_t; |
bogdanm | 82:6473597d706e | 91 | |
bogdanm | 82:6473597d706e | 92 | /*! |
bogdanm | 82:6473597d706e | 93 | * @brief VLLS/LLS stop sub mode definition |
bogdanm | 82:6473597d706e | 94 | */ |
bogdanm | 82:6473597d706e | 95 | typedef enum _smc_stop_submode { |
bogdanm | 82:6473597d706e | 96 | kSmcStopSub0, |
bogdanm | 82:6473597d706e | 97 | kSmcStopSub1, |
bogdanm | 82:6473597d706e | 98 | kSmcStopSub2, |
bogdanm | 82:6473597d706e | 99 | kSmcStopSub3 |
bogdanm | 82:6473597d706e | 100 | } smc_stop_submode_t; |
bogdanm | 82:6473597d706e | 101 | |
bogdanm | 82:6473597d706e | 102 | /*! @brief Low Power Wake Up on Interrupt option*/ |
bogdanm | 82:6473597d706e | 103 | typedef enum _smc_lpwui_option { |
bogdanm | 82:6473597d706e | 104 | kSmcLpwuiEnabled, /*!< Low Power Wake Up on Interrupt enabled*/ |
bogdanm | 82:6473597d706e | 105 | kSmcLpwuiDisabled /*!< Low Power Wake Up on Interrupt disabled*/ |
bogdanm | 82:6473597d706e | 106 | } smc_lpwui_option_t; |
bogdanm | 82:6473597d706e | 107 | |
bogdanm | 82:6473597d706e | 108 | /*! @brief Partial STOP option*/ |
bogdanm | 82:6473597d706e | 109 | typedef enum _smc_pstop_option { |
bogdanm | 82:6473597d706e | 110 | kSmcPstopStop, /*!< STOP - Normal Stop mode*/ |
bogdanm | 82:6473597d706e | 111 | kSmcPstopStop1, /*!< Partial Stop with both system and bus clocks disabled*/ |
bogdanm | 82:6473597d706e | 112 | kSmcPstopStop2, /*!< Partial Stop with system clock disabled and bus clock enabled*/ |
bogdanm | 82:6473597d706e | 113 | kSmcPstopReserved, |
bogdanm | 82:6473597d706e | 114 | } smc_pstop_option_t; |
bogdanm | 82:6473597d706e | 115 | |
bogdanm | 82:6473597d706e | 116 | /*! @brief POR option*/ |
bogdanm | 82:6473597d706e | 117 | typedef enum _smc_por_option { |
bogdanm | 82:6473597d706e | 118 | kSmcPorEnabled, /*!< POR detect circuit is enabled in VLLS0*/ |
bogdanm | 82:6473597d706e | 119 | kSmcPorDisabled /*!< POR detect circuit is disabled in VLLS0*/ |
bogdanm | 82:6473597d706e | 120 | } smc_por_option_t; |
bogdanm | 82:6473597d706e | 121 | |
bogdanm | 82:6473597d706e | 122 | /*! @brief LPO power option*/ |
bogdanm | 82:6473597d706e | 123 | typedef enum _smc_lpo_option { |
bogdanm | 82:6473597d706e | 124 | kSmcLpoEnabled, /*!< LPO clock is enabled in LLS/VLLSx*/ |
bogdanm | 82:6473597d706e | 125 | kSmcLpoDisabled /*!< LPO clock is disabled in LLS/VLLSx*/ |
bogdanm | 82:6473597d706e | 126 | } smc_lpo_option_t; |
bogdanm | 82:6473597d706e | 127 | |
bogdanm | 82:6473597d706e | 128 | /*! @brief Power mode control options*/ |
bogdanm | 82:6473597d706e | 129 | typedef enum _smc_power_options { |
bogdanm | 82:6473597d706e | 130 | kSmcOptionLpwui, /*!< Low Power Wake Up on Interrupt*/ |
bogdanm | 82:6473597d706e | 131 | kSmcOptionPropo /*!< POR option*/ |
bogdanm | 82:6473597d706e | 132 | } smc_power_options_t; |
bogdanm | 82:6473597d706e | 133 | |
bogdanm | 82:6473597d706e | 134 | /*! @brief Power mode protection configuration*/ |
bogdanm | 82:6473597d706e | 135 | typedef struct _smc_power_mode_protection_config { |
bogdanm | 82:6473597d706e | 136 | bool vlpProt; /*!< VLP protect*/ |
bogdanm | 82:6473597d706e | 137 | bool llsProt; /*!< LLS protect */ |
bogdanm | 82:6473597d706e | 138 | bool vllsProt; /*!< VLLS protect*/ |
bogdanm | 82:6473597d706e | 139 | } smc_power_mode_protection_config_t; |
bogdanm | 82:6473597d706e | 140 | |
bogdanm | 82:6473597d706e | 141 | /******************************************************************************* |
bogdanm | 82:6473597d706e | 142 | * API |
bogdanm | 82:6473597d706e | 143 | ******************************************************************************/ |
bogdanm | 82:6473597d706e | 144 | |
bogdanm | 82:6473597d706e | 145 | #if defined(__cplusplus) |
bogdanm | 82:6473597d706e | 146 | extern "C" { |
bogdanm | 82:6473597d706e | 147 | #endif /* __cplusplus*/ |
bogdanm | 82:6473597d706e | 148 | |
bogdanm | 82:6473597d706e | 149 | /*! @name System mode controller APIs*/ |
bogdanm | 82:6473597d706e | 150 | /*@{*/ |
bogdanm | 82:6473597d706e | 151 | |
bogdanm | 82:6473597d706e | 152 | /*! |
bogdanm | 82:6473597d706e | 153 | * @brief Configures all power mode protection settings. |
bogdanm | 82:6473597d706e | 154 | * |
bogdanm | 82:6473597d706e | 155 | * This function configures the power mode protection settings for |
bogdanm | 82:6473597d706e | 156 | * supported power modes in the specified chip family. The available power modes |
bogdanm | 82:6473597d706e | 157 | * are defined in the smc_power_mode_protection_config_t. An application should provide |
bogdanm | 82:6473597d706e | 158 | * the protect settings for all supported power modes on the chip. This |
bogdanm | 82:6473597d706e | 159 | * should be done at an early system level initialization stage. See the reference manual |
bogdanm | 82:6473597d706e | 160 | * for details. This register can only write once after the power reset. If the user has only a single option to set, |
bogdanm | 82:6473597d706e | 161 | * either use this function or use the individual set function. |
bogdanm | 82:6473597d706e | 162 | * |
bogdanm | 82:6473597d706e | 163 | * |
bogdanm | 82:6473597d706e | 164 | * @param protectConfig Configurations for the supported power mode protect settings |
bogdanm | 82:6473597d706e | 165 | * - See smc_power_mode_protection_config_t for details. |
bogdanm | 82:6473597d706e | 166 | */ |
bogdanm | 82:6473597d706e | 167 | void smc_hal_config_power_mode_protection(smc_power_mode_protection_config_t *protectConfig); |
bogdanm | 82:6473597d706e | 168 | |
bogdanm | 82:6473597d706e | 169 | /*! |
bogdanm | 82:6473597d706e | 170 | * @brief Configures the individual power mode protection settings. |
bogdanm | 82:6473597d706e | 171 | * |
bogdanm | 82:6473597d706e | 172 | * This function only configures the power mode protection settings for |
bogdanm | 82:6473597d706e | 173 | * a specified power mode on the specified chip family. The available power modes |
bogdanm | 82:6473597d706e | 174 | * are defined in the smc_power_mode_protection_config_t. See the reference manual |
bogdanm | 82:6473597d706e | 175 | * for details. This register can only write once after the power reset. |
bogdanm | 82:6473597d706e | 176 | * |
bogdanm | 82:6473597d706e | 177 | * @param protect Power mode to set for protection |
bogdanm | 82:6473597d706e | 178 | * @param allow Allow or not allow the power mode protection |
bogdanm | 82:6473597d706e | 179 | */ |
bogdanm | 82:6473597d706e | 180 | void smc_hal_set_power_mode_protection(power_modes_protect_t protect, bool allow); |
bogdanm | 82:6473597d706e | 181 | |
bogdanm | 82:6473597d706e | 182 | /*! |
bogdanm | 82:6473597d706e | 183 | * @brief Gets the the current power mode protection setting. |
bogdanm | 82:6473597d706e | 184 | * |
bogdanm | 82:6473597d706e | 185 | * This function gets the current power mode protection settings for |
bogdanm | 82:6473597d706e | 186 | * a specified power mode. |
bogdanm | 82:6473597d706e | 187 | * |
bogdanm | 82:6473597d706e | 188 | * @param protect Power mode to set for protection |
bogdanm | 82:6473597d706e | 189 | * @return state Status of the protection setting |
bogdanm | 82:6473597d706e | 190 | * - true: Allowed |
bogdanm | 82:6473597d706e | 191 | * - false: Not allowed |
bogdanm | 82:6473597d706e | 192 | */ |
bogdanm | 82:6473597d706e | 193 | bool smc_hal_get_power_mode_protection(power_modes_protect_t protect); |
bogdanm | 82:6473597d706e | 194 | |
bogdanm | 82:6473597d706e | 195 | /*! |
bogdanm | 82:6473597d706e | 196 | * @brief Configures the the RUN mode control setting. |
bogdanm | 82:6473597d706e | 197 | * |
bogdanm | 82:6473597d706e | 198 | * This function sets the run mode settings, for example, normal run mode, |
bogdanm | 82:6473597d706e | 199 | * very lower power run mode, etc. See the smc_run_mode_t for supported run |
bogdanm | 82:6473597d706e | 200 | * mode on the chip family and the reference manual for details about the |
bogdanm | 82:6473597d706e | 201 | * run mode. |
bogdanm | 82:6473597d706e | 202 | * |
bogdanm | 82:6473597d706e | 203 | * @param runMode Run mode setting defined in smc_run_mode_t |
bogdanm | 82:6473597d706e | 204 | */ |
bogdanm | 82:6473597d706e | 205 | void smc_hal_power_mode_config_run(smc_run_mode_t runMode); |
bogdanm | 82:6473597d706e | 206 | |
bogdanm | 82:6473597d706e | 207 | /*! |
bogdanm | 82:6473597d706e | 208 | * @brief Gets the current RUN mode configuration setting. |
bogdanm | 82:6473597d706e | 209 | * |
bogdanm | 82:6473597d706e | 210 | * This function gets the run mode settings. See the smc_run_mode_t |
bogdanm | 82:6473597d706e | 211 | * for a supported run mode on the chip family and the reference manual for |
bogdanm | 82:6473597d706e | 212 | * details about the run mode. |
bogdanm | 82:6473597d706e | 213 | * |
bogdanm | 82:6473597d706e | 214 | * @return setting Run mode configuration setting |
bogdanm | 82:6473597d706e | 215 | */ |
bogdanm | 82:6473597d706e | 216 | smc_run_mode_t smc_hal_power_mode_get_run_config(void); |
bogdanm | 82:6473597d706e | 217 | |
bogdanm | 82:6473597d706e | 218 | /*! |
bogdanm | 82:6473597d706e | 219 | * @brief Configures the STOP mode control setting. |
bogdanm | 82:6473597d706e | 220 | * |
bogdanm | 82:6473597d706e | 221 | * This function sets the stop mode settings, for example, normal stop mode, |
bogdanm | 82:6473597d706e | 222 | * very lower power stop mode, etc. See the smc_stop_mode_t for supported stop |
bogdanm | 82:6473597d706e | 223 | * mode on the chip family and the reference manual for details about the |
bogdanm | 82:6473597d706e | 224 | * stop mode. |
bogdanm | 82:6473597d706e | 225 | * |
bogdanm | 82:6473597d706e | 226 | * @param stopMode Stop mode defined in smc_stop_mode_t |
bogdanm | 82:6473597d706e | 227 | */ |
bogdanm | 82:6473597d706e | 228 | void smc_hal_power_mode_config_stop(smc_stop_mode_t stopMode); |
bogdanm | 82:6473597d706e | 229 | |
bogdanm | 82:6473597d706e | 230 | /*! |
bogdanm | 82:6473597d706e | 231 | * @brief Gets the current STOP mode control settings. |
bogdanm | 82:6473597d706e | 232 | * |
bogdanm | 82:6473597d706e | 233 | * This function gets the stop mode settings, for example, normal stop mode, |
bogdanm | 82:6473597d706e | 234 | * very lower power stop mode, etc. See the smc_stop_mode_t for supported stop |
bogdanm | 82:6473597d706e | 235 | * mode on the chip family and the reference manual for details about the |
bogdanm | 82:6473597d706e | 236 | * stop mode. |
bogdanm | 82:6473597d706e | 237 | * |
bogdanm | 82:6473597d706e | 238 | * @return setting Current stop mode configuration setting |
bogdanm | 82:6473597d706e | 239 | */ |
bogdanm | 82:6473597d706e | 240 | smc_stop_mode_t smc_hal_power_mode_get_stop_config(void); |
bogdanm | 82:6473597d706e | 241 | |
bogdanm | 82:6473597d706e | 242 | /*! |
bogdanm | 82:6473597d706e | 243 | * @brief Configures the stop sub mode control setting. |
bogdanm | 82:6473597d706e | 244 | * |
bogdanm | 82:6473597d706e | 245 | * This function sets the stop submode settings. Some of the stop mode |
bogdanm | 82:6473597d706e | 246 | * further supports submodes. See the smc_stop_submode_t for supported |
bogdanm | 82:6473597d706e | 247 | * stop submodes and the reference manual for details about the submodes |
bogdanm | 82:6473597d706e | 248 | * for a specific stop mode. |
bogdanm | 82:6473597d706e | 249 | * |
bogdanm | 82:6473597d706e | 250 | * @param stopSubMode Stop submode setting defined in smc_stop_submode_t |
bogdanm | 82:6473597d706e | 251 | * |
bogdanm | 82:6473597d706e | 252 | * @return none |
bogdanm | 82:6473597d706e | 253 | */ |
bogdanm | 82:6473597d706e | 254 | void smc_hal_power_mode_config_stop_submode(smc_stop_submode_t stopSubMode); |
bogdanm | 82:6473597d706e | 255 | |
bogdanm | 82:6473597d706e | 256 | /*! |
bogdanm | 82:6473597d706e | 257 | * @brief Gets the current stop submode configuration settings. |
bogdanm | 82:6473597d706e | 258 | * |
bogdanm | 82:6473597d706e | 259 | * This function gets the stop submode settings. Some of the stop mode |
bogdanm | 82:6473597d706e | 260 | * further support submodes. See the smc_stop_submode_t for supported |
bogdanm | 82:6473597d706e | 261 | * stop submodes and the reference manual for details about the submode |
bogdanm | 82:6473597d706e | 262 | * for a specific stop mode. |
bogdanm | 82:6473597d706e | 263 | * |
bogdanm | 82:6473597d706e | 264 | * @return setting Current stop submode setting |
bogdanm | 82:6473597d706e | 265 | */ |
bogdanm | 82:6473597d706e | 266 | smc_stop_submode_t smc_hal_power_mode_get_stop_submode_config(void); |
bogdanm | 82:6473597d706e | 267 | |
bogdanm | 82:6473597d706e | 268 | #if FSL_FEATURE_SMC_HAS_PORPO |
bogdanm | 82:6473597d706e | 269 | /*! |
bogdanm | 82:6473597d706e | 270 | * @brief Configures the POR (power-on-reset) option. |
bogdanm | 82:6473597d706e | 271 | * |
bogdanm | 82:6473597d706e | 272 | * This function sets the POR power option setting. It controls whether the |
bogdanm | 82:6473597d706e | 273 | * POR detect circuit (for brown-out detection) is enabled in a certain stop mode. |
bogdanm | 82:6473597d706e | 274 | * The setting either enables or disables the above feature when the POR |
bogdanm | 82:6473597d706e | 275 | * occurs. See the reference manual for details. |
bogdanm | 82:6473597d706e | 276 | * |
bogdanm | 82:6473597d706e | 277 | * @param option POR option setting refer to smc_por_option_t |
bogdanm | 82:6473597d706e | 278 | */ |
bogdanm | 82:6473597d706e | 279 | void smc_hal_config_por_power_option(smc_por_option_t option); |
bogdanm | 82:6473597d706e | 280 | |
bogdanm | 82:6473597d706e | 281 | /*! |
bogdanm | 82:6473597d706e | 282 | * @brief Gets the configuration settings for the POR option. |
bogdanm | 82:6473597d706e | 283 | * |
bogdanm | 82:6473597d706e | 284 | * This function sets the POR power option setting. See the configuration function |
bogdanm | 82:6473597d706e | 285 | * header for details. |
bogdanm | 82:6473597d706e | 286 | * |
bogdanm | 82:6473597d706e | 287 | * @return option Current POR option setting |
bogdanm | 82:6473597d706e | 288 | */ |
bogdanm | 82:6473597d706e | 289 | smc_por_option_t smc_hal_get_por_power_config(void); |
bogdanm | 82:6473597d706e | 290 | #endif |
bogdanm | 82:6473597d706e | 291 | |
bogdanm | 82:6473597d706e | 292 | #if FSL_FEATURE_SMC_HAS_PSTOPO |
bogdanm | 82:6473597d706e | 293 | /*! |
bogdanm | 82:6473597d706e | 294 | * @brief Configures the PSTOPOR (Partial Stop Option). |
bogdanm | 82:6473597d706e | 295 | * |
bogdanm | 82:6473597d706e | 296 | * This function sets the PSTOPOR option. It controls whether a Partial |
bogdanm | 82:6473597d706e | 297 | * Stop mode is entered when the STOPM=STOP. When entering a Partial Stop mode from the |
bogdanm | 82:6473597d706e | 298 | * RUN mode, the PMC, MCG and Flash remain fully powered allowing the device |
bogdanm | 82:6473597d706e | 299 | * to wakeup almost instantaneously at the expense of a higher power consumption. |
bogdanm | 82:6473597d706e | 300 | * In PSTOP2, only the system clocks are gated, which allows the peripherals running on bus |
bogdanm | 82:6473597d706e | 301 | * clock to remain fully functional. In PSTOP1, both system and bus clocks are |
bogdanm | 82:6473597d706e | 302 | * gated. Refer to the smc_pstop_option_t for supported options. See the reference |
bogdanm | 82:6473597d706e | 303 | * manual for details. |
bogdanm | 82:6473597d706e | 304 | * |
bogdanm | 82:6473597d706e | 305 | * @param option PSTOPOR option setting defined in smc_pstop_option_t |
bogdanm | 82:6473597d706e | 306 | */ |
bogdanm | 82:6473597d706e | 307 | void smc_hal_config_pstop_power_option(smc_pstop_option_t option); |
bogdanm | 82:6473597d706e | 308 | |
bogdanm | 82:6473597d706e | 309 | /*! |
bogdanm | 82:6473597d706e | 310 | * @brief Gets the configuration of the PSTOPO option. |
bogdanm | 82:6473597d706e | 311 | * |
bogdanm | 82:6473597d706e | 312 | * This function gets the current PSTOPOR option setting. See the configuration |
bogdanm | 82:6473597d706e | 313 | * function for more details. |
bogdanm | 82:6473597d706e | 314 | * |
bogdanm | 82:6473597d706e | 315 | * @return option Current PSTOPOR option setting |
bogdanm | 82:6473597d706e | 316 | */ |
bogdanm | 82:6473597d706e | 317 | smc_por_option_t smc_hal_get_pstop_power_config(void); |
bogdanm | 82:6473597d706e | 318 | #endif |
bogdanm | 82:6473597d706e | 319 | |
bogdanm | 82:6473597d706e | 320 | #if FSL_FEATURE_SMC_HAS_LPOPO |
bogdanm | 82:6473597d706e | 321 | /*! |
bogdanm | 82:6473597d706e | 322 | * @brief Configures the LPO option setting. |
bogdanm | 82:6473597d706e | 323 | * |
bogdanm | 82:6473597d706e | 324 | * This function sets the LPO option setting. It controls whether the 1 kHZ |
bogdanm | 82:6473597d706e | 325 | * LPO clock is enabled in a certain lower power stop modes. See the |
bogdanm | 82:6473597d706e | 326 | * smc_lpo_option_t for supported options and the reference manual for |
bogdanm | 82:6473597d706e | 327 | * details about this option. |
bogdanm | 82:6473597d706e | 328 | * |
bogdanm | 82:6473597d706e | 329 | * @param option LPO option setting defined in smc_lpo_option_t |
bogdanm | 82:6473597d706e | 330 | */ |
bogdanm | 82:6473597d706e | 331 | void smc_hal_config_lpo_power_option(smc_lpo_option_t option); |
bogdanm | 82:6473597d706e | 332 | |
bogdanm | 82:6473597d706e | 333 | /*! |
bogdanm | 82:6473597d706e | 334 | * @brief Gets the settings of the LPO option. |
bogdanm | 82:6473597d706e | 335 | * |
bogdanm | 82:6473597d706e | 336 | * This function gets the current LPO option setting. See the configuration |
bogdanm | 82:6473597d706e | 337 | * function for details. |
bogdanm | 82:6473597d706e | 338 | * |
bogdanm | 82:6473597d706e | 339 | * @return option Current LPO option setting |
bogdanm | 82:6473597d706e | 340 | */ |
bogdanm | 82:6473597d706e | 341 | smc_por_option_t smc_hal_get_lpo_power_config(void); |
bogdanm | 82:6473597d706e | 342 | #endif |
bogdanm | 82:6473597d706e | 343 | |
bogdanm | 82:6473597d706e | 344 | #if FSL_FEATURE_SMC_HAS_LPWUI |
bogdanm | 82:6473597d706e | 345 | /*! |
bogdanm | 82:6473597d706e | 346 | * @brief Configures the LPWUI (Low Power Wake Up on interrupt) option. |
bogdanm | 82:6473597d706e | 347 | * |
bogdanm | 82:6473597d706e | 348 | * This function sets the LPWUI option and cause the system to exit |
bogdanm | 82:6473597d706e | 349 | * to normal RUN mode when any active interrupt occurs while in a specific lower |
bogdanm | 82:6473597d706e | 350 | * power mode. See the smc_lpwui_option_t for supported options and the |
bogdanm | 82:6473597d706e | 351 | * reference manual for more details about this option. |
bogdanm | 82:6473597d706e | 352 | * |
bogdanm | 82:6473597d706e | 353 | * @param option LPWUI option setting defined in smc_lpwui_option_t |
bogdanm | 82:6473597d706e | 354 | */ |
bogdanm | 82:6473597d706e | 355 | void smc_hal_config_lpwui_option(smc_lpwui_option_t option); |
bogdanm | 82:6473597d706e | 356 | |
bogdanm | 82:6473597d706e | 357 | /*! |
bogdanm | 82:6473597d706e | 358 | * @brief Gets the current LPWUI option. |
bogdanm | 82:6473597d706e | 359 | * |
bogdanm | 82:6473597d706e | 360 | * This function gets the LPWUI option. See the configuration function for more |
bogdanm | 82:6473597d706e | 361 | * details. |
bogdanm | 82:6473597d706e | 362 | * |
bogdanm | 82:6473597d706e | 363 | * @return setting Current LPWAUI option setting |
bogdanm | 82:6473597d706e | 364 | */ |
bogdanm | 82:6473597d706e | 365 | smc_lpwui_option_t smc_hal_get_lpwui_config(void); |
bogdanm | 82:6473597d706e | 366 | #endif |
bogdanm | 82:6473597d706e | 367 | |
bogdanm | 82:6473597d706e | 368 | /*! |
bogdanm | 82:6473597d706e | 369 | * @brief Gets the current power mode stat. |
bogdanm | 82:6473597d706e | 370 | * |
bogdanm | 82:6473597d706e | 371 | * This function returns the current power mode stat. Once application |
bogdanm | 82:6473597d706e | 372 | * switches the power mode, it should always check the stat to check whether it |
bogdanm | 82:6473597d706e | 373 | * runs into the specified mode or not. An application should check |
bogdanm | 82:6473597d706e | 374 | * this mode before switching to a different mode. The system requires that |
bogdanm | 82:6473597d706e | 375 | * only certain modes can switch to other specific modes. See the |
bogdanm | 82:6473597d706e | 376 | * reference manual for details and the _power_mode_stat for information about |
bogdanm | 82:6473597d706e | 377 | * the power stat. |
bogdanm | 82:6473597d706e | 378 | * |
bogdanm | 82:6473597d706e | 379 | * @return stat Current power mode stat |
bogdanm | 82:6473597d706e | 380 | */ |
bogdanm | 82:6473597d706e | 381 | uint8_t smc_hal_get_power_mode_stat(void); |
bogdanm | 82:6473597d706e | 382 | |
bogdanm | 82:6473597d706e | 383 | /*@}*/ |
bogdanm | 82:6473597d706e | 384 | |
bogdanm | 82:6473597d706e | 385 | #if defined(__cplusplus) |
bogdanm | 82:6473597d706e | 386 | } |
bogdanm | 82:6473597d706e | 387 | #endif /* __cplusplus*/ |
bogdanm | 82:6473597d706e | 388 | |
bogdanm | 82:6473597d706e | 389 | /*! @}*/ |
bogdanm | 82:6473597d706e | 390 | |
bogdanm | 82:6473597d706e | 391 | #endif /* __FSL_SMC_HAL_H__*/ |
bogdanm | 82:6473597d706e | 392 | /******************************************************************************* |
bogdanm | 82:6473597d706e | 393 | * EOF |
bogdanm | 82:6473597d706e | 394 | ******************************************************************************/ |
bogdanm | 82:6473597d706e | 395 |