stm32f10x_iwdg.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. /**
  2. ******************************************************************************
  3. * @file stm32f10x_iwdg.h
  4. * @author MCD Application Team
  5. * @version V3.3.0
  6. * @date 04/16/2010
  7. * @brief This file contains all the functions prototypes for the IWDG
  8. * firmware library.
  9. ******************************************************************************
  10. * @copy
  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 2010 STMicroelectronics</center></h2>
  20. */
  21. /* Define to prevent recursive inclusion -------------------------------------*/
  22. #ifndef __STM32F10x_IWDG_H
  23. #define __STM32F10x_IWDG_H
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. /* Includes ------------------------------------------------------------------*/
  28. #include "stm32f10x.h"
  29. /** @addtogroup STM32F10x_StdPeriph_Driver
  30. * @{
  31. */
  32. /** @addtogroup IWDG
  33. * @{
  34. */
  35. /** @defgroup IWDG_Exported_Types
  36. * @{
  37. */
  38. /**
  39. * @}
  40. */
  41. /** @defgroup IWDG_Exported_Constants
  42. * @{
  43. */
  44. /** @defgroup IWDG_WriteAccess
  45. * @{
  46. */
  47. #define IWDG_WriteAccess_Enable ((uint16_t)0x5555)
  48. #define IWDG_WriteAccess_Disable ((uint16_t)0x0000)
  49. #define IS_IWDG_WRITE_ACCESS(ACCESS) (((ACCESS) == IWDG_WriteAccess_Enable) || \
  50. ((ACCESS) == IWDG_WriteAccess_Disable))
  51. /**
  52. * @}
  53. */
  54. /** @defgroup IWDG_prescaler
  55. * @{
  56. */
  57. #define IWDG_Prescaler_4 ((uint8_t)0x00)
  58. #define IWDG_Prescaler_8 ((uint8_t)0x01)
  59. #define IWDG_Prescaler_16 ((uint8_t)0x02)
  60. #define IWDG_Prescaler_32 ((uint8_t)0x03)
  61. #define IWDG_Prescaler_64 ((uint8_t)0x04)
  62. #define IWDG_Prescaler_128 ((uint8_t)0x05)
  63. #define IWDG_Prescaler_256 ((uint8_t)0x06)
  64. #define IS_IWDG_PRESCALER(PRESCALER) (((PRESCALER) == IWDG_Prescaler_4) || \
  65. ((PRESCALER) == IWDG_Prescaler_8) || \
  66. ((PRESCALER) == IWDG_Prescaler_16) || \
  67. ((PRESCALER) == IWDG_Prescaler_32) || \
  68. ((PRESCALER) == IWDG_Prescaler_64) || \
  69. ((PRESCALER) == IWDG_Prescaler_128)|| \
  70. ((PRESCALER) == IWDG_Prescaler_256))
  71. /**
  72. * @}
  73. */
  74. /** @defgroup IWDG_Flag
  75. * @{
  76. */
  77. #define IWDG_FLAG_PVU ((uint16_t)0x0001)
  78. #define IWDG_FLAG_RVU ((uint16_t)0x0002)
  79. #define IS_IWDG_FLAG(FLAG) (((FLAG) == IWDG_FLAG_PVU) || ((FLAG) == IWDG_FLAG_RVU))
  80. #define IS_IWDG_RELOAD(RELOAD) ((RELOAD) <= 0xFFF)
  81. /**
  82. * @}
  83. */
  84. /**
  85. * @}
  86. */
  87. /** @defgroup IWDG_Exported_Macros
  88. * @{
  89. */
  90. /**
  91. * @}
  92. */
  93. /** @defgroup IWDG_Exported_Functions
  94. * @{
  95. */
  96. void IWDG_WriteAccessCmd(uint16_t IWDG_WriteAccess);
  97. void IWDG_SetPrescaler(uint8_t IWDG_Prescaler);
  98. void IWDG_SetReload(uint16_t Reload);
  99. void IWDG_ReloadCounter(void);
  100. void IWDG_Enable(void);
  101. FlagStatus IWDG_GetFlagStatus(uint16_t IWDG_FLAG);
  102. #ifdef __cplusplus
  103. }
  104. #endif
  105. #endif /* __STM32F10x_IWDG_H */
  106. /**
  107. * @}
  108. */
  109. /**
  110. * @}
  111. */
  112. /**
  113. * @}
  114. */
  115. /******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/