wwdg.c 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /**
  2. ******************************************************************************
  3. * File Name : WWDG.c
  4. * Description : This file provides code for the configuration
  5. * of the WWDG instances.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * <h2><center>&copy; Copyright (c) 2020 STMicroelectronics.
  10. * All rights reserved.</center></h2>
  11. *
  12. * This software component is licensed by ST under Ultimate Liberty license
  13. * SLA0044, the "License"; You may not use this file except in compliance with
  14. * the License. You may obtain a copy of the License at:
  15. * www.st.com/SLA0044
  16. *
  17. ******************************************************************************
  18. */
  19. /* Includes ------------------------------------------------------------------*/
  20. #include "wwdg.h"
  21. /* USER CODE BEGIN 0 */
  22. /* USER CODE END 0 */
  23. WWDG_HandleTypeDef hwwdg;
  24. /* WWDG init function */
  25. void MX_WWDG_Init(void)
  26. {
  27. hwwdg.Instance = WWDG;
  28. hwwdg.Init.Prescaler = WWDG_PRESCALER_1;
  29. hwwdg.Init.Window = 64;
  30. hwwdg.Init.Counter = 64;
  31. hwwdg.Init.EWIMode = WWDG_EWI_DISABLE;
  32. if (HAL_WWDG_Init(&hwwdg) != HAL_OK)
  33. {
  34. Error_Handler();
  35. }
  36. }
  37. void HAL_WWDG_MspInit(WWDG_HandleTypeDef* wwdgHandle)
  38. {
  39. if(wwdgHandle->Instance==WWDG)
  40. {
  41. /* USER CODE BEGIN WWDG_MspInit 0 */
  42. /* USER CODE END WWDG_MspInit 0 */
  43. /* WWDG clock enable */
  44. __HAL_RCC_WWDG_CLK_ENABLE();
  45. /* USER CODE BEGIN WWDG_MspInit 1 */
  46. /* USER CODE END WWDG_MspInit 1 */
  47. }
  48. }
  49. /* USER CODE BEGIN 1 */
  50. /* USER CODE END 1 */
  51. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/