1 /*!
2     \file    gd32l23x_exti.h
3     \brief   definitions for the EXTI
4 
5     \version 2021-08-04, V1.0.0, firmware for GD32L23x
6 */
7 
8 /*
9     Copyright (c) 2021, GigaDevice Semiconductor Inc.
10 
11     Redistribution and use in source and binary forms, with or without modification,
12 are permitted provided that the following conditions are met:
13 
14     1. Redistributions of source code must retain the above copyright notice, this
15        list of conditions and the following disclaimer.
16     2. Redistributions in binary form must reproduce the above copyright notice,
17        this list of conditions and the following disclaimer in the documentation
18        and/or other materials provided with the distribution.
19     3. Neither the name of the copyright holder nor the names of its contributors
20        may be used to endorse or promote products derived from this software without
21        specific prior written permission.
22 
23     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
27 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
28 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
29 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
30 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
32 OF SUCH DAMAGE.
33 */
34 
35 #ifndef GD32L23X_EXTI_H
36 #define GD32L23X_EXTI_H
37 
38 #include "gd32l23x.h"
39 
40 /* EXTI definitions */
41 #define EXTI                         EXTI_BASE
42 
43 /* registers definitions */
44 #define EXTI_INTEN                   REG32(EXTI + 0x00U)      /*!< interrupt enable register */
45 #define EXTI_EVEN                    REG32(EXTI + 0x04U)      /*!< event enable register */
46 #define EXTI_RTEN                    REG32(EXTI + 0x08U)      /*!< rising edge trigger enable register */
47 #define EXTI_FTEN                    REG32(EXTI + 0x0CU)      /*!< falling trigger enable register */
48 #define EXTI_SWIEV                   REG32(EXTI + 0x10U)      /*!< software interrupt event register */
49 #define EXTI_PD                      REG32(EXTI + 0x14U)      /*!< pending register */
50 
51 /* bits definitions */
52 /* EXTI_INTEN */
53 #define EXTI_INTEN_INTEN0            BIT(0)                   /*!< interrupt from line 0 */
54 #define EXTI_INTEN_INTEN1            BIT(1)                   /*!< interrupt from line 1 */
55 #define EXTI_INTEN_INTEN2            BIT(2)                   /*!< interrupt from line 2 */
56 #define EXTI_INTEN_INTEN3            BIT(3)                   /*!< interrupt from line 3 */
57 #define EXTI_INTEN_INTEN4            BIT(4)                   /*!< interrupt from line 4 */
58 #define EXTI_INTEN_INTEN5            BIT(5)                   /*!< interrupt from line 5 */
59 #define EXTI_INTEN_INTEN6            BIT(6)                   /*!< interrupt from line 6 */
60 #define EXTI_INTEN_INTEN7            BIT(7)                   /*!< interrupt from line 7 */
61 #define EXTI_INTEN_INTEN8            BIT(8)                   /*!< interrupt from line 8 */
62 #define EXTI_INTEN_INTEN9            BIT(9)                   /*!< interrupt from line 9 */
63 #define EXTI_INTEN_INTEN10           BIT(10)                  /*!< interrupt from line 10 */
64 #define EXTI_INTEN_INTEN11           BIT(11)                  /*!< interrupt from line 11 */
65 #define EXTI_INTEN_INTEN12           BIT(12)                  /*!< interrupt from line 12 */
66 #define EXTI_INTEN_INTEN13           BIT(13)                  /*!< interrupt from line 13 */
67 #define EXTI_INTEN_INTEN14           BIT(14)                  /*!< interrupt from line 14 */
68 #define EXTI_INTEN_INTEN15           BIT(15)                  /*!< interrupt from line 15 */
69 #define EXTI_INTEN_INTEN16           BIT(16)                  /*!< interrupt from line 16 */
70 #define EXTI_INTEN_INTEN17           BIT(17)                  /*!< interrupt from line 17 */
71 #define EXTI_INTEN_INTEN18           BIT(18)                  /*!< interrupt from line 18 */
72 #define EXTI_INTEN_INTEN19           BIT(19)                  /*!< interrupt from line 19 */
73 #define EXTI_INTEN_INTEN20           BIT(20)                  /*!< interrupt from line 20 */
74 #define EXTI_INTEN_INTEN21           BIT(21)                  /*!< interrupt from line 21 */
75 #define EXTI_INTEN_INTEN22           BIT(22)                  /*!< interrupt from line 22 */
76 #define EXTI_INTEN_INTEN23           BIT(23)                  /*!< interrupt from line 23 */
77 #define EXTI_INTEN_INTEN24           BIT(24)                  /*!< interrupt from line 24 */
78 #define EXTI_INTEN_INTEN25           BIT(25)                  /*!< interrupt from line 25 */
79 #define EXTI_INTEN_INTEN26           BIT(26)                  /*!< interrupt from line 26 */
80 #define EXTI_INTEN_INTEN27           BIT(27)                  /*!< interrupt from line 27 */
81 #define EXTI_INTEN_INTEN28           BIT(28)                  /*!< interrupt from line 28 */
82 #define EXTI_INTEN_INTEN29           BIT(29)                  /*!< interrupt from line 29 */
83 
84 /* EXTI_EVEN */
85 #define EXTI_EVEN_EVEN0              BIT(0)                   /*!< event from line 0 */
86 #define EXTI_EVEN_EVEN1              BIT(1)                   /*!< event from line 1 */
87 #define EXTI_EVEN_EVEN2              BIT(2)                   /*!< event from line 2 */
88 #define EXTI_EVEN_EVEN3              BIT(3)                   /*!< event from line 3 */
89 #define EXTI_EVEN_EVEN4              BIT(4)                   /*!< event from line 4 */
90 #define EXTI_EVEN_EVEN5              BIT(5)                   /*!< event from line 5 */
91 #define EXTI_EVEN_EVEN6              BIT(6)                   /*!< event from line 6 */
92 #define EXTI_EVEN_EVEN7              BIT(7)                   /*!< event from line 7 */
93 #define EXTI_EVEN_EVEN8              BIT(8)                   /*!< event from line 8 */
94 #define EXTI_EVEN_EVEN9              BIT(9)                   /*!< event from line 9 */
95 #define EXTI_EVEN_EVEN10             BIT(10)                  /*!< event from line 10 */
96 #define EXTI_EVEN_EVEN11             BIT(11)                  /*!< event from line 11 */
97 #define EXTI_EVEN_EVEN12             BIT(12)                  /*!< event from line 12 */
98 #define EXTI_EVEN_EVEN13             BIT(13)                  /*!< event from line 13 */
99 #define EXTI_EVEN_EVEN14             BIT(14)                  /*!< event from line 14 */
100 #define EXTI_EVEN_EVEN15             BIT(15)                  /*!< event from line 15 */
101 #define EXTI_EVEN_EVEN16             BIT(16)                  /*!< event from line 16 */
102 #define EXTI_EVEN_EVEN17             BIT(17)                  /*!< event from line 17 */
103 #define EXTI_EVEN_EVEN18             BIT(18)                  /*!< event from line 18 */
104 #define EXTI_EVEN_EVEN19             BIT(19)                  /*!< event from line 19 */
105 #define EXTI_EVEN_EVEN20             BIT(20)                  /*!< event from line 20 */
106 #define EXTI_EVEN_EVEN21             BIT(21)                  /*!< event from line 21 */
107 #define EXTI_EVEN_EVEN22             BIT(22)                  /*!< event from line 22 */
108 #define EXTI_EVEN_EVEN23             BIT(23)                  /*!< event from line 23 */
109 #define EXTI_EVEN_EVEN24             BIT(24)                  /*!< event from line 24 */
110 #define EXTI_EVEN_EVEN25             BIT(25)                  /*!< event from line 25 */
111 #define EXTI_EVEN_EVEN26             BIT(26)                  /*!< event from line 26 */
112 #define EXTI_EVEN_EVEN27             BIT(27)                  /*!< event from line 27 */
113 #define EXTI_EVEN_EVEN28             BIT(28)                  /*!< event from line 28 */
114 #define EXTI_EVEN_EVEN29             BIT(29)                  /*!< event from line 29 */
115 
116 /* EXTI_RTEN */
117 #define EXTI_RTEN_RTEN0              BIT(0)                   /*!< rising edge from line 0 */
118 #define EXTI_RTEN_RTEN1              BIT(1)                   /*!< rising edge from line 1 */
119 #define EXTI_RTEN_RTEN2              BIT(2)                   /*!< rising edge from line 2 */
120 #define EXTI_RTEN_RTEN3              BIT(3)                   /*!< rising edge from line 3 */
121 #define EXTI_RTEN_RTEN4              BIT(4)                   /*!< rising edge from line 4 */
122 #define EXTI_RTEN_RTEN5              BIT(5)                   /*!< rising edge from line 5 */
123 #define EXTI_RTEN_RTEN6              BIT(6)                   /*!< rising edge from line 6 */
124 #define EXTI_RTEN_RTEN7              BIT(7)                   /*!< rising edge from line 7 */
125 #define EXTI_RTEN_RTEN8              BIT(8)                   /*!< rising edge from line 8 */
126 #define EXTI_RTEN_RTEN9              BIT(9)                   /*!< rising edge from line 9 */
127 #define EXTI_RTEN_RTEN10             BIT(10)                  /*!< rising edge from line 10 */
128 #define EXTI_RTEN_RTEN11             BIT(11)                  /*!< rising edge from line 11 */
129 #define EXTI_RTEN_RTEN12             BIT(12)                  /*!< rising edge from line 12 */
130 #define EXTI_RTEN_RTEN13             BIT(13)                  /*!< rising edge from line 13 */
131 #define EXTI_RTEN_RTEN14             BIT(14)                  /*!< rising edge from line 14 */
132 #define EXTI_RTEN_RTEN15             BIT(15)                  /*!< rising edge from line 15 */
133 #define EXTI_RTEN_RTEN16             BIT(16)                  /*!< rising edge from line 16 */
134 #define EXTI_RTEN_RTEN17             BIT(17)                  /*!< rising edge from line 17 */
135 #define EXTI_RTEN_RTEN19             BIT(19)                  /*!< rising edge from line 19 */
136 #define EXTI_RTEN_RTEN21             BIT(21)                  /*!< rising edge from line 21 */
137 #define EXTI_RTEN_RTEN22             BIT(22)                  /*!< rising edge from line 22 */
138 #define EXTI_RTEN_RTEN23             BIT(23)                  /*!< rising edge from line 23 */
139 #define EXTI_RTEN_RTEN24             BIT(24)                  /*!< rising edge from line 24 */
140 #define EXTI_RTEN_RTEN25             BIT(25)                  /*!< rising edge from line 25 */
141 #define EXTI_RTEN_RTEN26             BIT(26)                  /*!< rising edge from line 26 */
142 #define EXTI_RTEN_RTEN27             BIT(27)                  /*!< rising edge from line 27 */
143 #define EXTI_RTEN_RTEN28             BIT(28)                  /*!< rising edge from line 28 */
144 #define EXTI_RTEN_RTEN29             BIT(29)                  /*!< rising edge from line 29 */
145 
146 /* EXTI_FTEN */
147 #define EXTI_FTEN_FTEN0              BIT(0)                   /*!< falling edge from line 0 */
148 #define EXTI_FTEN_FTEN1              BIT(1)                   /*!< falling edge from line 1 */
149 #define EXTI_FTEN_FTEN2              BIT(2)                   /*!< falling edge from line 2 */
150 #define EXTI_FTEN_FTEN3              BIT(3)                   /*!< falling edge from line 3 */
151 #define EXTI_FTEN_FTEN4              BIT(4)                   /*!< falling edge from line 4 */
152 #define EXTI_FTEN_FTEN5              BIT(5)                   /*!< falling edge from line 5 */
153 #define EXTI_FTEN_FTEN6              BIT(6)                   /*!< falling edge from line 6 */
154 #define EXTI_FTEN_FTEN7              BIT(7)                   /*!< falling edge from line 7 */
155 #define EXTI_FTEN_FTEN8              BIT(8)                   /*!< falling edge from line 8 */
156 #define EXTI_FTEN_FTEN9              BIT(9)                   /*!< falling edge from line 9 */
157 #define EXTI_FTEN_FTEN10             BIT(10)                  /*!< falling edge from line 10 */
158 #define EXTI_FTEN_FTEN11             BIT(11)                  /*!< falling edge from line 11 */
159 #define EXTI_FTEN_FTEN12             BIT(12)                  /*!< falling edge from line 12 */
160 #define EXTI_FTEN_FTEN13             BIT(13)                  /*!< falling edge from line 13 */
161 #define EXTI_FTEN_FTEN14             BIT(14)                  /*!< falling edge from line 14 */
162 #define EXTI_FTEN_FTEN15             BIT(15)                  /*!< falling edge from line 15 */
163 #define EXTI_FTEN_FTEN16             BIT(16)                  /*!< falling edge from line 16 */
164 #define EXTI_FTEN_FTEN17             BIT(17)                  /*!< falling edge from line 17 */
165 #define EXTI_FTEN_FTEN19             BIT(19)                  /*!< falling edge from line 19 */
166 #define EXTI_FTEN_FTEN21             BIT(21)                  /*!< falling edge from line 21 */
167 #define EXTI_FTEN_FTEN22             BIT(22)                  /*!< falling edge from line 22 */
168 #define EXTI_FTEN_FTEN23             BIT(23)                  /*!< falling edge from line 23 */
169 #define EXTI_FTEN_FTEN24             BIT(24)                  /*!< falling edge from line 24 */
170 #define EXTI_FTEN_FTEN25             BIT(25)                  /*!< falling edge from line 25 */
171 #define EXTI_FTEN_FTEN26             BIT(26)                  /*!< falling edge from line 26 */
172 #define EXTI_FTEN_FTEN27             BIT(27)                  /*!< falling edge from line 27 */
173 #define EXTI_FTEN_FTEN28             BIT(28)                  /*!< falling edge from line 28 */
174 #define EXTI_FTEN_FTEN29             BIT(29)                  /*!< falling edge from line 29 */
175 
176 /* EXTI_SWIEV */
177 #define EXTI_SWIEV_SWIEV0            BIT(0)                   /*!< software interrupt/event request from line 0 */
178 #define EXTI_SWIEV_SWIEV1            BIT(1)                   /*!< software interrupt/event request from line 1 */
179 #define EXTI_SWIEV_SWIEV2            BIT(2)                   /*!< software interrupt/event request from line 2 */
180 #define EXTI_SWIEV_SWIEV3            BIT(3)                   /*!< software interrupt/event request from line 3 */
181 #define EXTI_SWIEV_SWIEV4            BIT(4)                   /*!< software interrupt/event request from line 4 */
182 #define EXTI_SWIEV_SWIEV5            BIT(5)                   /*!< software interrupt/event request from line 5 */
183 #define EXTI_SWIEV_SWIEV6            BIT(6)                   /*!< software interrupt/event request from line 6 */
184 #define EXTI_SWIEV_SWIEV7            BIT(7)                   /*!< software interrupt/event request from line 7 */
185 #define EXTI_SWIEV_SWIEV8            BIT(8)                   /*!< software interrupt/event request from line 8 */
186 #define EXTI_SWIEV_SWIEV9            BIT(9)                   /*!< software interrupt/event request from line 9 */
187 #define EXTI_SWIEV_SWIEV10           BIT(10)                  /*!< software interrupt/event request from line 10 */
188 #define EXTI_SWIEV_SWIEV11           BIT(11)                  /*!< software interrupt/event request from line 11 */
189 #define EXTI_SWIEV_SWIEV12           BIT(12)                  /*!< software interrupt/event request from line 12 */
190 #define EXTI_SWIEV_SWIEV13           BIT(13)                  /*!< software interrupt/event request from line 13 */
191 #define EXTI_SWIEV_SWIEV14           BIT(14)                  /*!< software interrupt/event request from line 14 */
192 #define EXTI_SWIEV_SWIEV15           BIT(15)                  /*!< software interrupt/event request from line 15 */
193 #define EXTI_SWIEV_SWIEV16           BIT(16)                  /*!< software interrupt/event request from line 16 */
194 #define EXTI_SWIEV_SWIEV17           BIT(17)                  /*!< software interrupt/event request from line 17 */
195 #define EXTI_SWIEV_SWIEV19           BIT(19)                  /*!< software interrupt/event request from line 19 */
196 #define EXTI_SWIEV_SWIEV21           BIT(21)                  /*!< software interrupt/event request from line 21 */
197 #define EXTI_SWIEV_SWIEV22           BIT(22)                  /*!< software interrupt/event request from line 22 */
198 #define EXTI_SWIEV_SWIEV23           BIT(23)                  /*!< software interrupt/event request from line 23 */
199 #define EXTI_SWIEV_SWIEV24           BIT(24)                  /*!< software interrupt/event request from line 24 */
200 #define EXTI_SWIEV_SWIEV25           BIT(25)                  /*!< software interrupt/event request from line 25 */
201 #define EXTI_SWIEV_SWIEV26           BIT(26)                  /*!< software interrupt/event request from line 26 */
202 #define EXTI_SWIEV_SWIEV27           BIT(27)                  /*!< software interrupt/event request from line 27 */
203 #define EXTI_SWIEV_SWIEV28           BIT(28)                  /*!< software interrupt/event request from line 28 */
204 #define EXTI_SWIEV_SWIEV29           BIT(29)                  /*!< software interrupt/event request from line 29 */
205 
206 
207 /* EXTI_PD */
208 #define EXTI_PD_PD0                  BIT(0)                   /*!< interrupt/event pending status from line 0 */
209 #define EXTI_PD_PD1                  BIT(1)                   /*!< interrupt/event pending status from line 1 */
210 #define EXTI_PD_PD2                  BIT(2)                   /*!< interrupt/event pending status from line 2 */
211 #define EXTI_PD_PD3                  BIT(3)                   /*!< interrupt/event pending status from line 3 */
212 #define EXTI_PD_PD4                  BIT(4)                   /*!< interrupt/event pending status from line 4 */
213 #define EXTI_PD_PD5                  BIT(5)                   /*!< interrupt/event pending status from line 5 */
214 #define EXTI_PD_PD6                  BIT(6)                   /*!< interrupt/event pending status from line 6 */
215 #define EXTI_PD_PD7                  BIT(7)                   /*!< interrupt/event pending status from line 7 */
216 #define EXTI_PD_PD8                  BIT(8)                   /*!< interrupt/event pending status from line 8 */
217 #define EXTI_PD_PD9                  BIT(9)                   /*!< interrupt/event pending status from line 9 */
218 #define EXTI_PD_PD10                 BIT(10)                  /*!< interrupt/event pending status from line 10 */
219 #define EXTI_PD_PD11                 BIT(11)                  /*!< interrupt/event pending status from line 11 */
220 #define EXTI_PD_PD12                 BIT(12)                  /*!< interrupt/event pending status from line 12 */
221 #define EXTI_PD_PD13                 BIT(13)                  /*!< interrupt/event pending status from line 13 */
222 #define EXTI_PD_PD14                 BIT(14)                  /*!< interrupt/event pending status from line 14 */
223 #define EXTI_PD_PD15                 BIT(15)                  /*!< interrupt/event pending status from line 15 */
224 #define EXTI_PD_PD16                 BIT(16)                  /*!< interrupt/event pending status from line 16 */
225 #define EXTI_PD_PD17                 BIT(17)                  /*!< interrupt/event pending status from line 17 */
226 #define EXTI_PD_PD19                 BIT(19)                  /*!< interrupt/event pending status from line 19 */
227 #define EXTI_PD_PD21                 BIT(21)                  /*!< interrupt/event pending status from line 21 */
228 #define EXTI_PD_PD22                 BIT(22)                  /*!< interrupt/event pending status from line 22 */
229 #define EXTI_PD_PD23                 BIT(23)                  /*!< interrupt/event pending status from line 23 */
230 #define EXTI_PD_PD24                 BIT(24)                  /*!< interrupt/event pending status from line 24 */
231 #define EXTI_PD_PD25                 BIT(25)                  /*!< interrupt/event pending status from line 25 */
232 #define EXTI_PD_PD26                 BIT(26)                  /*!< interrupt/event pending status from line 26 */
233 #define EXTI_PD_PD27                 BIT(27)                  /*!< interrupt/event pending status from line 27 */
234 #define EXTI_PD_PD28                 BIT(28)                  /*!< interrupt/event pending status from line 28 */
235 #define EXTI_PD_PD29                 BIT(29)                  /*!< interrupt/event pending status from line 29 */
236 
237 /* constants definitions */
238 /* EXTI line number */
239 typedef enum {
240     EXTI_0      = BIT(0),                                     /*!< EXTI line 0 */
241     EXTI_1      = BIT(1),                                     /*!< EXTI line 1 */
242     EXTI_2      = BIT(2),                                     /*!< EXTI line 2 */
243     EXTI_3      = BIT(3),                                     /*!< EXTI line 3 */
244     EXTI_4      = BIT(4),                                     /*!< EXTI line 4 */
245     EXTI_5      = BIT(5),                                     /*!< EXTI line 5 */
246     EXTI_6      = BIT(6),                                     /*!< EXTI line 6 */
247     EXTI_7      = BIT(7),                                     /*!< EXTI line 7 */
248     EXTI_8      = BIT(8),                                     /*!< EXTI line 8 */
249     EXTI_9      = BIT(9),                                     /*!< EXTI line 9 */
250     EXTI_10     = BIT(10),                                    /*!< EXTI line 10 */
251     EXTI_11     = BIT(11),                                    /*!< EXTI line 11 */
252     EXTI_12     = BIT(12),                                    /*!< EXTI line 12 */
253     EXTI_13     = BIT(13),                                    /*!< EXTI line 13 */
254     EXTI_14     = BIT(14),                                    /*!< EXTI line 14 */
255     EXTI_15     = BIT(15),                                    /*!< EXTI line 15 */
256     EXTI_16     = BIT(16),                                    /*!< EXTI line 16 */
257     EXTI_17     = BIT(17),                                    /*!< EXTI line 17 */
258     EXTI_18     = BIT(18),                                    /*!< EXTI line 18 */
259     EXTI_19     = BIT(19),                                    /*!< EXTI line 19 */
260     EXTI_20     = BIT(20),                                    /*!< EXTI line 20 */
261     EXTI_21     = BIT(21),                                    /*!< EXTI line 21 */
262     EXTI_22     = BIT(22),                                    /*!< EXTI line 22 */
263     EXTI_23     = BIT(23),                                    /*!< EXTI line 23 */
264     EXTI_24     = BIT(24),                                    /*!< EXTI line 24 */
265     EXTI_25     = BIT(25),                                    /*!< EXTI line 25 */
266     EXTI_26     = BIT(26),                                    /*!< EXTI line 26 */
267     EXTI_27     = BIT(27),                                    /*!< EXTI line 27 */
268     EXTI_28     = BIT(28),                                    /*!< EXTI line 28 */
269     EXTI_29     = BIT(29),                                    /*!< EXTI line 29 */
270 } exti_line_enum;
271 
272 /* external interrupt and event */
273 typedef enum {
274     EXTI_INTERRUPT   = 0,                                     /*!< EXTI interrupt mode */
275     EXTI_EVENT                                                /*!< EXTI event mode */
276 } exti_mode_enum;
277 
278 /* interrupt trigger mode */
279 typedef enum {
280     EXTI_TRIG_RISING = 0,                                     /*!< EXTI rising edge trigger */
281     EXTI_TRIG_FALLING,                                        /*!< EXTI falling edge trigger */
282     EXTI_TRIG_BOTH,                                           /*!< EXTI rising and falling edge trigger */
283     EXTI_TRIG_NONE                                            /*!< without rising edge or falling edge trigger */
284 } exti_trig_type_enum;
285 
286 /* function declarations */
287 /* interrupt and event configuration functions */
288 /* deinitialize the EXTI */
289 void exti_deinit(void);
290 /* initialize the EXTI, enable the configuration of EXTI initialize */
291 void exti_init(exti_line_enum linex, exti_mode_enum mode, exti_trig_type_enum trig_type);
292 /* enable the interrupts from EXTI line x */
293 void exti_interrupt_enable(exti_line_enum linex);
294 /* disable the interrupts from EXTI line x */
295 void exti_interrupt_disable(exti_line_enum linex);
296 /* enable the events from EXTI line x */
297 void exti_event_enable(exti_line_enum linex);
298 /* disable the events from EXTI line x */
299 void exti_event_disable(exti_line_enum linex);
300 
301 /* interrupt and flag functions */
302 /* enable EXTI software interrupt event */
303 void exti_software_interrupt_enable(exti_line_enum linex);
304 /* disable EXTI software interrupt event */
305 void exti_software_interrupt_disable(exti_line_enum linex);
306 /* get EXTI lines pending flag */
307 FlagStatus exti_flag_get(exti_line_enum linex);
308 /* clear EXTI lines pending flag */
309 void exti_flag_clear(exti_line_enum linex);
310 /* get EXTI lines flag when the interrupt flag is set */
311 FlagStatus exti_interrupt_flag_get(exti_line_enum linex);
312 /* clear EXTI lines pending flag */
313 void exti_interrupt_flag_clear(exti_line_enum linex);
314 
315 #endif /* gd32l23x_EXTI_H */
316