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 
11 /* Define to prevent recursive inclusion -------------------------------------*/
12 #ifndef __FT32F030X8_WWDG_H
13 #define __FT32F030X8_WWDG_H
14 
15 #ifdef __cplusplus
16  extern "C" {
17 #endif
18 
19 /* Includes ------------------------------------------------------------------*/
20 #include "ft32f0xx.h"
21 
22 /** @addtogroup FT32F030X8_StdPeriph_Driver
23   * @{
24   */
25 
26 /** @addtogroup WWDG
27   * @{
28   */
29 /* Exported types ------------------------------------------------------------*/
30 /* Exported constants --------------------------------------------------------*/
31 
32 /** @defgroup WWDG_Exported_Constants
33   * @{
34   */
35 
36 /** @defgroup WWDG_Prescaler
37   * @{
38   */
39 
40 #define WWDG_Prescaler_1    ((uint32_t)0x00000000)
41 #define WWDG_Prescaler_2    ((uint32_t)0x00000080)
42 #define WWDG_Prescaler_4    ((uint32_t)0x00000100)
43 #define WWDG_Prescaler_8    ((uint32_t)0x00000180)
44 #define IS_WWDG_PRESCALER(PRESCALER) (((PRESCALER) == WWDG_Prescaler_1) || \
45                                       ((PRESCALER) == WWDG_Prescaler_2) || \
46                                       ((PRESCALER) == WWDG_Prescaler_4) || \
47                                       ((PRESCALER) == WWDG_Prescaler_8))
48 #define IS_WWDG_WINDOW_VALUE(VALUE) ((VALUE) <= 0x7F)
49 #define IS_WWDG_COUNTER(COUNTER) (((COUNTER) >= 0x40) && ((COUNTER) <= 0x7F))
50 
51 /**
52   * @}
53   */
54 
55 /**
56   * @}
57   */
58 
59 /* Exported macro ------------------------------------------------------------*/
60 /* Exported functions ------------------------------------------------------- */
61 /*  Function used to set the WWDG configuration to the default reset state ****/
62 void WWDG_DeInit(void);
63 
64 /* Prescaler, Refresh window and Counter configuration functions **************/
65 void WWDG_SetPrescaler(uint32_t WWDG_Prescaler);
66 void WWDG_SetWindowValue(uint8_t WindowValue);
67 void WWDG_EnableIT(void);
68 void WWDG_SetCounter(uint8_t Counter);
69 
70 /* WWDG activation functions **************************************************/
71 void WWDG_Enable(uint8_t Counter);
72 
73 /* Interrupts and flags management functions **********************************/
74 FlagStatus WWDG_GetFlagStatus(void);
75 void WWDG_ClearFlag(void);
76 
77 #ifdef __cplusplus
78 }
79 #endif
80 
81 #endif /* __FT32F030X8_WWDG_H */
82 
83 /**
84   * @}
85   */
86 
87 /**
88   * @}
89   */
90 
91 /************************ (C) COPYRIGHT FMD *****END OF FILE****/
92