mbed library sources. Supersedes mbed-src.
Dependents: Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more
targets/TARGET_STM/TARGET_STM32L0/device/stm32l0xx_ll_wwdg.h@189:f392fc9709a3, 2019-02-20 (annotated)
- Committer:
- AnnaBridge
- Date:
- Wed Feb 20 22:31:08 2019 +0000
- Revision:
- 189:f392fc9709a3
- Parent:
- 186:707f6e361f3e
mbed library release version 165
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kojto | 158:b23ee177fd68 | 1 | /** |
Kojto | 158:b23ee177fd68 | 2 | ****************************************************************************** |
Kojto | 158:b23ee177fd68 | 3 | * @file stm32l0xx_ll_wwdg.h |
Kojto | 158:b23ee177fd68 | 4 | * @author MCD Application Team |
Kojto | 158:b23ee177fd68 | 5 | * @brief Header file of WWDG LL module. |
Kojto | 158:b23ee177fd68 | 6 | ****************************************************************************** |
Kojto | 158:b23ee177fd68 | 7 | * @attention |
Kojto | 158:b23ee177fd68 | 8 | * |
Kojto | 158:b23ee177fd68 | 9 | * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> |
Kojto | 158:b23ee177fd68 | 10 | * |
Kojto | 158:b23ee177fd68 | 11 | * Redistribution and use in source and binary forms, with or without modification, |
Kojto | 158:b23ee177fd68 | 12 | * are permitted provided that the following conditions are met: |
Kojto | 158:b23ee177fd68 | 13 | * 1. Redistributions of source code must retain the above copyright notice, |
Kojto | 158:b23ee177fd68 | 14 | * this list of conditions and the following disclaimer. |
Kojto | 158:b23ee177fd68 | 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
Kojto | 158:b23ee177fd68 | 16 | * this list of conditions and the following disclaimer in the documentation |
Kojto | 158:b23ee177fd68 | 17 | * and/or other materials provided with the distribution. |
Kojto | 158:b23ee177fd68 | 18 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
Kojto | 158:b23ee177fd68 | 19 | * may be used to endorse or promote products derived from this software |
Kojto | 158:b23ee177fd68 | 20 | * without specific prior written permission. |
Kojto | 158:b23ee177fd68 | 21 | * |
Kojto | 158:b23ee177fd68 | 22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
Kojto | 158:b23ee177fd68 | 23 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
Kojto | 158:b23ee177fd68 | 24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
Kojto | 158:b23ee177fd68 | 25 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
Kojto | 158:b23ee177fd68 | 26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
Kojto | 158:b23ee177fd68 | 27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
Kojto | 158:b23ee177fd68 | 28 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
Kojto | 158:b23ee177fd68 | 29 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
Kojto | 158:b23ee177fd68 | 30 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
Kojto | 158:b23ee177fd68 | 31 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Kojto | 158:b23ee177fd68 | 32 | * |
Kojto | 158:b23ee177fd68 | 33 | ****************************************************************************** |
Kojto | 158:b23ee177fd68 | 34 | */ |
Kojto | 158:b23ee177fd68 | 35 | |
Kojto | 158:b23ee177fd68 | 36 | /* Define to prevent recursive inclusion -------------------------------------*/ |
Kojto | 158:b23ee177fd68 | 37 | #ifndef __STM32L0xx_LL_WWDG_H |
Kojto | 158:b23ee177fd68 | 38 | #define __STM32L0xx_LL_WWDG_H |
Kojto | 158:b23ee177fd68 | 39 | |
Kojto | 158:b23ee177fd68 | 40 | #ifdef __cplusplus |
Kojto | 158:b23ee177fd68 | 41 | extern "C" { |
Kojto | 158:b23ee177fd68 | 42 | #endif |
Kojto | 158:b23ee177fd68 | 43 | |
Kojto | 158:b23ee177fd68 | 44 | /* Includes ------------------------------------------------------------------*/ |
Kojto | 158:b23ee177fd68 | 45 | #include "stm32l0xx.h" |
Kojto | 158:b23ee177fd68 | 46 | |
Kojto | 158:b23ee177fd68 | 47 | /** @addtogroup STM32L0xx_LL_Driver |
Kojto | 158:b23ee177fd68 | 48 | * @{ |
Kojto | 158:b23ee177fd68 | 49 | */ |
Kojto | 158:b23ee177fd68 | 50 | |
Kojto | 158:b23ee177fd68 | 51 | #if defined (WWDG) |
Kojto | 158:b23ee177fd68 | 52 | |
Kojto | 158:b23ee177fd68 | 53 | /** @defgroup WWDG_LL WWDG |
Kojto | 158:b23ee177fd68 | 54 | * @{ |
Kojto | 158:b23ee177fd68 | 55 | */ |
Kojto | 158:b23ee177fd68 | 56 | |
Kojto | 158:b23ee177fd68 | 57 | /* Private types -------------------------------------------------------------*/ |
Kojto | 158:b23ee177fd68 | 58 | /* Private variables ---------------------------------------------------------*/ |
Kojto | 158:b23ee177fd68 | 59 | |
Kojto | 158:b23ee177fd68 | 60 | /* Private constants ---------------------------------------------------------*/ |
Kojto | 158:b23ee177fd68 | 61 | |
Kojto | 158:b23ee177fd68 | 62 | /* Private macros ------------------------------------------------------------*/ |
Kojto | 158:b23ee177fd68 | 63 | |
Kojto | 158:b23ee177fd68 | 64 | /* Exported types ------------------------------------------------------------*/ |
Kojto | 158:b23ee177fd68 | 65 | /* Exported constants --------------------------------------------------------*/ |
Kojto | 158:b23ee177fd68 | 66 | /** @defgroup WWDG_LL_Exported_Constants WWDG Exported Constants |
Kojto | 158:b23ee177fd68 | 67 | * @{ |
Kojto | 158:b23ee177fd68 | 68 | */ |
Kojto | 158:b23ee177fd68 | 69 | |
Kojto | 158:b23ee177fd68 | 70 | |
Kojto | 158:b23ee177fd68 | 71 | /** @defgroup WWDG_LL_EC_IT IT Defines |
Kojto | 158:b23ee177fd68 | 72 | * @brief IT defines which can be used with LL_WWDG_ReadReg and LL_WWDG_WriteReg functions |
Kojto | 158:b23ee177fd68 | 73 | * @{ |
Kojto | 158:b23ee177fd68 | 74 | */ |
Kojto | 158:b23ee177fd68 | 75 | #define LL_WWDG_CFR_EWI WWDG_CFR_EWI |
Kojto | 158:b23ee177fd68 | 76 | /** |
Kojto | 158:b23ee177fd68 | 77 | * @} |
Kojto | 158:b23ee177fd68 | 78 | */ |
Kojto | 158:b23ee177fd68 | 79 | |
Kojto | 158:b23ee177fd68 | 80 | /** @defgroup WWDG_LL_EC_PRESCALER PRESCALER |
Kojto | 158:b23ee177fd68 | 81 | * @{ |
Kojto | 158:b23ee177fd68 | 82 | */ |
Kojto | 158:b23ee177fd68 | 83 | #define LL_WWDG_PRESCALER_1 (uint32_t)0x00000000U /*!< WWDG counter clock = (PCLK1/4096)/1 */ |
Kojto | 158:b23ee177fd68 | 84 | #define LL_WWDG_PRESCALER_2 WWDG_CFR_WDGTB_0 /*!< WWDG counter clock = (PCLK1/4096)/2 */ |
Kojto | 158:b23ee177fd68 | 85 | #define LL_WWDG_PRESCALER_4 WWDG_CFR_WDGTB_1 /*!< WWDG counter clock = (PCLK1/4096)/4 */ |
Kojto | 158:b23ee177fd68 | 86 | #define LL_WWDG_PRESCALER_8 (WWDG_CFR_WDGTB_0 | WWDG_CFR_WDGTB_1) /*!< WWDG counter clock = (PCLK1/4096)/8 */ |
Kojto | 158:b23ee177fd68 | 87 | /** |
Kojto | 158:b23ee177fd68 | 88 | * @} |
Kojto | 158:b23ee177fd68 | 89 | */ |
Kojto | 158:b23ee177fd68 | 90 | |
Kojto | 158:b23ee177fd68 | 91 | /** |
Kojto | 158:b23ee177fd68 | 92 | * @} |
Kojto | 158:b23ee177fd68 | 93 | */ |
Kojto | 158:b23ee177fd68 | 94 | |
Kojto | 158:b23ee177fd68 | 95 | /* Exported macro ------------------------------------------------------------*/ |
Kojto | 158:b23ee177fd68 | 96 | /** @defgroup WWDG_LL_Exported_Macros WWDG Exported Macros |
Kojto | 158:b23ee177fd68 | 97 | * @{ |
Kojto | 158:b23ee177fd68 | 98 | */ |
Kojto | 158:b23ee177fd68 | 99 | /** @defgroup WWDG_LL_EM_WRITE_READ Common Write and read registers macros |
Kojto | 158:b23ee177fd68 | 100 | * @{ |
Kojto | 158:b23ee177fd68 | 101 | */ |
Kojto | 158:b23ee177fd68 | 102 | /** |
Kojto | 158:b23ee177fd68 | 103 | * @brief Write a value in WWDG register |
Kojto | 158:b23ee177fd68 | 104 | * @param __INSTANCE__ WWDG Instance |
Kojto | 158:b23ee177fd68 | 105 | * @param __REG__ Register to be written |
Kojto | 158:b23ee177fd68 | 106 | * @param __VALUE__ Value to be written in the register |
Kojto | 158:b23ee177fd68 | 107 | * @retval None |
Kojto | 158:b23ee177fd68 | 108 | */ |
Kojto | 158:b23ee177fd68 | 109 | #define LL_WWDG_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__)) |
Kojto | 158:b23ee177fd68 | 110 | |
Kojto | 158:b23ee177fd68 | 111 | /** |
Kojto | 158:b23ee177fd68 | 112 | * @brief Read a value in WWDG register |
Kojto | 158:b23ee177fd68 | 113 | * @param __INSTANCE__ WWDG Instance |
Kojto | 158:b23ee177fd68 | 114 | * @param __REG__ Register to be read |
Kojto | 158:b23ee177fd68 | 115 | * @retval Register value |
Kojto | 158:b23ee177fd68 | 116 | */ |
Kojto | 158:b23ee177fd68 | 117 | #define LL_WWDG_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__) |
Kojto | 158:b23ee177fd68 | 118 | /** |
Kojto | 158:b23ee177fd68 | 119 | * @} |
Kojto | 158:b23ee177fd68 | 120 | */ |
Kojto | 158:b23ee177fd68 | 121 | |
Kojto | 158:b23ee177fd68 | 122 | |
Kojto | 158:b23ee177fd68 | 123 | /** |
Kojto | 158:b23ee177fd68 | 124 | * @} |
Kojto | 158:b23ee177fd68 | 125 | */ |
Kojto | 158:b23ee177fd68 | 126 | |
Kojto | 158:b23ee177fd68 | 127 | /* Exported functions --------------------------------------------------------*/ |
Kojto | 158:b23ee177fd68 | 128 | /** @defgroup WWDG_LL_Exported_Functions WWDG Exported Functions |
Kojto | 158:b23ee177fd68 | 129 | * @{ |
Kojto | 158:b23ee177fd68 | 130 | */ |
Kojto | 158:b23ee177fd68 | 131 | |
Kojto | 158:b23ee177fd68 | 132 | /** @defgroup WWDG_LL_EF_Configuration Configuration |
Kojto | 158:b23ee177fd68 | 133 | * @{ |
Kojto | 158:b23ee177fd68 | 134 | */ |
Kojto | 158:b23ee177fd68 | 135 | /** |
Kojto | 158:b23ee177fd68 | 136 | * @brief Enable Window Watchdog. The watchdog is always disabled after a reset. |
Kojto | 158:b23ee177fd68 | 137 | * @note It is enabled by setting the WDGA bit in the WWDG_CR register, |
Kojto | 158:b23ee177fd68 | 138 | * then it cannot be disabled again except by a reset. |
Kojto | 158:b23ee177fd68 | 139 | * This bit is set by software and only cleared by hardware after a reset. |
Kojto | 158:b23ee177fd68 | 140 | * When WDGA = 1, the watchdog can generate a reset. |
Kojto | 158:b23ee177fd68 | 141 | * @rmtoll CR WDGA LL_WWDG_Enable |
Kojto | 158:b23ee177fd68 | 142 | * @param WWDGx WWDG Instance |
Kojto | 158:b23ee177fd68 | 143 | * @retval None |
Kojto | 158:b23ee177fd68 | 144 | */ |
Kojto | 158:b23ee177fd68 | 145 | __STATIC_INLINE void LL_WWDG_Enable(WWDG_TypeDef *WWDGx) |
Kojto | 158:b23ee177fd68 | 146 | { |
Kojto | 158:b23ee177fd68 | 147 | SET_BIT(WWDGx->CR, WWDG_CR_WDGA); |
Kojto | 158:b23ee177fd68 | 148 | } |
Kojto | 158:b23ee177fd68 | 149 | |
Kojto | 158:b23ee177fd68 | 150 | /** |
Kojto | 158:b23ee177fd68 | 151 | * @brief Checks if Window Watchdog is enabled |
Kojto | 158:b23ee177fd68 | 152 | * @rmtoll CR WDGA LL_WWDG_IsEnabled |
Kojto | 158:b23ee177fd68 | 153 | * @param WWDGx WWDG Instance |
Kojto | 158:b23ee177fd68 | 154 | * @retval State of bit (1 or 0). |
Kojto | 158:b23ee177fd68 | 155 | */ |
Kojto | 158:b23ee177fd68 | 156 | __STATIC_INLINE uint32_t LL_WWDG_IsEnabled(WWDG_TypeDef *WWDGx) |
Kojto | 158:b23ee177fd68 | 157 | { |
Kojto | 158:b23ee177fd68 | 158 | return (READ_BIT(WWDGx->CR, WWDG_CR_WDGA) == (WWDG_CR_WDGA)); |
Kojto | 158:b23ee177fd68 | 159 | } |
Kojto | 158:b23ee177fd68 | 160 | |
Kojto | 158:b23ee177fd68 | 161 | /** |
Kojto | 158:b23ee177fd68 | 162 | * @brief Set the Watchdog counter value to provided value (7-bits T[6:0]) |
Kojto | 158:b23ee177fd68 | 163 | * @note When writing to the WWDG_CR register, always write 1 in the MSB b6 to avoid generating an immediate reset |
Kojto | 158:b23ee177fd68 | 164 | * This counter is decremented every (4096 x 2expWDGTB) PCLK cycles |
Kojto | 158:b23ee177fd68 | 165 | * A reset is produced when it rolls over from 0x40 to 0x3F (bit T6 becomes cleared) |
Kojto | 158:b23ee177fd68 | 166 | * Setting the counter lower then 0x40 causes an immediate reset (if WWDG enabled) |
Kojto | 158:b23ee177fd68 | 167 | * @rmtoll CR T LL_WWDG_SetCounter |
Kojto | 158:b23ee177fd68 | 168 | * @param WWDGx WWDG Instance |
Kojto | 158:b23ee177fd68 | 169 | * @param Counter 0..0x7F (7 bit counter value) |
Kojto | 158:b23ee177fd68 | 170 | * @retval None |
Kojto | 158:b23ee177fd68 | 171 | */ |
Kojto | 158:b23ee177fd68 | 172 | __STATIC_INLINE void LL_WWDG_SetCounter(WWDG_TypeDef *WWDGx, uint32_t Counter) |
Kojto | 158:b23ee177fd68 | 173 | { |
Kojto | 158:b23ee177fd68 | 174 | MODIFY_REG(WWDGx->CR, WWDG_CR_T, Counter); |
Kojto | 158:b23ee177fd68 | 175 | } |
Kojto | 158:b23ee177fd68 | 176 | |
Kojto | 158:b23ee177fd68 | 177 | /** |
Kojto | 158:b23ee177fd68 | 178 | * @brief Return current Watchdog Counter Value (7 bits counter value) |
Kojto | 158:b23ee177fd68 | 179 | * @rmtoll CR T LL_WWDG_GetCounter |
Kojto | 158:b23ee177fd68 | 180 | * @param WWDGx WWDG Instance |
Kojto | 158:b23ee177fd68 | 181 | * @retval 7 bit Watchdog Counter value |
Kojto | 158:b23ee177fd68 | 182 | */ |
Kojto | 158:b23ee177fd68 | 183 | __STATIC_INLINE uint32_t LL_WWDG_GetCounter(WWDG_TypeDef *WWDGx) |
Kojto | 158:b23ee177fd68 | 184 | { |
Kojto | 158:b23ee177fd68 | 185 | return (uint32_t)(READ_BIT(WWDGx->CR, WWDG_CR_T)); |
Kojto | 158:b23ee177fd68 | 186 | } |
Kojto | 158:b23ee177fd68 | 187 | |
Kojto | 158:b23ee177fd68 | 188 | /** |
Kojto | 158:b23ee177fd68 | 189 | * @brief Set the time base of the prescaler (WDGTB). |
Kojto | 158:b23ee177fd68 | 190 | * @note Prescaler is used to apply ratio on PCLK clock, so that Watchdog counter |
Kojto | 158:b23ee177fd68 | 191 | * is decremented every (4096 x 2expWDGTB) PCLK cycles |
Kojto | 158:b23ee177fd68 | 192 | * @rmtoll CFR WDGTB LL_WWDG_SetPrescaler |
Kojto | 158:b23ee177fd68 | 193 | * @param WWDGx WWDG Instance |
Kojto | 158:b23ee177fd68 | 194 | * @param Prescaler This parameter can be one of the following values: |
Kojto | 158:b23ee177fd68 | 195 | * @arg @ref LL_WWDG_PRESCALER_1 |
Kojto | 158:b23ee177fd68 | 196 | * @arg @ref LL_WWDG_PRESCALER_2 |
Kojto | 158:b23ee177fd68 | 197 | * @arg @ref LL_WWDG_PRESCALER_4 |
Kojto | 158:b23ee177fd68 | 198 | * @arg @ref LL_WWDG_PRESCALER_8 |
Kojto | 158:b23ee177fd68 | 199 | * @retval None |
Kojto | 158:b23ee177fd68 | 200 | */ |
Kojto | 158:b23ee177fd68 | 201 | __STATIC_INLINE void LL_WWDG_SetPrescaler(WWDG_TypeDef *WWDGx, uint32_t Prescaler) |
Kojto | 158:b23ee177fd68 | 202 | { |
Kojto | 158:b23ee177fd68 | 203 | MODIFY_REG(WWDGx->CFR, WWDG_CFR_WDGTB, Prescaler); |
Kojto | 158:b23ee177fd68 | 204 | } |
Kojto | 158:b23ee177fd68 | 205 | |
Kojto | 158:b23ee177fd68 | 206 | /** |
Kojto | 158:b23ee177fd68 | 207 | * @brief Return current Watchdog Prescaler Value |
Kojto | 158:b23ee177fd68 | 208 | * @rmtoll CFR WDGTB LL_WWDG_GetPrescaler |
Kojto | 158:b23ee177fd68 | 209 | * @param WWDGx WWDG Instance |
Kojto | 158:b23ee177fd68 | 210 | * @retval Returned value can be one of the following values: |
Kojto | 158:b23ee177fd68 | 211 | * @arg @ref LL_WWDG_PRESCALER_1 |
Kojto | 158:b23ee177fd68 | 212 | * @arg @ref LL_WWDG_PRESCALER_2 |
Kojto | 158:b23ee177fd68 | 213 | * @arg @ref LL_WWDG_PRESCALER_4 |
Kojto | 158:b23ee177fd68 | 214 | * @arg @ref LL_WWDG_PRESCALER_8 |
Kojto | 158:b23ee177fd68 | 215 | */ |
Kojto | 158:b23ee177fd68 | 216 | __STATIC_INLINE uint32_t LL_WWDG_GetPrescaler(WWDG_TypeDef *WWDGx) |
Kojto | 158:b23ee177fd68 | 217 | { |
Kojto | 158:b23ee177fd68 | 218 | return (uint32_t)(READ_BIT(WWDGx->CFR, WWDG_CFR_WDGTB)); |
Kojto | 158:b23ee177fd68 | 219 | } |
Kojto | 158:b23ee177fd68 | 220 | |
Kojto | 158:b23ee177fd68 | 221 | /** |
Kojto | 158:b23ee177fd68 | 222 | * @brief Set the Watchdog Window value to be compared to the downcounter (7-bits W[6:0]). |
Kojto | 158:b23ee177fd68 | 223 | * @note This window value defines when write in the WWDG_CR register |
Kojto | 158:b23ee177fd68 | 224 | * to program Watchdog counter is allowed. |
Kojto | 158:b23ee177fd68 | 225 | * Watchdog counter value update must occur only when the counter value |
Kojto | 158:b23ee177fd68 | 226 | * is lower than the Watchdog window register value. |
Kojto | 158:b23ee177fd68 | 227 | * Otherwise, a MCU reset is generated if the 7-bit Watchdog counter value |
Kojto | 158:b23ee177fd68 | 228 | * (in the control register) is refreshed before the downcounter has reached |
Kojto | 158:b23ee177fd68 | 229 | * the watchdog window register value. |
Kojto | 158:b23ee177fd68 | 230 | * Physically is possible to set the Window lower then 0x40 but it is not recommended. |
Kojto | 158:b23ee177fd68 | 231 | * To generate an immediate reset, it is possible to set the Counter lower than 0x40. |
Kojto | 158:b23ee177fd68 | 232 | * @rmtoll CFR W LL_WWDG_SetWindow |
Kojto | 158:b23ee177fd68 | 233 | * @param WWDGx WWDG Instance |
Kojto | 158:b23ee177fd68 | 234 | * @param Window 0x00..0x7F (7 bit Window value) |
Kojto | 158:b23ee177fd68 | 235 | * @retval None |
Kojto | 158:b23ee177fd68 | 236 | */ |
Kojto | 158:b23ee177fd68 | 237 | __STATIC_INLINE void LL_WWDG_SetWindow(WWDG_TypeDef *WWDGx, uint32_t Window) |
Kojto | 158:b23ee177fd68 | 238 | { |
Kojto | 158:b23ee177fd68 | 239 | MODIFY_REG(WWDGx->CFR, WWDG_CFR_W, Window); |
Kojto | 158:b23ee177fd68 | 240 | } |
Kojto | 158:b23ee177fd68 | 241 | |
Kojto | 158:b23ee177fd68 | 242 | /** |
Kojto | 158:b23ee177fd68 | 243 | * @brief Return current Watchdog Window Value (7 bits value) |
Kojto | 158:b23ee177fd68 | 244 | * @rmtoll CFR W LL_WWDG_GetWindow |
Kojto | 158:b23ee177fd68 | 245 | * @param WWDGx WWDG Instance |
Kojto | 158:b23ee177fd68 | 246 | * @retval 7 bit Watchdog Window value |
Kojto | 158:b23ee177fd68 | 247 | */ |
Kojto | 158:b23ee177fd68 | 248 | __STATIC_INLINE uint32_t LL_WWDG_GetWindow(WWDG_TypeDef *WWDGx) |
Kojto | 158:b23ee177fd68 | 249 | { |
Kojto | 158:b23ee177fd68 | 250 | return (uint32_t)(READ_BIT(WWDGx->CFR, WWDG_CFR_W)); |
Kojto | 158:b23ee177fd68 | 251 | } |
Kojto | 158:b23ee177fd68 | 252 | |
Kojto | 158:b23ee177fd68 | 253 | /** |
Kojto | 158:b23ee177fd68 | 254 | * @} |
Kojto | 158:b23ee177fd68 | 255 | */ |
Kojto | 158:b23ee177fd68 | 256 | |
Kojto | 158:b23ee177fd68 | 257 | /** @defgroup WWDG_LL_EF_FLAG_Management FLAG_Management |
Kojto | 158:b23ee177fd68 | 258 | * @{ |
Kojto | 158:b23ee177fd68 | 259 | */ |
Kojto | 158:b23ee177fd68 | 260 | /** |
Kojto | 158:b23ee177fd68 | 261 | * @brief Indicates if the WWDG Early Wakeup Interrupt Flag is set or not. |
Kojto | 158:b23ee177fd68 | 262 | * @note This bit is set by hardware when the counter has reached the value 0x40. |
Kojto | 158:b23ee177fd68 | 263 | * It must be cleared by software by writing 0. |
Kojto | 158:b23ee177fd68 | 264 | * A write of 1 has no effect. This bit is also set if the interrupt is not enabled. |
Kojto | 158:b23ee177fd68 | 265 | * @rmtoll SR EWIF LL_WWDG_IsActiveFlag_EWKUP |
Kojto | 158:b23ee177fd68 | 266 | * @param WWDGx WWDG Instance |
Kojto | 158:b23ee177fd68 | 267 | * @retval State of bit (1 or 0). |
Kojto | 158:b23ee177fd68 | 268 | */ |
Kojto | 158:b23ee177fd68 | 269 | __STATIC_INLINE uint32_t LL_WWDG_IsActiveFlag_EWKUP(WWDG_TypeDef *WWDGx) |
Kojto | 158:b23ee177fd68 | 270 | { |
Kojto | 158:b23ee177fd68 | 271 | return (READ_BIT(WWDGx->SR, WWDG_SR_EWIF) == (WWDG_SR_EWIF)); |
Kojto | 158:b23ee177fd68 | 272 | } |
Kojto | 158:b23ee177fd68 | 273 | |
Kojto | 158:b23ee177fd68 | 274 | /** |
Kojto | 158:b23ee177fd68 | 275 | * @brief Clear WWDG Early Wakeup Interrupt Flag (EWIF) |
Kojto | 158:b23ee177fd68 | 276 | * @rmtoll SR EWIF LL_WWDG_ClearFlag_EWKUP |
Kojto | 158:b23ee177fd68 | 277 | * @param WWDGx WWDG Instance |
Kojto | 158:b23ee177fd68 | 278 | * @retval None |
Kojto | 158:b23ee177fd68 | 279 | */ |
Kojto | 158:b23ee177fd68 | 280 | __STATIC_INLINE void LL_WWDG_ClearFlag_EWKUP(WWDG_TypeDef *WWDGx) |
Kojto | 158:b23ee177fd68 | 281 | { |
Kojto | 158:b23ee177fd68 | 282 | WRITE_REG(WWDGx->SR, ~WWDG_SR_EWIF); |
Kojto | 158:b23ee177fd68 | 283 | } |
Kojto | 158:b23ee177fd68 | 284 | |
Kojto | 158:b23ee177fd68 | 285 | /** |
Kojto | 158:b23ee177fd68 | 286 | * @} |
Kojto | 158:b23ee177fd68 | 287 | */ |
Kojto | 158:b23ee177fd68 | 288 | |
Kojto | 158:b23ee177fd68 | 289 | /** @defgroup WWDG_LL_EF_IT_Management IT_Management |
Kojto | 158:b23ee177fd68 | 290 | * @{ |
Kojto | 158:b23ee177fd68 | 291 | */ |
Kojto | 158:b23ee177fd68 | 292 | /** |
Kojto | 158:b23ee177fd68 | 293 | * @brief Enable the Early Wakeup Interrupt. |
Kojto | 158:b23ee177fd68 | 294 | * @note When set, an interrupt occurs whenever the counter reaches value 0x40. |
Kojto | 158:b23ee177fd68 | 295 | * This interrupt is only cleared by hardware after a reset |
Kojto | 158:b23ee177fd68 | 296 | * @rmtoll CFR EWI LL_WWDG_EnableIT_EWKUP |
Kojto | 158:b23ee177fd68 | 297 | * @param WWDGx WWDG Instance |
Kojto | 158:b23ee177fd68 | 298 | * @retval None |
Kojto | 158:b23ee177fd68 | 299 | */ |
Kojto | 158:b23ee177fd68 | 300 | __STATIC_INLINE void LL_WWDG_EnableIT_EWKUP(WWDG_TypeDef *WWDGx) |
Kojto | 158:b23ee177fd68 | 301 | { |
Kojto | 158:b23ee177fd68 | 302 | SET_BIT(WWDGx->CFR, WWDG_CFR_EWI); |
Kojto | 158:b23ee177fd68 | 303 | } |
Kojto | 158:b23ee177fd68 | 304 | |
Kojto | 158:b23ee177fd68 | 305 | /** |
Kojto | 158:b23ee177fd68 | 306 | * @brief Check if Early Wakeup Interrupt is enabled |
Kojto | 158:b23ee177fd68 | 307 | * @rmtoll CFR EWI LL_WWDG_IsEnabledIT_EWKUP |
Kojto | 158:b23ee177fd68 | 308 | * @param WWDGx WWDG Instance |
Kojto | 158:b23ee177fd68 | 309 | * @retval State of bit (1 or 0). |
Kojto | 158:b23ee177fd68 | 310 | */ |
Kojto | 158:b23ee177fd68 | 311 | __STATIC_INLINE uint32_t LL_WWDG_IsEnabledIT_EWKUP(WWDG_TypeDef *WWDGx) |
Kojto | 158:b23ee177fd68 | 312 | { |
Kojto | 158:b23ee177fd68 | 313 | return (READ_BIT(WWDGx->CFR, WWDG_CFR_EWI) == (WWDG_CFR_EWI)); |
Kojto | 158:b23ee177fd68 | 314 | } |
Kojto | 158:b23ee177fd68 | 315 | |
Kojto | 158:b23ee177fd68 | 316 | /** |
Kojto | 158:b23ee177fd68 | 317 | * @} |
Kojto | 158:b23ee177fd68 | 318 | */ |
Kojto | 158:b23ee177fd68 | 319 | |
Kojto | 158:b23ee177fd68 | 320 | /** |
Kojto | 158:b23ee177fd68 | 321 | * @} |
Kojto | 158:b23ee177fd68 | 322 | */ |
Kojto | 158:b23ee177fd68 | 323 | |
Kojto | 158:b23ee177fd68 | 324 | /** |
Kojto | 158:b23ee177fd68 | 325 | * @} |
Kojto | 158:b23ee177fd68 | 326 | */ |
Kojto | 158:b23ee177fd68 | 327 | |
Kojto | 158:b23ee177fd68 | 328 | #endif /* WWDG */ |
Kojto | 158:b23ee177fd68 | 329 | |
Kojto | 158:b23ee177fd68 | 330 | /** |
Kojto | 158:b23ee177fd68 | 331 | * @} |
Kojto | 158:b23ee177fd68 | 332 | */ |
Kojto | 158:b23ee177fd68 | 333 | |
Kojto | 158:b23ee177fd68 | 334 | #ifdef __cplusplus |
Kojto | 158:b23ee177fd68 | 335 | } |
Kojto | 158:b23ee177fd68 | 336 | #endif |
Kojto | 158:b23ee177fd68 | 337 | |
Kojto | 158:b23ee177fd68 | 338 | #endif /* __STM32L0xx_LL_WWDG_H */ |
Kojto | 158:b23ee177fd68 | 339 | |
Kojto | 158:b23ee177fd68 | 340 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |