inport from local

Dependents:   Hobbyking_Cheetah_0511

Committer:
NYX
Date:
Mon Mar 16 06:35:48 2020 +0000
Revision:
0:85b3fd62ea1a
reinport to mbed;

Who changed what in which revision?

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