stm32f2xx_iwdg.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. /**
  2. ******************************************************************************
  3. * @file stm32f2xx_iwdg.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 IWDG
  8. * firmware 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_IWDG_H
  23. #define __STM32F2xx_IWDG_H
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. /* Includes ------------------------------------------------------------------*/
  28. #include "stm32f2xx.h"
  29. /** @addtogroup STM32F2xx_StdPeriph_Driver
  30. * @{
  31. */
  32. /** @addtogroup IWDG
  33. * @{
  34. */
  35. /* Exported types ------------------------------------------------------------*/
  36. /* Exported constants --------------------------------------------------------*/
  37. /** @defgroup IWDG_Exported_Constants
  38. * @{
  39. */
  40. /** @defgroup IWDG_WriteAccess
  41. * @{
  42. */
  43. #define IWDG_WriteAccess_Enable ((uint16_t)0x5555)
  44. #define IWDG_WriteAccess_Disable ((uint16_t)0x0000)
  45. #define IS_IWDG_WRITE_ACCESS(ACCESS) (((ACCESS) == IWDG_WriteAccess_Enable) || \
  46. ((ACCESS) == IWDG_WriteAccess_Disable))
  47. /**
  48. * @}
  49. */
  50. /** @defgroup IWDG_prescaler
  51. * @{
  52. */
  53. #define IWDG_Prescaler_4 ((uint8_t)0x00)
  54. #define IWDG_Prescaler_8 ((uint8_t)0x01)
  55. #define IWDG_Prescaler_16 ((uint8_t)0x02)
  56. #define IWDG_Prescaler_32 ((uint8_t)0x03)
  57. #define IWDG_Prescaler_64 ((uint8_t)0x04)
  58. #define IWDG_Prescaler_128 ((uint8_t)0x05)
  59. #define IWDG_Prescaler_256 ((uint8_t)0x06)
  60. #define IS_IWDG_PRESCALER(PRESCALER) (((PRESCALER) == IWDG_Prescaler_4) || \
  61. ((PRESCALER) == IWDG_Prescaler_8) || \
  62. ((PRESCALER) == IWDG_Prescaler_16) || \
  63. ((PRESCALER) == IWDG_Prescaler_32) || \
  64. ((PRESCALER) == IWDG_Prescaler_64) || \
  65. ((PRESCALER) == IWDG_Prescaler_128)|| \
  66. ((PRESCALER) == IWDG_Prescaler_256))
  67. /**
  68. * @}
  69. */
  70. /** @defgroup IWDG_Flag
  71. * @{
  72. */
  73. #define IWDG_FLAG_PVU ((uint16_t)0x0001)
  74. #define IWDG_FLAG_RVU ((uint16_t)0x0002)
  75. #define IS_IWDG_FLAG(FLAG) (((FLAG) == IWDG_FLAG_PVU) || ((FLAG) == IWDG_FLAG_RVU))
  76. #define IS_IWDG_RELOAD(RELOAD) ((RELOAD) <= 0xFFF)
  77. /**
  78. * @}
  79. */
  80. /**
  81. * @}
  82. */
  83. /* Exported macro ------------------------------------------------------------*/
  84. /* Exported functions --------------------------------------------------------*/
  85. /* Prescaler and Counter configuration functions ******************************/
  86. void IWDG_WriteAccessCmd(uint16_t IWDG_WriteAccess);
  87. void IWDG_SetPrescaler(uint8_t IWDG_Prescaler);
  88. void IWDG_SetReload(uint16_t Reload);
  89. void IWDG_ReloadCounter(void);
  90. /* IWDG activation function ***************************************************/
  91. void IWDG_Enable(void);
  92. /* Flag management function ***************************************************/
  93. FlagStatus IWDG_GetFlagStatus(uint16_t IWDG_FLAG);
  94. #ifdef __cplusplus
  95. }
  96. #endif
  97. #endif /* __STM32F2xx_IWDG_H */
  98. /**
  99. * @}
  100. */
  101. /**
  102. * @}
  103. */