stm32f4xx_iwdg.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /**
  2. ******************************************************************************
  3. * @file stm32f4xx_iwdg.h
  4. * @author MCD Application Team
  5. * @version V1.4.0
  6. * @date 04-August-2014
  7. * @brief This file contains all the functions prototypes for the IWDG
  8. * firmware library.
  9. ******************************************************************************
  10. * @attention
  11. *
  12. * <h2><center>&copy; COPYRIGHT 2014 STMicroelectronics</center></h2>
  13. *
  14. * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
  15. * You may not use this file except in compliance with the License.
  16. * You may obtain a copy of the License at:
  17. *
  18. * http://www.st.com/software_license_agreement_liberty_v2
  19. *
  20. * Unless required by applicable law or agreed to in writing, software
  21. * distributed under the License is distributed on an "AS IS" BASIS,
  22. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  23. * See the License for the specific language governing permissions and
  24. * limitations under the License.
  25. *
  26. ******************************************************************************
  27. */
  28. /* Define to prevent recursive inclusion -------------------------------------*/
  29. #ifndef __STM32F4xx_IWDG_H
  30. #define __STM32F4xx_IWDG_H
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34. /* Includes ------------------------------------------------------------------*/
  35. #include "stm32f4xx.h"
  36. /** @addtogroup STM32F4xx_StdPeriph_Driver
  37. * @{
  38. */
  39. /** @addtogroup IWDG
  40. * @{
  41. */
  42. /* Exported types ------------------------------------------------------------*/
  43. /* Exported constants --------------------------------------------------------*/
  44. /** @defgroup IWDG_Exported_Constants
  45. * @{
  46. */
  47. /** @defgroup IWDG_WriteAccess
  48. * @{
  49. */
  50. #define IWDG_WriteAccess_Enable ((uint16_t)0x5555)
  51. #define IWDG_WriteAccess_Disable ((uint16_t)0x0000)
  52. #define IS_IWDG_WRITE_ACCESS(ACCESS) (((ACCESS) == IWDG_WriteAccess_Enable) || \
  53. ((ACCESS) == IWDG_WriteAccess_Disable))
  54. /**
  55. * @}
  56. */
  57. /** @defgroup IWDG_prescaler
  58. * @{
  59. */
  60. #define IWDG_Prescaler_4 ((uint8_t)0x00)
  61. #define IWDG_Prescaler_8 ((uint8_t)0x01)
  62. #define IWDG_Prescaler_16 ((uint8_t)0x02)
  63. #define IWDG_Prescaler_32 ((uint8_t)0x03)
  64. #define IWDG_Prescaler_64 ((uint8_t)0x04)
  65. #define IWDG_Prescaler_128 ((uint8_t)0x05)
  66. #define IWDG_Prescaler_256 ((uint8_t)0x06)
  67. #define IS_IWDG_PRESCALER(PRESCALER) (((PRESCALER) == IWDG_Prescaler_4) || \
  68. ((PRESCALER) == IWDG_Prescaler_8) || \
  69. ((PRESCALER) == IWDG_Prescaler_16) || \
  70. ((PRESCALER) == IWDG_Prescaler_32) || \
  71. ((PRESCALER) == IWDG_Prescaler_64) || \
  72. ((PRESCALER) == IWDG_Prescaler_128)|| \
  73. ((PRESCALER) == IWDG_Prescaler_256))
  74. /**
  75. * @}
  76. */
  77. /** @defgroup IWDG_Flag
  78. * @{
  79. */
  80. #define IWDG_FLAG_PVU ((uint16_t)0x0001)
  81. #define IWDG_FLAG_RVU ((uint16_t)0x0002)
  82. #define IS_IWDG_FLAG(FLAG) (((FLAG) == IWDG_FLAG_PVU) || ((FLAG) == IWDG_FLAG_RVU))
  83. #define IS_IWDG_RELOAD(RELOAD) ((RELOAD) <= 0xFFF)
  84. /**
  85. * @}
  86. */
  87. /**
  88. * @}
  89. */
  90. /* Exported macro ------------------------------------------------------------*/
  91. /* Exported functions --------------------------------------------------------*/
  92. /* Prescaler and Counter configuration functions ******************************/
  93. void IWDG_WriteAccessCmd(uint16_t IWDG_WriteAccess);
  94. void IWDG_SetPrescaler(uint8_t IWDG_Prescaler);
  95. void IWDG_SetReload(uint16_t Reload);
  96. void IWDG_ReloadCounter(void);
  97. /* IWDG activation function ***************************************************/
  98. void IWDG_Enable(void);
  99. /* Flag management function ***************************************************/
  100. FlagStatus IWDG_GetFlagStatus(uint16_t IWDG_FLAG);
  101. #ifdef __cplusplus
  102. }
  103. #endif
  104. #endif /* __STM32F4xx_IWDG_H */
  105. /**
  106. * @}
  107. */
  108. /**
  109. * @}
  110. */
  111. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/