mbed library sources. Supersedes mbed-src.

Dependents:   Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more

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?

UserRevisionLine numberNew contents of line
<> 144:ef7eb2e8f9f7 1 /**
<> 144:ef7eb2e8f9f7 2 ******************************************************************************
<> 144:ef7eb2e8f9f7 3 * @file stm32l0xx_hal_wwdg.c
<> 144:ef7eb2e8f9f7 4 * @author MCD Application Team
<> 144:ef7eb2e8f9f7 5 * @brief WWDG HAL module driver.
<> 144:ef7eb2e8f9f7 6 * This file provides firmware functions to manage the following
<> 144:ef7eb2e8f9f7 7 * functionalities of the Window Watchdog (WWDG) peripheral:
Anna Bridge 186:707f6e361f3e 8 * + Initialization and Configuration function
<> 144:ef7eb2e8f9f7 9 * + IO operation functions
<> 144:ef7eb2e8f9f7 10 @verbatim
<> 144:ef7eb2e8f9f7 11 ==============================================================================
<> 144:ef7eb2e8f9f7 12 ##### WWDG specific features #####
<> 144:ef7eb2e8f9f7 13 ==============================================================================
Anna Bridge 186:707f6e361f3e 14 [..]
<> 144:ef7eb2e8f9f7 15 Once enabled the WWDG generates a system reset on expiry of a programmed
Anna Bridge 186:707f6e361f3e 16 time period, unless the program refreshes the counter (T[6;0] downcounter)
Anna Bridge 186:707f6e361f3e 17 before reaching 0x3F value (i.e. a reset is generated when the counter
Anna Bridge 186:707f6e361f3e 18 value rolls over from 0x40 to 0x3F).
Anna Bridge 186:707f6e361f3e 19
Anna Bridge 186:707f6e361f3e 20 (+) An MCU reset is also generated if the counter value is refreshed
Anna Bridge 186:707f6e361f3e 21 before the counter has reached the refresh window value. This
Anna Bridge 186:707f6e361f3e 22 implies that the counter must be refreshed in a limited window.
Anna Bridge 186:707f6e361f3e 23
Anna Bridge 186:707f6e361f3e 24 (+) Once enabled the WWDG cannot be disabled except by a system reset.
Anna Bridge 186:707f6e361f3e 25
Anna Bridge 186:707f6e361f3e 26 (+) WWDGRST flag in RCC_CSR register informs when a WWDG reset has
Anna Bridge 186:707f6e361f3e 27 occurred (check available with __HAL_RCC_GET_FLAG(RCC_FLAG_WWDGRST)).
Anna Bridge 186:707f6e361f3e 28
Anna Bridge 186:707f6e361f3e 29 (+) The WWDG downcounter input clock is derived from the APB clock divided
Anna Bridge 186:707f6e361f3e 30 by a programmable prescaler.
Anna Bridge 186:707f6e361f3e 31
Anna Bridge 186:707f6e361f3e 32 (+) WWDG downcounter clock (Hz) = PCLK1 / (4096 * Prescaler)
Anna Bridge 186:707f6e361f3e 33
Anna Bridge 186:707f6e361f3e 34 (+) WWDG timeout (ms) = (1000 * (T[5;0] + 1)) / (WWDG downcounter clock)
Anna Bridge 186:707f6e361f3e 35 where T[5;0] are the lowest 6 bits of downcounter.
<> 144:ef7eb2e8f9f7 36
Anna Bridge 186:707f6e361f3e 37 (+) WWDG Counter refresh is allowed between the following limits :
Anna Bridge 186:707f6e361f3e 38 (++) min time (ms) = (1000 * (T[5;0] - Window)) / (WWDG downcounter clock)
Anna Bridge 186:707f6e361f3e 39 (++) max time (ms) = (1000 * (T[5;0] - 0x40)) / (WWDG downcounter clock)
Anna Bridge 186:707f6e361f3e 40
Anna Bridge 186:707f6e361f3e 41 (+) Min-max timeout value @32 MHz(PCLK1): ~128.0 us / ~65.54 ms
<> 144:ef7eb2e8f9f7 42
Anna Bridge 186:707f6e361f3e 43 (+) The Early Wakeup Interrupt (EWI) can be used if specific safety
Anna Bridge 186:707f6e361f3e 44 operations or data logging must be performed before the actual reset is
Anna Bridge 186:707f6e361f3e 45 generated. When the downcounter reaches the value 0x40, an EWI interrupt
Anna Bridge 186:707f6e361f3e 46 is generated and the corresponding interrupt service routine (ISR) can
Anna Bridge 186:707f6e361f3e 47 be used to trigger specific actions (such as communications or data
Anna Bridge 186:707f6e361f3e 48 logging), before resetting the device.
Anna Bridge 186:707f6e361f3e 49 In some applications, the EWI interrupt can be used to manage a software
Anna Bridge 186:707f6e361f3e 50 system check and/or system recovery/graceful degradation, without
Anna Bridge 186:707f6e361f3e 51 generating a WWDG reset. In this case, the corresponding interrupt
Anna Bridge 186:707f6e361f3e 52 service routine (ISR) should reload the WWDG counter to avoid the WWDG
Anna Bridge 186:707f6e361f3e 53 reset, then trigger the required actions.
Anna Bridge 186:707f6e361f3e 54 Note:When the EWI interrupt cannot be served, e.g. due to a system lock
Anna Bridge 186:707f6e361f3e 55 in a higher priority task, the WWDG reset will eventually be generated.
Anna Bridge 186:707f6e361f3e 56
Anna Bridge 186:707f6e361f3e 57 (+) Debug mode : When the microcontroller enters debug mode (core halted),
Anna Bridge 186:707f6e361f3e 58 the WWDG counter either continues to work normally or stops, depending
Anna Bridge 186:707f6e361f3e 59 on DBG_WWDG_STOP configuration bit in DBG module, accessible through
Anna Bridge 186:707f6e361f3e 60 __HAL_DBGMCU_FREEZE_WWDG() and __HAL_DBGMCU_UNFREEZE_WWDG() macros
<> 144:ef7eb2e8f9f7 61
<> 144:ef7eb2e8f9f7 62 ##### How to use this driver #####
<> 144:ef7eb2e8f9f7 63 ==============================================================================
<> 144:ef7eb2e8f9f7 64 [..]
<> 144:ef7eb2e8f9f7 65 (+) Enable WWDG APB1 clock using __HAL_RCC_WWDG_CLK_ENABLE().
Anna Bridge 186:707f6e361f3e 66
Anna Bridge 186:707f6e361f3e 67 (+) Set the WWDG prescaler, refresh window, counter value and Early Wakeup
Anna Bridge 186:707f6e361f3e 68 Interrupt mode using using HAL_WWDG_Init() function.
Anna Bridge 186:707f6e361f3e 69 This enables WWDG peripheral and the downcounter starts downcounting
Anna Bridge 186:707f6e361f3e 70 from given counter value.
Anna Bridge 186:707f6e361f3e 71 Init function can be called again to modify all watchdog parameters,
Anna Bridge 186:707f6e361f3e 72 however if EWI mode has been set once, it can't be clear until next
Anna Bridge 186:707f6e361f3e 73 reset.
Anna Bridge 186:707f6e361f3e 74
Anna Bridge 186:707f6e361f3e 75 (+) The application program must refresh the WWDG counter at regular
Anna Bridge 186:707f6e361f3e 76 intervals during normal operation to prevent an MCU reset using
<> 144:ef7eb2e8f9f7 77 HAL_WWDG_Refresh() function. This operation must occur only when
Anna Bridge 186:707f6e361f3e 78 the counter is lower than the window value already programmed.
Anna Bridge 186:707f6e361f3e 79
Anna Bridge 186:707f6e361f3e 80 (+) if Early Wakeup Interrupt mode is enable an interrupt is generated when
Anna Bridge 186:707f6e361f3e 81 the counter reaches 0x40. User can add his own code in weak function
Anna Bridge 186:707f6e361f3e 82 HAL_WWDG_EarlyWakeupCallback().
Anna Bridge 186:707f6e361f3e 83
<> 144:ef7eb2e8f9f7 84 *** WWDG HAL driver macros list ***
<> 144:ef7eb2e8f9f7 85 ==================================
<> 144:ef7eb2e8f9f7 86 [..]
<> 144:ef7eb2e8f9f7 87 Below the list of most used macros in WWDG HAL driver.
Anna Bridge 186:707f6e361f3e 88
Anna Bridge 186:707f6e361f3e 89 (+) __HAL_WWDG_GET_IT_SOURCE: Check the selected WWDG's interrupt source.
Anna Bridge 186:707f6e361f3e 90 (+) __HAL_WWDG_GET_FLAG: Get the selected WWDG's flag status.
Anna Bridge 186:707f6e361f3e 91 (+) __HAL_WWDG_CLEAR_FLAG: Clear the WWDG's pending flags.
<> 144:ef7eb2e8f9f7 92
<> 144:ef7eb2e8f9f7 93 @endverbatim
<> 144:ef7eb2e8f9f7 94 ******************************************************************************
<> 144:ef7eb2e8f9f7 95 * @attention
<> 144:ef7eb2e8f9f7 96 *
<> 144:ef7eb2e8f9f7 97 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
<> 144:ef7eb2e8f9f7 98 *
<> 144:ef7eb2e8f9f7 99 * Redistribution and use in source and binary forms, with or without modification,
<> 144:ef7eb2e8f9f7 100 * are permitted provided that the following conditions are met:
<> 144:ef7eb2e8f9f7 101 * 1. Redistributions of source code must retain the above copyright notice,
<> 144:ef7eb2e8f9f7 102 * this list of conditions and the following disclaimer.
<> 144:ef7eb2e8f9f7 103 * 2. Redistributions in binary form must reproduce the above copyright notice,
<> 144:ef7eb2e8f9f7 104 * this list of conditions and the following disclaimer in the documentation
<> 144:ef7eb2e8f9f7 105 * and/or other materials provided with the distribution.
<> 144:ef7eb2e8f9f7 106 * 3. Neither the name of STMicroelectronics nor the names of its contributors
<> 144:ef7eb2e8f9f7 107 * may be used to endorse or promote products derived from this software
<> 144:ef7eb2e8f9f7 108 * without specific prior written permission.
<> 144:ef7eb2e8f9f7 109 *
<> 144:ef7eb2e8f9f7 110 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
<> 144:ef7eb2e8f9f7 111 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
<> 144:ef7eb2e8f9f7 112 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
<> 144:ef7eb2e8f9f7 113 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
<> 144:ef7eb2e8f9f7 114 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
<> 144:ef7eb2e8f9f7 115 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
<> 144:ef7eb2e8f9f7 116 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
<> 144:ef7eb2e8f9f7 117 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
<> 144:ef7eb2e8f9f7 118 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
<> 144:ef7eb2e8f9f7 119 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<> 144:ef7eb2e8f9f7 120 *
<> 144:ef7eb2e8f9f7 121 ******************************************************************************
<> 144:ef7eb2e8f9f7 122 */
<> 144:ef7eb2e8f9f7 123
<> 144:ef7eb2e8f9f7 124 /* Includes ------------------------------------------------------------------*/
<> 144:ef7eb2e8f9f7 125 #include "stm32l0xx_hal.h"
<> 144:ef7eb2e8f9f7 126
<> 144:ef7eb2e8f9f7 127 /** @addtogroup STM32L0xx_HAL_Driver
<> 144:ef7eb2e8f9f7 128 * @{
<> 144:ef7eb2e8f9f7 129 */
<> 144:ef7eb2e8f9f7 130
<> 144:ef7eb2e8f9f7 131 #ifdef HAL_WWDG_MODULE_ENABLED
Anna Bridge 186:707f6e361f3e 132 /** @defgroup WWDG WWDG
<> 144:ef7eb2e8f9f7 133 * @brief WWDG HAL module driver.
<> 144:ef7eb2e8f9f7 134 * @{
<> 144:ef7eb2e8f9f7 135 */
<> 144:ef7eb2e8f9f7 136
Anna Bridge 186:707f6e361f3e 137 /* Private typedef -----------------------------------------------------------*/
Anna Bridge 186:707f6e361f3e 138 /* Private define ------------------------------------------------------------*/
Anna Bridge 186:707f6e361f3e 139 /* Private macro -------------------------------------------------------------*/
Anna Bridge 186:707f6e361f3e 140 /* Private variables ---------------------------------------------------------*/
Anna Bridge 186:707f6e361f3e 141 /* Private function prototypes -----------------------------------------------*/
Anna Bridge 186:707f6e361f3e 142 /* Exported functions --------------------------------------------------------*/
<> 144:ef7eb2e8f9f7 143
Anna Bridge 186:707f6e361f3e 144 /** @defgroup WWDG_Exported_Functions WWDG Exported Functions
<> 144:ef7eb2e8f9f7 145 * @{
<> 144:ef7eb2e8f9f7 146 */
<> 144:ef7eb2e8f9f7 147
Anna Bridge 186:707f6e361f3e 148 /** @defgroup WWDG_Exported_Functions_Group1 Initialization and Configuration functions
<> 144:ef7eb2e8f9f7 149 * @brief Initialization and Configuration functions.
<> 144:ef7eb2e8f9f7 150 *
<> 144:ef7eb2e8f9f7 151 @verbatim
<> 144:ef7eb2e8f9f7 152 ==============================================================================
Anna Bridge 186:707f6e361f3e 153 ##### Initialization and Configuration functions #####
<> 144:ef7eb2e8f9f7 154 ==============================================================================
<> 144:ef7eb2e8f9f7 155 [..]
<> 144:ef7eb2e8f9f7 156 This section provides functions allowing to:
Anna Bridge 186:707f6e361f3e 157 (+) Initialize and start the WWDG according to the specified parameters
Anna Bridge 186:707f6e361f3e 158 in the WWDG_InitTypeDef of associated handle.
Anna Bridge 186:707f6e361f3e 159 (+) Initialize the WWDG MSP.
<> 144:ef7eb2e8f9f7 160
<> 144:ef7eb2e8f9f7 161 @endverbatim
<> 144:ef7eb2e8f9f7 162 * @{
<> 144:ef7eb2e8f9f7 163 */
<> 144:ef7eb2e8f9f7 164
<> 144:ef7eb2e8f9f7 165 /**
Anna Bridge 186:707f6e361f3e 166 * @brief Initialize the WWDG according to the specified.
Anna Bridge 186:707f6e361f3e 167 * parameters in the WWDG_InitTypeDef of associated handle.
Anna Bridge 186:707f6e361f3e 168 * @param hwwdg pointer to a WWDG_HandleTypeDef structure that contains
Anna Bridge 186:707f6e361f3e 169 * the configuration information for the specified WWDG module.
<> 144:ef7eb2e8f9f7 170 * @retval HAL status
<> 144:ef7eb2e8f9f7 171 */
<> 144:ef7eb2e8f9f7 172 HAL_StatusTypeDef HAL_WWDG_Init(WWDG_HandleTypeDef *hwwdg)
<> 144:ef7eb2e8f9f7 173 {
<> 144:ef7eb2e8f9f7 174 /* Check the WWDG handle allocation */
<> 144:ef7eb2e8f9f7 175 if(hwwdg == NULL)
<> 144:ef7eb2e8f9f7 176 {
<> 144:ef7eb2e8f9f7 177 return HAL_ERROR;
<> 144:ef7eb2e8f9f7 178 }
<> 144:ef7eb2e8f9f7 179
<> 144:ef7eb2e8f9f7 180 /* Check the parameters */
<> 144:ef7eb2e8f9f7 181 assert_param(IS_WWDG_ALL_INSTANCE(hwwdg->Instance));
<> 144:ef7eb2e8f9f7 182 assert_param(IS_WWDG_PRESCALER(hwwdg->Init.Prescaler));
<> 144:ef7eb2e8f9f7 183 assert_param(IS_WWDG_WINDOW(hwwdg->Init.Window));
<> 144:ef7eb2e8f9f7 184 assert_param(IS_WWDG_COUNTER(hwwdg->Init.Counter));
Anna Bridge 186:707f6e361f3e 185 assert_param(IS_WWDG_EWI_MODE(hwwdg->Init.EWIMode));
<> 144:ef7eb2e8f9f7 186
Anna Bridge 186:707f6e361f3e 187 /* Init the low level hardware */
Anna Bridge 186:707f6e361f3e 188 HAL_WWDG_MspInit(hwwdg);
<> 144:ef7eb2e8f9f7 189
Anna Bridge 186:707f6e361f3e 190 /* Set WWDG Counter */
Anna Bridge 186:707f6e361f3e 191 WRITE_REG(hwwdg->Instance->CR, (WWDG_CR_WDGA | hwwdg->Init.Counter));
<> 144:ef7eb2e8f9f7 192
Anna Bridge 186:707f6e361f3e 193 /* Set WWDG Prescaler and Window */
Anna Bridge 186:707f6e361f3e 194 WRITE_REG(hwwdg->Instance->CFR, (hwwdg->Init.EWIMode | hwwdg->Init.Prescaler | hwwdg->Init.Window));
<> 144:ef7eb2e8f9f7 195
<> 144:ef7eb2e8f9f7 196 /* Return function status */
<> 144:ef7eb2e8f9f7 197 return HAL_OK;
<> 144:ef7eb2e8f9f7 198 }
<> 144:ef7eb2e8f9f7 199
<> 144:ef7eb2e8f9f7 200
<> 144:ef7eb2e8f9f7 201 /**
Anna Bridge 186:707f6e361f3e 202 * @brief Initialize the WWDG MSP.
Anna Bridge 186:707f6e361f3e 203 * @param hwwdg pointer to a WWDG_HandleTypeDef structure that contains
Anna Bridge 186:707f6e361f3e 204 * the configuration information for the specified WWDG module.
Anna Bridge 186:707f6e361f3e 205 * @note When rewriting this function in user file, mechanism may be added
Anna Bridge 186:707f6e361f3e 206 * to avoid multiple initialize when HAL_WWDG_Init function is called
Anna Bridge 186:707f6e361f3e 207 * again to change parameters.
<> 144:ef7eb2e8f9f7 208 * @retval None
<> 144:ef7eb2e8f9f7 209 */
<> 144:ef7eb2e8f9f7 210 __weak void HAL_WWDG_MspInit(WWDG_HandleTypeDef *hwwdg)
<> 144:ef7eb2e8f9f7 211 {
<> 144:ef7eb2e8f9f7 212 /* Prevent unused argument(s) compilation warning */
<> 144:ef7eb2e8f9f7 213 UNUSED(hwwdg);
<> 144:ef7eb2e8f9f7 214
Anna Bridge 186:707f6e361f3e 215 /* NOTE: This function should not be modified, when the callback is needed,
<> 144:ef7eb2e8f9f7 216 the HAL_WWDG_MspInit could be implemented in the user file
<> 144:ef7eb2e8f9f7 217 */
<> 144:ef7eb2e8f9f7 218 }
<> 144:ef7eb2e8f9f7 219
<> 144:ef7eb2e8f9f7 220 /**
<> 144:ef7eb2e8f9f7 221 * @}
<> 144:ef7eb2e8f9f7 222 */
<> 144:ef7eb2e8f9f7 223
Anna Bridge 186:707f6e361f3e 224 /** @defgroup WWDG_Exported_Functions_Group2 IO operation functions
<> 144:ef7eb2e8f9f7 225 * @brief IO operation functions
<> 144:ef7eb2e8f9f7 226 *
<> 144:ef7eb2e8f9f7 227 @verbatim
<> 144:ef7eb2e8f9f7 228 ==============================================================================
<> 144:ef7eb2e8f9f7 229 ##### IO operation functions #####
<> 144:ef7eb2e8f9f7 230 ==============================================================================
Anna Bridge 186:707f6e361f3e 231 [..]
<> 144:ef7eb2e8f9f7 232 This section provides functions allowing to:
Anna Bridge 186:707f6e361f3e 233 (+) Refresh the WWDG.
Anna Bridge 186:707f6e361f3e 234 (+) Handle WWDG interrupt request and associated function callback.
<> 144:ef7eb2e8f9f7 235
<> 144:ef7eb2e8f9f7 236 @endverbatim
<> 144:ef7eb2e8f9f7 237 * @{
<> 144:ef7eb2e8f9f7 238 */
<> 144:ef7eb2e8f9f7 239
<> 144:ef7eb2e8f9f7 240 /**
Anna Bridge 186:707f6e361f3e 241 * @brief Refresh the WWDG.
Anna Bridge 186:707f6e361f3e 242 * @param hwwdg pointer to a WWDG_HandleTypeDef structure that contains
Anna Bridge 186:707f6e361f3e 243 * the configuration information for the specified WWDG module.
<> 144:ef7eb2e8f9f7 244 * @retval HAL status
<> 144:ef7eb2e8f9f7 245 */
Anna Bridge 186:707f6e361f3e 246 HAL_StatusTypeDef HAL_WWDG_Refresh(WWDG_HandleTypeDef *hwwdg)
<> 144:ef7eb2e8f9f7 247 {
Anna Bridge 186:707f6e361f3e 248 /* Write to WWDG CR the WWDG Counter value to refresh with */
Anna Bridge 186:707f6e361f3e 249 WRITE_REG(hwwdg->Instance->CR, (hwwdg->Init.Counter));
<> 144:ef7eb2e8f9f7 250
<> 144:ef7eb2e8f9f7 251 /* Return function status */
<> 144:ef7eb2e8f9f7 252 return HAL_OK;
<> 144:ef7eb2e8f9f7 253 }
<> 144:ef7eb2e8f9f7 254
<> 144:ef7eb2e8f9f7 255 /**
Anna Bridge 186:707f6e361f3e 256 * @brief Handle WWDG interrupt request.
<> 144:ef7eb2e8f9f7 257 * @note The Early Wakeup Interrupt (EWI) can be used if specific safety operations
<> 144:ef7eb2e8f9f7 258 * or data logging must be performed before the actual reset is generated.
Anna Bridge 186:707f6e361f3e 259 * The EWI interrupt is enabled by calling HAL_WWDG_Init function with
Anna Bridge 186:707f6e361f3e 260 * EWIMode set to WWDG_EWI_ENABLE.
<> 144:ef7eb2e8f9f7 261 * When the downcounter reaches the value 0x40, and EWI interrupt is
<> 144:ef7eb2e8f9f7 262 * generated and the corresponding Interrupt Service Routine (ISR) can
<> 144:ef7eb2e8f9f7 263 * be used to trigger specific actions (such as communications or data
<> 144:ef7eb2e8f9f7 264 * logging), before resetting the device.
Anna Bridge 186:707f6e361f3e 265 * @param hwwdg pointer to a WWDG_HandleTypeDef structure that contains
Anna Bridge 186:707f6e361f3e 266 * the configuration information for the specified WWDG module.
<> 144:ef7eb2e8f9f7 267 * @retval None
<> 144:ef7eb2e8f9f7 268 */
<> 144:ef7eb2e8f9f7 269 void HAL_WWDG_IRQHandler(WWDG_HandleTypeDef *hwwdg)
<> 144:ef7eb2e8f9f7 270 {
<> 144:ef7eb2e8f9f7 271 /* Check if Early Wakeup Interrupt is enable */
<> 144:ef7eb2e8f9f7 272 if(__HAL_WWDG_GET_IT_SOURCE(hwwdg, WWDG_IT_EWI) != RESET)
<> 144:ef7eb2e8f9f7 273 {
<> 144:ef7eb2e8f9f7 274 /* Check if WWDG Early Wakeup Interrupt occurred */
<> 144:ef7eb2e8f9f7 275 if(__HAL_WWDG_GET_FLAG(hwwdg, WWDG_FLAG_EWIF) != RESET)
<> 144:ef7eb2e8f9f7 276 {
Anna Bridge 186:707f6e361f3e 277 /* Clear the WWDG Early Wakeup flag */
Anna Bridge 186:707f6e361f3e 278 __HAL_WWDG_CLEAR_FLAG(hwwdg, WWDG_FLAG_EWIF);
<> 144:ef7eb2e8f9f7 279
Anna Bridge 186:707f6e361f3e 280 /* Early Wakeup callback */
Anna Bridge 186:707f6e361f3e 281 HAL_WWDG_EarlyWakeupCallback(hwwdg);
<> 144:ef7eb2e8f9f7 282 }
<> 144:ef7eb2e8f9f7 283 }
<> 144:ef7eb2e8f9f7 284 }
<> 144:ef7eb2e8f9f7 285
Anna Bridge 186:707f6e361f3e 286
<> 144:ef7eb2e8f9f7 287 /**
Anna Bridge 186:707f6e361f3e 288 * @brief WWDG Early Wakeup callback.
Anna Bridge 186:707f6e361f3e 289 * @param hwwdg pointer to a WWDG_HandleTypeDef structure that contains
Anna Bridge 186:707f6e361f3e 290 * the configuration information for the specified WWDG module.
<> 144:ef7eb2e8f9f7 291 * @retval None
<> 144:ef7eb2e8f9f7 292 */
Anna Bridge 186:707f6e361f3e 293 __weak void HAL_WWDG_EarlyWakeupCallback(WWDG_HandleTypeDef* hwwdg)
<> 144:ef7eb2e8f9f7 294 {
<> 144:ef7eb2e8f9f7 295 /* Prevent unused argument(s) compilation warning */
<> 144:ef7eb2e8f9f7 296 UNUSED(hwwdg);
<> 144:ef7eb2e8f9f7 297
Anna Bridge 186:707f6e361f3e 298 /* NOTE: This function should not be modified, when the callback is needed,
Anna Bridge 186:707f6e361f3e 299 the HAL_WWDG_EarlyWakeupCallback could be implemented in the user file
Anna Bridge 186:707f6e361f3e 300 */
<> 144:ef7eb2e8f9f7 301 }
<> 144:ef7eb2e8f9f7 302
<> 144:ef7eb2e8f9f7 303 /**
<> 144:ef7eb2e8f9f7 304 * @}
<> 144:ef7eb2e8f9f7 305 */
<> 144:ef7eb2e8f9f7 306
<> 144:ef7eb2e8f9f7 307 /**
<> 144:ef7eb2e8f9f7 308 * @}
<> 144:ef7eb2e8f9f7 309 */
<> 144:ef7eb2e8f9f7 310
Anna Bridge 186:707f6e361f3e 311 #endif /* HAL_WWDG_MODULE_ENABLED */
<> 144:ef7eb2e8f9f7 312 /**
<> 144:ef7eb2e8f9f7 313 * @}
<> 144:ef7eb2e8f9f7 314 */
<> 144:ef7eb2e8f9f7 315
<> 144:ef7eb2e8f9f7 316 /**
<> 144:ef7eb2e8f9f7 317 * @}
<> 144:ef7eb2e8f9f7 318 */
<> 144:ef7eb2e8f9f7 319
<> 144:ef7eb2e8f9f7 320 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/