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