mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Committer:
mbed_official
Date:
Thu Apr 03 11:45:06 2014 +0100
Revision:
149:1fb5f62b92bd
Parent:
targets/hal/TARGET_Freescale/TARGET_KSDK_MCUS/TARGET_KSDK_CODE/hal/smc/fsl_smc_hal.h@146:f64d43ff0c18
Child:
324:406fd2029f23
Synchronized with git revision 220c0bb39ceee40016e1e86350c058963d01ed42

Full URL: https://github.com/mbedmicro/mbed/commit/220c0bb39ceee40016e1e86350c058963d01ed42/

Who changed what in which revision?

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