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.

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?

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