stm32f2xx_wwdg.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /**
  2. ******************************************************************************
  3. * @file stm32f2xx_wwdg.h
  4. * @author MCD Application Team
  5. * @version V1.1.3
  6. * @date 31-December-2021
  7. * @brief This file contains all the functions prototypes for the WWDG firmware
  8. * library.
  9. ******************************************************************************
  10. * @attention
  11. *
  12. * Copyright (c) 2012 STMicroelectronics.
  13. * All rights reserved.
  14. *
  15. * This software is licensed under terms that can be found in the LICENSE file
  16. * in the root directory of this software component.
  17. * If no LICENSE file comes with this software, it is provided AS-IS.
  18. *
  19. ******************************************************************************
  20. */
  21. /* Define to prevent recursive inclusion -------------------------------------*/
  22. #ifndef __STM32F2xx_WWDG_H
  23. #define __STM32F2xx_WWDG_H
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. /* Includes ------------------------------------------------------------------*/
  28. #include "stm32f2xx.h"
  29. /** @addtogroup STM32F2xx_StdPeriph_Driver
  30. * @{
  31. */
  32. /** @addtogroup WWDG
  33. * @{
  34. */
  35. /* Exported types ------------------------------------------------------------*/
  36. /* Exported constants --------------------------------------------------------*/
  37. /** @defgroup WWDG_Exported_Constants
  38. * @{
  39. */
  40. /** @defgroup WWDG_Prescaler
  41. * @{
  42. */
  43. #define WWDG_Prescaler_1 ((uint32_t)0x00000000)
  44. #define WWDG_Prescaler_2 ((uint32_t)0x00000080)
  45. #define WWDG_Prescaler_4 ((uint32_t)0x00000100)
  46. #define WWDG_Prescaler_8 ((uint32_t)0x00000180)
  47. #define IS_WWDG_PRESCALER(PRESCALER) (((PRESCALER) == WWDG_Prescaler_1) || \
  48. ((PRESCALER) == WWDG_Prescaler_2) || \
  49. ((PRESCALER) == WWDG_Prescaler_4) || \
  50. ((PRESCALER) == WWDG_Prescaler_8))
  51. #define IS_WWDG_WINDOW_VALUE(VALUE) ((VALUE) <= 0x7F)
  52. #define IS_WWDG_COUNTER(COUNTER) (((COUNTER) >= 0x40) && ((COUNTER) <= 0x7F))
  53. /**
  54. * @}
  55. */
  56. /**
  57. * @}
  58. */
  59. /* Exported macro ------------------------------------------------------------*/
  60. /* Exported functions --------------------------------------------------------*/
  61. /* Function used to set the WWDG configuration to the default reset state ****/
  62. void WWDG_DeInit(void);
  63. /* Prescaler, Refresh window and Counter configuration functions **************/
  64. void WWDG_SetPrescaler(uint32_t WWDG_Prescaler);
  65. void WWDG_SetWindowValue(uint8_t WindowValue);
  66. void WWDG_EnableIT(void);
  67. void WWDG_SetCounter(uint8_t Counter);
  68. /* WWDG activation function ***************************************************/
  69. void WWDG_Enable(uint8_t Counter);
  70. /* Interrupts and flags management functions **********************************/
  71. FlagStatus WWDG_GetFlagStatus(void);
  72. void WWDG_ClearFlag(void);
  73. #ifdef __cplusplus
  74. }
  75. #endif
  76. #endif /* __STM32F2xx_WWDG_H */
  77. /**
  78. * @}
  79. */
  80. /**
  81. * @}
  82. */