2 **************************************************************************
3 * @file at32f435_437_wwdt.h
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
36 /* Includes ------------------------------------------------------------------*/
37 #include "at32f435_437.h"
39 /** @addtogroup AT32F435_437_periph_driver
47 /** @defgroup WWDT_enable_bit_definition
48 * @brief wwdt enable bit
52 #define WWDT_EN_BIT ((uint32_t)0x00000080) /*!< wwdt enable bit */
58 /** @defgroup WWDT_exported_types
63 * @brief wwdt division type
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) */
74 * @brief type define wwdt register all
80 * @brief wwdt ctrl register, offset:0x00
87 __IO
uint32_t cnt
: 7; /* [6:0] */
88 __IO
uint32_t wwdten
: 1; /* [7] */
89 __IO
uint32_t reserved1
: 24;/* [31:8] */
94 * @brief wwdt cfg register, offset:0x04
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] */
109 * @brief wwdt cfg register, offset:0x08
116 __IO
uint32_t rldf
: 1; /* [0] */
117 __IO
uint32_t reserved1
: 31;/* [31:1] */
127 #define WWDT ((wwdt_type *) WWDT_BASE)
129 /** @defgroup WWDT_exported_functions
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
);