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 Sep 18 14:00:17 2014 +0100
Revision:
324:406fd2029f23
Synchronized with git revision a73f28e6fbca9559fbed2726410eeb4c0534a4a5

Full URL: https://github.com/mbedmicro/mbed/commit/a73f28e6fbca9559fbed2726410eeb4c0534a4a5/

Extended #476, which does not break ethernet for K64F

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 324:406fd2029f23 1 /*
mbed_official 324:406fd2029f23 2 * Copyright (c) 2013 - 2014, Freescale Semiconductor, Inc.
mbed_official 324:406fd2029f23 3 * All rights reserved.
mbed_official 324:406fd2029f23 4 *
mbed_official 324:406fd2029f23 5 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 324:406fd2029f23 6 * are permitted provided that the following conditions are met:
mbed_official 324:406fd2029f23 7 *
mbed_official 324:406fd2029f23 8 * o Redistributions of source code must retain the above copyright notice, this list
mbed_official 324:406fd2029f23 9 * of conditions and the following disclaimer.
mbed_official 324:406fd2029f23 10 *
mbed_official 324:406fd2029f23 11 * o Redistributions in binary form must reproduce the above copyright notice, this
mbed_official 324:406fd2029f23 12 * list of conditions and the following disclaimer in the documentation and/or
mbed_official 324:406fd2029f23 13 * other materials provided with the distribution.
mbed_official 324:406fd2029f23 14 *
mbed_official 324:406fd2029f23 15 * o Neither the name of Freescale Semiconductor, Inc. nor the names of its
mbed_official 324:406fd2029f23 16 * contributors may be used to endorse or promote products derived from this
mbed_official 324:406fd2029f23 17 * software without specific prior written permission.
mbed_official 324:406fd2029f23 18 *
mbed_official 324:406fd2029f23 19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
mbed_official 324:406fd2029f23 20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
mbed_official 324:406fd2029f23 21 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 324:406fd2029f23 22 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
mbed_official 324:406fd2029f23 23 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
mbed_official 324:406fd2029f23 24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
mbed_official 324:406fd2029f23 25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
mbed_official 324:406fd2029f23 26 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
mbed_official 324:406fd2029f23 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
mbed_official 324:406fd2029f23 28 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 324:406fd2029f23 29 */
mbed_official 324:406fd2029f23 30 #if !defined(__FSL_LLWU_HAL_H__)
mbed_official 324:406fd2029f23 31 #define __FSL_LLWU_HAL_H__
mbed_official 324:406fd2029f23 32
mbed_official 324:406fd2029f23 33 #include <stdint.h>
mbed_official 324:406fd2029f23 34 #include <stdbool.h>
mbed_official 324:406fd2029f23 35 #include <assert.h>
mbed_official 324:406fd2029f23 36 #include "fsl_device_registers.h"
mbed_official 324:406fd2029f23 37 #include "fsl_llwu_features.h"
mbed_official 324:406fd2029f23 38
mbed_official 324:406fd2029f23 39 /*! @addtogroup llwu_hal*/
mbed_official 324:406fd2029f23 40 /*! @{*/
mbed_official 324:406fd2029f23 41
mbed_official 324:406fd2029f23 42 /*! @file fsl_llwu_hal.h */
mbed_official 324:406fd2029f23 43
mbed_official 324:406fd2029f23 44 /*******************************************************************************
mbed_official 324:406fd2029f23 45 * Definitions
mbed_official 324:406fd2029f23 46 ******************************************************************************/
mbed_official 324:406fd2029f23 47
mbed_official 324:406fd2029f23 48 /*! @brief External input pin control modes */
mbed_official 324:406fd2029f23 49 typedef enum _llwu_external_pin_modes {
mbed_official 324:406fd2029f23 50 kLlwuExternalPinDisabled, /* pin disabled as wakeup input */
mbed_official 324:406fd2029f23 51 kLlwuExternalPinRisingEdge, /* pin enabled with rising edge detection */
mbed_official 324:406fd2029f23 52 kLlwuExternalPinFallingEdge, /* pin enabled with falling edge detection */
mbed_official 324:406fd2029f23 53 kLlwuExternalPinChangeDetect /* pin enabled with any change detection */
mbed_official 324:406fd2029f23 54 } llwu_external_pin_modes_t;
mbed_official 324:406fd2029f23 55
mbed_official 324:406fd2029f23 56 /*! @brief Digital filter control modes */
mbed_official 324:406fd2029f23 57 typedef enum _llwu_filter_modes {
mbed_official 324:406fd2029f23 58 kLlwuFilterDisabled, /* filter disabled */
mbed_official 324:406fd2029f23 59 kLlwuFilterPosEdgeDetect, /* filter positive edge detection */
mbed_official 324:406fd2029f23 60 kLlwuFilterNegEdgeDetect, /* filter negative edge detection */
mbed_official 324:406fd2029f23 61 kLlwuFilterAnyEdgeDetect /* filter any edge detection */
mbed_official 324:406fd2029f23 62 } llwu_filter_modes_t;
mbed_official 324:406fd2029f23 63
mbed_official 324:406fd2029f23 64 /*! @brief External input pin filter control structure */
mbed_official 324:406fd2029f23 65 typedef struct _llwu_external_pin_filter_mode {
mbed_official 324:406fd2029f23 66 llwu_filter_modes_t filterMode; /* filter mode */
mbed_official 324:406fd2029f23 67 uint32_t pinNumber; /* pin number */
mbed_official 324:406fd2029f23 68 } llwu_external_pin_filter_mode_t;
mbed_official 324:406fd2029f23 69
mbed_official 324:406fd2029f23 70 /*! @brief Reset enable control structure */
mbed_official 324:406fd2029f23 71 typedef struct _llwu_reset_enable_mode {
mbed_official 324:406fd2029f23 72 bool lowLeakageMode; /* reset for Low-leakage mode */
mbed_official 324:406fd2029f23 73 bool digitalFilterMode; /* reset for digital filter mode */
mbed_official 324:406fd2029f23 74 } llwu_reset_enable_mode_t;
mbed_official 324:406fd2029f23 75
mbed_official 324:406fd2029f23 76 /*******************************************************************************
mbed_official 324:406fd2029f23 77 * API
mbed_official 324:406fd2029f23 78 ******************************************************************************/
mbed_official 324:406fd2029f23 79 /*!
mbed_official 324:406fd2029f23 80 * @brief Sets the external input pin source mode.
mbed_official 324:406fd2029f23 81 *
mbed_official 324:406fd2029f23 82 * This function sets the external input pin source mode that is used
mbed_official 324:406fd2029f23 83 * as a wake up source.
mbed_official 324:406fd2029f23 84 *
mbed_official 324:406fd2029f23 85 * @param baseAddr Register base address of LLWU
mbed_official 324:406fd2029f23 86 * @param pinMode pin configuration mode defined in llwu_external_pin_modes_t
mbed_official 324:406fd2029f23 87 * @param pinNumber pin number specified
mbed_official 324:406fd2029f23 88 */
mbed_official 324:406fd2029f23 89 void LLWU_HAL_SetExternalInputPinMode(uint32_t baseAddr,
mbed_official 324:406fd2029f23 90 llwu_external_pin_modes_t pinMode,
mbed_official 324:406fd2029f23 91 uint32_t pinNumber);
mbed_official 324:406fd2029f23 92
mbed_official 324:406fd2029f23 93 /*!
mbed_official 324:406fd2029f23 94 * @brief Gets the external input pin source mode.
mbed_official 324:406fd2029f23 95 *
mbed_official 324:406fd2029f23 96 * This function gets the external input pin source mode that is used
mbed_official 324:406fd2029f23 97 * as wake up source.
mbed_official 324:406fd2029f23 98 *
mbed_official 324:406fd2029f23 99 * @param baseAddr Register base address of LLWU
mbed_official 324:406fd2029f23 100 * @param pinNumber pin number specified
mbed_official 324:406fd2029f23 101 * @return pinMode pin mode defined in llwu_external_pin_modes_t
mbed_official 324:406fd2029f23 102 */
mbed_official 324:406fd2029f23 103 llwu_external_pin_modes_t LLWU_HAL_GetExternalInputPinMode(uint32_t baseAddr,
mbed_official 324:406fd2029f23 104 uint32_t pinNumber);
mbed_official 324:406fd2029f23 105
mbed_official 324:406fd2029f23 106 /*!
mbed_official 324:406fd2029f23 107 * @brief Enables/disables the internal module source.
mbed_official 324:406fd2029f23 108 *
mbed_official 324:406fd2029f23 109 * This function enables/disables the internal module source mode that is used
mbed_official 324:406fd2029f23 110 * as a wake up source.
mbed_official 324:406fd2029f23 111 *
mbed_official 324:406fd2029f23 112 * @param baseAddr Register base address of LLWU
mbed_official 324:406fd2029f23 113 * @param moduleNumber module number specified
mbed_official 324:406fd2029f23 114 * @param enable enable or disable setting
mbed_official 324:406fd2029f23 115 */
mbed_official 324:406fd2029f23 116 void LLWU_HAL_SetInternalModuleCmd(uint32_t baseAddr, uint32_t moduleNumber, bool enable);
mbed_official 324:406fd2029f23 117
mbed_official 324:406fd2029f23 118 /*!
mbed_official 324:406fd2029f23 119 * @brief Gets the internal module source enable setting.
mbed_official 324:406fd2029f23 120 *
mbed_official 324:406fd2029f23 121 * This function gets the internal module source enable setting that is used
mbed_official 324:406fd2029f23 122 * as a wake up source.
mbed_official 324:406fd2029f23 123 *
mbed_official 324:406fd2029f23 124 * @param baseAddr Register base address of LLWU
mbed_official 324:406fd2029f23 125 * @param moduleNumber module number specified
mbed_official 324:406fd2029f23 126 * @return enable enable or disable setting
mbed_official 324:406fd2029f23 127 */
mbed_official 324:406fd2029f23 128 bool LLWU_HAL_GetInternalModuleCmd(uint32_t baseAddr, uint32_t moduleNumber);
mbed_official 324:406fd2029f23 129
mbed_official 324:406fd2029f23 130 /*!
mbed_official 324:406fd2029f23 131 * @brief Gets the external wakeup source flag.
mbed_official 324:406fd2029f23 132 *
mbed_official 324:406fd2029f23 133 * This function gets the external wakeup source flag for a specific pin.
mbed_official 324:406fd2029f23 134 *
mbed_official 324:406fd2029f23 135 * @param baseAddr Register base address of LLWU
mbed_official 324:406fd2029f23 136 * @param pinNumber pin number specified
mbed_official 324:406fd2029f23 137 * @return flag true if wakeup source flag set
mbed_official 324:406fd2029f23 138 */
mbed_official 324:406fd2029f23 139 bool LLWU_HAL_GetExternalPinWakeupFlag(uint32_t baseAddr, uint32_t pinNumber);
mbed_official 324:406fd2029f23 140
mbed_official 324:406fd2029f23 141 /*!
mbed_official 324:406fd2029f23 142 * @brief Clears the external wakeup source flag.
mbed_official 324:406fd2029f23 143 *
mbed_official 324:406fd2029f23 144 * This function clears the external wakeup source flag for a specific pin.
mbed_official 324:406fd2029f23 145 *
mbed_official 324:406fd2029f23 146 * @param baseAddr Register base address of LLWU
mbed_official 324:406fd2029f23 147 * @param pinNumber pin number specified
mbed_official 324:406fd2029f23 148 */
mbed_official 324:406fd2029f23 149 void LLWU_HAL_ClearExternalPinWakeupFlag(uint32_t baseAddr, uint32_t pinNumber);
mbed_official 324:406fd2029f23 150
mbed_official 324:406fd2029f23 151 /*!
mbed_official 324:406fd2029f23 152 * @brief Gets the internal module wakeup source flag.
mbed_official 324:406fd2029f23 153 *
mbed_official 324:406fd2029f23 154 * This function gets the internal module wakeup source flag for a specific module.
mbed_official 324:406fd2029f23 155 *
mbed_official 324:406fd2029f23 156 * @param baseAddr Register base address of LLWU
mbed_official 324:406fd2029f23 157 * @param moduleNumber module number specified
mbed_official 324:406fd2029f23 158 * @return flag true if wakeup flag set
mbed_official 324:406fd2029f23 159 */
mbed_official 324:406fd2029f23 160 bool LLWU_HAL_GetInternalModuleWakeupFlag(uint32_t baseAddr, uint32_t moduleNumber);
mbed_official 324:406fd2029f23 161
mbed_official 324:406fd2029f23 162 /*!
mbed_official 324:406fd2029f23 163 * @brief Sets the pin filter configuration.
mbed_official 324:406fd2029f23 164 *
mbed_official 324:406fd2029f23 165 * This function sets the pin filter configuration.
mbed_official 324:406fd2029f23 166 *
mbed_official 324:406fd2029f23 167 * @param baseAddr Register base address of LLWU
mbed_official 324:406fd2029f23 168 * @param filterNumber filter number specified
mbed_official 324:406fd2029f23 169 * @param pinFilterMode filter mode configuration
mbed_official 324:406fd2029f23 170 */
mbed_official 324:406fd2029f23 171 void LLWU_HAL_SetPinFilterMode(uint32_t baseAddr, uint32_t filterNumber,
mbed_official 324:406fd2029f23 172 llwu_external_pin_filter_mode_t pinFilterMode);
mbed_official 324:406fd2029f23 173 /*!
mbed_official 324:406fd2029f23 174 * @brief Gets the pin filter configuration.
mbed_official 324:406fd2029f23 175 *
mbed_official 324:406fd2029f23 176 * This function gets the pin filter configuration.
mbed_official 324:406fd2029f23 177 *
mbed_official 324:406fd2029f23 178 * @param baseAddr Register base address of LLWU
mbed_official 324:406fd2029f23 179 * @param filterNumber filter number specified
mbed_official 324:406fd2029f23 180 * @param pinFilterMode filter mode configuration
mbed_official 324:406fd2029f23 181 */
mbed_official 324:406fd2029f23 182 void LLWU_HAL_GetPinFilterMode(uint32_t baseAddr, uint32_t filterNumber,
mbed_official 324:406fd2029f23 183 llwu_external_pin_filter_mode_t *pinFilterMode);
mbed_official 324:406fd2029f23 184
mbed_official 324:406fd2029f23 185 /*!
mbed_official 324:406fd2029f23 186 * @brief Gets the filter detect flag.
mbed_official 324:406fd2029f23 187 *
mbed_official 324:406fd2029f23 188 * This function will get the filter detect flag.
mbed_official 324:406fd2029f23 189 *
mbed_official 324:406fd2029f23 190 * @param baseAddr Register base address of LLWU
mbed_official 324:406fd2029f23 191 * @param filterNumber filter number specified
mbed_official 324:406fd2029f23 192 * @return flag true if the filter was a wakeup source
mbed_official 324:406fd2029f23 193 */
mbed_official 324:406fd2029f23 194 bool LLWU_HAL_GetFilterDetectFlag(uint32_t baseAddr, uint32_t filterNumber);
mbed_official 324:406fd2029f23 195
mbed_official 324:406fd2029f23 196 /*!
mbed_official 324:406fd2029f23 197 * @brief Clears the filter detect flag.
mbed_official 324:406fd2029f23 198 *
mbed_official 324:406fd2029f23 199 * This function will clear the filter detect flag.
mbed_official 324:406fd2029f23 200 *
mbed_official 324:406fd2029f23 201 * @param baseAddr Register base address of LLWU
mbed_official 324:406fd2029f23 202 * @param filterNumber filter number specified
mbed_official 324:406fd2029f23 203 */
mbed_official 324:406fd2029f23 204 void LLWU_HAL_ClearFilterDetectFlag(uint32_t baseAddr, uint32_t filterNumber);
mbed_official 324:406fd2029f23 205
mbed_official 324:406fd2029f23 206 #if FSL_FEATURE_LLWU_HAS_RESET_ENABLE
mbed_official 324:406fd2029f23 207 /*!
mbed_official 324:406fd2029f23 208 * @brief Sets the reset enable mode.
mbed_official 324:406fd2029f23 209 *
mbed_official 324:406fd2029f23 210 * This function will set the reset enable mode.
mbed_official 324:406fd2029f23 211 *
mbed_official 324:406fd2029f23 212 * @param baseAddr Register base address of LLWU
mbed_official 324:406fd2029f23 213 * @param resetEnableMode reset enable mode defined in llwu_reset_enable_mode_t
mbed_official 324:406fd2029f23 214 */
mbed_official 324:406fd2029f23 215 void LLWU_HAL_SetResetEnableMode(uint32_t baseAddr, llwu_reset_enable_mode_t resetEnableMode);
mbed_official 324:406fd2029f23 216
mbed_official 324:406fd2029f23 217 /*!
mbed_official 324:406fd2029f23 218 * @brief Gets the reset enable mode.
mbed_official 324:406fd2029f23 219 *
mbed_official 324:406fd2029f23 220 * This function gets the reset enable mode.
mbed_official 324:406fd2029f23 221 *
mbed_official 324:406fd2029f23 222 * @param baseAddr Register base address of LLWU
mbed_official 324:406fd2029f23 223 * @param resetEnableMode reset enable mode defined in llwu_reset_enable_mode_t
mbed_official 324:406fd2029f23 224 */
mbed_official 324:406fd2029f23 225 void LLWU_HAL_GetResetEnableMode(uint32_t baseAddr, llwu_reset_enable_mode_t *resetEnableMode);
mbed_official 324:406fd2029f23 226 #endif
mbed_official 324:406fd2029f23 227
mbed_official 324:406fd2029f23 228 #if defined(__cplusplus)
mbed_official 324:406fd2029f23 229 extern "C" {
mbed_official 324:406fd2029f23 230 #endif /* __cplusplus*/
mbed_official 324:406fd2029f23 231
mbed_official 324:406fd2029f23 232 /*! @name Low-Leakage Wakeup Unit Control APIs*/
mbed_official 324:406fd2029f23 233 /*@{*/
mbed_official 324:406fd2029f23 234
mbed_official 324:406fd2029f23 235
mbed_official 324:406fd2029f23 236 /*@}*/
mbed_official 324:406fd2029f23 237
mbed_official 324:406fd2029f23 238 #if defined(__cplusplus)
mbed_official 324:406fd2029f23 239 }
mbed_official 324:406fd2029f23 240 #endif /* __cplusplus*/
mbed_official 324:406fd2029f23 241
mbed_official 324:406fd2029f23 242 /*! @}*/
mbed_official 324:406fd2029f23 243
mbed_official 324:406fd2029f23 244 #endif /* __FSL_LLWU_HAL_H__*/
mbed_official 324:406fd2029f23 245 /*******************************************************************************
mbed_official 324:406fd2029f23 246 * EOF
mbed_official 324:406fd2029f23 247 ******************************************************************************/
mbed_official 324:406fd2029f23 248