1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
/*!
* @file apm32f4xx_iwdt.h
*
* @brief This file contains all the functions prototypes for the IWDT firmware library.
*
* @version V1.0.2
*
* @date 2022-06-23
*
* @attention
*
* Copyright (C) 2021-2022 Geehy Semiconductor
*
* You may not use this file except in compliance with the
* GEEHY COPYRIGHT NOTICE (GEEHY SOFTWARE PACKAGE LICENSE).
*
* The program is only for reference, which is distributed in the hope
* that it will be usefull and instructional for customers to develop
* their software. Unless required by applicable law or agreed to in
* writing, the program is distributed on an "AS IS" BASIS, WITHOUT
* ANY WARRANTY OR CONDITIONS OF ANY KIND, either express or implied.
* See the GEEHY SOFTWARE PACKAGE LICENSE for the governing permissions
* and limitations under the License.
*/
/* Define to prevent recursive inclusion */
#ifndef __APM32F4XX_IWDT_H
#define __APM32F4XX_IWDT_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes */
#include "apm32f4xx.h"
/** @addtogroup APM32F4xx_StdPeriphDriver
@{
*/
/** @addtogroup IWDT_Driver
@{
*/
/** @defgroup IWDT_Enumerations
@{
*/
/**
* @brief IWDT KEYWORD define
*/
typedef enum
{
IWDT_KEYWORD_RELOAD = 0xAAAA, /*!< Reload IWDT_CNTRLD register */
IWDT_KEYWORD_ENABLE = 0xCCCC /*!< Activate watchdog */
} IWDT_KEYWORD_T;
/**
* @brief IWDT Write Access define
*/
typedef enum
{
IWDT_WRITEACCESS_ENABLE = 0x5555, /*!< Allow access IWDT register */
IWDT_WRITEACCESS_DISABLE = 0x0000 /*!< Disable access IWDT register */
} IWDT_WRITEACCESS_T;
/**
* @brief IWDT Divider
*/
typedef enum
{
IWDT_DIVIDER_4 = 0x00, /*!< Prescaler divider equal to 4 */
IWDT_DIVIDER_8 = 0x01, /*!< Prescaler divider equal to 8 */
IWDT_DIVIDER_16 = 0x02, /*!< Prescaler divider equal to 16 */
IWDT_DIVIDER_32 = 0x03, /*!< Prescaler divider equal to 32 */
IWDT_DIVIDER_64 = 0x04, /*!< Prescaler divider equal to 64 */
IWDT_DIVIDER_128 = 0x05, /*!< Prescaler divider equal to 128 */
IWDT_DIVIDER_256 = 0x06 /*!< Prescaler divider equal to 256 */
} IWDT_DIVIDER_T;
/**
* @brief IWDT Flag
*/
typedef enum
{
IWDT_FLAG_PSCU = BIT0, /*!< Watchdog Prescaler Factor Update flag */
IWDT_FLAG_CNTU = BIT1 /*!< Watchdog Counter Reload Value Update flag */
} IWDT_FLAG_T;
/**@} end of group IWDT_Enumerations*/
/** @defgroup IWDT_Functions
@{
*/
/* Enable IWDT */
void IWDT_Enable(void);
/* Refresh IWDT */
void IWDT_Refresh(void);
/* Counter reload */
void IWDT_ConfigReload(uint16_t reload);
/* Divider */
void IWDT_ConfigDivider(uint8_t div);
/* Write Access */
void IWDT_EnableWriteAccess(void);
void IWDT_DisableWriteAccess(void);
/* flag */
uint8_t IWDT_ReadStatusFlag(uint16_t flag);
#ifdef __cplusplus
}
#endif
#endif /* __APM32F4XX_IWDT_H */
/**@} end of group IWDT_Enumerations */
/**@} end of group IWDT_Driver */
/**@} end of group APM32F4xx_StdPeriphDriver */
|