hk32f0xx_wwdg.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /**
  2. ******************************************************************************
  3. * @file hk32f0xx_wwdg.h
  4. * @version V1.0.1
  5. * @date 2019-08-15
  6. ******************************************************************************
  7. */
  8. /* Define to prevent recursive inclusion -------------------------------------*/
  9. #ifndef __HK32F0XX_WWDG_H
  10. #define __HK32F0XX_WWDG_H
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. /* Includes ------------------------------------------------------------------*/
  15. #include "hk32f0xx.h"
  16. /** @addtogroup HK32F0xx_StdPeriph_Driver
  17. * @{
  18. */
  19. /** @addtogroup WWDG
  20. * @{
  21. */
  22. /* Exported types ------------------------------------------------------------*/
  23. /* Exported constants --------------------------------------------------------*/
  24. /** @defgroup WWDG_Exported_Constants
  25. * @{
  26. */
  27. /** @defgroup WWDG_Prescaler
  28. * @{
  29. */
  30. #define WWDG_Prescaler_1 ((uint32_t)0x00000000)
  31. #define WWDG_Prescaler_2 ((uint32_t)0x00000080)
  32. #define WWDG_Prescaler_4 ((uint32_t)0x00000100)
  33. #define WWDG_Prescaler_8 ((uint32_t)0x00000180)
  34. #define IS_WWDG_PRESCALER(PRESCALER) (((PRESCALER) == WWDG_Prescaler_1) || \
  35. ((PRESCALER) == WWDG_Prescaler_2) || \
  36. ((PRESCALER) == WWDG_Prescaler_4) || \
  37. ((PRESCALER) == WWDG_Prescaler_8))
  38. #define IS_WWDG_WINDOW_VALUE(VALUE) ((VALUE) <= 0x7F)
  39. #define IS_WWDG_COUNTER(COUNTER) (((COUNTER) >= 0x40) && ((COUNTER) <= 0x7F))
  40. /**
  41. * @}
  42. */
  43. /**
  44. * @}
  45. */
  46. /* Exported macro ------------------------------------------------------------*/
  47. /* Exported functions ------------------------------------------------------- */
  48. /* Function used to set the WWDG configuration to the default reset state ****/
  49. void WWDG_DeInit(void);
  50. /* Prescaler, Refresh window and Counter configuration functions **************/
  51. void WWDG_SetPrescaler(uint32_t WWDG_Prescaler);
  52. void WWDG_SetWindowValue(uint8_t WindowValue);
  53. void WWDG_EnableIT(void);
  54. void WWDG_SetCounter(uint8_t Counter);
  55. /* WWDG activation functions **************************************************/
  56. void WWDG_Enable(uint8_t Counter);
  57. /* Interrupts and flags management functions **********************************/
  58. FlagStatus WWDG_GetFlagStatus(void);
  59. void WWDG_ClearFlag(void);
  60. #ifdef __cplusplus
  61. }
  62. #endif
  63. #endif /* __HK32F0XX_WWDG_H */
  64. /**
  65. * @}
  66. */
  67. /**
  68. * @}
  69. */