Removed excess trailing spaces before new lines on licenses.
[betaflight.git] / src / main / drivers / io_def_generated.h
blobf3bfd0c700b53f756bd0a2399feea79744f83255
1 /*
2 * This file is part of Cleanflight and Betaflight.
4 * Cleanflight and Betaflight are free software. You can redistribute
5 * this software and/or modify this software under the terms of the
6 * GNU General Public License as published by the Free Software
7 * Foundation, either version 3 of the License, or (at your option)
8 * any later version.
10 * Cleanflight and Betaflight are distributed in the hope that they
11 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this software.
18 * If not, see <http://www.gnu.org/licenses/>.
21 #pragma once
23 // this file is automatically generated by src/utils/def_generated.pl script
24 // do not modify this file directly, your changes will be lost
26 // DEFIO_PORT_<port>_USED_MASK is bitmask of used pins on target
27 // DEFIO_PORT_<port>_USED_COUNT is count of used pins on target
29 #if defined(TARGET_IO_PORTA)
30 # define DEFIO_PORT_A_USED_MASK TARGET_IO_PORTA
31 # define DEFIO_PORT_A_USED_COUNT BITCOUNT(DEFIO_PORT_A_USED_MASK)
32 #else
33 # define DEFIO_PORT_A_USED_MASK 0
34 # define DEFIO_PORT_A_USED_COUNT 0
35 #endif
36 #define DEFIO_PORT_A_OFFSET (0)
38 #if defined(TARGET_IO_PORTB)
39 # define DEFIO_PORT_B_USED_MASK TARGET_IO_PORTB
40 # define DEFIO_PORT_B_USED_COUNT BITCOUNT(DEFIO_PORT_B_USED_MASK)
41 #else
42 # define DEFIO_PORT_B_USED_MASK 0
43 # define DEFIO_PORT_B_USED_COUNT 0
44 #endif
45 #define DEFIO_PORT_B_OFFSET (DEFIO_PORT_A_USED_COUNT)
47 #if defined(TARGET_IO_PORTC)
48 # define DEFIO_PORT_C_USED_MASK TARGET_IO_PORTC
49 # define DEFIO_PORT_C_USED_COUNT BITCOUNT(DEFIO_PORT_C_USED_MASK)
50 #else
51 # define DEFIO_PORT_C_USED_MASK 0
52 # define DEFIO_PORT_C_USED_COUNT 0
53 #endif
54 #define DEFIO_PORT_C_OFFSET (DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT)
56 #if defined(TARGET_IO_PORTD)
57 # define DEFIO_PORT_D_USED_MASK TARGET_IO_PORTD
58 # define DEFIO_PORT_D_USED_COUNT BITCOUNT(DEFIO_PORT_D_USED_MASK)
59 #else
60 # define DEFIO_PORT_D_USED_MASK 0
61 # define DEFIO_PORT_D_USED_COUNT 0
62 #endif
63 #define DEFIO_PORT_D_OFFSET (DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT)
65 #if defined(TARGET_IO_PORTE)
66 # define DEFIO_PORT_E_USED_MASK TARGET_IO_PORTE
67 # define DEFIO_PORT_E_USED_COUNT BITCOUNT(DEFIO_PORT_E_USED_MASK)
68 #else
69 # define DEFIO_PORT_E_USED_MASK 0
70 # define DEFIO_PORT_E_USED_COUNT 0
71 #endif
72 #define DEFIO_PORT_E_OFFSET (DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT)
74 #if defined(TARGET_IO_PORTF)
75 # define DEFIO_PORT_F_USED_MASK TARGET_IO_PORTF
76 # define DEFIO_PORT_F_USED_COUNT BITCOUNT(DEFIO_PORT_F_USED_MASK)
77 #else
78 # define DEFIO_PORT_F_USED_MASK 0
79 # define DEFIO_PORT_F_USED_COUNT 0
80 #endif
81 #define DEFIO_PORT_F_OFFSET (DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT+DEFIO_PORT_E_USED_COUNT)
83 #if defined(TARGET_IO_PORTG)
84 # define DEFIO_PORT_G_USED_MASK TARGET_IO_PORTG
85 # define DEFIO_PORT_G_USED_COUNT BITCOUNT(DEFIO_PORT_G_USED_MASK)
86 #else
87 # define DEFIO_PORT_G_USED_MASK 0
88 # define DEFIO_PORT_G_USED_COUNT 0
89 #endif
90 #define DEFIO_PORT_G_OFFSET (DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT+DEFIO_PORT_E_USED_COUNT+DEFIO_PORT_F_USED_COUNT)
94 // DEFIO_GPIOID__<port> maps to port index
95 #define DEFIO_GPIOID__A 0
96 #define DEFIO_GPIOID__B 1
97 #define DEFIO_GPIOID__C 2
98 #define DEFIO_GPIOID__D 3
99 #define DEFIO_GPIOID__E 4
100 #define DEFIO_GPIOID__F 5
101 #define DEFIO_GPIOID__G 6
103 // DEFIO_TAG__P<port><pin> will expand to TAG if defined for target, error is triggered otherwise
104 // DEFIO_TAG_E__P<port><pin> will expand to TAG if defined, to NONE otherwise (usefull for tables that are CPU-specific)
105 // DEFIO_REC__P<port><pin> will expand to ioRec* (using DEFIO_REC_INDEX(idx))
107 #if DEFIO_PORT_A_USED_MASK & BIT(0)
108 # define DEFIO_TAG__PA0 DEFIO_TAG_MAKE(DEFIO_GPIOID__A, 0)
109 # define DEFIO_TAG_E__PA0 DEFIO_TAG_MAKE(DEFIO_GPIOID__A, 0)
110 # define DEFIO_REC__PA0 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_A_USED_MASK & (BIT(0) - 1)) + 0)
111 #else
112 # define DEFIO_TAG__PA0 defio_error_PA0_is_not_supported_on_TARGET
113 # define DEFIO_TAG_E__PA0 DEFIO_TAG_E__NONE
114 # define DEFIO_REC__PA0 defio_error_PA0_is_not_supported_on_TARGET
115 #endif
116 #if DEFIO_PORT_A_USED_MASK & BIT(1)
117 # define DEFIO_TAG__PA1 DEFIO_TAG_MAKE(DEFIO_GPIOID__A, 1)
118 # define DEFIO_TAG_E__PA1 DEFIO_TAG_MAKE(DEFIO_GPIOID__A, 1)
119 # define DEFIO_REC__PA1 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_A_USED_MASK & (BIT(1) - 1)) + 0)
120 #else
121 # define DEFIO_TAG__PA1 defio_error_PA1_is_not_supported_on_TARGET
122 # define DEFIO_TAG_E__PA1 DEFIO_TAG_E__NONE
123 # define DEFIO_REC__PA1 defio_error_PA1_is_not_supported_on_TARGET
124 #endif
125 #if DEFIO_PORT_A_USED_MASK & BIT(2)
126 # define DEFIO_TAG__PA2 DEFIO_TAG_MAKE(DEFIO_GPIOID__A, 2)
127 # define DEFIO_TAG_E__PA2 DEFIO_TAG_MAKE(DEFIO_GPIOID__A, 2)
128 # define DEFIO_REC__PA2 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_A_USED_MASK & (BIT(2) - 1)) + 0)
129 #else
130 # define DEFIO_TAG__PA2 defio_error_PA2_is_not_supported_on_TARGET
131 # define DEFIO_TAG_E__PA2 DEFIO_TAG_E__NONE
132 # define DEFIO_REC__PA2 defio_error_PA2_is_not_supported_on_TARGET
133 #endif
134 #if DEFIO_PORT_A_USED_MASK & BIT(3)
135 # define DEFIO_TAG__PA3 DEFIO_TAG_MAKE(DEFIO_GPIOID__A, 3)
136 # define DEFIO_TAG_E__PA3 DEFIO_TAG_MAKE(DEFIO_GPIOID__A, 3)
137 # define DEFIO_REC__PA3 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_A_USED_MASK & (BIT(3) - 1)) + 0)
138 #else
139 # define DEFIO_TAG__PA3 defio_error_PA3_is_not_supported_on_TARGET
140 # define DEFIO_TAG_E__PA3 DEFIO_TAG_E__NONE
141 # define DEFIO_REC__PA3 defio_error_PA3_is_not_supported_on_TARGET
142 #endif
143 #if DEFIO_PORT_A_USED_MASK & BIT(4)
144 # define DEFIO_TAG__PA4 DEFIO_TAG_MAKE(DEFIO_GPIOID__A, 4)
145 # define DEFIO_TAG_E__PA4 DEFIO_TAG_MAKE(DEFIO_GPIOID__A, 4)
146 # define DEFIO_REC__PA4 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_A_USED_MASK & (BIT(4) - 1)) + 0)
147 #else
148 # define DEFIO_TAG__PA4 defio_error_PA4_is_not_supported_on_TARGET
149 # define DEFIO_TAG_E__PA4 DEFIO_TAG_E__NONE
150 # define DEFIO_REC__PA4 defio_error_PA4_is_not_supported_on_TARGET
151 #endif
152 #if DEFIO_PORT_A_USED_MASK & BIT(5)
153 # define DEFIO_TAG__PA5 DEFIO_TAG_MAKE(DEFIO_GPIOID__A, 5)
154 # define DEFIO_TAG_E__PA5 DEFIO_TAG_MAKE(DEFIO_GPIOID__A, 5)
155 # define DEFIO_REC__PA5 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_A_USED_MASK & (BIT(5) - 1)) + 0)
156 #else
157 # define DEFIO_TAG__PA5 defio_error_PA5_is_not_supported_on_TARGET
158 # define DEFIO_TAG_E__PA5 DEFIO_TAG_E__NONE
159 # define DEFIO_REC__PA5 defio_error_PA5_is_not_supported_on_TARGET
160 #endif
161 #if DEFIO_PORT_A_USED_MASK & BIT(6)
162 # define DEFIO_TAG__PA6 DEFIO_TAG_MAKE(DEFIO_GPIOID__A, 6)
163 # define DEFIO_TAG_E__PA6 DEFIO_TAG_MAKE(DEFIO_GPIOID__A, 6)
164 # define DEFIO_REC__PA6 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_A_USED_MASK & (BIT(6) - 1)) + 0)
165 #else
166 # define DEFIO_TAG__PA6 defio_error_PA6_is_not_supported_on_TARGET
167 # define DEFIO_TAG_E__PA6 DEFIO_TAG_E__NONE
168 # define DEFIO_REC__PA6 defio_error_PA6_is_not_supported_on_TARGET
169 #endif
170 #if DEFIO_PORT_A_USED_MASK & BIT(7)
171 # define DEFIO_TAG__PA7 DEFIO_TAG_MAKE(DEFIO_GPIOID__A, 7)
172 # define DEFIO_TAG_E__PA7 DEFIO_TAG_MAKE(DEFIO_GPIOID__A, 7)
173 # define DEFIO_REC__PA7 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_A_USED_MASK & (BIT(7) - 1)) + 0)
174 #else
175 # define DEFIO_TAG__PA7 defio_error_PA7_is_not_supported_on_TARGET
176 # define DEFIO_TAG_E__PA7 DEFIO_TAG_E__NONE
177 # define DEFIO_REC__PA7 defio_error_PA7_is_not_supported_on_TARGET
178 #endif
179 #if DEFIO_PORT_A_USED_MASK & BIT(8)
180 # define DEFIO_TAG__PA8 DEFIO_TAG_MAKE(DEFIO_GPIOID__A, 8)
181 # define DEFIO_TAG_E__PA8 DEFIO_TAG_MAKE(DEFIO_GPIOID__A, 8)
182 # define DEFIO_REC__PA8 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_A_USED_MASK & (BIT(8) - 1)) + 0)
183 #else
184 # define DEFIO_TAG__PA8 defio_error_PA8_is_not_supported_on_TARGET
185 # define DEFIO_TAG_E__PA8 DEFIO_TAG_E__NONE
186 # define DEFIO_REC__PA8 defio_error_PA8_is_not_supported_on_TARGET
187 #endif
188 #if DEFIO_PORT_A_USED_MASK & BIT(9)
189 # define DEFIO_TAG__PA9 DEFIO_TAG_MAKE(DEFIO_GPIOID__A, 9)
190 # define DEFIO_TAG_E__PA9 DEFIO_TAG_MAKE(DEFIO_GPIOID__A, 9)
191 # define DEFIO_REC__PA9 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_A_USED_MASK & (BIT(9) - 1)) + 0)
192 #else
193 # define DEFIO_TAG__PA9 defio_error_PA9_is_not_supported_on_TARGET
194 # define DEFIO_TAG_E__PA9 DEFIO_TAG_E__NONE
195 # define DEFIO_REC__PA9 defio_error_PA9_is_not_supported_on_TARGET
196 #endif
197 #if DEFIO_PORT_A_USED_MASK & BIT(10)
198 # define DEFIO_TAG__PA10 DEFIO_TAG_MAKE(DEFIO_GPIOID__A, 10)
199 # define DEFIO_TAG_E__PA10 DEFIO_TAG_MAKE(DEFIO_GPIOID__A, 10)
200 # define DEFIO_REC__PA10 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_A_USED_MASK & (BIT(10) - 1)) + 0)
201 #else
202 # define DEFIO_TAG__PA10 defio_error_PA10_is_not_supported_on_TARGET
203 # define DEFIO_TAG_E__PA10 DEFIO_TAG_E__NONE
204 # define DEFIO_REC__PA10 defio_error_PA10_is_not_supported_on_TARGET
205 #endif
206 #if DEFIO_PORT_A_USED_MASK & BIT(11)
207 # define DEFIO_TAG__PA11 DEFIO_TAG_MAKE(DEFIO_GPIOID__A, 11)
208 # define DEFIO_TAG_E__PA11 DEFIO_TAG_MAKE(DEFIO_GPIOID__A, 11)
209 # define DEFIO_REC__PA11 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_A_USED_MASK & (BIT(11) - 1)) + 0)
210 #else
211 # define DEFIO_TAG__PA11 defio_error_PA11_is_not_supported_on_TARGET
212 # define DEFIO_TAG_E__PA11 DEFIO_TAG_E__NONE
213 # define DEFIO_REC__PA11 defio_error_PA11_is_not_supported_on_TARGET
214 #endif
215 #if DEFIO_PORT_A_USED_MASK & BIT(12)
216 # define DEFIO_TAG__PA12 DEFIO_TAG_MAKE(DEFIO_GPIOID__A, 12)
217 # define DEFIO_TAG_E__PA12 DEFIO_TAG_MAKE(DEFIO_GPIOID__A, 12)
218 # define DEFIO_REC__PA12 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_A_USED_MASK & (BIT(12) - 1)) + 0)
219 #else
220 # define DEFIO_TAG__PA12 defio_error_PA12_is_not_supported_on_TARGET
221 # define DEFIO_TAG_E__PA12 DEFIO_TAG_E__NONE
222 # define DEFIO_REC__PA12 defio_error_PA12_is_not_supported_on_TARGET
223 #endif
224 #if DEFIO_PORT_A_USED_MASK & BIT(13)
225 # define DEFIO_TAG__PA13 DEFIO_TAG_MAKE(DEFIO_GPIOID__A, 13)
226 # define DEFIO_TAG_E__PA13 DEFIO_TAG_MAKE(DEFIO_GPIOID__A, 13)
227 # define DEFIO_REC__PA13 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_A_USED_MASK & (BIT(13) - 1)) + 0)
228 #else
229 # define DEFIO_TAG__PA13 defio_error_PA13_is_not_supported_on_TARGET
230 # define DEFIO_TAG_E__PA13 DEFIO_TAG_E__NONE
231 # define DEFIO_REC__PA13 defio_error_PA13_is_not_supported_on_TARGET
232 #endif
233 #if DEFIO_PORT_A_USED_MASK & BIT(14)
234 # define DEFIO_TAG__PA14 DEFIO_TAG_MAKE(DEFIO_GPIOID__A, 14)
235 # define DEFIO_TAG_E__PA14 DEFIO_TAG_MAKE(DEFIO_GPIOID__A, 14)
236 # define DEFIO_REC__PA14 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_A_USED_MASK & (BIT(14) - 1)) + 0)
237 #else
238 # define DEFIO_TAG__PA14 defio_error_PA14_is_not_supported_on_TARGET
239 # define DEFIO_TAG_E__PA14 DEFIO_TAG_E__NONE
240 # define DEFIO_REC__PA14 defio_error_PA14_is_not_supported_on_TARGET
241 #endif
242 #if DEFIO_PORT_A_USED_MASK & BIT(15)
243 # define DEFIO_TAG__PA15 DEFIO_TAG_MAKE(DEFIO_GPIOID__A, 15)
244 # define DEFIO_TAG_E__PA15 DEFIO_TAG_MAKE(DEFIO_GPIOID__A, 15)
245 # define DEFIO_REC__PA15 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_A_USED_MASK & (BIT(15) - 1)) + 0)
246 #else
247 # define DEFIO_TAG__PA15 defio_error_PA15_is_not_supported_on_TARGET
248 # define DEFIO_TAG_E__PA15 DEFIO_TAG_E__NONE
249 # define DEFIO_REC__PA15 defio_error_PA15_is_not_supported_on_TARGET
250 #endif
251 #if DEFIO_PORT_B_USED_MASK & BIT(0)
252 # define DEFIO_TAG__PB0 DEFIO_TAG_MAKE(DEFIO_GPIOID__B, 0)
253 # define DEFIO_TAG_E__PB0 DEFIO_TAG_MAKE(DEFIO_GPIOID__B, 0)
254 # define DEFIO_REC__PB0 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_B_USED_MASK & (BIT(0) - 1)) + DEFIO_PORT_A_USED_COUNT)
255 #else
256 # define DEFIO_TAG__PB0 defio_error_PB0_is_not_supported_on_TARGET
257 # define DEFIO_TAG_E__PB0 DEFIO_TAG_E__NONE
258 # define DEFIO_REC__PB0 defio_error_PB0_is_not_supported_on_TARGET
259 #endif
260 #if DEFIO_PORT_B_USED_MASK & BIT(1)
261 # define DEFIO_TAG__PB1 DEFIO_TAG_MAKE(DEFIO_GPIOID__B, 1)
262 # define DEFIO_TAG_E__PB1 DEFIO_TAG_MAKE(DEFIO_GPIOID__B, 1)
263 # define DEFIO_REC__PB1 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_B_USED_MASK & (BIT(1) - 1)) + DEFIO_PORT_A_USED_COUNT)
264 #else
265 # define DEFIO_TAG__PB1 defio_error_PB1_is_not_supported_on_TARGET
266 # define DEFIO_TAG_E__PB1 DEFIO_TAG_E__NONE
267 # define DEFIO_REC__PB1 defio_error_PB1_is_not_supported_on_TARGET
268 #endif
269 #if DEFIO_PORT_B_USED_MASK & BIT(2)
270 # define DEFIO_TAG__PB2 DEFIO_TAG_MAKE(DEFIO_GPIOID__B, 2)
271 # define DEFIO_TAG_E__PB2 DEFIO_TAG_MAKE(DEFIO_GPIOID__B, 2)
272 # define DEFIO_REC__PB2 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_B_USED_MASK & (BIT(2) - 1)) + DEFIO_PORT_A_USED_COUNT)
273 #else
274 # define DEFIO_TAG__PB2 defio_error_PB2_is_not_supported_on_TARGET
275 # define DEFIO_TAG_E__PB2 DEFIO_TAG_E__NONE
276 # define DEFIO_REC__PB2 defio_error_PB2_is_not_supported_on_TARGET
277 #endif
278 #if DEFIO_PORT_B_USED_MASK & BIT(3)
279 # define DEFIO_TAG__PB3 DEFIO_TAG_MAKE(DEFIO_GPIOID__B, 3)
280 # define DEFIO_TAG_E__PB3 DEFIO_TAG_MAKE(DEFIO_GPIOID__B, 3)
281 # define DEFIO_REC__PB3 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_B_USED_MASK & (BIT(3) - 1)) + DEFIO_PORT_A_USED_COUNT)
282 #else
283 # define DEFIO_TAG__PB3 defio_error_PB3_is_not_supported_on_TARGET
284 # define DEFIO_TAG_E__PB3 DEFIO_TAG_E__NONE
285 # define DEFIO_REC__PB3 defio_error_PB3_is_not_supported_on_TARGET
286 #endif
287 #if DEFIO_PORT_B_USED_MASK & BIT(4)
288 # define DEFIO_TAG__PB4 DEFIO_TAG_MAKE(DEFIO_GPIOID__B, 4)
289 # define DEFIO_TAG_E__PB4 DEFIO_TAG_MAKE(DEFIO_GPIOID__B, 4)
290 # define DEFIO_REC__PB4 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_B_USED_MASK & (BIT(4) - 1)) + DEFIO_PORT_A_USED_COUNT)
291 #else
292 # define DEFIO_TAG__PB4 defio_error_PB4_is_not_supported_on_TARGET
293 # define DEFIO_TAG_E__PB4 DEFIO_TAG_E__NONE
294 # define DEFIO_REC__PB4 defio_error_PB4_is_not_supported_on_TARGET
295 #endif
296 #if DEFIO_PORT_B_USED_MASK & BIT(5)
297 # define DEFIO_TAG__PB5 DEFIO_TAG_MAKE(DEFIO_GPIOID__B, 5)
298 # define DEFIO_TAG_E__PB5 DEFIO_TAG_MAKE(DEFIO_GPIOID__B, 5)
299 # define DEFIO_REC__PB5 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_B_USED_MASK & (BIT(5) - 1)) + DEFIO_PORT_A_USED_COUNT)
300 #else
301 # define DEFIO_TAG__PB5 defio_error_PB5_is_not_supported_on_TARGET
302 # define DEFIO_TAG_E__PB5 DEFIO_TAG_E__NONE
303 # define DEFIO_REC__PB5 defio_error_PB5_is_not_supported_on_TARGET
304 #endif
305 #if DEFIO_PORT_B_USED_MASK & BIT(6)
306 # define DEFIO_TAG__PB6 DEFIO_TAG_MAKE(DEFIO_GPIOID__B, 6)
307 # define DEFIO_TAG_E__PB6 DEFIO_TAG_MAKE(DEFIO_GPIOID__B, 6)
308 # define DEFIO_REC__PB6 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_B_USED_MASK & (BIT(6) - 1)) + DEFIO_PORT_A_USED_COUNT)
309 #else
310 # define DEFIO_TAG__PB6 defio_error_PB6_is_not_supported_on_TARGET
311 # define DEFIO_TAG_E__PB6 DEFIO_TAG_E__NONE
312 # define DEFIO_REC__PB6 defio_error_PB6_is_not_supported_on_TARGET
313 #endif
314 #if DEFIO_PORT_B_USED_MASK & BIT(7)
315 # define DEFIO_TAG__PB7 DEFIO_TAG_MAKE(DEFIO_GPIOID__B, 7)
316 # define DEFIO_TAG_E__PB7 DEFIO_TAG_MAKE(DEFIO_GPIOID__B, 7)
317 # define DEFIO_REC__PB7 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_B_USED_MASK & (BIT(7) - 1)) + DEFIO_PORT_A_USED_COUNT)
318 #else
319 # define DEFIO_TAG__PB7 defio_error_PB7_is_not_supported_on_TARGET
320 # define DEFIO_TAG_E__PB7 DEFIO_TAG_E__NONE
321 # define DEFIO_REC__PB7 defio_error_PB7_is_not_supported_on_TARGET
322 #endif
323 #if DEFIO_PORT_B_USED_MASK & BIT(8)
324 # define DEFIO_TAG__PB8 DEFIO_TAG_MAKE(DEFIO_GPIOID__B, 8)
325 # define DEFIO_TAG_E__PB8 DEFIO_TAG_MAKE(DEFIO_GPIOID__B, 8)
326 # define DEFIO_REC__PB8 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_B_USED_MASK & (BIT(8) - 1)) + DEFIO_PORT_A_USED_COUNT)
327 #else
328 # define DEFIO_TAG__PB8 defio_error_PB8_is_not_supported_on_TARGET
329 # define DEFIO_TAG_E__PB8 DEFIO_TAG_E__NONE
330 # define DEFIO_REC__PB8 defio_error_PB8_is_not_supported_on_TARGET
331 #endif
332 #if DEFIO_PORT_B_USED_MASK & BIT(9)
333 # define DEFIO_TAG__PB9 DEFIO_TAG_MAKE(DEFIO_GPIOID__B, 9)
334 # define DEFIO_TAG_E__PB9 DEFIO_TAG_MAKE(DEFIO_GPIOID__B, 9)
335 # define DEFIO_REC__PB9 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_B_USED_MASK & (BIT(9) - 1)) + DEFIO_PORT_A_USED_COUNT)
336 #else
337 # define DEFIO_TAG__PB9 defio_error_PB9_is_not_supported_on_TARGET
338 # define DEFIO_TAG_E__PB9 DEFIO_TAG_E__NONE
339 # define DEFIO_REC__PB9 defio_error_PB9_is_not_supported_on_TARGET
340 #endif
341 #if DEFIO_PORT_B_USED_MASK & BIT(10)
342 # define DEFIO_TAG__PB10 DEFIO_TAG_MAKE(DEFIO_GPIOID__B, 10)
343 # define DEFIO_TAG_E__PB10 DEFIO_TAG_MAKE(DEFIO_GPIOID__B, 10)
344 # define DEFIO_REC__PB10 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_B_USED_MASK & (BIT(10) - 1)) + DEFIO_PORT_A_USED_COUNT)
345 #else
346 # define DEFIO_TAG__PB10 defio_error_PB10_is_not_supported_on_TARGET
347 # define DEFIO_TAG_E__PB10 DEFIO_TAG_E__NONE
348 # define DEFIO_REC__PB10 defio_error_PB10_is_not_supported_on_TARGET
349 #endif
350 #if DEFIO_PORT_B_USED_MASK & BIT(11)
351 # define DEFIO_TAG__PB11 DEFIO_TAG_MAKE(DEFIO_GPIOID__B, 11)
352 # define DEFIO_TAG_E__PB11 DEFIO_TAG_MAKE(DEFIO_GPIOID__B, 11)
353 # define DEFIO_REC__PB11 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_B_USED_MASK & (BIT(11) - 1)) + DEFIO_PORT_A_USED_COUNT)
354 #else
355 # define DEFIO_TAG__PB11 defio_error_PB11_is_not_supported_on_TARGET
356 # define DEFIO_TAG_E__PB11 DEFIO_TAG_E__NONE
357 # define DEFIO_REC__PB11 defio_error_PB11_is_not_supported_on_TARGET
358 #endif
359 #if DEFIO_PORT_B_USED_MASK & BIT(12)
360 # define DEFIO_TAG__PB12 DEFIO_TAG_MAKE(DEFIO_GPIOID__B, 12)
361 # define DEFIO_TAG_E__PB12 DEFIO_TAG_MAKE(DEFIO_GPIOID__B, 12)
362 # define DEFIO_REC__PB12 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_B_USED_MASK & (BIT(12) - 1)) + DEFIO_PORT_A_USED_COUNT)
363 #else
364 # define DEFIO_TAG__PB12 defio_error_PB12_is_not_supported_on_TARGET
365 # define DEFIO_TAG_E__PB12 DEFIO_TAG_E__NONE
366 # define DEFIO_REC__PB12 defio_error_PB12_is_not_supported_on_TARGET
367 #endif
368 #if DEFIO_PORT_B_USED_MASK & BIT(13)
369 # define DEFIO_TAG__PB13 DEFIO_TAG_MAKE(DEFIO_GPIOID__B, 13)
370 # define DEFIO_TAG_E__PB13 DEFIO_TAG_MAKE(DEFIO_GPIOID__B, 13)
371 # define DEFIO_REC__PB13 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_B_USED_MASK & (BIT(13) - 1)) + DEFIO_PORT_A_USED_COUNT)
372 #else
373 # define DEFIO_TAG__PB13 defio_error_PB13_is_not_supported_on_TARGET
374 # define DEFIO_TAG_E__PB13 DEFIO_TAG_E__NONE
375 # define DEFIO_REC__PB13 defio_error_PB13_is_not_supported_on_TARGET
376 #endif
377 #if DEFIO_PORT_B_USED_MASK & BIT(14)
378 # define DEFIO_TAG__PB14 DEFIO_TAG_MAKE(DEFIO_GPIOID__B, 14)
379 # define DEFIO_TAG_E__PB14 DEFIO_TAG_MAKE(DEFIO_GPIOID__B, 14)
380 # define DEFIO_REC__PB14 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_B_USED_MASK & (BIT(14) - 1)) + DEFIO_PORT_A_USED_COUNT)
381 #else
382 # define DEFIO_TAG__PB14 defio_error_PB14_is_not_supported_on_TARGET
383 # define DEFIO_TAG_E__PB14 DEFIO_TAG_E__NONE
384 # define DEFIO_REC__PB14 defio_error_PB14_is_not_supported_on_TARGET
385 #endif
386 #if DEFIO_PORT_B_USED_MASK & BIT(15)
387 # define DEFIO_TAG__PB15 DEFIO_TAG_MAKE(DEFIO_GPIOID__B, 15)
388 # define DEFIO_TAG_E__PB15 DEFIO_TAG_MAKE(DEFIO_GPIOID__B, 15)
389 # define DEFIO_REC__PB15 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_B_USED_MASK & (BIT(15) - 1)) + DEFIO_PORT_A_USED_COUNT)
390 #else
391 # define DEFIO_TAG__PB15 defio_error_PB15_is_not_supported_on_TARGET
392 # define DEFIO_TAG_E__PB15 DEFIO_TAG_E__NONE
393 # define DEFIO_REC__PB15 defio_error_PB15_is_not_supported_on_TARGET
394 #endif
395 #if DEFIO_PORT_C_USED_MASK & BIT(0)
396 # define DEFIO_TAG__PC0 DEFIO_TAG_MAKE(DEFIO_GPIOID__C, 0)
397 # define DEFIO_TAG_E__PC0 DEFIO_TAG_MAKE(DEFIO_GPIOID__C, 0)
398 # define DEFIO_REC__PC0 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_C_USED_MASK & (BIT(0) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT)
399 #else
400 # define DEFIO_TAG__PC0 defio_error_PC0_is_not_supported_on_TARGET
401 # define DEFIO_TAG_E__PC0 DEFIO_TAG_E__NONE
402 # define DEFIO_REC__PC0 defio_error_PC0_is_not_supported_on_TARGET
403 #endif
404 #if DEFIO_PORT_C_USED_MASK & BIT(1)
405 # define DEFIO_TAG__PC1 DEFIO_TAG_MAKE(DEFIO_GPIOID__C, 1)
406 # define DEFIO_TAG_E__PC1 DEFIO_TAG_MAKE(DEFIO_GPIOID__C, 1)
407 # define DEFIO_REC__PC1 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_C_USED_MASK & (BIT(1) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT)
408 #else
409 # define DEFIO_TAG__PC1 defio_error_PC1_is_not_supported_on_TARGET
410 # define DEFIO_TAG_E__PC1 DEFIO_TAG_E__NONE
411 # define DEFIO_REC__PC1 defio_error_PC1_is_not_supported_on_TARGET
412 #endif
413 #if DEFIO_PORT_C_USED_MASK & BIT(2)
414 # define DEFIO_TAG__PC2 DEFIO_TAG_MAKE(DEFIO_GPIOID__C, 2)
415 # define DEFIO_TAG_E__PC2 DEFIO_TAG_MAKE(DEFIO_GPIOID__C, 2)
416 # define DEFIO_REC__PC2 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_C_USED_MASK & (BIT(2) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT)
417 #else
418 # define DEFIO_TAG__PC2 defio_error_PC2_is_not_supported_on_TARGET
419 # define DEFIO_TAG_E__PC2 DEFIO_TAG_E__NONE
420 # define DEFIO_REC__PC2 defio_error_PC2_is_not_supported_on_TARGET
421 #endif
422 #if DEFIO_PORT_C_USED_MASK & BIT(3)
423 # define DEFIO_TAG__PC3 DEFIO_TAG_MAKE(DEFIO_GPIOID__C, 3)
424 # define DEFIO_TAG_E__PC3 DEFIO_TAG_MAKE(DEFIO_GPIOID__C, 3)
425 # define DEFIO_REC__PC3 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_C_USED_MASK & (BIT(3) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT)
426 #else
427 # define DEFIO_TAG__PC3 defio_error_PC3_is_not_supported_on_TARGET
428 # define DEFIO_TAG_E__PC3 DEFIO_TAG_E__NONE
429 # define DEFIO_REC__PC3 defio_error_PC3_is_not_supported_on_TARGET
430 #endif
431 #if DEFIO_PORT_C_USED_MASK & BIT(4)
432 # define DEFIO_TAG__PC4 DEFIO_TAG_MAKE(DEFIO_GPIOID__C, 4)
433 # define DEFIO_TAG_E__PC4 DEFIO_TAG_MAKE(DEFIO_GPIOID__C, 4)
434 # define DEFIO_REC__PC4 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_C_USED_MASK & (BIT(4) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT)
435 #else
436 # define DEFIO_TAG__PC4 defio_error_PC4_is_not_supported_on_TARGET
437 # define DEFIO_TAG_E__PC4 DEFIO_TAG_E__NONE
438 # define DEFIO_REC__PC4 defio_error_PC4_is_not_supported_on_TARGET
439 #endif
440 #if DEFIO_PORT_C_USED_MASK & BIT(5)
441 # define DEFIO_TAG__PC5 DEFIO_TAG_MAKE(DEFIO_GPIOID__C, 5)
442 # define DEFIO_TAG_E__PC5 DEFIO_TAG_MAKE(DEFIO_GPIOID__C, 5)
443 # define DEFIO_REC__PC5 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_C_USED_MASK & (BIT(5) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT)
444 #else
445 # define DEFIO_TAG__PC5 defio_error_PC5_is_not_supported_on_TARGET
446 # define DEFIO_TAG_E__PC5 DEFIO_TAG_E__NONE
447 # define DEFIO_REC__PC5 defio_error_PC5_is_not_supported_on_TARGET
448 #endif
449 #if DEFIO_PORT_C_USED_MASK & BIT(6)
450 # define DEFIO_TAG__PC6 DEFIO_TAG_MAKE(DEFIO_GPIOID__C, 6)
451 # define DEFIO_TAG_E__PC6 DEFIO_TAG_MAKE(DEFIO_GPIOID__C, 6)
452 # define DEFIO_REC__PC6 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_C_USED_MASK & (BIT(6) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT)
453 #else
454 # define DEFIO_TAG__PC6 defio_error_PC6_is_not_supported_on_TARGET
455 # define DEFIO_TAG_E__PC6 DEFIO_TAG_E__NONE
456 # define DEFIO_REC__PC6 defio_error_PC6_is_not_supported_on_TARGET
457 #endif
458 #if DEFIO_PORT_C_USED_MASK & BIT(7)
459 # define DEFIO_TAG__PC7 DEFIO_TAG_MAKE(DEFIO_GPIOID__C, 7)
460 # define DEFIO_TAG_E__PC7 DEFIO_TAG_MAKE(DEFIO_GPIOID__C, 7)
461 # define DEFIO_REC__PC7 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_C_USED_MASK & (BIT(7) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT)
462 #else
463 # define DEFIO_TAG__PC7 defio_error_PC7_is_not_supported_on_TARGET
464 # define DEFIO_TAG_E__PC7 DEFIO_TAG_E__NONE
465 # define DEFIO_REC__PC7 defio_error_PC7_is_not_supported_on_TARGET
466 #endif
467 #if DEFIO_PORT_C_USED_MASK & BIT(8)
468 # define DEFIO_TAG__PC8 DEFIO_TAG_MAKE(DEFIO_GPIOID__C, 8)
469 # define DEFIO_TAG_E__PC8 DEFIO_TAG_MAKE(DEFIO_GPIOID__C, 8)
470 # define DEFIO_REC__PC8 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_C_USED_MASK & (BIT(8) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT)
471 #else
472 # define DEFIO_TAG__PC8 defio_error_PC8_is_not_supported_on_TARGET
473 # define DEFIO_TAG_E__PC8 DEFIO_TAG_E__NONE
474 # define DEFIO_REC__PC8 defio_error_PC8_is_not_supported_on_TARGET
475 #endif
476 #if DEFIO_PORT_C_USED_MASK & BIT(9)
477 # define DEFIO_TAG__PC9 DEFIO_TAG_MAKE(DEFIO_GPIOID__C, 9)
478 # define DEFIO_TAG_E__PC9 DEFIO_TAG_MAKE(DEFIO_GPIOID__C, 9)
479 # define DEFIO_REC__PC9 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_C_USED_MASK & (BIT(9) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT)
480 #else
481 # define DEFIO_TAG__PC9 defio_error_PC9_is_not_supported_on_TARGET
482 # define DEFIO_TAG_E__PC9 DEFIO_TAG_E__NONE
483 # define DEFIO_REC__PC9 defio_error_PC9_is_not_supported_on_TARGET
484 #endif
485 #if DEFIO_PORT_C_USED_MASK & BIT(10)
486 # define DEFIO_TAG__PC10 DEFIO_TAG_MAKE(DEFIO_GPIOID__C, 10)
487 # define DEFIO_TAG_E__PC10 DEFIO_TAG_MAKE(DEFIO_GPIOID__C, 10)
488 # define DEFIO_REC__PC10 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_C_USED_MASK & (BIT(10) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT)
489 #else
490 # define DEFIO_TAG__PC10 defio_error_PC10_is_not_supported_on_TARGET
491 # define DEFIO_TAG_E__PC10 DEFIO_TAG_E__NONE
492 # define DEFIO_REC__PC10 defio_error_PC10_is_not_supported_on_TARGET
493 #endif
494 #if DEFIO_PORT_C_USED_MASK & BIT(11)
495 # define DEFIO_TAG__PC11 DEFIO_TAG_MAKE(DEFIO_GPIOID__C, 11)
496 # define DEFIO_TAG_E__PC11 DEFIO_TAG_MAKE(DEFIO_GPIOID__C, 11)
497 # define DEFIO_REC__PC11 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_C_USED_MASK & (BIT(11) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT)
498 #else
499 # define DEFIO_TAG__PC11 defio_error_PC11_is_not_supported_on_TARGET
500 # define DEFIO_TAG_E__PC11 DEFIO_TAG_E__NONE
501 # define DEFIO_REC__PC11 defio_error_PC11_is_not_supported_on_TARGET
502 #endif
503 #if DEFIO_PORT_C_USED_MASK & BIT(12)
504 # define DEFIO_TAG__PC12 DEFIO_TAG_MAKE(DEFIO_GPIOID__C, 12)
505 # define DEFIO_TAG_E__PC12 DEFIO_TAG_MAKE(DEFIO_GPIOID__C, 12)
506 # define DEFIO_REC__PC12 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_C_USED_MASK & (BIT(12) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT)
507 #else
508 # define DEFIO_TAG__PC12 defio_error_PC12_is_not_supported_on_TARGET
509 # define DEFIO_TAG_E__PC12 DEFIO_TAG_E__NONE
510 # define DEFIO_REC__PC12 defio_error_PC12_is_not_supported_on_TARGET
511 #endif
512 #if DEFIO_PORT_C_USED_MASK & BIT(13)
513 # define DEFIO_TAG__PC13 DEFIO_TAG_MAKE(DEFIO_GPIOID__C, 13)
514 # define DEFIO_TAG_E__PC13 DEFIO_TAG_MAKE(DEFIO_GPIOID__C, 13)
515 # define DEFIO_REC__PC13 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_C_USED_MASK & (BIT(13) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT)
516 #else
517 # define DEFIO_TAG__PC13 defio_error_PC13_is_not_supported_on_TARGET
518 # define DEFIO_TAG_E__PC13 DEFIO_TAG_E__NONE
519 # define DEFIO_REC__PC13 defio_error_PC13_is_not_supported_on_TARGET
520 #endif
521 #if DEFIO_PORT_C_USED_MASK & BIT(14)
522 # define DEFIO_TAG__PC14 DEFIO_TAG_MAKE(DEFIO_GPIOID__C, 14)
523 # define DEFIO_TAG_E__PC14 DEFIO_TAG_MAKE(DEFIO_GPIOID__C, 14)
524 # define DEFIO_REC__PC14 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_C_USED_MASK & (BIT(14) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT)
525 #else
526 # define DEFIO_TAG__PC14 defio_error_PC14_is_not_supported_on_TARGET
527 # define DEFIO_TAG_E__PC14 DEFIO_TAG_E__NONE
528 # define DEFIO_REC__PC14 defio_error_PC14_is_not_supported_on_TARGET
529 #endif
530 #if DEFIO_PORT_C_USED_MASK & BIT(15)
531 # define DEFIO_TAG__PC15 DEFIO_TAG_MAKE(DEFIO_GPIOID__C, 15)
532 # define DEFIO_TAG_E__PC15 DEFIO_TAG_MAKE(DEFIO_GPIOID__C, 15)
533 # define DEFIO_REC__PC15 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_C_USED_MASK & (BIT(15) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT)
534 #else
535 # define DEFIO_TAG__PC15 defio_error_PC15_is_not_supported_on_TARGET
536 # define DEFIO_TAG_E__PC15 DEFIO_TAG_E__NONE
537 # define DEFIO_REC__PC15 defio_error_PC15_is_not_supported_on_TARGET
538 #endif
539 #if DEFIO_PORT_D_USED_MASK & BIT(0)
540 # define DEFIO_TAG__PD0 DEFIO_TAG_MAKE(DEFIO_GPIOID__D, 0)
541 # define DEFIO_TAG_E__PD0 DEFIO_TAG_MAKE(DEFIO_GPIOID__D, 0)
542 # define DEFIO_REC__PD0 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_D_USED_MASK & (BIT(0) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT)
543 #else
544 # define DEFIO_TAG__PD0 defio_error_PD0_is_not_supported_on_TARGET
545 # define DEFIO_TAG_E__PD0 DEFIO_TAG_E__NONE
546 # define DEFIO_REC__PD0 defio_error_PD0_is_not_supported_on_TARGET
547 #endif
548 #if DEFIO_PORT_D_USED_MASK & BIT(1)
549 # define DEFIO_TAG__PD1 DEFIO_TAG_MAKE(DEFIO_GPIOID__D, 1)
550 # define DEFIO_TAG_E__PD1 DEFIO_TAG_MAKE(DEFIO_GPIOID__D, 1)
551 # define DEFIO_REC__PD1 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_D_USED_MASK & (BIT(1) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT)
552 #else
553 # define DEFIO_TAG__PD1 defio_error_PD1_is_not_supported_on_TARGET
554 # define DEFIO_TAG_E__PD1 DEFIO_TAG_E__NONE
555 # define DEFIO_REC__PD1 defio_error_PD1_is_not_supported_on_TARGET
556 #endif
557 #if DEFIO_PORT_D_USED_MASK & BIT(2)
558 # define DEFIO_TAG__PD2 DEFIO_TAG_MAKE(DEFIO_GPIOID__D, 2)
559 # define DEFIO_TAG_E__PD2 DEFIO_TAG_MAKE(DEFIO_GPIOID__D, 2)
560 # define DEFIO_REC__PD2 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_D_USED_MASK & (BIT(2) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT)
561 #else
562 # define DEFIO_TAG__PD2 defio_error_PD2_is_not_supported_on_TARGET
563 # define DEFIO_TAG_E__PD2 DEFIO_TAG_E__NONE
564 # define DEFIO_REC__PD2 defio_error_PD2_is_not_supported_on_TARGET
565 #endif
566 #if DEFIO_PORT_D_USED_MASK & BIT(3)
567 # define DEFIO_TAG__PD3 DEFIO_TAG_MAKE(DEFIO_GPIOID__D, 3)
568 # define DEFIO_TAG_E__PD3 DEFIO_TAG_MAKE(DEFIO_GPIOID__D, 3)
569 # define DEFIO_REC__PD3 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_D_USED_MASK & (BIT(3) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT)
570 #else
571 # define DEFIO_TAG__PD3 defio_error_PD3_is_not_supported_on_TARGET
572 # define DEFIO_TAG_E__PD3 DEFIO_TAG_E__NONE
573 # define DEFIO_REC__PD3 defio_error_PD3_is_not_supported_on_TARGET
574 #endif
575 #if DEFIO_PORT_D_USED_MASK & BIT(4)
576 # define DEFIO_TAG__PD4 DEFIO_TAG_MAKE(DEFIO_GPIOID__D, 4)
577 # define DEFIO_TAG_E__PD4 DEFIO_TAG_MAKE(DEFIO_GPIOID__D, 4)
578 # define DEFIO_REC__PD4 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_D_USED_MASK & (BIT(4) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT)
579 #else
580 # define DEFIO_TAG__PD4 defio_error_PD4_is_not_supported_on_TARGET
581 # define DEFIO_TAG_E__PD4 DEFIO_TAG_E__NONE
582 # define DEFIO_REC__PD4 defio_error_PD4_is_not_supported_on_TARGET
583 #endif
584 #if DEFIO_PORT_D_USED_MASK & BIT(5)
585 # define DEFIO_TAG__PD5 DEFIO_TAG_MAKE(DEFIO_GPIOID__D, 5)
586 # define DEFIO_TAG_E__PD5 DEFIO_TAG_MAKE(DEFIO_GPIOID__D, 5)
587 # define DEFIO_REC__PD5 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_D_USED_MASK & (BIT(5) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT)
588 #else
589 # define DEFIO_TAG__PD5 defio_error_PD5_is_not_supported_on_TARGET
590 # define DEFIO_TAG_E__PD5 DEFIO_TAG_E__NONE
591 # define DEFIO_REC__PD5 defio_error_PD5_is_not_supported_on_TARGET
592 #endif
593 #if DEFIO_PORT_D_USED_MASK & BIT(6)
594 # define DEFIO_TAG__PD6 DEFIO_TAG_MAKE(DEFIO_GPIOID__D, 6)
595 # define DEFIO_TAG_E__PD6 DEFIO_TAG_MAKE(DEFIO_GPIOID__D, 6)
596 # define DEFIO_REC__PD6 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_D_USED_MASK & (BIT(6) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT)
597 #else
598 # define DEFIO_TAG__PD6 defio_error_PD6_is_not_supported_on_TARGET
599 # define DEFIO_TAG_E__PD6 DEFIO_TAG_E__NONE
600 # define DEFIO_REC__PD6 defio_error_PD6_is_not_supported_on_TARGET
601 #endif
602 #if DEFIO_PORT_D_USED_MASK & BIT(7)
603 # define DEFIO_TAG__PD7 DEFIO_TAG_MAKE(DEFIO_GPIOID__D, 7)
604 # define DEFIO_TAG_E__PD7 DEFIO_TAG_MAKE(DEFIO_GPIOID__D, 7)
605 # define DEFIO_REC__PD7 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_D_USED_MASK & (BIT(7) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT)
606 #else
607 # define DEFIO_TAG__PD7 defio_error_PD7_is_not_supported_on_TARGET
608 # define DEFIO_TAG_E__PD7 DEFIO_TAG_E__NONE
609 # define DEFIO_REC__PD7 defio_error_PD7_is_not_supported_on_TARGET
610 #endif
611 #if DEFIO_PORT_D_USED_MASK & BIT(8)
612 # define DEFIO_TAG__PD8 DEFIO_TAG_MAKE(DEFIO_GPIOID__D, 8)
613 # define DEFIO_TAG_E__PD8 DEFIO_TAG_MAKE(DEFIO_GPIOID__D, 8)
614 # define DEFIO_REC__PD8 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_D_USED_MASK & (BIT(8) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT)
615 #else
616 # define DEFIO_TAG__PD8 defio_error_PD8_is_not_supported_on_TARGET
617 # define DEFIO_TAG_E__PD8 DEFIO_TAG_E__NONE
618 # define DEFIO_REC__PD8 defio_error_PD8_is_not_supported_on_TARGET
619 #endif
620 #if DEFIO_PORT_D_USED_MASK & BIT(9)
621 # define DEFIO_TAG__PD9 DEFIO_TAG_MAKE(DEFIO_GPIOID__D, 9)
622 # define DEFIO_TAG_E__PD9 DEFIO_TAG_MAKE(DEFIO_GPIOID__D, 9)
623 # define DEFIO_REC__PD9 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_D_USED_MASK & (BIT(9) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT)
624 #else
625 # define DEFIO_TAG__PD9 defio_error_PD9_is_not_supported_on_TARGET
626 # define DEFIO_TAG_E__PD9 DEFIO_TAG_E__NONE
627 # define DEFIO_REC__PD9 defio_error_PD9_is_not_supported_on_TARGET
628 #endif
629 #if DEFIO_PORT_D_USED_MASK & BIT(10)
630 # define DEFIO_TAG__PD10 DEFIO_TAG_MAKE(DEFIO_GPIOID__D, 10)
631 # define DEFIO_TAG_E__PD10 DEFIO_TAG_MAKE(DEFIO_GPIOID__D, 10)
632 # define DEFIO_REC__PD10 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_D_USED_MASK & (BIT(10) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT)
633 #else
634 # define DEFIO_TAG__PD10 defio_error_PD10_is_not_supported_on_TARGET
635 # define DEFIO_TAG_E__PD10 DEFIO_TAG_E__NONE
636 # define DEFIO_REC__PD10 defio_error_PD10_is_not_supported_on_TARGET
637 #endif
638 #if DEFIO_PORT_D_USED_MASK & BIT(11)
639 # define DEFIO_TAG__PD11 DEFIO_TAG_MAKE(DEFIO_GPIOID__D, 11)
640 # define DEFIO_TAG_E__PD11 DEFIO_TAG_MAKE(DEFIO_GPIOID__D, 11)
641 # define DEFIO_REC__PD11 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_D_USED_MASK & (BIT(11) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT)
642 #else
643 # define DEFIO_TAG__PD11 defio_error_PD11_is_not_supported_on_TARGET
644 # define DEFIO_TAG_E__PD11 DEFIO_TAG_E__NONE
645 # define DEFIO_REC__PD11 defio_error_PD11_is_not_supported_on_TARGET
646 #endif
647 #if DEFIO_PORT_D_USED_MASK & BIT(12)
648 # define DEFIO_TAG__PD12 DEFIO_TAG_MAKE(DEFIO_GPIOID__D, 12)
649 # define DEFIO_TAG_E__PD12 DEFIO_TAG_MAKE(DEFIO_GPIOID__D, 12)
650 # define DEFIO_REC__PD12 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_D_USED_MASK & (BIT(12) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT)
651 #else
652 # define DEFIO_TAG__PD12 defio_error_PD12_is_not_supported_on_TARGET
653 # define DEFIO_TAG_E__PD12 DEFIO_TAG_E__NONE
654 # define DEFIO_REC__PD12 defio_error_PD12_is_not_supported_on_TARGET
655 #endif
656 #if DEFIO_PORT_D_USED_MASK & BIT(13)
657 # define DEFIO_TAG__PD13 DEFIO_TAG_MAKE(DEFIO_GPIOID__D, 13)
658 # define DEFIO_TAG_E__PD13 DEFIO_TAG_MAKE(DEFIO_GPIOID__D, 13)
659 # define DEFIO_REC__PD13 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_D_USED_MASK & (BIT(13) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT)
660 #else
661 # define DEFIO_TAG__PD13 defio_error_PD13_is_not_supported_on_TARGET
662 # define DEFIO_TAG_E__PD13 DEFIO_TAG_E__NONE
663 # define DEFIO_REC__PD13 defio_error_PD13_is_not_supported_on_TARGET
664 #endif
665 #if DEFIO_PORT_D_USED_MASK & BIT(14)
666 # define DEFIO_TAG__PD14 DEFIO_TAG_MAKE(DEFIO_GPIOID__D, 14)
667 # define DEFIO_TAG_E__PD14 DEFIO_TAG_MAKE(DEFIO_GPIOID__D, 14)
668 # define DEFIO_REC__PD14 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_D_USED_MASK & (BIT(14) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT)
669 #else
670 # define DEFIO_TAG__PD14 defio_error_PD14_is_not_supported_on_TARGET
671 # define DEFIO_TAG_E__PD14 DEFIO_TAG_E__NONE
672 # define DEFIO_REC__PD14 defio_error_PD14_is_not_supported_on_TARGET
673 #endif
674 #if DEFIO_PORT_D_USED_MASK & BIT(15)
675 # define DEFIO_TAG__PD15 DEFIO_TAG_MAKE(DEFIO_GPIOID__D, 15)
676 # define DEFIO_TAG_E__PD15 DEFIO_TAG_MAKE(DEFIO_GPIOID__D, 15)
677 # define DEFIO_REC__PD15 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_D_USED_MASK & (BIT(15) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT)
678 #else
679 # define DEFIO_TAG__PD15 defio_error_PD15_is_not_supported_on_TARGET
680 # define DEFIO_TAG_E__PD15 DEFIO_TAG_E__NONE
681 # define DEFIO_REC__PD15 defio_error_PD15_is_not_supported_on_TARGET
682 #endif
683 #if DEFIO_PORT_E_USED_MASK & BIT(0)
684 # define DEFIO_TAG__PE0 DEFIO_TAG_MAKE(DEFIO_GPIOID__E, 0)
685 # define DEFIO_TAG_E__PE0 DEFIO_TAG_MAKE(DEFIO_GPIOID__E, 0)
686 # define DEFIO_REC__PE0 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_E_USED_MASK & (BIT(0) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT)
687 #else
688 # define DEFIO_TAG__PE0 defio_error_PE0_is_not_supported_on_TARGET
689 # define DEFIO_TAG_E__PE0 DEFIO_TAG_E__NONE
690 # define DEFIO_REC__PE0 defio_error_PE0_is_not_supported_on_TARGET
691 #endif
692 #if DEFIO_PORT_E_USED_MASK & BIT(1)
693 # define DEFIO_TAG__PE1 DEFIO_TAG_MAKE(DEFIO_GPIOID__E, 1)
694 # define DEFIO_TAG_E__PE1 DEFIO_TAG_MAKE(DEFIO_GPIOID__E, 1)
695 # define DEFIO_REC__PE1 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_E_USED_MASK & (BIT(1) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT)
696 #else
697 # define DEFIO_TAG__PE1 defio_error_PE1_is_not_supported_on_TARGET
698 # define DEFIO_TAG_E__PE1 DEFIO_TAG_E__NONE
699 # define DEFIO_REC__PE1 defio_error_PE1_is_not_supported_on_TARGET
700 #endif
701 #if DEFIO_PORT_E_USED_MASK & BIT(2)
702 # define DEFIO_TAG__PE2 DEFIO_TAG_MAKE(DEFIO_GPIOID__E, 2)
703 # define DEFIO_TAG_E__PE2 DEFIO_TAG_MAKE(DEFIO_GPIOID__E, 2)
704 # define DEFIO_REC__PE2 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_E_USED_MASK & (BIT(2) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT)
705 #else
706 # define DEFIO_TAG__PE2 defio_error_PE2_is_not_supported_on_TARGET
707 # define DEFIO_TAG_E__PE2 DEFIO_TAG_E__NONE
708 # define DEFIO_REC__PE2 defio_error_PE2_is_not_supported_on_TARGET
709 #endif
710 #if DEFIO_PORT_E_USED_MASK & BIT(3)
711 # define DEFIO_TAG__PE3 DEFIO_TAG_MAKE(DEFIO_GPIOID__E, 3)
712 # define DEFIO_TAG_E__PE3 DEFIO_TAG_MAKE(DEFIO_GPIOID__E, 3)
713 # define DEFIO_REC__PE3 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_E_USED_MASK & (BIT(3) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT)
714 #else
715 # define DEFIO_TAG__PE3 defio_error_PE3_is_not_supported_on_TARGET
716 # define DEFIO_TAG_E__PE3 DEFIO_TAG_E__NONE
717 # define DEFIO_REC__PE3 defio_error_PE3_is_not_supported_on_TARGET
718 #endif
719 #if DEFIO_PORT_E_USED_MASK & BIT(4)
720 # define DEFIO_TAG__PE4 DEFIO_TAG_MAKE(DEFIO_GPIOID__E, 4)
721 # define DEFIO_TAG_E__PE4 DEFIO_TAG_MAKE(DEFIO_GPIOID__E, 4)
722 # define DEFIO_REC__PE4 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_E_USED_MASK & (BIT(4) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT)
723 #else
724 # define DEFIO_TAG__PE4 defio_error_PE4_is_not_supported_on_TARGET
725 # define DEFIO_TAG_E__PE4 DEFIO_TAG_E__NONE
726 # define DEFIO_REC__PE4 defio_error_PE4_is_not_supported_on_TARGET
727 #endif
728 #if DEFIO_PORT_E_USED_MASK & BIT(5)
729 # define DEFIO_TAG__PE5 DEFIO_TAG_MAKE(DEFIO_GPIOID__E, 5)
730 # define DEFIO_TAG_E__PE5 DEFIO_TAG_MAKE(DEFIO_GPIOID__E, 5)
731 # define DEFIO_REC__PE5 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_E_USED_MASK & (BIT(5) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT)
732 #else
733 # define DEFIO_TAG__PE5 defio_error_PE5_is_not_supported_on_TARGET
734 # define DEFIO_TAG_E__PE5 DEFIO_TAG_E__NONE
735 # define DEFIO_REC__PE5 defio_error_PE5_is_not_supported_on_TARGET
736 #endif
737 #if DEFIO_PORT_E_USED_MASK & BIT(6)
738 # define DEFIO_TAG__PE6 DEFIO_TAG_MAKE(DEFIO_GPIOID__E, 6)
739 # define DEFIO_TAG_E__PE6 DEFIO_TAG_MAKE(DEFIO_GPIOID__E, 6)
740 # define DEFIO_REC__PE6 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_E_USED_MASK & (BIT(6) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT)
741 #else
742 # define DEFIO_TAG__PE6 defio_error_PE6_is_not_supported_on_TARGET
743 # define DEFIO_TAG_E__PE6 DEFIO_TAG_E__NONE
744 # define DEFIO_REC__PE6 defio_error_PE6_is_not_supported_on_TARGET
745 #endif
746 #if DEFIO_PORT_E_USED_MASK & BIT(7)
747 # define DEFIO_TAG__PE7 DEFIO_TAG_MAKE(DEFIO_GPIOID__E, 7)
748 # define DEFIO_TAG_E__PE7 DEFIO_TAG_MAKE(DEFIO_GPIOID__E, 7)
749 # define DEFIO_REC__PE7 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_E_USED_MASK & (BIT(7) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT)
750 #else
751 # define DEFIO_TAG__PE7 defio_error_PE7_is_not_supported_on_TARGET
752 # define DEFIO_TAG_E__PE7 DEFIO_TAG_E__NONE
753 # define DEFIO_REC__PE7 defio_error_PE7_is_not_supported_on_TARGET
754 #endif
755 #if DEFIO_PORT_E_USED_MASK & BIT(8)
756 # define DEFIO_TAG__PE8 DEFIO_TAG_MAKE(DEFIO_GPIOID__E, 8)
757 # define DEFIO_TAG_E__PE8 DEFIO_TAG_MAKE(DEFIO_GPIOID__E, 8)
758 # define DEFIO_REC__PE8 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_E_USED_MASK & (BIT(8) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT)
759 #else
760 # define DEFIO_TAG__PE8 defio_error_PE8_is_not_supported_on_TARGET
761 # define DEFIO_TAG_E__PE8 DEFIO_TAG_E__NONE
762 # define DEFIO_REC__PE8 defio_error_PE8_is_not_supported_on_TARGET
763 #endif
764 #if DEFIO_PORT_E_USED_MASK & BIT(9)
765 # define DEFIO_TAG__PE9 DEFIO_TAG_MAKE(DEFIO_GPIOID__E, 9)
766 # define DEFIO_TAG_E__PE9 DEFIO_TAG_MAKE(DEFIO_GPIOID__E, 9)
767 # define DEFIO_REC__PE9 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_E_USED_MASK & (BIT(9) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT)
768 #else
769 # define DEFIO_TAG__PE9 defio_error_PE9_is_not_supported_on_TARGET
770 # define DEFIO_TAG_E__PE9 DEFIO_TAG_E__NONE
771 # define DEFIO_REC__PE9 defio_error_PE9_is_not_supported_on_TARGET
772 #endif
773 #if DEFIO_PORT_E_USED_MASK & BIT(10)
774 # define DEFIO_TAG__PE10 DEFIO_TAG_MAKE(DEFIO_GPIOID__E, 10)
775 # define DEFIO_TAG_E__PE10 DEFIO_TAG_MAKE(DEFIO_GPIOID__E, 10)
776 # define DEFIO_REC__PE10 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_E_USED_MASK & (BIT(10) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT)
777 #else
778 # define DEFIO_TAG__PE10 defio_error_PE10_is_not_supported_on_TARGET
779 # define DEFIO_TAG_E__PE10 DEFIO_TAG_E__NONE
780 # define DEFIO_REC__PE10 defio_error_PE10_is_not_supported_on_TARGET
781 #endif
782 #if DEFIO_PORT_E_USED_MASK & BIT(11)
783 # define DEFIO_TAG__PE11 DEFIO_TAG_MAKE(DEFIO_GPIOID__E, 11)
784 # define DEFIO_TAG_E__PE11 DEFIO_TAG_MAKE(DEFIO_GPIOID__E, 11)
785 # define DEFIO_REC__PE11 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_E_USED_MASK & (BIT(11) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT)
786 #else
787 # define DEFIO_TAG__PE11 defio_error_PE11_is_not_supported_on_TARGET
788 # define DEFIO_TAG_E__PE11 DEFIO_TAG_E__NONE
789 # define DEFIO_REC__PE11 defio_error_PE11_is_not_supported_on_TARGET
790 #endif
791 #if DEFIO_PORT_E_USED_MASK & BIT(12)
792 # define DEFIO_TAG__PE12 DEFIO_TAG_MAKE(DEFIO_GPIOID__E, 12)
793 # define DEFIO_TAG_E__PE12 DEFIO_TAG_MAKE(DEFIO_GPIOID__E, 12)
794 # define DEFIO_REC__PE12 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_E_USED_MASK & (BIT(12) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT)
795 #else
796 # define DEFIO_TAG__PE12 defio_error_PE12_is_not_supported_on_TARGET
797 # define DEFIO_TAG_E__PE12 DEFIO_TAG_E__NONE
798 # define DEFIO_REC__PE12 defio_error_PE12_is_not_supported_on_TARGET
799 #endif
800 #if DEFIO_PORT_E_USED_MASK & BIT(13)
801 # define DEFIO_TAG__PE13 DEFIO_TAG_MAKE(DEFIO_GPIOID__E, 13)
802 # define DEFIO_TAG_E__PE13 DEFIO_TAG_MAKE(DEFIO_GPIOID__E, 13)
803 # define DEFIO_REC__PE13 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_E_USED_MASK & (BIT(13) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT)
804 #else
805 # define DEFIO_TAG__PE13 defio_error_PE13_is_not_supported_on_TARGET
806 # define DEFIO_TAG_E__PE13 DEFIO_TAG_E__NONE
807 # define DEFIO_REC__PE13 defio_error_PE13_is_not_supported_on_TARGET
808 #endif
809 #if DEFIO_PORT_E_USED_MASK & BIT(14)
810 # define DEFIO_TAG__PE14 DEFIO_TAG_MAKE(DEFIO_GPIOID__E, 14)
811 # define DEFIO_TAG_E__PE14 DEFIO_TAG_MAKE(DEFIO_GPIOID__E, 14)
812 # define DEFIO_REC__PE14 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_E_USED_MASK & (BIT(14) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT)
813 #else
814 # define DEFIO_TAG__PE14 defio_error_PE14_is_not_supported_on_TARGET
815 # define DEFIO_TAG_E__PE14 DEFIO_TAG_E__NONE
816 # define DEFIO_REC__PE14 defio_error_PE14_is_not_supported_on_TARGET
817 #endif
818 #if DEFIO_PORT_E_USED_MASK & BIT(15)
819 # define DEFIO_TAG__PE15 DEFIO_TAG_MAKE(DEFIO_GPIOID__E, 15)
820 # define DEFIO_TAG_E__PE15 DEFIO_TAG_MAKE(DEFIO_GPIOID__E, 15)
821 # define DEFIO_REC__PE15 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_E_USED_MASK & (BIT(15) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT)
822 #else
823 # define DEFIO_TAG__PE15 defio_error_PE15_is_not_supported_on_TARGET
824 # define DEFIO_TAG_E__PE15 DEFIO_TAG_E__NONE
825 # define DEFIO_REC__PE15 defio_error_PE15_is_not_supported_on_TARGET
826 #endif
827 #if DEFIO_PORT_F_USED_MASK & BIT(0)
828 # define DEFIO_TAG__PF0 DEFIO_TAG_MAKE(DEFIO_GPIOID__F, 0)
829 # define DEFIO_TAG_E__PF0 DEFIO_TAG_MAKE(DEFIO_GPIOID__F, 0)
830 # define DEFIO_REC__PF0 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_F_USED_MASK & (BIT(0) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT+DEFIO_PORT_E_USED_COUNT)
831 #else
832 # define DEFIO_TAG__PF0 defio_error_PF0_is_not_supported_on_TARGET
833 # define DEFIO_TAG_E__PF0 DEFIO_TAG_E__NONE
834 # define DEFIO_REC__PF0 defio_error_PF0_is_not_supported_on_TARGET
835 #endif
836 #if DEFIO_PORT_F_USED_MASK & BIT(1)
837 # define DEFIO_TAG__PF1 DEFIO_TAG_MAKE(DEFIO_GPIOID__F, 1)
838 # define DEFIO_TAG_E__PF1 DEFIO_TAG_MAKE(DEFIO_GPIOID__F, 1)
839 # define DEFIO_REC__PF1 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_F_USED_MASK & (BIT(1) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT+DEFIO_PORT_E_USED_COUNT)
840 #else
841 # define DEFIO_TAG__PF1 defio_error_PF1_is_not_supported_on_TARGET
842 # define DEFIO_TAG_E__PF1 DEFIO_TAG_E__NONE
843 # define DEFIO_REC__PF1 defio_error_PF1_is_not_supported_on_TARGET
844 #endif
845 #if DEFIO_PORT_F_USED_MASK & BIT(2)
846 # define DEFIO_TAG__PF2 DEFIO_TAG_MAKE(DEFIO_GPIOID__F, 2)
847 # define DEFIO_TAG_E__PF2 DEFIO_TAG_MAKE(DEFIO_GPIOID__F, 2)
848 # define DEFIO_REC__PF2 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_F_USED_MASK & (BIT(2) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT+DEFIO_PORT_E_USED_COUNT)
849 #else
850 # define DEFIO_TAG__PF2 defio_error_PF2_is_not_supported_on_TARGET
851 # define DEFIO_TAG_E__PF2 DEFIO_TAG_E__NONE
852 # define DEFIO_REC__PF2 defio_error_PF2_is_not_supported_on_TARGET
853 #endif
854 #if DEFIO_PORT_F_USED_MASK & BIT(3)
855 # define DEFIO_TAG__PF3 DEFIO_TAG_MAKE(DEFIO_GPIOID__F, 3)
856 # define DEFIO_TAG_E__PF3 DEFIO_TAG_MAKE(DEFIO_GPIOID__F, 3)
857 # define DEFIO_REC__PF3 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_F_USED_MASK & (BIT(3) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT+DEFIO_PORT_E_USED_COUNT)
858 #else
859 # define DEFIO_TAG__PF3 defio_error_PF3_is_not_supported_on_TARGET
860 # define DEFIO_TAG_E__PF3 DEFIO_TAG_E__NONE
861 # define DEFIO_REC__PF3 defio_error_PF3_is_not_supported_on_TARGET
862 #endif
863 #if DEFIO_PORT_F_USED_MASK & BIT(4)
864 # define DEFIO_TAG__PF4 DEFIO_TAG_MAKE(DEFIO_GPIOID__F, 4)
865 # define DEFIO_TAG_E__PF4 DEFIO_TAG_MAKE(DEFIO_GPIOID__F, 4)
866 # define DEFIO_REC__PF4 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_F_USED_MASK & (BIT(4) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT+DEFIO_PORT_E_USED_COUNT)
867 #else
868 # define DEFIO_TAG__PF4 defio_error_PF4_is_not_supported_on_TARGET
869 # define DEFIO_TAG_E__PF4 DEFIO_TAG_E__NONE
870 # define DEFIO_REC__PF4 defio_error_PF4_is_not_supported_on_TARGET
871 #endif
872 #if DEFIO_PORT_F_USED_MASK & BIT(5)
873 # define DEFIO_TAG__PF5 DEFIO_TAG_MAKE(DEFIO_GPIOID__F, 5)
874 # define DEFIO_TAG_E__PF5 DEFIO_TAG_MAKE(DEFIO_GPIOID__F, 5)
875 # define DEFIO_REC__PF5 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_F_USED_MASK & (BIT(5) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT+DEFIO_PORT_E_USED_COUNT)
876 #else
877 # define DEFIO_TAG__PF5 defio_error_PF5_is_not_supported_on_TARGET
878 # define DEFIO_TAG_E__PF5 DEFIO_TAG_E__NONE
879 # define DEFIO_REC__PF5 defio_error_PF5_is_not_supported_on_TARGET
880 #endif
881 #if DEFIO_PORT_F_USED_MASK & BIT(6)
882 # define DEFIO_TAG__PF6 DEFIO_TAG_MAKE(DEFIO_GPIOID__F, 6)
883 # define DEFIO_TAG_E__PF6 DEFIO_TAG_MAKE(DEFIO_GPIOID__F, 6)
884 # define DEFIO_REC__PF6 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_F_USED_MASK & (BIT(6) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT+DEFIO_PORT_E_USED_COUNT)
885 #else
886 # define DEFIO_TAG__PF6 defio_error_PF6_is_not_supported_on_TARGET
887 # define DEFIO_TAG_E__PF6 DEFIO_TAG_E__NONE
888 # define DEFIO_REC__PF6 defio_error_PF6_is_not_supported_on_TARGET
889 #endif
890 #if DEFIO_PORT_F_USED_MASK & BIT(7)
891 # define DEFIO_TAG__PF7 DEFIO_TAG_MAKE(DEFIO_GPIOID__F, 7)
892 # define DEFIO_TAG_E__PF7 DEFIO_TAG_MAKE(DEFIO_GPIOID__F, 7)
893 # define DEFIO_REC__PF7 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_F_USED_MASK & (BIT(7) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT+DEFIO_PORT_E_USED_COUNT)
894 #else
895 # define DEFIO_TAG__PF7 defio_error_PF7_is_not_supported_on_TARGET
896 # define DEFIO_TAG_E__PF7 DEFIO_TAG_E__NONE
897 # define DEFIO_REC__PF7 defio_error_PF7_is_not_supported_on_TARGET
898 #endif
899 #if DEFIO_PORT_F_USED_MASK & BIT(8)
900 # define DEFIO_TAG__PF8 DEFIO_TAG_MAKE(DEFIO_GPIOID__F, 8)
901 # define DEFIO_TAG_E__PF8 DEFIO_TAG_MAKE(DEFIO_GPIOID__F, 8)
902 # define DEFIO_REC__PF8 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_F_USED_MASK & (BIT(8) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT+DEFIO_PORT_E_USED_COUNT)
903 #else
904 # define DEFIO_TAG__PF8 defio_error_PF8_is_not_supported_on_TARGET
905 # define DEFIO_TAG_E__PF8 DEFIO_TAG_E__NONE
906 # define DEFIO_REC__PF8 defio_error_PF8_is_not_supported_on_TARGET
907 #endif
908 #if DEFIO_PORT_F_USED_MASK & BIT(9)
909 # define DEFIO_TAG__PF9 DEFIO_TAG_MAKE(DEFIO_GPIOID__F, 9)
910 # define DEFIO_TAG_E__PF9 DEFIO_TAG_MAKE(DEFIO_GPIOID__F, 9)
911 # define DEFIO_REC__PF9 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_F_USED_MASK & (BIT(9) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT+DEFIO_PORT_E_USED_COUNT)
912 #else
913 # define DEFIO_TAG__PF9 defio_error_PF9_is_not_supported_on_TARGET
914 # define DEFIO_TAG_E__PF9 DEFIO_TAG_E__NONE
915 # define DEFIO_REC__PF9 defio_error_PF9_is_not_supported_on_TARGET
916 #endif
917 #if DEFIO_PORT_F_USED_MASK & BIT(10)
918 # define DEFIO_TAG__PF10 DEFIO_TAG_MAKE(DEFIO_GPIOID__F, 10)
919 # define DEFIO_TAG_E__PF10 DEFIO_TAG_MAKE(DEFIO_GPIOID__F, 10)
920 # define DEFIO_REC__PF10 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_F_USED_MASK & (BIT(10) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT+DEFIO_PORT_E_USED_COUNT)
921 #else
922 # define DEFIO_TAG__PF10 defio_error_PF10_is_not_supported_on_TARGET
923 # define DEFIO_TAG_E__PF10 DEFIO_TAG_E__NONE
924 # define DEFIO_REC__PF10 defio_error_PF10_is_not_supported_on_TARGET
925 #endif
926 #if DEFIO_PORT_F_USED_MASK & BIT(11)
927 # define DEFIO_TAG__PF11 DEFIO_TAG_MAKE(DEFIO_GPIOID__F, 11)
928 # define DEFIO_TAG_E__PF11 DEFIO_TAG_MAKE(DEFIO_GPIOID__F, 11)
929 # define DEFIO_REC__PF11 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_F_USED_MASK & (BIT(11) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT+DEFIO_PORT_E_USED_COUNT)
930 #else
931 # define DEFIO_TAG__PF11 defio_error_PF11_is_not_supported_on_TARGET
932 # define DEFIO_TAG_E__PF11 DEFIO_TAG_E__NONE
933 # define DEFIO_REC__PF11 defio_error_PF11_is_not_supported_on_TARGET
934 #endif
935 #if DEFIO_PORT_F_USED_MASK & BIT(12)
936 # define DEFIO_TAG__PF12 DEFIO_TAG_MAKE(DEFIO_GPIOID__F, 12)
937 # define DEFIO_TAG_E__PF12 DEFIO_TAG_MAKE(DEFIO_GPIOID__F, 12)
938 # define DEFIO_REC__PF12 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_F_USED_MASK & (BIT(12) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT+DEFIO_PORT_E_USED_COUNT)
939 #else
940 # define DEFIO_TAG__PF12 defio_error_PF12_is_not_supported_on_TARGET
941 # define DEFIO_TAG_E__PF12 DEFIO_TAG_E__NONE
942 # define DEFIO_REC__PF12 defio_error_PF12_is_not_supported_on_TARGET
943 #endif
944 #if DEFIO_PORT_F_USED_MASK & BIT(13)
945 # define DEFIO_TAG__PF13 DEFIO_TAG_MAKE(DEFIO_GPIOID__F, 13)
946 # define DEFIO_TAG_E__PF13 DEFIO_TAG_MAKE(DEFIO_GPIOID__F, 13)
947 # define DEFIO_REC__PF13 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_F_USED_MASK & (BIT(13) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT+DEFIO_PORT_E_USED_COUNT)
948 #else
949 # define DEFIO_TAG__PF13 defio_error_PF13_is_not_supported_on_TARGET
950 # define DEFIO_TAG_E__PF13 DEFIO_TAG_E__NONE
951 # define DEFIO_REC__PF13 defio_error_PF13_is_not_supported_on_TARGET
952 #endif
953 #if DEFIO_PORT_F_USED_MASK & BIT(14)
954 # define DEFIO_TAG__PF14 DEFIO_TAG_MAKE(DEFIO_GPIOID__F, 14)
955 # define DEFIO_TAG_E__PF14 DEFIO_TAG_MAKE(DEFIO_GPIOID__F, 14)
956 # define DEFIO_REC__PF14 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_F_USED_MASK & (BIT(14) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT+DEFIO_PORT_E_USED_COUNT)
957 #else
958 # define DEFIO_TAG__PF14 defio_error_PF14_is_not_supported_on_TARGET
959 # define DEFIO_TAG_E__PF14 DEFIO_TAG_E__NONE
960 # define DEFIO_REC__PF14 defio_error_PF14_is_not_supported_on_TARGET
961 #endif
962 #if DEFIO_PORT_F_USED_MASK & BIT(15)
963 # define DEFIO_TAG__PF15 DEFIO_TAG_MAKE(DEFIO_GPIOID__F, 15)
964 # define DEFIO_TAG_E__PF15 DEFIO_TAG_MAKE(DEFIO_GPIOID__F, 15)
965 # define DEFIO_REC__PF15 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_F_USED_MASK & (BIT(15) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT+DEFIO_PORT_E_USED_COUNT)
966 #else
967 # define DEFIO_TAG__PF15 defio_error_PF15_is_not_supported_on_TARGET
968 # define DEFIO_TAG_E__PF15 DEFIO_TAG_E__NONE
969 # define DEFIO_REC__PF15 defio_error_PF15_is_not_supported_on_TARGET
970 #endif
971 #if DEFIO_PORT_G_USED_MASK & BIT(0)
972 # define DEFIO_TAG__PG0 DEFIO_TAG_MAKE(DEFIO_GPIOID__G, 0)
973 # define DEFIO_TAG_E__PG0 DEFIO_TAG_MAKE(DEFIO_GPIOID__G, 0)
974 # define DEFIO_REC__PG0 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_G_USED_MASK & (BIT(0) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT+DEFIO_PORT_E_USED_COUNT+DEFIO_PORT_F_USED_COUNT)
975 #else
976 # define DEFIO_TAG__PG0 defio_error_PG0_is_not_supported_on_TARGET
977 # define DEFIO_TAG_E__PG0 DEFIO_TAG_E__NONE
978 # define DEFIO_REC__PG0 defio_error_PG0_is_not_supported_on_TARGET
979 #endif
980 #if DEFIO_PORT_G_USED_MASK & BIT(1)
981 # define DEFIO_TAG__PG1 DEFIO_TAG_MAKE(DEFIO_GPIOID__G, 1)
982 # define DEFIO_TAG_E__PG1 DEFIO_TAG_MAKE(DEFIO_GPIOID__G, 1)
983 # define DEFIO_REC__PG1 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_G_USED_MASK & (BIT(1) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT+DEFIO_PORT_E_USED_COUNT+DEFIO_PORT_F_USED_COUNT)
984 #else
985 # define DEFIO_TAG__PG1 defio_error_PG1_is_not_supported_on_TARGET
986 # define DEFIO_TAG_E__PG1 DEFIO_TAG_E__NONE
987 # define DEFIO_REC__PG1 defio_error_PG1_is_not_supported_on_TARGET
988 #endif
989 #if DEFIO_PORT_G_USED_MASK & BIT(2)
990 # define DEFIO_TAG__PG2 DEFIO_TAG_MAKE(DEFIO_GPIOID__G, 2)
991 # define DEFIO_TAG_E__PG2 DEFIO_TAG_MAKE(DEFIO_GPIOID__G, 2)
992 # define DEFIO_REC__PG2 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_G_USED_MASK & (BIT(2) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT+DEFIO_PORT_E_USED_COUNT+DEFIO_PORT_F_USED_COUNT)
993 #else
994 # define DEFIO_TAG__PG2 defio_error_PG2_is_not_supported_on_TARGET
995 # define DEFIO_TAG_E__PG2 DEFIO_TAG_E__NONE
996 # define DEFIO_REC__PG2 defio_error_PG2_is_not_supported_on_TARGET
997 #endif
998 #if DEFIO_PORT_G_USED_MASK & BIT(3)
999 # define DEFIO_TAG__PG3 DEFIO_TAG_MAKE(DEFIO_GPIOID__G, 3)
1000 # define DEFIO_TAG_E__PG3 DEFIO_TAG_MAKE(DEFIO_GPIOID__G, 3)
1001 # define DEFIO_REC__PG3 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_G_USED_MASK & (BIT(3) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT+DEFIO_PORT_E_USED_COUNT+DEFIO_PORT_F_USED_COUNT)
1002 #else
1003 # define DEFIO_TAG__PG3 defio_error_PG3_is_not_supported_on_TARGET
1004 # define DEFIO_TAG_E__PG3 DEFIO_TAG_E__NONE
1005 # define DEFIO_REC__PG3 defio_error_PG3_is_not_supported_on_TARGET
1006 #endif
1007 #if DEFIO_PORT_G_USED_MASK & BIT(4)
1008 # define DEFIO_TAG__PG4 DEFIO_TAG_MAKE(DEFIO_GPIOID__G, 4)
1009 # define DEFIO_TAG_E__PG4 DEFIO_TAG_MAKE(DEFIO_GPIOID__G, 4)
1010 # define DEFIO_REC__PG4 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_G_USED_MASK & (BIT(4) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT+DEFIO_PORT_E_USED_COUNT+DEFIO_PORT_F_USED_COUNT)
1011 #else
1012 # define DEFIO_TAG__PG4 defio_error_PG4_is_not_supported_on_TARGET
1013 # define DEFIO_TAG_E__PG4 DEFIO_TAG_E__NONE
1014 # define DEFIO_REC__PG4 defio_error_PG4_is_not_supported_on_TARGET
1015 #endif
1016 #if DEFIO_PORT_G_USED_MASK & BIT(5)
1017 # define DEFIO_TAG__PG5 DEFIO_TAG_MAKE(DEFIO_GPIOID__G, 5)
1018 # define DEFIO_TAG_E__PG5 DEFIO_TAG_MAKE(DEFIO_GPIOID__G, 5)
1019 # define DEFIO_REC__PG5 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_G_USED_MASK & (BIT(5) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT+DEFIO_PORT_E_USED_COUNT+DEFIO_PORT_F_USED_COUNT)
1020 #else
1021 # define DEFIO_TAG__PG5 defio_error_PG5_is_not_supported_on_TARGET
1022 # define DEFIO_TAG_E__PG5 DEFIO_TAG_E__NONE
1023 # define DEFIO_REC__PG5 defio_error_PG5_is_not_supported_on_TARGET
1024 #endif
1025 #if DEFIO_PORT_G_USED_MASK & BIT(6)
1026 # define DEFIO_TAG__PG6 DEFIO_TAG_MAKE(DEFIO_GPIOID__G, 6)
1027 # define DEFIO_TAG_E__PG6 DEFIO_TAG_MAKE(DEFIO_GPIOID__G, 6)
1028 # define DEFIO_REC__PG6 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_G_USED_MASK & (BIT(6) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT+DEFIO_PORT_E_USED_COUNT+DEFIO_PORT_F_USED_COUNT)
1029 #else
1030 # define DEFIO_TAG__PG6 defio_error_PG6_is_not_supported_on_TARGET
1031 # define DEFIO_TAG_E__PG6 DEFIO_TAG_E__NONE
1032 # define DEFIO_REC__PG6 defio_error_PG6_is_not_supported_on_TARGET
1033 #endif
1034 #if DEFIO_PORT_G_USED_MASK & BIT(7)
1035 # define DEFIO_TAG__PG7 DEFIO_TAG_MAKE(DEFIO_GPIOID__G, 7)
1036 # define DEFIO_TAG_E__PG7 DEFIO_TAG_MAKE(DEFIO_GPIOID__G, 7)
1037 # define DEFIO_REC__PG7 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_G_USED_MASK & (BIT(7) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT+DEFIO_PORT_E_USED_COUNT+DEFIO_PORT_F_USED_COUNT)
1038 #else
1039 # define DEFIO_TAG__PG7 defio_error_PG7_is_not_supported_on_TARGET
1040 # define DEFIO_TAG_E__PG7 DEFIO_TAG_E__NONE
1041 # define DEFIO_REC__PG7 defio_error_PG7_is_not_supported_on_TARGET
1042 #endif
1043 #if DEFIO_PORT_G_USED_MASK & BIT(8)
1044 # define DEFIO_TAG__PG8 DEFIO_TAG_MAKE(DEFIO_GPIOID__G, 8)
1045 # define DEFIO_TAG_E__PG8 DEFIO_TAG_MAKE(DEFIO_GPIOID__G, 8)
1046 # define DEFIO_REC__PG8 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_G_USED_MASK & (BIT(8) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT+DEFIO_PORT_E_USED_COUNT+DEFIO_PORT_F_USED_COUNT)
1047 #else
1048 # define DEFIO_TAG__PG8 defio_error_PG8_is_not_supported_on_TARGET
1049 # define DEFIO_TAG_E__PG8 DEFIO_TAG_E__NONE
1050 # define DEFIO_REC__PG8 defio_error_PG8_is_not_supported_on_TARGET
1051 #endif
1052 #if DEFIO_PORT_G_USED_MASK & BIT(9)
1053 # define DEFIO_TAG__PG9 DEFIO_TAG_MAKE(DEFIO_GPIOID__G, 9)
1054 # define DEFIO_TAG_E__PG9 DEFIO_TAG_MAKE(DEFIO_GPIOID__G, 9)
1055 # define DEFIO_REC__PG9 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_G_USED_MASK & (BIT(9) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT+DEFIO_PORT_E_USED_COUNT+DEFIO_PORT_F_USED_COUNT)
1056 #else
1057 # define DEFIO_TAG__PG9 defio_error_PG9_is_not_supported_on_TARGET
1058 # define DEFIO_TAG_E__PG9 DEFIO_TAG_E__NONE
1059 # define DEFIO_REC__PG9 defio_error_PG9_is_not_supported_on_TARGET
1060 #endif
1061 #if DEFIO_PORT_G_USED_MASK & BIT(10)
1062 # define DEFIO_TAG__PG10 DEFIO_TAG_MAKE(DEFIO_GPIOID__G, 10)
1063 # define DEFIO_TAG_E__PG10 DEFIO_TAG_MAKE(DEFIO_GPIOID__G, 10)
1064 # define DEFIO_REC__PG10 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_G_USED_MASK & (BIT(10) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT+DEFIO_PORT_E_USED_COUNT+DEFIO_PORT_F_USED_COUNT)
1065 #else
1066 # define DEFIO_TAG__PG10 defio_error_PG10_is_not_supported_on_TARGET
1067 # define DEFIO_TAG_E__PG10 DEFIO_TAG_E__NONE
1068 # define DEFIO_REC__PG10 defio_error_PG10_is_not_supported_on_TARGET
1069 #endif
1070 #if DEFIO_PORT_G_USED_MASK & BIT(11)
1071 # define DEFIO_TAG__PG11 DEFIO_TAG_MAKE(DEFIO_GPIOID__G, 11)
1072 # define DEFIO_TAG_E__PG11 DEFIO_TAG_MAKE(DEFIO_GPIOID__G, 11)
1073 # define DEFIO_REC__PG11 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_G_USED_MASK & (BIT(11) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT+DEFIO_PORT_E_USED_COUNT+DEFIO_PORT_F_USED_COUNT)
1074 #else
1075 # define DEFIO_TAG__PG11 defio_error_PG11_is_not_supported_on_TARGET
1076 # define DEFIO_TAG_E__PG11 DEFIO_TAG_E__NONE
1077 # define DEFIO_REC__PG11 defio_error_PG11_is_not_supported_on_TARGET
1078 #endif
1079 #if DEFIO_PORT_G_USED_MASK & BIT(12)
1080 # define DEFIO_TAG__PG12 DEFIO_TAG_MAKE(DEFIO_GPIOID__G, 12)
1081 # define DEFIO_TAG_E__PG12 DEFIO_TAG_MAKE(DEFIO_GPIOID__G, 12)
1082 # define DEFIO_REC__PG12 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_G_USED_MASK & (BIT(12) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT+DEFIO_PORT_E_USED_COUNT+DEFIO_PORT_F_USED_COUNT)
1083 #else
1084 # define DEFIO_TAG__PG12 defio_error_PG12_is_not_supported_on_TARGET
1085 # define DEFIO_TAG_E__PG12 DEFIO_TAG_E__NONE
1086 # define DEFIO_REC__PG12 defio_error_PG12_is_not_supported_on_TARGET
1087 #endif
1088 #if DEFIO_PORT_G_USED_MASK & BIT(13)
1089 # define DEFIO_TAG__PG13 DEFIO_TAG_MAKE(DEFIO_GPIOID__G, 13)
1090 # define DEFIO_TAG_E__PG13 DEFIO_TAG_MAKE(DEFIO_GPIOID__G, 13)
1091 # define DEFIO_REC__PG13 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_G_USED_MASK & (BIT(13) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT+DEFIO_PORT_E_USED_COUNT+DEFIO_PORT_F_USED_COUNT)
1092 #else
1093 # define DEFIO_TAG__PG13 defio_error_PG13_is_not_supported_on_TARGET
1094 # define DEFIO_TAG_E__PG13 DEFIO_TAG_E__NONE
1095 # define DEFIO_REC__PG13 defio_error_PG13_is_not_supported_on_TARGET
1096 #endif
1097 #if DEFIO_PORT_G_USED_MASK & BIT(14)
1098 # define DEFIO_TAG__PG14 DEFIO_TAG_MAKE(DEFIO_GPIOID__G, 14)
1099 # define DEFIO_TAG_E__PG14 DEFIO_TAG_MAKE(DEFIO_GPIOID__G, 14)
1100 # define DEFIO_REC__PG14 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_G_USED_MASK & (BIT(14) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT+DEFIO_PORT_E_USED_COUNT+DEFIO_PORT_F_USED_COUNT)
1101 #else
1102 # define DEFIO_TAG__PG14 defio_error_PG14_is_not_supported_on_TARGET
1103 # define DEFIO_TAG_E__PG14 DEFIO_TAG_E__NONE
1104 # define DEFIO_REC__PG14 defio_error_PG14_is_not_supported_on_TARGET
1105 #endif
1106 #if DEFIO_PORT_G_USED_MASK & BIT(15)
1107 # define DEFIO_TAG__PG15 DEFIO_TAG_MAKE(DEFIO_GPIOID__G, 15)
1108 # define DEFIO_TAG_E__PG15 DEFIO_TAG_MAKE(DEFIO_GPIOID__G, 15)
1109 # define DEFIO_REC__PG15 DEFIO_REC_INDEXED(BITCOUNT(DEFIO_PORT_G_USED_MASK & (BIT(15) - 1)) + DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT+DEFIO_PORT_E_USED_COUNT+DEFIO_PORT_F_USED_COUNT)
1110 #else
1111 # define DEFIO_TAG__PG15 defio_error_PG15_is_not_supported_on_TARGET
1112 # define DEFIO_TAG_E__PG15 DEFIO_TAG_E__NONE
1113 # define DEFIO_REC__PG15 defio_error_PG15_is_not_supported_on_TARGET
1114 #endif
1116 // DEFIO_IO_USED_COUNT is number of io pins supported on target
1117 #define DEFIO_IO_USED_COUNT (DEFIO_PORT_A_USED_COUNT+DEFIO_PORT_B_USED_COUNT+DEFIO_PORT_C_USED_COUNT+DEFIO_PORT_D_USED_COUNT+DEFIO_PORT_E_USED_COUNT+DEFIO_PORT_F_USED_COUNT+DEFIO_PORT_G_USED_COUNT)
1119 // DEFIO_PORT_USED_LIST - comma separated list of bitmask for all used ports.
1120 // DEFIO_PORT_OFFSET_LIST - comma separated list of port offsets (count of pins before this port)
1121 // unused ports on end of list are skipped
1122 #if !defined DEFIO_PORT_USED_LIST && DEFIO_PORT_G_USED_COUNT > 0
1123 # define DEFIO_PORT_USED_COUNT 7
1124 # define DEFIO_PORT_USED_LIST DEFIO_PORT_A_USED_MASK,DEFIO_PORT_B_USED_MASK,DEFIO_PORT_C_USED_MASK,DEFIO_PORT_D_USED_MASK,DEFIO_PORT_E_USED_MASK,DEFIO_PORT_F_USED_MASK,DEFIO_PORT_G_USED_MASK
1125 # define DEFIO_PORT_OFFSET_LIST DEFIO_PORT_A_OFFSET,DEFIO_PORT_B_OFFSET,DEFIO_PORT_C_OFFSET,DEFIO_PORT_D_OFFSET,DEFIO_PORT_E_OFFSET,DEFIO_PORT_F_OFFSET,DEFIO_PORT_G_OFFSET
1126 #endif
1127 #if !defined DEFIO_PORT_USED_LIST && DEFIO_PORT_F_USED_COUNT > 0
1128 # define DEFIO_PORT_USED_COUNT 6
1129 # define DEFIO_PORT_USED_LIST DEFIO_PORT_A_USED_MASK,DEFIO_PORT_B_USED_MASK,DEFIO_PORT_C_USED_MASK,DEFIO_PORT_D_USED_MASK,DEFIO_PORT_E_USED_MASK,DEFIO_PORT_F_USED_MASK
1130 # define DEFIO_PORT_OFFSET_LIST DEFIO_PORT_A_OFFSET,DEFIO_PORT_B_OFFSET,DEFIO_PORT_C_OFFSET,DEFIO_PORT_D_OFFSET,DEFIO_PORT_E_OFFSET,DEFIO_PORT_F_OFFSET
1131 #endif
1132 #if !defined DEFIO_PORT_USED_LIST && DEFIO_PORT_E_USED_COUNT > 0
1133 # define DEFIO_PORT_USED_COUNT 5
1134 # define DEFIO_PORT_USED_LIST DEFIO_PORT_A_USED_MASK,DEFIO_PORT_B_USED_MASK,DEFIO_PORT_C_USED_MASK,DEFIO_PORT_D_USED_MASK,DEFIO_PORT_E_USED_MASK
1135 # define DEFIO_PORT_OFFSET_LIST DEFIO_PORT_A_OFFSET,DEFIO_PORT_B_OFFSET,DEFIO_PORT_C_OFFSET,DEFIO_PORT_D_OFFSET,DEFIO_PORT_E_OFFSET
1136 #endif
1137 #if !defined DEFIO_PORT_USED_LIST && DEFIO_PORT_D_USED_COUNT > 0
1138 # define DEFIO_PORT_USED_COUNT 4
1139 # define DEFIO_PORT_USED_LIST DEFIO_PORT_A_USED_MASK,DEFIO_PORT_B_USED_MASK,DEFIO_PORT_C_USED_MASK,DEFIO_PORT_D_USED_MASK
1140 # define DEFIO_PORT_OFFSET_LIST DEFIO_PORT_A_OFFSET,DEFIO_PORT_B_OFFSET,DEFIO_PORT_C_OFFSET,DEFIO_PORT_D_OFFSET
1141 #endif
1142 #if !defined DEFIO_PORT_USED_LIST && DEFIO_PORT_C_USED_COUNT > 0
1143 # define DEFIO_PORT_USED_COUNT 3
1144 # define DEFIO_PORT_USED_LIST DEFIO_PORT_A_USED_MASK,DEFIO_PORT_B_USED_MASK,DEFIO_PORT_C_USED_MASK
1145 # define DEFIO_PORT_OFFSET_LIST DEFIO_PORT_A_OFFSET,DEFIO_PORT_B_OFFSET,DEFIO_PORT_C_OFFSET
1146 #endif
1147 #if !defined DEFIO_PORT_USED_LIST && DEFIO_PORT_B_USED_COUNT > 0
1148 # define DEFIO_PORT_USED_COUNT 2
1149 # define DEFIO_PORT_USED_LIST DEFIO_PORT_A_USED_MASK,DEFIO_PORT_B_USED_MASK
1150 # define DEFIO_PORT_OFFSET_LIST DEFIO_PORT_A_OFFSET,DEFIO_PORT_B_OFFSET
1151 #endif
1152 #if !defined DEFIO_PORT_USED_LIST && DEFIO_PORT_A_USED_COUNT > 0
1153 # define DEFIO_PORT_USED_COUNT 1
1154 # define DEFIO_PORT_USED_LIST DEFIO_PORT_A_USED_MASK
1155 # define DEFIO_PORT_OFFSET_LIST DEFIO_PORT_A_OFFSET
1156 #endif
1158 #if !defined(DEFIO_PORT_USED_LIST)
1159 # if !defined DEFIO_NO_PORTS // supress warnings if we really don't want any pins
1160 # warning "No pins are defined. Maybe you forgot to define TARGET_IO_PORTx in target.h"
1161 # endif
1162 # define DEFIO_PORT_USED_COUNT 0
1163 # define DEFIO_PORT_USED_LIST /* empty */
1164 # define DEFIO_PORT_OFFSET_LIST /* empty */
1165 #endif