STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
stm32f7xx_hal_wwdg.c
Go to the documentation of this file.
1 
126 /* Includes ------------------------------------------------------------------*/
127 #include "stm32f7xx_hal.h"
128 
133 #ifdef HAL_WWDG_MODULE_ENABLED
134 
139 /* Private typedef -----------------------------------------------------------*/
140 /* Private define ------------------------------------------------------------*/
141 /* Private macro -------------------------------------------------------------*/
142 /* Private variables ---------------------------------------------------------*/
143 /* Private function prototypes -----------------------------------------------*/
144 /* Exported functions --------------------------------------------------------*/
145 
175 {
176  /* Check the WWDG handle allocation */
177  if(hwwdg == NULL)
178  {
179  return HAL_ERROR;
180  }
181 
182  /* Check the parameters */
188 
189  /* Init the low level hardware */
190  HAL_WWDG_MspInit(hwwdg);
191 
192  /* Set WWDG Counter */
193  WRITE_REG(hwwdg->Instance->CR, (WWDG_CR_WDGA | hwwdg->Init.Counter));
194 
195  /* Set WWDG Prescaler and Window */
196  WRITE_REG(hwwdg->Instance->CFR, (hwwdg->Init.EWIMode | hwwdg->Init.Prescaler | hwwdg->Init.Window));
197 
198  /* Return function status */
199  return HAL_OK;
200 }
201 
202 
212 __weak void HAL_WWDG_MspInit(WWDG_HandleTypeDef *hwwdg)
213 {
214  /* Prevent unused argument(s) compilation warning */
215  UNUSED(hwwdg);
216 
217  /* NOTE: This function should not be modified, when the callback is needed,
218  the HAL_WWDG_MspInit could be implemented in the user file
219  */
220 }
221 
249 {
250  /* Write to WWDG CR the WWDG Counter value to refresh with */
251  WRITE_REG(hwwdg->Instance->CR, (hwwdg->Init.Counter));
252 
253  /* Return function status */
254  return HAL_OK;
255 }
256 
272 {
273  /* Check if Early Wakeup Interrupt is enable */
275  {
276  /* Check if WWDG Early Wakeup Interrupt occurred */
278  {
279  /* Clear the WWDG Early Wakeup flag */
281 
282  /* Early Wakeup callback */
284  }
285  }
286 }
287 
288 
296 {
297  /* Prevent unused argument(s) compilation warning */
298  UNUSED(hwwdg);
299 
300  /* NOTE: This function should not be modified, when the callback is needed,
301  the HAL_WWDG_EarlyWakeupCallback could be implemented in the user file
302  */
303 }
304 
313 #endif /* HAL_WWDG_MODULE_ENABLED */
314 
322 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
void HAL_WWDG_MspInit(WWDG_HandleTypeDef *hwwdg)
#define __HAL_WWDG_CLEAR_FLAG(__HANDLE__, __FLAG__)
Clear the WWDG's pending flags.
#define __HAL_WWDG_GET_FLAG(__HANDLE__, __FLAG__)
Check whether the specified WWDG flag is set or not.
HAL_StatusTypeDef HAL_WWDG_Refresh(WWDG_HandleTypeDef *hwwdg)
WWDG_TypeDef * Instance
#define IS_WWDG_COUNTER(__COUNTER__)
#define assert_param(expr)
Include module's header file.
#define WRITE_REG(REG, VAL)
Definition: stm32f7xx.h:186
WWDG_InitTypeDef Init
__IO uint32_t CR
Definition: stm32f745xx.h:950
HAL_StatusTypeDef HAL_WWDG_Init(WWDG_HandleTypeDef *hwwdg)
#define NULL
Definition: usbd_def.h:53
#define __HAL_WWDG_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__)
Check whether the specified WWDG interrupt source is enabled or not.
This file contains all the functions prototypes for the HAL module driver.
WWDG handle Structure definition.
__IO uint32_t CFR
Definition: stm32f745xx.h:951
#define IS_WWDG_WINDOW(__WINDOW__)
#define IS_WWDG_EWI_MODE(__MODE__)
#define UNUSED(x)
#define IS_WWDG_PRESCALER(__PRESCALER__)
void HAL_WWDG_IRQHandler(WWDG_HandleTypeDef *hwwdg)
#define WWDG_CR_WDGA
Definition: stm32f745xx.h:7577
#define IS_WWDG_ALL_INSTANCE(__INSTANCE__)
Definition: stm32f745xx.h:9226
#define WWDG_FLAG_EWIF
HAL_StatusTypeDef
HAL Status structures definition.
void HAL_WWDG_EarlyWakeupCallback(WWDG_HandleTypeDef *hwwdg)
#define WWDG_IT_EWI