before merging master
[inav.git] / lib / main / AT32F43x / Drivers / AT32F43x_StdPeriph_Driver / inc / at32f435_437_wwdt.h
blobf7999c9eb9bba10b889edf7d33c41d8cac315f87
1 /**
2 **************************************************************************
3 * @file at32f435_437_wwdt.h
4 * @version v2.1.0
5 * @date 2022-08-16
6 * @brief at32f435_437 wwdt header file
7 **************************************************************************
8 * Copyright notice & Disclaimer
10 * The software Board Support Package (BSP) that is made available to
11 * download from Artery official website is the copyrighted work of Artery.
12 * Artery authorizes customers to use, copy, and distribute the BSP
13 * software and its related documentation for the purpose of design and
14 * development in conjunction with Artery microcontrollers. Use of the
15 * software is governed by this copyright notice and the following disclaimer.
17 * THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
18 * GUARANTEES OR REPRESENTATIONS OF ANY KIND. ARTERY EXPRESSLY DISCLAIMS,
19 * TO THE FULLEST EXTENT PERMITTED BY LAW, ALL EXPRESS, IMPLIED OR
20 * STATUTORY OR OTHER WARRANTIES, GUARANTEES OR REPRESENTATIONS,
21 * INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
24 **************************************************************************
27 /* Define to prevent recursive inclusion -------------------------------------*/
28 #ifndef __AT32F435_437_WWDT_H
29 #define __AT32F435_437_WWDT_H
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
36 /* Includes ------------------------------------------------------------------*/
37 #include "at32f435_437.h"
39 /** @addtogroup AT32F435_437_periph_driver
40 * @{
43 /** @addtogroup WWDT
44 * @{
47 /** @defgroup WWDT_enable_bit_definition
48 * @brief wwdt enable bit
49 * @{
52 #define WWDT_EN_BIT ((uint32_t)0x00000080) /*!< wwdt enable bit */
54 /**
55 * @}
58 /** @defgroup WWDT_exported_types
59 * @{
62 /**
63 * @brief wwdt division type
65 typedef enum
67 WWDT_PCLK1_DIV_4096 = 0x00, /*!< wwdt counter clock = (pclk1/4096)/1) */
68 WWDT_PCLK1_DIV_8192 = 0x01, /*!< wwdt counter clock = (pclk1/4096)/2) */
69 WWDT_PCLK1_DIV_16384 = 0x02, /*!< wwdt counter clock = (pclk1/4096)/4) */
70 WWDT_PCLK1_DIV_32768 = 0x03 /*!< wwdt counter clock = (pclk1/4096)/8) */
71 } wwdt_division_type;
73 /**
74 * @brief type define wwdt register all
76 typedef struct
79 /**
80 * @brief wwdt ctrl register, offset:0x00
82 union
84 __IO uint32_t ctrl;
85 struct
87 __IO uint32_t cnt : 7; /* [6:0] */
88 __IO uint32_t wwdten : 1; /* [7] */
89 __IO uint32_t reserved1 : 24;/* [31:8] */
90 } ctrl_bit;
93 /**
94 * @brief wwdt cfg register, offset:0x04
96 union
98 __IO uint32_t cfg;
99 struct
101 __IO uint32_t win : 7; /* [6:0] */
102 __IO uint32_t div : 2; /* [8:7] */
103 __IO uint32_t rldien : 1; /* [9] */
104 __IO uint32_t reserved1 : 22;/* [31:10] */
105 } cfg_bit;
109 * @brief wwdt cfg register, offset:0x08
111 union
113 __IO uint32_t sts;
114 struct
116 __IO uint32_t rldf : 1; /* [0] */
117 __IO uint32_t reserved1 : 31;/* [31:1] */
118 } sts_bit;
121 } wwdt_type;
124 * @}
127 #define WWDT ((wwdt_type *) WWDT_BASE)
129 /** @defgroup WWDT_exported_functions
130 * @{
133 void wwdt_reset(void);
134 void wwdt_divider_set(wwdt_division_type division);
135 void wwdt_flag_clear(void);
136 void wwdt_enable(uint8_t wwdt_cnt);
137 void wwdt_interrupt_enable(void);
138 flag_status wwdt_flag_get(void);
139 void wwdt_counter_set(uint8_t wwdt_cnt);
140 void wwdt_window_counter_set(uint8_t window_cnt);
143 * @}
147 * @}
151 * @}
154 #ifdef __cplusplus
156 #endif
158 #endif