stm32f4xx_iwdg.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. /**
  2. ******************************************************************************
  3. * @file stm32f4xx_iwdg.h
  4. * @author MCD Application Team
  5. * @version V1.0.0
  6. * @date 30-September-2011
  7. * @brief This file contains all the functions prototypes for the IWDG
  8. * firmware library.
  9. ******************************************************************************
  10. * @attention
  11. *
  12. * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  13. * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
  14. * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
  15. * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
  16. * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
  17. * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  18. *
  19. * <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2>
  20. ******************************************************************************
  21. */
  22. /* Define to prevent recursive inclusion -------------------------------------*/
  23. #ifndef __STM32F4xx_IWDG_H
  24. #define __STM32F4xx_IWDG_H
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28. /* Includes ------------------------------------------------------------------*/
  29. #include "stm32f4xx.h"
  30. /** @addtogroup STM32F4xx_StdPeriph_Driver
  31. * @{
  32. */
  33. /** @addtogroup IWDG
  34. * @{
  35. */
  36. /* Exported types ------------------------------------------------------------*/
  37. /* Exported constants --------------------------------------------------------*/
  38. /** @defgroup IWDG_Exported_Constants
  39. * @{
  40. */
  41. /** @defgroup IWDG_WriteAccess
  42. * @{
  43. */
  44. #define IWDG_WriteAccess_Enable ((uint16_t)0x5555)
  45. #define IWDG_WriteAccess_Disable ((uint16_t)0x0000)
  46. #define IS_IWDG_WRITE_ACCESS(ACCESS) (((ACCESS) == IWDG_WriteAccess_Enable) || \
  47. ((ACCESS) == IWDG_WriteAccess_Disable))
  48. /**
  49. * @}
  50. */
  51. /** @defgroup IWDG_prescaler
  52. * @{
  53. */
  54. #define IWDG_Prescaler_4 ((uint8_t)0x00)
  55. #define IWDG_Prescaler_8 ((uint8_t)0x01)
  56. #define IWDG_Prescaler_16 ((uint8_t)0x02)
  57. #define IWDG_Prescaler_32 ((uint8_t)0x03)
  58. #define IWDG_Prescaler_64 ((uint8_t)0x04)
  59. #define IWDG_Prescaler_128 ((uint8_t)0x05)
  60. #define IWDG_Prescaler_256 ((uint8_t)0x06)
  61. #define IS_IWDG_PRESCALER(PRESCALER) (((PRESCALER) == IWDG_Prescaler_4) || \
  62. ((PRESCALER) == IWDG_Prescaler_8) || \
  63. ((PRESCALER) == IWDG_Prescaler_16) || \
  64. ((PRESCALER) == IWDG_Prescaler_32) || \
  65. ((PRESCALER) == IWDG_Prescaler_64) || \
  66. ((PRESCALER) == IWDG_Prescaler_128)|| \
  67. ((PRESCALER) == IWDG_Prescaler_256))
  68. /**
  69. * @}
  70. */
  71. /** @defgroup IWDG_Flag
  72. * @{
  73. */
  74. #define IWDG_FLAG_PVU ((uint16_t)0x0001)
  75. #define IWDG_FLAG_RVU ((uint16_t)0x0002)
  76. #define IS_IWDG_FLAG(FLAG) (((FLAG) == IWDG_FLAG_PVU) || ((FLAG) == IWDG_FLAG_RVU))
  77. #define IS_IWDG_RELOAD(RELOAD) ((RELOAD) <= 0xFFF)
  78. /**
  79. * @}
  80. */
  81. /**
  82. * @}
  83. */
  84. /* Exported macro ------------------------------------------------------------*/
  85. /* Exported functions --------------------------------------------------------*/
  86. /* Prescaler and Counter configuration functions ******************************/
  87. void IWDG_WriteAccessCmd(uint16_t IWDG_WriteAccess);
  88. void IWDG_SetPrescaler(uint8_t IWDG_Prescaler);
  89. void IWDG_SetReload(uint16_t Reload);
  90. void IWDG_ReloadCounter(void);
  91. /* IWDG activation function ***************************************************/
  92. void IWDG_Enable(void);
  93. /* Flag management function ***************************************************/
  94. FlagStatus IWDG_GetFlagStatus(uint16_t IWDG_FLAG);
  95. #ifdef __cplusplus
  96. }
  97. #endif
  98. #endif /* __STM32F4xx_IWDG_H */
  99. /**
  100. * @}
  101. */
  102. /**
  103. * @}
  104. */
  105. /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/