1 /***************COPYRIGHT(C)  2019 WCH. A11 rights reserved*********************
2 * File Name          : ch32f10x_iwdg.h
3 * Author             : WCH
4 * Version            : V1.0.0
5 * Date               : 2019/10/15
6 * Description        : This file contains all the functions prototypes for the
7 *                      IWDG firmware library.
8 *******************************************************************************/
9 #ifndef __CH32F10x_IWDG_H
10 #define __CH32F10x_IWDG_H
11 
12 #ifdef __cplusplus
13  extern "C" {
14 #endif
15 
16 #include "ch32f10x.h"
17 
18 /* IWDG_WriteAccess */
19 #define IWDG_WriteAccess_Enable     ((uint16_t)0x5555)
20 #define IWDG_WriteAccess_Disable    ((uint16_t)0x0000)
21 
22 /* IWDG_prescaler */
23 #define IWDG_Prescaler_4            ((uint8_t)0x00)
24 #define IWDG_Prescaler_8            ((uint8_t)0x01)
25 #define IWDG_Prescaler_16           ((uint8_t)0x02)
26 #define IWDG_Prescaler_32           ((uint8_t)0x03)
27 #define IWDG_Prescaler_64           ((uint8_t)0x04)
28 #define IWDG_Prescaler_128          ((uint8_t)0x05)
29 #define IWDG_Prescaler_256          ((uint8_t)0x06)
30 
31 /* IWDG_Flag */
32 #define IWDG_FLAG_PVU               ((uint16_t)0x0001)
33 #define IWDG_FLAG_RVU               ((uint16_t)0x0002)
34 
35 
36 void IWDG_WriteAccessCmd(uint16_t IWDG_WriteAccess);
37 void IWDG_SetPrescaler(uint8_t IWDG_Prescaler);
38 void IWDG_SetReload(uint16_t Reload);
39 void IWDG_ReloadCounter(void);
40 void IWDG_Enable(void);
41 FlagStatus IWDG_GetFlagStatus(uint16_t IWDG_FLAG);
42 
43 #ifdef __cplusplus
44 }
45 #endif
46 
47 #endif /* __CH32F10x_IWDG_H */
48 
49 
50 
51 
52 
53 
54 
55