stm32f0xx_iwdg.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. /**
  2. ******************************************************************************
  3. * @file stm32f0xx_iwdg.h
  4. * @author MCD Application Team
  5. * @version V1.5.0
  6. * @date 05-December-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 __STM32F0XX_IWDG_H
  30. #define __STM32F0XX_IWDG_H
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34. /* Includes ------------------------------------------------------------------*/
  35. #include "stm32f0xx.h"
  36. /** @addtogroup STM32F0xx_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 IWDG_SR_PVU
  81. #define IWDG_FLAG_RVU IWDG_SR_RVU
  82. #define IWDG_FLAG_WVU IWDG_SR_WVU
  83. #define IS_IWDG_FLAG(FLAG) (((FLAG) == IWDG_FLAG_PVU) || ((FLAG) == IWDG_FLAG_RVU) || \
  84. ((FLAG) == IWDG_FLAG_WVU))
  85. #define IS_IWDG_RELOAD(RELOAD) ((RELOAD) <= 0xFFF)
  86. #define IS_IWDG_WINDOW_VALUE(VALUE) ((VALUE) <= 0xFFF)
  87. /**
  88. * @}
  89. */
  90. /**
  91. * @}
  92. */
  93. /* Exported macro ------------------------------------------------------------*/
  94. /* Exported functions ------------------------------------------------------- */
  95. /* Prescaler and Counter configuration functions ******************************/
  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_SetWindowValue(uint16_t WindowValue);
  101. /* IWDG activation function ***************************************************/
  102. void IWDG_Enable(void);
  103. /* Flag management function ***************************************************/
  104. FlagStatus IWDG_GetFlagStatus(uint16_t IWDG_FLAG);
  105. #ifdef __cplusplus
  106. }
  107. #endif
  108. #endif /* __STM32F0XX_IWDG_H */
  109. /**
  110. * @}
  111. */
  112. /**
  113. * @}
  114. */
  115. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/