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