ft32f0xx_wwdg.h 2.5 KB

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