The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.
Dependents: hello SerialTestv11 SerialTestv12 Sierpinski ... more
mbed 2
This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.
TARGET_K66F/TOOLCHAIN_IAR/fsl_llwu.h@172:65be27845400, 2019-02-20 (annotated)
- Committer:
- AnnaBridge
- Date:
- Wed Feb 20 20:53:29 2019 +0000
- Revision:
- 172:65be27845400
- Parent:
- 171:3a7713b1edbc
mbed library release version 165
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AnnaBridge | 143:86740a56073b | 1 | /* |
AnnaBridge | 143:86740a56073b | 2 | * Copyright (c) 2015, Freescale Semiconductor, Inc. |
AnnaBridge | 143:86740a56073b | 3 | * Copyright 2016-2017 NXP |
AnnaBridge | 143:86740a56073b | 4 | * |
AnnaBridge | 143:86740a56073b | 5 | * Redistribution and use in source and binary forms, with or without modification, |
AnnaBridge | 143:86740a56073b | 6 | * are permitted provided that the following conditions are met: |
AnnaBridge | 143:86740a56073b | 7 | * |
AnnaBridge | 143:86740a56073b | 8 | * o Redistributions of source code must retain the above copyright notice, this list |
AnnaBridge | 143:86740a56073b | 9 | * of conditions and the following disclaimer. |
AnnaBridge | 143:86740a56073b | 10 | * |
AnnaBridge | 143:86740a56073b | 11 | * o Redistributions in binary form must reproduce the above copyright notice, this |
AnnaBridge | 143:86740a56073b | 12 | * list of conditions and the following disclaimer in the documentation and/or |
AnnaBridge | 143:86740a56073b | 13 | * other materials provided with the distribution. |
AnnaBridge | 143:86740a56073b | 14 | * |
AnnaBridge | 143:86740a56073b | 15 | * o Neither the name of the copyright holder nor the names of its |
AnnaBridge | 143:86740a56073b | 16 | * contributors may be used to endorse or promote products derived from this |
AnnaBridge | 143:86740a56073b | 17 | * software without specific prior written permission. |
AnnaBridge | 143:86740a56073b | 18 | * |
AnnaBridge | 143:86740a56073b | 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
AnnaBridge | 143:86740a56073b | 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
AnnaBridge | 143:86740a56073b | 21 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
AnnaBridge | 143:86740a56073b | 22 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR |
AnnaBridge | 143:86740a56073b | 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
AnnaBridge | 143:86740a56073b | 24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
AnnaBridge | 143:86740a56073b | 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
AnnaBridge | 143:86740a56073b | 26 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
AnnaBridge | 143:86740a56073b | 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
AnnaBridge | 143:86740a56073b | 28 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
AnnaBridge | 143:86740a56073b | 29 | */ |
AnnaBridge | 143:86740a56073b | 30 | #ifndef _FSL_LLWU_H_ |
AnnaBridge | 143:86740a56073b | 31 | #define _FSL_LLWU_H_ |
AnnaBridge | 143:86740a56073b | 32 | |
AnnaBridge | 143:86740a56073b | 33 | #include "fsl_common.h" |
AnnaBridge | 143:86740a56073b | 34 | |
AnnaBridge | 143:86740a56073b | 35 | /*! @addtogroup llwu */ |
AnnaBridge | 143:86740a56073b | 36 | /*! @{ */ |
AnnaBridge | 143:86740a56073b | 37 | |
AnnaBridge | 143:86740a56073b | 38 | |
AnnaBridge | 143:86740a56073b | 39 | /******************************************************************************* |
AnnaBridge | 143:86740a56073b | 40 | * Definitions |
AnnaBridge | 143:86740a56073b | 41 | ******************************************************************************/ |
AnnaBridge | 143:86740a56073b | 42 | |
AnnaBridge | 143:86740a56073b | 43 | /*! @name Driver version */ |
AnnaBridge | 143:86740a56073b | 44 | /*@{*/ |
AnnaBridge | 143:86740a56073b | 45 | /*! @brief LLWU driver version 2.0.1. */ |
AnnaBridge | 143:86740a56073b | 46 | #define FSL_LLWU_DRIVER_VERSION (MAKE_VERSION(2, 0, 1)) |
AnnaBridge | 143:86740a56073b | 47 | /*@}*/ |
AnnaBridge | 143:86740a56073b | 48 | |
AnnaBridge | 143:86740a56073b | 49 | /*! |
AnnaBridge | 143:86740a56073b | 50 | * @brief External input pin control modes |
AnnaBridge | 143:86740a56073b | 51 | */ |
AnnaBridge | 143:86740a56073b | 52 | typedef enum _llwu_external_pin_mode |
AnnaBridge | 143:86740a56073b | 53 | { |
AnnaBridge | 143:86740a56073b | 54 | kLLWU_ExternalPinDisable = 0U, /*!< Pin disabled as a wakeup input. */ |
AnnaBridge | 143:86740a56073b | 55 | kLLWU_ExternalPinRisingEdge = 1U, /*!< Pin enabled with the rising edge detection. */ |
AnnaBridge | 143:86740a56073b | 56 | kLLWU_ExternalPinFallingEdge = 2U, /*!< Pin enabled with the falling edge detection.*/ |
AnnaBridge | 143:86740a56073b | 57 | kLLWU_ExternalPinAnyEdge = 3U /*!< Pin enabled with any change detection. */ |
AnnaBridge | 143:86740a56073b | 58 | } llwu_external_pin_mode_t; |
AnnaBridge | 143:86740a56073b | 59 | |
AnnaBridge | 143:86740a56073b | 60 | /*! |
AnnaBridge | 143:86740a56073b | 61 | * @brief Digital filter control modes |
AnnaBridge | 143:86740a56073b | 62 | */ |
AnnaBridge | 143:86740a56073b | 63 | typedef enum _llwu_pin_filter_mode |
AnnaBridge | 143:86740a56073b | 64 | { |
AnnaBridge | 143:86740a56073b | 65 | kLLWU_PinFilterDisable = 0U, /*!< Filter disabled. */ |
AnnaBridge | 143:86740a56073b | 66 | kLLWU_PinFilterRisingEdge = 1U, /*!< Filter positive edge detection.*/ |
AnnaBridge | 143:86740a56073b | 67 | kLLWU_PinFilterFallingEdge = 2U, /*!< Filter negative edge detection.*/ |
AnnaBridge | 143:86740a56073b | 68 | kLLWU_PinFilterAnyEdge = 3U /*!< Filter any edge detection. */ |
AnnaBridge | 143:86740a56073b | 69 | } llwu_pin_filter_mode_t; |
AnnaBridge | 143:86740a56073b | 70 | |
AnnaBridge | 143:86740a56073b | 71 | #if (defined(FSL_FEATURE_LLWU_HAS_VERID) && FSL_FEATURE_LLWU_HAS_VERID) |
AnnaBridge | 143:86740a56073b | 72 | /*! |
AnnaBridge | 143:86740a56073b | 73 | * @brief IP version ID definition. |
AnnaBridge | 143:86740a56073b | 74 | */ |
AnnaBridge | 143:86740a56073b | 75 | typedef struct _llwu_version_id |
AnnaBridge | 143:86740a56073b | 76 | { |
AnnaBridge | 143:86740a56073b | 77 | uint16_t feature; /*!< A feature specification number. */ |
AnnaBridge | 143:86740a56073b | 78 | uint8_t minor; /*!< The minor version number. */ |
AnnaBridge | 143:86740a56073b | 79 | uint8_t major; /*!< The major version number. */ |
AnnaBridge | 143:86740a56073b | 80 | } llwu_version_id_t; |
AnnaBridge | 143:86740a56073b | 81 | #endif /* FSL_FEATURE_LLWU_HAS_VERID */ |
AnnaBridge | 143:86740a56073b | 82 | |
AnnaBridge | 143:86740a56073b | 83 | #if (defined(FSL_FEATURE_LLWU_HAS_PARAM) && FSL_FEATURE_LLWU_HAS_PARAM) |
AnnaBridge | 143:86740a56073b | 84 | /*! |
AnnaBridge | 143:86740a56073b | 85 | * @brief IP parameter definition. |
AnnaBridge | 143:86740a56073b | 86 | */ |
AnnaBridge | 143:86740a56073b | 87 | typedef struct _llwu_param |
AnnaBridge | 143:86740a56073b | 88 | { |
AnnaBridge | 143:86740a56073b | 89 | uint8_t filters; /*!< A number of the pin filter. */ |
AnnaBridge | 143:86740a56073b | 90 | uint8_t dmas; /*!< A number of the wakeup DMA. */ |
AnnaBridge | 143:86740a56073b | 91 | uint8_t modules; /*!< A number of the wakeup module. */ |
AnnaBridge | 143:86740a56073b | 92 | uint8_t pins; /*!< A number of the wake up pin. */ |
AnnaBridge | 143:86740a56073b | 93 | } llwu_param_t; |
AnnaBridge | 143:86740a56073b | 94 | #endif /* FSL_FEATURE_LLWU_HAS_PARAM */ |
AnnaBridge | 143:86740a56073b | 95 | |
AnnaBridge | 143:86740a56073b | 96 | #if (defined(FSL_FEATURE_LLWU_HAS_PIN_FILTER) && FSL_FEATURE_LLWU_HAS_PIN_FILTER) |
AnnaBridge | 143:86740a56073b | 97 | /*! |
AnnaBridge | 143:86740a56073b | 98 | * @brief An external input pin filter control structure |
AnnaBridge | 143:86740a56073b | 99 | */ |
AnnaBridge | 143:86740a56073b | 100 | typedef struct _llwu_external_pin_filter_mode |
AnnaBridge | 143:86740a56073b | 101 | { |
AnnaBridge | 143:86740a56073b | 102 | uint32_t pinIndex; /*!< A pin number */ |
AnnaBridge | 143:86740a56073b | 103 | llwu_pin_filter_mode_t filterMode; /*!< Filter mode */ |
AnnaBridge | 143:86740a56073b | 104 | } llwu_external_pin_filter_mode_t; |
AnnaBridge | 143:86740a56073b | 105 | #endif /* FSL_FEATURE_LLWU_HAS_PIN_FILTER */ |
AnnaBridge | 143:86740a56073b | 106 | |
AnnaBridge | 143:86740a56073b | 107 | /******************************************************************************* |
AnnaBridge | 143:86740a56073b | 108 | * API |
AnnaBridge | 143:86740a56073b | 109 | ******************************************************************************/ |
AnnaBridge | 143:86740a56073b | 110 | |
AnnaBridge | 143:86740a56073b | 111 | #if defined(__cplusplus) |
AnnaBridge | 143:86740a56073b | 112 | extern "C" { |
AnnaBridge | 143:86740a56073b | 113 | #endif |
AnnaBridge | 143:86740a56073b | 114 | |
AnnaBridge | 143:86740a56073b | 115 | /*! |
AnnaBridge | 143:86740a56073b | 116 | * @name Low-Leakage Wakeup Unit Control APIs |
AnnaBridge | 143:86740a56073b | 117 | * @{ |
AnnaBridge | 143:86740a56073b | 118 | */ |
AnnaBridge | 143:86740a56073b | 119 | |
AnnaBridge | 143:86740a56073b | 120 | #if (defined(FSL_FEATURE_LLWU_HAS_VERID) && FSL_FEATURE_LLWU_HAS_VERID) |
AnnaBridge | 143:86740a56073b | 121 | /*! |
AnnaBridge | 143:86740a56073b | 122 | * @brief Gets the LLWU version ID. |
AnnaBridge | 143:86740a56073b | 123 | * |
AnnaBridge | 143:86740a56073b | 124 | * This function gets the LLWU version ID, including the major version number, |
AnnaBridge | 143:86740a56073b | 125 | * the minor version number, and the feature specification number. |
AnnaBridge | 143:86740a56073b | 126 | * |
AnnaBridge | 143:86740a56073b | 127 | * @param base LLWU peripheral base address. |
AnnaBridge | 143:86740a56073b | 128 | * @param versionId A pointer to the version ID structure. |
AnnaBridge | 143:86740a56073b | 129 | */ |
AnnaBridge | 143:86740a56073b | 130 | static inline void LLWU_GetVersionId(LLWU_Type *base, llwu_version_id_t *versionId) |
AnnaBridge | 143:86740a56073b | 131 | { |
AnnaBridge | 143:86740a56073b | 132 | *((uint32_t *)versionId) = base->VERID; |
AnnaBridge | 143:86740a56073b | 133 | } |
AnnaBridge | 143:86740a56073b | 134 | #endif /* FSL_FEATURE_LLWU_HAS_VERID */ |
AnnaBridge | 143:86740a56073b | 135 | |
AnnaBridge | 143:86740a56073b | 136 | #if (defined(FSL_FEATURE_LLWU_HAS_PARAM) && FSL_FEATURE_LLWU_HAS_PARAM) |
AnnaBridge | 143:86740a56073b | 137 | /*! |
AnnaBridge | 143:86740a56073b | 138 | * @brief Gets the LLWU parameter. |
AnnaBridge | 143:86740a56073b | 139 | * |
AnnaBridge | 143:86740a56073b | 140 | * This function gets the LLWU parameter, including a wakeup pin number, a module |
AnnaBridge | 143:86740a56073b | 141 | * number, a DMA number, and a pin filter number. |
AnnaBridge | 143:86740a56073b | 142 | * |
AnnaBridge | 143:86740a56073b | 143 | * @param base LLWU peripheral base address. |
AnnaBridge | 143:86740a56073b | 144 | * @param param A pointer to the LLWU parameter structure. |
AnnaBridge | 143:86740a56073b | 145 | */ |
AnnaBridge | 143:86740a56073b | 146 | static inline void LLWU_GetParam(LLWU_Type *base, llwu_param_t *param) |
AnnaBridge | 143:86740a56073b | 147 | { |
AnnaBridge | 143:86740a56073b | 148 | *((uint32_t *)param) = base->PARAM; |
AnnaBridge | 143:86740a56073b | 149 | } |
AnnaBridge | 143:86740a56073b | 150 | #endif /* FSL_FEATURE_LLWU_HAS_PARAM */ |
AnnaBridge | 143:86740a56073b | 151 | |
AnnaBridge | 143:86740a56073b | 152 | #if (defined(FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN) && FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN) |
AnnaBridge | 143:86740a56073b | 153 | /*! |
AnnaBridge | 143:86740a56073b | 154 | * @brief Sets the external input pin source mode. |
AnnaBridge | 143:86740a56073b | 155 | * |
AnnaBridge | 143:86740a56073b | 156 | * This function sets the external input pin source mode that is used |
AnnaBridge | 143:86740a56073b | 157 | * as a wake up source. |
AnnaBridge | 143:86740a56073b | 158 | * |
AnnaBridge | 143:86740a56073b | 159 | * @param base LLWU peripheral base address. |
AnnaBridge | 143:86740a56073b | 160 | * @param pinIndex A pin index to be enabled as an external wakeup source starting from 1. |
AnnaBridge | 143:86740a56073b | 161 | * @param pinMode A pin configuration mode defined in the llwu_external_pin_modes_t. |
AnnaBridge | 143:86740a56073b | 162 | */ |
AnnaBridge | 143:86740a56073b | 163 | void LLWU_SetExternalWakeupPinMode(LLWU_Type *base, uint32_t pinIndex, llwu_external_pin_mode_t pinMode); |
AnnaBridge | 143:86740a56073b | 164 | |
AnnaBridge | 143:86740a56073b | 165 | /*! |
AnnaBridge | 143:86740a56073b | 166 | * @brief Gets the external wakeup source flag. |
AnnaBridge | 143:86740a56073b | 167 | * |
AnnaBridge | 143:86740a56073b | 168 | * This function checks the external pin flag to detect whether the MCU is |
AnnaBridge | 143:86740a56073b | 169 | * woken up by the specific pin. |
AnnaBridge | 143:86740a56073b | 170 | * |
AnnaBridge | 143:86740a56073b | 171 | * @param base LLWU peripheral base address. |
AnnaBridge | 143:86740a56073b | 172 | * @param pinIndex A pin index, which starts from 1. |
AnnaBridge | 143:86740a56073b | 173 | * @return True if the specific pin is a wakeup source. |
AnnaBridge | 143:86740a56073b | 174 | */ |
AnnaBridge | 143:86740a56073b | 175 | bool LLWU_GetExternalWakeupPinFlag(LLWU_Type *base, uint32_t pinIndex); |
AnnaBridge | 143:86740a56073b | 176 | |
AnnaBridge | 143:86740a56073b | 177 | /*! |
AnnaBridge | 143:86740a56073b | 178 | * @brief Clears the external wakeup source flag. |
AnnaBridge | 143:86740a56073b | 179 | * |
AnnaBridge | 143:86740a56073b | 180 | * This function clears the external wakeup source flag for a specific pin. |
AnnaBridge | 143:86740a56073b | 181 | * |
AnnaBridge | 143:86740a56073b | 182 | * @param base LLWU peripheral base address. |
AnnaBridge | 143:86740a56073b | 183 | * @param pinIndex A pin index, which starts from 1. |
AnnaBridge | 143:86740a56073b | 184 | */ |
AnnaBridge | 143:86740a56073b | 185 | void LLWU_ClearExternalWakeupPinFlag(LLWU_Type *base, uint32_t pinIndex); |
AnnaBridge | 143:86740a56073b | 186 | #endif /* FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN */ |
AnnaBridge | 143:86740a56073b | 187 | |
AnnaBridge | 143:86740a56073b | 188 | #if (defined(FSL_FEATURE_LLWU_HAS_INTERNAL_MODULE) && FSL_FEATURE_LLWU_HAS_INTERNAL_MODULE) |
AnnaBridge | 143:86740a56073b | 189 | /*! |
AnnaBridge | 143:86740a56073b | 190 | * @brief Enables/disables the internal module source. |
AnnaBridge | 143:86740a56073b | 191 | * |
AnnaBridge | 143:86740a56073b | 192 | * This function enables/disables the internal module source mode that is used |
AnnaBridge | 143:86740a56073b | 193 | * as a wake up source. |
AnnaBridge | 143:86740a56073b | 194 | * |
AnnaBridge | 143:86740a56073b | 195 | * @param base LLWU peripheral base address. |
AnnaBridge | 143:86740a56073b | 196 | * @param moduleIndex A module index to be enabled as an internal wakeup source starting from 1. |
AnnaBridge | 143:86740a56073b | 197 | * @param enable An enable or a disable setting |
AnnaBridge | 143:86740a56073b | 198 | */ |
AnnaBridge | 143:86740a56073b | 199 | static inline void LLWU_EnableInternalModuleInterruptWakup(LLWU_Type *base, uint32_t moduleIndex, bool enable) |
AnnaBridge | 143:86740a56073b | 200 | { |
AnnaBridge | 143:86740a56073b | 201 | if (enable) |
AnnaBridge | 143:86740a56073b | 202 | { |
AnnaBridge | 143:86740a56073b | 203 | base->ME |= 1U << moduleIndex; |
AnnaBridge | 143:86740a56073b | 204 | } |
AnnaBridge | 143:86740a56073b | 205 | else |
AnnaBridge | 143:86740a56073b | 206 | { |
AnnaBridge | 143:86740a56073b | 207 | base->ME &= ~(1U << moduleIndex); |
AnnaBridge | 143:86740a56073b | 208 | } |
AnnaBridge | 143:86740a56073b | 209 | } |
AnnaBridge | 143:86740a56073b | 210 | |
AnnaBridge | 143:86740a56073b | 211 | /*! |
AnnaBridge | 143:86740a56073b | 212 | * @brief Gets the external wakeup source flag. |
AnnaBridge | 143:86740a56073b | 213 | * |
AnnaBridge | 143:86740a56073b | 214 | * This function checks the external pin flag to detect whether the system is |
AnnaBridge | 143:86740a56073b | 215 | * woken up by the specific pin. |
AnnaBridge | 143:86740a56073b | 216 | * |
AnnaBridge | 143:86740a56073b | 217 | * @param base LLWU peripheral base address. |
AnnaBridge | 143:86740a56073b | 218 | * @param moduleIndex A module index, which starts from 1. |
AnnaBridge | 143:86740a56073b | 219 | * @return True if the specific pin is a wake up source. |
AnnaBridge | 143:86740a56073b | 220 | */ |
AnnaBridge | 143:86740a56073b | 221 | static inline bool LLWU_GetInternalWakeupModuleFlag(LLWU_Type *base, uint32_t moduleIndex) |
AnnaBridge | 143:86740a56073b | 222 | { |
AnnaBridge | 143:86740a56073b | 223 | #if (defined(FSL_FEATURE_LLWU_HAS_MF) && FSL_FEATURE_LLWU_HAS_MF) |
AnnaBridge | 143:86740a56073b | 224 | #if (defined(FSL_FEATURE_LLWU_REG_BITWIDTH) && (FSL_FEATURE_LLWU_REG_BITWIDTH == 32)) |
AnnaBridge | 143:86740a56073b | 225 | return (bool)(base->MF & (1U << moduleIndex)); |
AnnaBridge | 143:86740a56073b | 226 | #else |
AnnaBridge | 143:86740a56073b | 227 | return (bool)(base->MF5 & (1U << moduleIndex)); |
AnnaBridge | 143:86740a56073b | 228 | #endif /* FSL_FEATURE_LLWU_REG_BITWIDTH */ |
AnnaBridge | 143:86740a56073b | 229 | #else |
AnnaBridge | 143:86740a56073b | 230 | #if (defined(FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN) && (FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN > 16)) |
AnnaBridge | 143:86740a56073b | 231 | return (bool)(base->F5 & (1U << moduleIndex)); |
AnnaBridge | 143:86740a56073b | 232 | #else |
AnnaBridge | 143:86740a56073b | 233 | #if (defined(FSL_FEATURE_LLWU_HAS_PF) && FSL_FEATURE_LLWU_HAS_PF) |
AnnaBridge | 143:86740a56073b | 234 | return (bool)(base->PF3 & (1U << moduleIndex)); |
AnnaBridge | 143:86740a56073b | 235 | #else |
AnnaBridge | 143:86740a56073b | 236 | return (bool)(base->F3 & (1U << moduleIndex)); |
AnnaBridge | 143:86740a56073b | 237 | #endif /* FSL_FEATURE_LLWU_HAS_PF */ |
AnnaBridge | 143:86740a56073b | 238 | #endif /* FSL_FEATURE_LLWU_HAS_EXTERNAL_PIN */ |
AnnaBridge | 143:86740a56073b | 239 | #endif /* FSL_FEATURE_LLWU_HAS_MF */ |
AnnaBridge | 143:86740a56073b | 240 | } |
AnnaBridge | 143:86740a56073b | 241 | #endif /* FSL_FEATURE_LLWU_HAS_INTERNAL_MODULE */ |
AnnaBridge | 143:86740a56073b | 242 | |
AnnaBridge | 143:86740a56073b | 243 | #if (defined(FSL_FEATURE_LLWU_HAS_DMA_ENABLE_REG) && FSL_FEATURE_LLWU_HAS_DMA_ENABLE_REG) |
AnnaBridge | 143:86740a56073b | 244 | /*! |
AnnaBridge | 143:86740a56073b | 245 | * @brief Enables/disables the internal module DMA wakeup source. |
AnnaBridge | 143:86740a56073b | 246 | * |
AnnaBridge | 143:86740a56073b | 247 | * This function enables/disables the internal DMA that is used as a wake up source. |
AnnaBridge | 143:86740a56073b | 248 | * |
AnnaBridge | 143:86740a56073b | 249 | * @param base LLWU peripheral base address. |
AnnaBridge | 143:86740a56073b | 250 | * @param moduleIndex An internal module index which is used as a DMA request source, starting from 1. |
AnnaBridge | 143:86740a56073b | 251 | * @param enable Enable or disable the DMA request source |
AnnaBridge | 143:86740a56073b | 252 | */ |
AnnaBridge | 143:86740a56073b | 253 | static inline void LLWU_EnableInternalModuleDmaRequestWakup(LLWU_Type *base, uint32_t moduleIndex, bool enable) |
AnnaBridge | 143:86740a56073b | 254 | { |
AnnaBridge | 143:86740a56073b | 255 | if (enable) |
AnnaBridge | 143:86740a56073b | 256 | { |
AnnaBridge | 143:86740a56073b | 257 | base->DE |= 1U << moduleIndex; |
AnnaBridge | 143:86740a56073b | 258 | } |
AnnaBridge | 143:86740a56073b | 259 | else |
AnnaBridge | 143:86740a56073b | 260 | { |
AnnaBridge | 143:86740a56073b | 261 | base->DE &= ~(1U << moduleIndex); |
AnnaBridge | 143:86740a56073b | 262 | } |
AnnaBridge | 143:86740a56073b | 263 | } |
AnnaBridge | 143:86740a56073b | 264 | #endif /* FSL_FEATURE_LLWU_HAS_DMA_ENABLE_REG */ |
AnnaBridge | 143:86740a56073b | 265 | |
AnnaBridge | 143:86740a56073b | 266 | #if (defined(FSL_FEATURE_LLWU_HAS_PIN_FILTER) && FSL_FEATURE_LLWU_HAS_PIN_FILTER) |
AnnaBridge | 143:86740a56073b | 267 | /*! |
AnnaBridge | 143:86740a56073b | 268 | * @brief Sets the pin filter configuration. |
AnnaBridge | 143:86740a56073b | 269 | * |
AnnaBridge | 143:86740a56073b | 270 | * This function sets the pin filter configuration. |
AnnaBridge | 143:86740a56073b | 271 | * |
AnnaBridge | 143:86740a56073b | 272 | * @param base LLWU peripheral base address. |
AnnaBridge | 143:86740a56073b | 273 | * @param filterIndex A pin filter index used to enable/disable the digital filter, starting from 1. |
AnnaBridge | 143:86740a56073b | 274 | * @param filterMode A filter mode configuration |
AnnaBridge | 143:86740a56073b | 275 | */ |
AnnaBridge | 143:86740a56073b | 276 | void LLWU_SetPinFilterMode(LLWU_Type *base, uint32_t filterIndex, llwu_external_pin_filter_mode_t filterMode); |
AnnaBridge | 143:86740a56073b | 277 | |
AnnaBridge | 143:86740a56073b | 278 | /*! |
AnnaBridge | 143:86740a56073b | 279 | * @brief Gets the pin filter configuration. |
AnnaBridge | 143:86740a56073b | 280 | * |
AnnaBridge | 143:86740a56073b | 281 | * This function gets the pin filter flag. |
AnnaBridge | 143:86740a56073b | 282 | * |
AnnaBridge | 143:86740a56073b | 283 | * @param base LLWU peripheral base address. |
AnnaBridge | 143:86740a56073b | 284 | * @param filterIndex A pin filter index, which starts from 1. |
AnnaBridge | 143:86740a56073b | 285 | * @return True if the flag is a source of the existing low-leakage power mode. |
AnnaBridge | 143:86740a56073b | 286 | */ |
AnnaBridge | 143:86740a56073b | 287 | bool LLWU_GetPinFilterFlag(LLWU_Type *base, uint32_t filterIndex); |
AnnaBridge | 143:86740a56073b | 288 | |
AnnaBridge | 143:86740a56073b | 289 | /*! |
AnnaBridge | 143:86740a56073b | 290 | * @brief Clears the pin filter configuration. |
AnnaBridge | 143:86740a56073b | 291 | * |
AnnaBridge | 143:86740a56073b | 292 | * This function clears the pin filter flag. |
AnnaBridge | 143:86740a56073b | 293 | * |
AnnaBridge | 143:86740a56073b | 294 | * @param base LLWU peripheral base address. |
AnnaBridge | 143:86740a56073b | 295 | * @param filterIndex A pin filter index to clear the flag, starting from 1. |
AnnaBridge | 143:86740a56073b | 296 | */ |
AnnaBridge | 143:86740a56073b | 297 | void LLWU_ClearPinFilterFlag(LLWU_Type *base, uint32_t filterIndex); |
AnnaBridge | 143:86740a56073b | 298 | |
AnnaBridge | 143:86740a56073b | 299 | #endif /* FSL_FEATURE_LLWU_HAS_PIN_FILTER */ |
AnnaBridge | 143:86740a56073b | 300 | |
AnnaBridge | 143:86740a56073b | 301 | #if (defined(FSL_FEATURE_LLWU_HAS_RESET_ENABLE) && FSL_FEATURE_LLWU_HAS_RESET_ENABLE) |
AnnaBridge | 143:86740a56073b | 302 | /*! |
AnnaBridge | 143:86740a56073b | 303 | * @brief Sets the reset pin mode. |
AnnaBridge | 143:86740a56073b | 304 | * |
AnnaBridge | 143:86740a56073b | 305 | * This function determines how the reset pin is used as a low leakage mode exit source. |
AnnaBridge | 143:86740a56073b | 306 | * |
AnnaBridge | 143:86740a56073b | 307 | * @param pinEnable Enable reset the pin filter |
AnnaBridge | 143:86740a56073b | 308 | * @param pinFilterEnable Specify whether the pin filter is enabled in Low-Leakage power mode. |
AnnaBridge | 143:86740a56073b | 309 | */ |
AnnaBridge | 143:86740a56073b | 310 | void LLWU_SetResetPinMode(LLWU_Type *base, bool pinEnable, bool enableInLowLeakageMode); |
AnnaBridge | 143:86740a56073b | 311 | #endif /* FSL_FEATURE_LLWU_HAS_RESET_ENABLE */ |
AnnaBridge | 143:86740a56073b | 312 | |
AnnaBridge | 143:86740a56073b | 313 | /*@}*/ |
AnnaBridge | 143:86740a56073b | 314 | |
AnnaBridge | 143:86740a56073b | 315 | #if defined(__cplusplus) |
AnnaBridge | 143:86740a56073b | 316 | } |
AnnaBridge | 143:86740a56073b | 317 | #endif |
AnnaBridge | 143:86740a56073b | 318 | |
AnnaBridge | 143:86740a56073b | 319 | /*! @}*/ |
AnnaBridge | 143:86740a56073b | 320 | #endif /* _FSL_LLWU_H_*/ |