aboutsummaryrefslogtreecommitdiff
path: root/lib/chibios/os/hal/boards/ST_NUCLEO144_L4R5ZI/board.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chibios/os/hal/boards/ST_NUCLEO144_L4R5ZI/board.h')
-rw-r--r--lib/chibios/os/hal/boards/ST_NUCLEO144_L4R5ZI/board.h1644
1 files changed, 1644 insertions, 0 deletions
diff --git a/lib/chibios/os/hal/boards/ST_NUCLEO144_L4R5ZI/board.h b/lib/chibios/os/hal/boards/ST_NUCLEO144_L4R5ZI/board.h
new file mode 100644
index 000000000..21a85ff0e
--- /dev/null
+++ b/lib/chibios/os/hal/boards/ST_NUCLEO144_L4R5ZI/board.h
@@ -0,0 +1,1644 @@
1/*
2 ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17/*
18 * This file has been automatically generated using ChibiStudio board
19 * generator plugin. Do not edit manually.
20 */
21
22#ifndef BOARD_H
23#define BOARD_H
24
25/*===========================================================================*/
26/* Driver constants. */
27/*===========================================================================*/
28
29/*
30 * Setup for STMicroelectronics STM32 Nucleo144-L4R5ZI board.
31 */
32
33/*
34 * Board identifier.
35 */
36#define BOARD_ST_NUCLEO144_L4R5ZI
37#define BOARD_NAME "STMicroelectronics STM32 Nucleo144-L4R5ZI"
38
39/*
40 * Board oscillators-related settings.
41 * NOTE: LSE not fitted.
42 * NOTE: HSE not fitted.
43 */
44#if !defined(STM32_LSECLK)
45#define STM32_LSECLK 0U
46#endif
47
48#define STM32_LSEDRV (3U << 3U)
49
50#if !defined(STM32_HSECLK)
51#define STM32_HSECLK 0U
52#endif
53
54/*
55 * Board voltages.
56 * Required for performance limits calculation.
57 */
58#define STM32_VDD 300U
59
60/*
61 * MCU type as defined in the ST header.
62 */
63#define STM32L4R5xx
64
65/*
66 * IO pins assignments.
67 */
68#define GPIOA_PIN0 0U
69#define GPIOA_PIN1 1U
70#define GPIOA_PIN2 2U
71#define GPIOA_PIN3 3U
72#define GPIOA_PIN4 4U
73#define GPIOA_PIN5 5U
74#define GPIOA_PIN6 6U
75#define GPIOA_PIN7 7U
76#define GPIOA_USB_SOF 8U
77#define GPIOA_USB_VBUS 9U
78#define GPIOA_USB_ID 10U
79#define GPIOA_USB_DM 11U
80#define GPIOA_USB_DP 12U
81#define GPIOA_SWDIO 13U
82#define GPIOA_SWCLK 14U
83#define GPIOA_PIN15 15U
84
85#define GPIOB_PIN0 0U
86#define GPIOB_PIN1 1U
87#define GPIOB_PIN2 2U
88#define GPIOB_SWO 3U
89#define GPIOB_PIN4 4U
90#define GPIOB_PIN5 5U
91#define GPIOB_PIN6 6U
92#define GPIOB_LED2 7U
93#define GPIOB_LED_BLUE 7U
94#define GPIOB_PIN8 8U
95#define GPIOB_PIN9 9U
96#define GPIOB_PIN10 10U
97#define GPIOB_PIN11 11U
98#define GPIOB_PIN12 12U
99#define GPIOB_PIN13 13U
100#define GPIOB_LED3 14U
101#define GPIOB_LED_RED 14U
102#define GPIOB_PIN15 15U
103
104#define GPIOC_PIN0 0U
105#define GPIOC_PIN1 1U
106#define GPIOC_PIN2 2U
107#define GPIOC_PIN3 3U
108#define GPIOC_PIN4 4U
109#define GPIOC_PIN5 5U
110#define GPIOC_PIN6 6U
111#define GPIOC_LED1 7U
112#define GPIOC_LED_GREEN 7U
113#define GPIOC_PIN8 8U
114#define GPIOC_PIN9 9U
115#define GPIOC_PIN10 10U
116#define GPIOC_PIN11 11U
117#define GPIOC_PIN12 12U
118#define GPIOC_BUTTON 13U
119#define GPIOC_PIN14 14U
120#define GPIOC_PIN15 15U
121
122#define GPIOD_PIN0 0U
123#define GPIOD_PIN1 1U
124#define GPIOD_PIN2 2U
125#define GPIOD_PIN3 3U
126#define GPIOD_PIN4 4U
127#define GPIOD_PIN5 5U
128#define GPIOD_PIN6 6U
129#define GPIOD_PIN7 7U
130#define GPIOD_PIN8 8U
131#define GPIOD_PIN9 9U
132#define GPIOD_PIN10 10U
133#define GPIOD_PIN11 11U
134#define GPIOD_PIN12 12U
135#define GPIOD_PIN13 13U
136#define GPIOD_PIN14 14U
137#define GPIOD_PIN15 15U
138
139#define GPIOE_PIN0 0U
140#define GPIOE_PIN1 1U
141#define GPIOE_PIN2 2U
142#define GPIOE_PIN3 3U
143#define GPIOE_PIN4 4U
144#define GPIOE_PIN5 5U
145#define GPIOE_PIN6 6U
146#define GPIOE_PIN7 7U
147#define GPIOE_PIN8 8U
148#define GPIOE_PIN9 9U
149#define GPIOE_PIN10 10U
150#define GPIOE_PIN11 11U
151#define GPIOE_PIN12 12U
152#define GPIOE_PIN13 13U
153#define GPIOE_PIN14 14U
154#define GPIOE_PIN15 15U
155
156#define GPIOF_PIN0 0U
157#define GPIOF_PIN1 1U
158#define GPIOF_PIN2 2U
159#define GPIOF_PIN3 3U
160#define GPIOF_PIN4 4U
161#define GPIOF_PIN5 5U
162#define GPIOF_PIN6 6U
163#define GPIOF_PIN7 7U
164#define GPIOF_PIN8 8U
165#define GPIOF_PIN9 9U
166#define GPIOF_PIN10 10U
167#define GPIOF_PIN11 11U
168#define GPIOF_PIN12 12U
169#define GPIOF_PIN13 13U
170#define GPIOF_PIN14 14U
171#define GPIOF_PIN15 15U
172
173#define GPIOG_PIN0 0U
174#define GPIOG_PIN1 1U
175#define GPIOG_PIN2 2U
176#define GPIOG_PIN3 3U
177#define GPIOG_PIN4 4U
178#define GPIOG_USB_OVER_CURRENT 5U
179#define GPIOG_USB_POWER_SWITCH_ON 6U
180#define GPIOG_LPUART1_TX 7U
181#define GPIOG_LPUART1_RX 8U
182#define GPIOG_PIN9 9U
183#define GPIOG_PIN10 10U
184#define GPIOG_PIN11 11U
185#define GPIOG_PIN12 12U
186#define GPIOG_PIN13 13U
187#define GPIOG_PIN14 14U
188#define GPIOG_PIN15 15U
189
190#define GPIOH_PIN0 0U
191#define GPIOH_PIN1 1U
192#define GPIOH_PIN2 2U
193#define GPIOH_PIN3 3U
194#define GPIOH_PIN4 4U
195#define GPIOH_PIN5 5U
196#define GPIOH_PIN6 6U
197#define GPIOH_PIN7 7U
198#define GPIOH_PIN8 8U
199#define GPIOH_PIN9 9U
200#define GPIOH_PIN10 10U
201#define GPIOH_PIN11 11U
202#define GPIOH_PIN12 12U
203#define GPIOH_PIN13 13U
204#define GPIOH_PIN14 14U
205#define GPIOH_PIN15 15U
206
207#define GPIOI_PIN0 0U
208#define GPIOI_PIN1 1U
209#define GPIOI_PIN2 2U
210#define GPIOI_PIN3 3U
211#define GPIOI_PIN4 4U
212#define GPIOI_PIN5 5U
213#define GPIOI_PIN6 6U
214#define GPIOI_PIN7 7U
215#define GPIOI_PIN8 8U
216#define GPIOI_PIN9 9U
217#define GPIOI_PIN10 10U
218#define GPIOI_PIN11 11U
219#define GPIOI_PIN12 12U
220#define GPIOI_PIN13 13U
221#define GPIOI_PIN14 14U
222#define GPIOI_PIN15 15U
223
224/*
225 * IO lines assignments.
226 */
227#define LINE_USB_SOF PAL_LINE(GPIOA, 8U)
228#define LINE_USB_VBUS PAL_LINE(GPIOA, 9U)
229#define LINE_USB_ID PAL_LINE(GPIOA, 10U)
230#define LINE_USB_DM PAL_LINE(GPIOA, 11U)
231#define LINE_USB_DP PAL_LINE(GPIOA, 12U)
232#define LINE_SWDIO PAL_LINE(GPIOA, 13U)
233#define LINE_SWCLK PAL_LINE(GPIOA, 14U)
234#define LINE_SWO PAL_LINE(GPIOB, 3U)
235#define LINE_LED2 PAL_LINE(GPIOB, 7U)
236#define LINE_LED_BLUE PAL_LINE(GPIOB, 7U)
237#define LINE_LED3 PAL_LINE(GPIOB, 14U)
238#define LINE_LED_RED PAL_LINE(GPIOB, 14U)
239#define LINE_LED1 PAL_LINE(GPIOC, 7U)
240#define LINE_LED_GREEN PAL_LINE(GPIOC, 7U)
241#define LINE_BUTTON PAL_LINE(GPIOC, 13U)
242#define LINE_USB_OVER_CURRENT PAL_LINE(GPIOG, 5U)
243#define LINE_USB_POWER_SWITCH_ON PAL_LINE(GPIOG, 6U)
244#define LINE_LPUART1_TX PAL_LINE(GPIOG, 7U)
245#define LINE_LPUART1_RX PAL_LINE(GPIOG, 8U)
246
247/*===========================================================================*/
248/* Driver pre-compile time settings. */
249/*===========================================================================*/
250
251/*===========================================================================*/
252/* Derived constants and error checks. */
253/*===========================================================================*/
254
255/*===========================================================================*/
256/* Driver data structures and types. */
257/*===========================================================================*/
258
259/*===========================================================================*/
260/* Driver macros. */
261/*===========================================================================*/
262
263/*
264 * I/O ports initial setup, this configuration is established soon after reset
265 * in the initialization code.
266 * Please refer to the STM32 Reference Manual for details.
267 */
268#define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
269#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
270#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
271#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
272#define PIN_ODR_LOW(n) (0U << (n))
273#define PIN_ODR_HIGH(n) (1U << (n))
274#define PIN_OTYPE_PUSHPULL(n) (0U << (n))
275#define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
276#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U))
277#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U))
278#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U))
279#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U))
280#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
281#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
282#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
283#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
284#define PIN_ASCR_DISABLED(n) (0U << (n))
285#define PIN_ASCR_ENABLED(n) (1U << (n))
286#define PIN_LOCKR_DISABLED(n) (0U << (n))
287#define PIN_LOCKR_ENABLED(n) (1U << (n))
288
289/*
290 * GPIOA setup:
291 *
292 * PA0 - PIN0 (analog).
293 * PA1 - PIN1 (analog).
294 * PA2 - PIN2 (analog).
295 * PA3 - PIN3 (analog).
296 * PA4 - PIN4 (analog).
297 * PA5 - PIN5 (analog).
298 * PA6 - PIN6 (analog).
299 * PA7 - PIN7 (analog).
300 * PA8 - USB_SOF (alternate 10).
301 * PA9 - USB_VBUS (analog).
302 * PA10 - USB_ID (alternate 10).
303 * PA11 - USB_DM (alternate 10).
304 * PA12 - USB_DP (alternate 10).
305 * PA13 - SWDIO (alternate 0).
306 * PA14 - SWCLK (alternate 0).
307 * PA15 - PIN15 (analog).
308 */
309#define VAL_GPIOA_MODER (PIN_MODE_ANALOG(GPIOA_PIN0) | \
310 PIN_MODE_ANALOG(GPIOA_PIN1) | \
311 PIN_MODE_ANALOG(GPIOA_PIN2) | \
312 PIN_MODE_ANALOG(GPIOA_PIN3) | \
313 PIN_MODE_ANALOG(GPIOA_PIN4) | \
314 PIN_MODE_ANALOG(GPIOA_PIN5) | \
315 PIN_MODE_ANALOG(GPIOA_PIN6) | \
316 PIN_MODE_ANALOG(GPIOA_PIN7) | \
317 PIN_MODE_ALTERNATE(GPIOA_USB_SOF) | \
318 PIN_MODE_ANALOG(GPIOA_USB_VBUS) | \
319 PIN_MODE_ALTERNATE(GPIOA_USB_ID) | \
320 PIN_MODE_ALTERNATE(GPIOA_USB_DM) | \
321 PIN_MODE_ALTERNATE(GPIOA_USB_DP) | \
322 PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \
323 PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \
324 PIN_MODE_ANALOG(GPIOA_PIN15))
325#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_PIN0) | \
326 PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \
327 PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \
328 PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \
329 PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \
330 PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \
331 PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \
332 PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \
333 PIN_OTYPE_PUSHPULL(GPIOA_USB_SOF) | \
334 PIN_OTYPE_PUSHPULL(GPIOA_USB_VBUS) | \
335 PIN_OTYPE_PUSHPULL(GPIOA_USB_ID) | \
336 PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | \
337 PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | \
338 PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \
339 PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \
340 PIN_OTYPE_PUSHPULL(GPIOA_PIN15))
341#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_PIN0) | \
342 PIN_OSPEED_VERYLOW(GPIOA_PIN1) | \
343 PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \
344 PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \
345 PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \
346 PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \
347 PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \
348 PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \
349 PIN_OSPEED_HIGH(GPIOA_USB_SOF) | \
350 PIN_OSPEED_VERYLOW(GPIOA_USB_VBUS) | \
351 PIN_OSPEED_HIGH(GPIOA_USB_ID) | \
352 PIN_OSPEED_HIGH(GPIOA_USB_DM) | \
353 PIN_OSPEED_HIGH(GPIOA_USB_DP) | \
354 PIN_OSPEED_HIGH(GPIOA_SWDIO) | \
355 PIN_OSPEED_HIGH(GPIOA_SWCLK) | \
356 PIN_OSPEED_VERYLOW(GPIOA_PIN15))
357#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_PIN0) | \
358 PIN_PUPDR_FLOATING(GPIOA_PIN1) | \
359 PIN_PUPDR_FLOATING(GPIOA_PIN2) | \
360 PIN_PUPDR_FLOATING(GPIOA_PIN3) | \
361 PIN_PUPDR_FLOATING(GPIOA_PIN4) | \
362 PIN_PUPDR_FLOATING(GPIOA_PIN5) | \
363 PIN_PUPDR_FLOATING(GPIOA_PIN6) | \
364 PIN_PUPDR_FLOATING(GPIOA_PIN7) | \
365 PIN_PUPDR_FLOATING(GPIOA_USB_SOF) | \
366 PIN_PUPDR_FLOATING(GPIOA_USB_VBUS) | \
367 PIN_PUPDR_FLOATING(GPIOA_USB_ID) | \
368 PIN_PUPDR_FLOATING(GPIOA_USB_DM) | \
369 PIN_PUPDR_FLOATING(GPIOA_USB_DP) | \
370 PIN_PUPDR_PULLDOWN(GPIOA_SWDIO) | \
371 PIN_PUPDR_PULLUP(GPIOA_SWCLK) | \
372 PIN_PUPDR_FLOATING(GPIOA_PIN15))
373#define VAL_GPIOA_ODR (PIN_ODR_LOW(GPIOA_PIN0) | \
374 PIN_ODR_LOW(GPIOA_PIN1) | \
375 PIN_ODR_LOW(GPIOA_PIN2) | \
376 PIN_ODR_LOW(GPIOA_PIN3) | \
377 PIN_ODR_LOW(GPIOA_PIN4) | \
378 PIN_ODR_LOW(GPIOA_PIN5) | \
379 PIN_ODR_LOW(GPIOA_PIN6) | \
380 PIN_ODR_LOW(GPIOA_PIN7) | \
381 PIN_ODR_LOW(GPIOA_USB_SOF) | \
382 PIN_ODR_LOW(GPIOA_USB_VBUS) | \
383 PIN_ODR_LOW(GPIOA_USB_ID) | \
384 PIN_ODR_LOW(GPIOA_USB_DM) | \
385 PIN_ODR_LOW(GPIOA_USB_DP) | \
386 PIN_ODR_LOW(GPIOA_SWDIO) | \
387 PIN_ODR_LOW(GPIOA_SWCLK) | \
388 PIN_ODR_LOW(GPIOA_PIN15))
389#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_PIN0, 0U) | \
390 PIN_AFIO_AF(GPIOA_PIN1, 0U) | \
391 PIN_AFIO_AF(GPIOA_PIN2, 0U) | \
392 PIN_AFIO_AF(GPIOA_PIN3, 0U) | \
393 PIN_AFIO_AF(GPIOA_PIN4, 0U) | \
394 PIN_AFIO_AF(GPIOA_PIN5, 0U) | \
395 PIN_AFIO_AF(GPIOA_PIN6, 0U) | \
396 PIN_AFIO_AF(GPIOA_PIN7, 0U))
397#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_USB_SOF, 10U) | \
398 PIN_AFIO_AF(GPIOA_USB_VBUS, 0U) | \
399 PIN_AFIO_AF(GPIOA_USB_ID, 10U) | \
400 PIN_AFIO_AF(GPIOA_USB_DM, 10U) | \
401 PIN_AFIO_AF(GPIOA_USB_DP, 10U) | \
402 PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \
403 PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \
404 PIN_AFIO_AF(GPIOA_PIN15, 0U))
405#define VAL_GPIOA_ASCR (PIN_ASCR_DISABLED(GPIOA_PIN0) | \
406 PIN_ASCR_DISABLED(GPIOA_PIN1) | \
407 PIN_ASCR_DISABLED(GPIOA_PIN2) | \
408 PIN_ASCR_DISABLED(GPIOA_PIN3) | \
409 PIN_ASCR_DISABLED(GPIOA_PIN4) | \
410 PIN_ASCR_DISABLED(GPIOA_PIN5) | \
411 PIN_ASCR_DISABLED(GPIOA_PIN6) | \
412 PIN_ASCR_DISABLED(GPIOA_PIN7) | \
413 PIN_ASCR_DISABLED(GPIOA_USB_SOF) | \
414 PIN_ASCR_DISABLED(GPIOA_USB_VBUS) | \
415 PIN_ASCR_DISABLED(GPIOA_USB_ID) | \
416 PIN_ASCR_DISABLED(GPIOA_USB_DM) | \
417 PIN_ASCR_DISABLED(GPIOA_USB_DP) | \
418 PIN_ASCR_DISABLED(GPIOA_SWDIO) | \
419 PIN_ASCR_DISABLED(GPIOA_SWCLK) | \
420 PIN_ASCR_DISABLED(GPIOA_PIN15))
421#define VAL_GPIOA_LOCKR (PIN_LOCKR_DISABLED(GPIOA_PIN0) | \
422 PIN_LOCKR_DISABLED(GPIOA_PIN1) | \
423 PIN_LOCKR_DISABLED(GPIOA_PIN2) | \
424 PIN_LOCKR_DISABLED(GPIOA_PIN3) | \
425 PIN_LOCKR_DISABLED(GPIOA_PIN4) | \
426 PIN_LOCKR_DISABLED(GPIOA_PIN5) | \
427 PIN_LOCKR_DISABLED(GPIOA_PIN6) | \
428 PIN_LOCKR_DISABLED(GPIOA_PIN7) | \
429 PIN_LOCKR_DISABLED(GPIOA_USB_SOF) | \
430 PIN_LOCKR_DISABLED(GPIOA_USB_VBUS) | \
431 PIN_LOCKR_DISABLED(GPIOA_USB_ID) | \
432 PIN_LOCKR_DISABLED(GPIOA_USB_DM) | \
433 PIN_LOCKR_DISABLED(GPIOA_USB_DP) | \
434 PIN_LOCKR_DISABLED(GPIOA_SWDIO) | \
435 PIN_LOCKR_DISABLED(GPIOA_SWCLK) | \
436 PIN_LOCKR_DISABLED(GPIOA_PIN15))
437
438/*
439 * GPIOB setup:
440 *
441 * PB0 - PIN0 (analog).
442 * PB1 - PIN1 (analog).
443 * PB2 - PIN2 (analog).
444 * PB3 - SWO (alternate 0).
445 * PB4 - PIN4 (analog).
446 * PB5 - PIN5 (analog).
447 * PB6 - PIN6 (analog).
448 * PB7 - LED2 LED_BLUE (output pushpull maximum).
449 * PB8 - PIN8 (analog).
450 * PB9 - PIN9 (analog).
451 * PB10 - PIN10 (analog).
452 * PB11 - PIN11 (analog).
453 * PB12 - PIN12 (analog).
454 * PB13 - PIN13 (analog).
455 * PB14 - LED3 LED_RED (output pushpull maximum).
456 * PB15 - PIN15 (analog).
457 */
458#define VAL_GPIOB_MODER (PIN_MODE_ANALOG(GPIOB_PIN0) | \
459 PIN_MODE_ANALOG(GPIOB_PIN1) | \
460 PIN_MODE_ANALOG(GPIOB_PIN2) | \
461 PIN_MODE_ALTERNATE(GPIOB_SWO) | \
462 PIN_MODE_ANALOG(GPIOB_PIN4) | \
463 PIN_MODE_ANALOG(GPIOB_PIN5) | \
464 PIN_MODE_ANALOG(GPIOB_PIN6) | \
465 PIN_MODE_OUTPUT(GPIOB_LED2) | \
466 PIN_MODE_ANALOG(GPIOB_PIN8) | \
467 PIN_MODE_ANALOG(GPIOB_PIN9) | \
468 PIN_MODE_ANALOG(GPIOB_PIN10) | \
469 PIN_MODE_ANALOG(GPIOB_PIN11) | \
470 PIN_MODE_ANALOG(GPIOB_PIN12) | \
471 PIN_MODE_ANALOG(GPIOB_PIN13) | \
472 PIN_MODE_OUTPUT(GPIOB_LED3) | \
473 PIN_MODE_ANALOG(GPIOB_PIN15))
474#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \
475 PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \
476 PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \
477 PIN_OTYPE_PUSHPULL(GPIOB_SWO) | \
478 PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \
479 PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \
480 PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | \
481 PIN_OTYPE_PUSHPULL(GPIOB_LED2) | \
482 PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \
483 PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \
484 PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \
485 PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \
486 PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \
487 PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \
488 PIN_OTYPE_PUSHPULL(GPIOB_LED3) | \
489 PIN_OTYPE_PUSHPULL(GPIOB_PIN15))
490#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \
491 PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \
492 PIN_OSPEED_VERYLOW(GPIOB_PIN2) | \
493 PIN_OSPEED_HIGH(GPIOB_SWO) | \
494 PIN_OSPEED_VERYLOW(GPIOB_PIN4) | \
495 PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \
496 PIN_OSPEED_VERYLOW(GPIOB_PIN6) | \
497 PIN_OSPEED_HIGH(GPIOB_LED2) | \
498 PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \
499 PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \
500 PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \
501 PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \
502 PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \
503 PIN_OSPEED_VERYLOW(GPIOB_PIN13) | \
504 PIN_OSPEED_HIGH(GPIOB_LED3) | \
505 PIN_OSPEED_VERYLOW(GPIOB_PIN15))
506#define VAL_GPIOB_PUPDR (PIN_PUPDR_FLOATING(GPIOB_PIN0) | \
507 PIN_PUPDR_FLOATING(GPIOB_PIN1) | \
508 PIN_PUPDR_FLOATING(GPIOB_PIN2) | \
509 PIN_PUPDR_FLOATING(GPIOB_SWO) | \
510 PIN_PUPDR_FLOATING(GPIOB_PIN4) | \
511 PIN_PUPDR_FLOATING(GPIOB_PIN5) | \
512 PIN_PUPDR_FLOATING(GPIOB_PIN6) | \
513 PIN_PUPDR_FLOATING(GPIOB_LED2) | \
514 PIN_PUPDR_FLOATING(GPIOB_PIN8) | \
515 PIN_PUPDR_FLOATING(GPIOB_PIN9) | \
516 PIN_PUPDR_FLOATING(GPIOB_PIN10) | \
517 PIN_PUPDR_FLOATING(GPIOB_PIN11) | \
518 PIN_PUPDR_FLOATING(GPIOB_PIN12) | \
519 PIN_PUPDR_FLOATING(GPIOB_PIN13) | \
520 PIN_PUPDR_FLOATING(GPIOB_LED3) | \
521 PIN_PUPDR_FLOATING(GPIOB_PIN15))
522#define VAL_GPIOB_ODR (PIN_ODR_LOW(GPIOB_PIN0) | \
523 PIN_ODR_LOW(GPIOB_PIN1) | \
524 PIN_ODR_LOW(GPIOB_PIN2) | \
525 PIN_ODR_LOW(GPIOB_SWO) | \
526 PIN_ODR_LOW(GPIOB_PIN4) | \
527 PIN_ODR_LOW(GPIOB_PIN5) | \
528 PIN_ODR_LOW(GPIOB_PIN6) | \
529 PIN_ODR_LOW(GPIOB_LED2) | \
530 PIN_ODR_LOW(GPIOB_PIN8) | \
531 PIN_ODR_LOW(GPIOB_PIN9) | \
532 PIN_ODR_LOW(GPIOB_PIN10) | \
533 PIN_ODR_LOW(GPIOB_PIN11) | \
534 PIN_ODR_LOW(GPIOB_PIN12) | \
535 PIN_ODR_LOW(GPIOB_PIN13) | \
536 PIN_ODR_LOW(GPIOB_LED3) | \
537 PIN_ODR_LOW(GPIOB_PIN15))
538#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0U) | \
539 PIN_AFIO_AF(GPIOB_PIN1, 0U) | \
540 PIN_AFIO_AF(GPIOB_PIN2, 0U) | \
541 PIN_AFIO_AF(GPIOB_SWO, 0U) | \
542 PIN_AFIO_AF(GPIOB_PIN4, 0U) | \
543 PIN_AFIO_AF(GPIOB_PIN5, 0U) | \
544 PIN_AFIO_AF(GPIOB_PIN6, 0U) | \
545 PIN_AFIO_AF(GPIOB_LED2, 0U))
546#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \
547 PIN_AFIO_AF(GPIOB_PIN9, 0U) | \
548 PIN_AFIO_AF(GPIOB_PIN10, 0U) | \
549 PIN_AFIO_AF(GPIOB_PIN11, 0U) | \
550 PIN_AFIO_AF(GPIOB_PIN12, 0U) | \
551 PIN_AFIO_AF(GPIOB_PIN13, 0U) | \
552 PIN_AFIO_AF(GPIOB_LED3, 0U) | \
553 PIN_AFIO_AF(GPIOB_PIN15, 0U))
554#define VAL_GPIOB_ASCR (PIN_ASCR_DISABLED(GPIOB_PIN0) | \
555 PIN_ASCR_DISABLED(GPIOB_PIN1) | \
556 PIN_ASCR_DISABLED(GPIOB_PIN2) | \
557 PIN_ASCR_DISABLED(GPIOB_SWO) | \
558 PIN_ASCR_DISABLED(GPIOB_PIN4) | \
559 PIN_ASCR_DISABLED(GPIOB_PIN5) | \
560 PIN_ASCR_DISABLED(GPIOB_PIN6) | \
561 PIN_ASCR_DISABLED(GPIOB_LED2) | \
562 PIN_ASCR_DISABLED(GPIOB_PIN8) | \
563 PIN_ASCR_DISABLED(GPIOB_PIN9) | \
564 PIN_ASCR_DISABLED(GPIOB_PIN10) | \
565 PIN_ASCR_DISABLED(GPIOB_PIN11) | \
566 PIN_ASCR_DISABLED(GPIOB_PIN12) | \
567 PIN_ASCR_DISABLED(GPIOB_PIN13) | \
568 PIN_ASCR_DISABLED(GPIOB_LED3) | \
569 PIN_ASCR_DISABLED(GPIOB_PIN15))
570#define VAL_GPIOB_LOCKR (PIN_LOCKR_DISABLED(GPIOB_PIN0) | \
571 PIN_LOCKR_DISABLED(GPIOB_PIN1) | \
572 PIN_LOCKR_DISABLED(GPIOB_PIN2) | \
573 PIN_LOCKR_DISABLED(GPIOB_SWO) | \
574 PIN_LOCKR_DISABLED(GPIOB_PIN4) | \
575 PIN_LOCKR_DISABLED(GPIOB_PIN5) | \
576 PIN_LOCKR_DISABLED(GPIOB_PIN6) | \
577 PIN_LOCKR_DISABLED(GPIOB_LED2) | \
578 PIN_LOCKR_DISABLED(GPIOB_PIN8) | \
579 PIN_LOCKR_DISABLED(GPIOB_PIN9) | \
580 PIN_LOCKR_DISABLED(GPIOB_PIN10) | \
581 PIN_LOCKR_DISABLED(GPIOB_PIN11) | \
582 PIN_LOCKR_DISABLED(GPIOB_PIN12) | \
583 PIN_LOCKR_DISABLED(GPIOB_PIN13) | \
584 PIN_LOCKR_DISABLED(GPIOB_LED3) | \
585 PIN_LOCKR_DISABLED(GPIOB_PIN15))
586
587/*
588 * GPIOC setup:
589 *
590 * PC0 - PIN0 (analog).
591 * PC1 - PIN1 (analog).
592 * PC2 - PIN2 (analog).
593 * PC3 - PIN3 (analog).
594 * PC4 - PIN4 (analog).
595 * PC5 - PIN5 (analog).
596 * PC6 - PIN6 (analog).
597 * PC7 - LED1 LED_GREEN (output pushpull maximum).
598 * PC8 - PIN8 (analog).
599 * PC9 - PIN9 (analog).
600 * PC10 - PIN10 (analog).
601 * PC11 - PIN11 (analog).
602 * PC12 - PIN12 (analog).
603 * PC13 - BUTTON (input floating).
604 * PC14 - PIN14 (analog).
605 * PC15 - PIN15 (analog).
606 */
607#define VAL_GPIOC_MODER (PIN_MODE_ANALOG(GPIOC_PIN0) | \
608 PIN_MODE_ANALOG(GPIOC_PIN1) | \
609 PIN_MODE_ANALOG(GPIOC_PIN2) | \
610 PIN_MODE_ANALOG(GPIOC_PIN3) | \
611 PIN_MODE_ANALOG(GPIOC_PIN4) | \
612 PIN_MODE_ANALOG(GPIOC_PIN5) | \
613 PIN_MODE_ANALOG(GPIOC_PIN6) | \
614 PIN_MODE_OUTPUT(GPIOC_LED1) | \
615 PIN_MODE_ANALOG(GPIOC_PIN8) | \
616 PIN_MODE_ANALOG(GPIOC_PIN9) | \
617 PIN_MODE_ANALOG(GPIOC_PIN10) | \
618 PIN_MODE_ANALOG(GPIOC_PIN11) | \
619 PIN_MODE_ANALOG(GPIOC_PIN12) | \
620 PIN_MODE_INPUT(GPIOC_BUTTON) | \
621 PIN_MODE_ANALOG(GPIOC_PIN14) | \
622 PIN_MODE_ANALOG(GPIOC_PIN15))
623#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_PIN0) | \
624 PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \
625 PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \
626 PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \
627 PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \
628 PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \
629 PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | \
630 PIN_OTYPE_PUSHPULL(GPIOC_LED1) | \
631 PIN_OTYPE_PUSHPULL(GPIOC_PIN8) | \
632 PIN_OTYPE_PUSHPULL(GPIOC_PIN9) | \
633 PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \
634 PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \
635 PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \
636 PIN_OTYPE_PUSHPULL(GPIOC_BUTTON) | \
637 PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | \
638 PIN_OTYPE_PUSHPULL(GPIOC_PIN15))
639#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOC_PIN0) | \
640 PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \
641 PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \
642 PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \
643 PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \
644 PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \
645 PIN_OSPEED_VERYLOW(GPIOC_PIN6) | \
646 PIN_OSPEED_HIGH(GPIOC_LED1) | \
647 PIN_OSPEED_VERYLOW(GPIOC_PIN8) | \
648 PIN_OSPEED_VERYLOW(GPIOC_PIN9) | \
649 PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \
650 PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \
651 PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \
652 PIN_OSPEED_VERYLOW(GPIOC_BUTTON) | \
653 PIN_OSPEED_VERYLOW(GPIOC_PIN14) | \
654 PIN_OSPEED_VERYLOW(GPIOC_PIN15))
655#define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_PIN0) | \
656 PIN_PUPDR_FLOATING(GPIOC_PIN1) | \
657 PIN_PUPDR_FLOATING(GPIOC_PIN2) | \
658 PIN_PUPDR_FLOATING(GPIOC_PIN3) | \
659 PIN_PUPDR_FLOATING(GPIOC_PIN4) | \
660 PIN_PUPDR_FLOATING(GPIOC_PIN5) | \
661 PIN_PUPDR_FLOATING(GPIOC_PIN6) | \
662 PIN_PUPDR_FLOATING(GPIOC_LED1) | \
663 PIN_PUPDR_FLOATING(GPIOC_PIN8) | \
664 PIN_PUPDR_FLOATING(GPIOC_PIN9) | \
665 PIN_PUPDR_FLOATING(GPIOC_PIN10) | \
666 PIN_PUPDR_FLOATING(GPIOC_PIN11) | \
667 PIN_PUPDR_FLOATING(GPIOC_PIN12) | \
668 PIN_PUPDR_FLOATING(GPIOC_BUTTON) | \
669 PIN_PUPDR_FLOATING(GPIOC_PIN14) | \
670 PIN_PUPDR_FLOATING(GPIOC_PIN15))
671#define VAL_GPIOC_ODR (PIN_ODR_LOW(GPIOC_PIN0) | \
672 PIN_ODR_LOW(GPIOC_PIN1) | \
673 PIN_ODR_LOW(GPIOC_PIN2) | \
674 PIN_ODR_LOW(GPIOC_PIN3) | \
675 PIN_ODR_LOW(GPIOC_PIN4) | \
676 PIN_ODR_LOW(GPIOC_PIN5) | \
677 PIN_ODR_LOW(GPIOC_PIN6) | \
678 PIN_ODR_LOW(GPIOC_LED1) | \
679 PIN_ODR_LOW(GPIOC_PIN8) | \
680 PIN_ODR_LOW(GPIOC_PIN9) | \
681 PIN_ODR_LOW(GPIOC_PIN10) | \
682 PIN_ODR_LOW(GPIOC_PIN11) | \
683 PIN_ODR_LOW(GPIOC_PIN12) | \
684 PIN_ODR_LOW(GPIOC_BUTTON) | \
685 PIN_ODR_LOW(GPIOC_PIN14) | \
686 PIN_ODR_LOW(GPIOC_PIN15))
687#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_PIN0, 0U) | \
688 PIN_AFIO_AF(GPIOC_PIN1, 0U) | \
689 PIN_AFIO_AF(GPIOC_PIN2, 0U) | \
690 PIN_AFIO_AF(GPIOC_PIN3, 0U) | \
691 PIN_AFIO_AF(GPIOC_PIN4, 0U) | \
692 PIN_AFIO_AF(GPIOC_PIN5, 0U) | \
693 PIN_AFIO_AF(GPIOC_PIN6, 0U) | \
694 PIN_AFIO_AF(GPIOC_LED1, 0U))
695#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_PIN8, 0U) | \
696 PIN_AFIO_AF(GPIOC_PIN9, 0U) | \
697 PIN_AFIO_AF(GPIOC_PIN10, 0U) | \
698 PIN_AFIO_AF(GPIOC_PIN11, 0U) | \
699 PIN_AFIO_AF(GPIOC_PIN12, 0U) | \
700 PIN_AFIO_AF(GPIOC_BUTTON, 0U) | \
701 PIN_AFIO_AF(GPIOC_PIN14, 0U) | \
702 PIN_AFIO_AF(GPIOC_PIN15, 0U))
703#define VAL_GPIOC_ASCR (PIN_ASCR_DISABLED(GPIOC_PIN0) | \
704 PIN_ASCR_DISABLED(GPIOC_PIN1) | \
705 PIN_ASCR_DISABLED(GPIOC_PIN2) | \
706 PIN_ASCR_DISABLED(GPIOC_PIN3) | \
707 PIN_ASCR_DISABLED(GPIOC_PIN4) | \
708 PIN_ASCR_DISABLED(GPIOC_PIN5) | \
709 PIN_ASCR_DISABLED(GPIOC_PIN6) | \
710 PIN_ASCR_DISABLED(GPIOC_LED1) | \
711 PIN_ASCR_DISABLED(GPIOC_PIN8) | \
712 PIN_ASCR_DISABLED(GPIOC_PIN9) | \
713 PIN_ASCR_DISABLED(GPIOC_PIN10) | \
714 PIN_ASCR_DISABLED(GPIOC_PIN11) | \
715 PIN_ASCR_DISABLED(GPIOC_PIN12) | \
716 PIN_ASCR_DISABLED(GPIOC_BUTTON) | \
717 PIN_ASCR_DISABLED(GPIOC_PIN14) | \
718 PIN_ASCR_DISABLED(GPIOC_PIN15))
719#define VAL_GPIOC_LOCKR (PIN_LOCKR_DISABLED(GPIOC_PIN0) | \
720 PIN_LOCKR_DISABLED(GPIOC_PIN1) | \
721 PIN_LOCKR_DISABLED(GPIOC_PIN2) | \
722 PIN_LOCKR_DISABLED(GPIOC_PIN3) | \
723 PIN_LOCKR_DISABLED(GPIOC_PIN4) | \
724 PIN_LOCKR_DISABLED(GPIOC_PIN5) | \
725 PIN_LOCKR_DISABLED(GPIOC_PIN6) | \
726 PIN_LOCKR_DISABLED(GPIOC_LED1) | \
727 PIN_LOCKR_DISABLED(GPIOC_PIN8) | \
728 PIN_LOCKR_DISABLED(GPIOC_PIN9) | \
729 PIN_LOCKR_DISABLED(GPIOC_PIN10) | \
730 PIN_LOCKR_DISABLED(GPIOC_PIN11) | \
731 PIN_LOCKR_DISABLED(GPIOC_PIN12) | \
732 PIN_LOCKR_DISABLED(GPIOC_BUTTON) | \
733 PIN_LOCKR_DISABLED(GPIOC_PIN14) | \
734 PIN_LOCKR_DISABLED(GPIOC_PIN15))
735
736/*
737 * GPIOD setup:
738 *
739 * PD0 - PIN0 (analog).
740 * PD1 - PIN1 (analog).
741 * PD2 - PIN2 (analog).
742 * PD3 - PIN3 (analog).
743 * PD4 - PIN4 (analog).
744 * PD5 - PIN5 (analog).
745 * PD6 - PIN6 (analog).
746 * PD7 - PIN7 (analog).
747 * PD8 - PIN8 (analog).
748 * PD9 - PIN9 (analog).
749 * PD10 - PIN10 (analog).
750 * PD11 - PIN11 (analog).
751 * PD12 - PIN12 (analog).
752 * PD13 - PIN13 (analog).
753 * PD14 - PIN14 (analog).
754 * PD15 - PIN15 (analog).
755 */
756#define VAL_GPIOD_MODER (PIN_MODE_ANALOG(GPIOD_PIN0) | \
757 PIN_MODE_ANALOG(GPIOD_PIN1) | \
758 PIN_MODE_ANALOG(GPIOD_PIN2) | \
759 PIN_MODE_ANALOG(GPIOD_PIN3) | \
760 PIN_MODE_ANALOG(GPIOD_PIN4) | \
761 PIN_MODE_ANALOG(GPIOD_PIN5) | \
762 PIN_MODE_ANALOG(GPIOD_PIN6) | \
763 PIN_MODE_ANALOG(GPIOD_PIN7) | \
764 PIN_MODE_ANALOG(GPIOD_PIN8) | \
765 PIN_MODE_ANALOG(GPIOD_PIN9) | \
766 PIN_MODE_ANALOG(GPIOD_PIN10) | \
767 PIN_MODE_ANALOG(GPIOD_PIN11) | \
768 PIN_MODE_ANALOG(GPIOD_PIN12) | \
769 PIN_MODE_ANALOG(GPIOD_PIN13) | \
770 PIN_MODE_ANALOG(GPIOD_PIN14) | \
771 PIN_MODE_ANALOG(GPIOD_PIN15))
772#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \
773 PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \
774 PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \
775 PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \
776 PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \
777 PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \
778 PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \
779 PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \
780 PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \
781 PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \
782 PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \
783 PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \
784 PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \
785 PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \
786 PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \
787 PIN_OTYPE_PUSHPULL(GPIOD_PIN15))
788#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \
789 PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \
790 PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \
791 PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \
792 PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \
793 PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \
794 PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \
795 PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \
796 PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \
797 PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \
798 PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \
799 PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \
800 PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \
801 PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \
802 PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \
803 PIN_OSPEED_VERYLOW(GPIOD_PIN15))
804#define VAL_GPIOD_PUPDR (PIN_PUPDR_FLOATING(GPIOD_PIN0) | \
805 PIN_PUPDR_FLOATING(GPIOD_PIN1) | \
806 PIN_PUPDR_FLOATING(GPIOD_PIN2) | \
807 PIN_PUPDR_FLOATING(GPIOD_PIN3) | \
808 PIN_PUPDR_FLOATING(GPIOD_PIN4) | \
809 PIN_PUPDR_FLOATING(GPIOD_PIN5) | \
810 PIN_PUPDR_FLOATING(GPIOD_PIN6) | \
811 PIN_PUPDR_FLOATING(GPIOD_PIN7) | \
812 PIN_PUPDR_FLOATING(GPIOD_PIN8) | \
813 PIN_PUPDR_FLOATING(GPIOD_PIN9) | \
814 PIN_PUPDR_FLOATING(GPIOD_PIN10) | \
815 PIN_PUPDR_FLOATING(GPIOD_PIN11) | \
816 PIN_PUPDR_FLOATING(GPIOD_PIN12) | \
817 PIN_PUPDR_FLOATING(GPIOD_PIN13) | \
818 PIN_PUPDR_FLOATING(GPIOD_PIN14) | \
819 PIN_PUPDR_FLOATING(GPIOD_PIN15))
820#define VAL_GPIOD_ODR (PIN_ODR_LOW(GPIOD_PIN0) | \
821 PIN_ODR_LOW(GPIOD_PIN1) | \
822 PIN_ODR_LOW(GPIOD_PIN2) | \
823 PIN_ODR_LOW(GPIOD_PIN3) | \
824 PIN_ODR_LOW(GPIOD_PIN4) | \
825 PIN_ODR_LOW(GPIOD_PIN5) | \
826 PIN_ODR_LOW(GPIOD_PIN6) | \
827 PIN_ODR_LOW(GPIOD_PIN7) | \
828 PIN_ODR_LOW(GPIOD_PIN8) | \
829 PIN_ODR_LOW(GPIOD_PIN9) | \
830 PIN_ODR_LOW(GPIOD_PIN10) | \
831 PIN_ODR_LOW(GPIOD_PIN11) | \
832 PIN_ODR_LOW(GPIOD_PIN12) | \
833 PIN_ODR_LOW(GPIOD_PIN13) | \
834 PIN_ODR_LOW(GPIOD_PIN14) | \
835 PIN_ODR_LOW(GPIOD_PIN15))
836#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \
837 PIN_AFIO_AF(GPIOD_PIN1, 0U) | \
838 PIN_AFIO_AF(GPIOD_PIN2, 0U) | \
839 PIN_AFIO_AF(GPIOD_PIN3, 0U) | \
840 PIN_AFIO_AF(GPIOD_PIN4, 0U) | \
841 PIN_AFIO_AF(GPIOD_PIN5, 0U) | \
842 PIN_AFIO_AF(GPIOD_PIN6, 0U) | \
843 PIN_AFIO_AF(GPIOD_PIN7, 0U))
844#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \
845 PIN_AFIO_AF(GPIOD_PIN9, 0U) | \
846 PIN_AFIO_AF(GPIOD_PIN10, 0U) | \
847 PIN_AFIO_AF(GPIOD_PIN11, 0U) | \
848 PIN_AFIO_AF(GPIOD_PIN12, 0U) | \
849 PIN_AFIO_AF(GPIOD_PIN13, 0U) | \
850 PIN_AFIO_AF(GPIOD_PIN14, 0U) | \
851 PIN_AFIO_AF(GPIOD_PIN15, 0U))
852#define VAL_GPIOD_ASCR (PIN_ASCR_DISABLED(GPIOD_PIN0) | \
853 PIN_ASCR_DISABLED(GPIOD_PIN1) | \
854 PIN_ASCR_DISABLED(GPIOD_PIN2) | \
855 PIN_ASCR_DISABLED(GPIOD_PIN3) | \
856 PIN_ASCR_DISABLED(GPIOD_PIN4) | \
857 PIN_ASCR_DISABLED(GPIOD_PIN5) | \
858 PIN_ASCR_DISABLED(GPIOD_PIN6) | \
859 PIN_ASCR_DISABLED(GPIOD_PIN7) | \
860 PIN_ASCR_DISABLED(GPIOD_PIN8) | \
861 PIN_ASCR_DISABLED(GPIOD_PIN9) | \
862 PIN_ASCR_DISABLED(GPIOD_PIN10) | \
863 PIN_ASCR_DISABLED(GPIOD_PIN11) | \
864 PIN_ASCR_DISABLED(GPIOD_PIN12) | \
865 PIN_ASCR_DISABLED(GPIOD_PIN13) | \
866 PIN_ASCR_DISABLED(GPIOD_PIN14) | \
867 PIN_ASCR_DISABLED(GPIOD_PIN15))
868#define VAL_GPIOD_LOCKR (PIN_LOCKR_DISABLED(GPIOD_PIN0) | \
869 PIN_LOCKR_DISABLED(GPIOD_PIN1) | \
870 PIN_LOCKR_DISABLED(GPIOD_PIN2) | \
871 PIN_LOCKR_DISABLED(GPIOD_PIN3) | \
872 PIN_LOCKR_DISABLED(GPIOD_PIN4) | \
873 PIN_LOCKR_DISABLED(GPIOD_PIN5) | \
874 PIN_LOCKR_DISABLED(GPIOD_PIN6) | \
875 PIN_LOCKR_DISABLED(GPIOD_PIN7) | \
876 PIN_LOCKR_DISABLED(GPIOD_PIN8) | \
877 PIN_LOCKR_DISABLED(GPIOD_PIN9) | \
878 PIN_LOCKR_DISABLED(GPIOD_PIN10) | \
879 PIN_LOCKR_DISABLED(GPIOD_PIN11) | \
880 PIN_LOCKR_DISABLED(GPIOD_PIN12) | \
881 PIN_LOCKR_DISABLED(GPIOD_PIN13) | \
882 PIN_LOCKR_DISABLED(GPIOD_PIN14) | \
883 PIN_LOCKR_DISABLED(GPIOD_PIN15))
884
885/*
886 * GPIOE setup:
887 *
888 * PE0 - PIN0 (analog).
889 * PE1 - PIN1 (analog).
890 * PE2 - PIN2 (analog).
891 * PE3 - PIN3 (analog).
892 * PE4 - PIN4 (analog).
893 * PE5 - PIN5 (analog).
894 * PE6 - PIN6 (analog).
895 * PE7 - PIN7 (analog).
896 * PE8 - PIN8 (analog).
897 * PE9 - PIN9 (analog).
898 * PE10 - PIN10 (analog).
899 * PE11 - PIN11 (analog).
900 * PE12 - PIN12 (analog).
901 * PE13 - PIN13 (analog).
902 * PE14 - PIN14 (analog).
903 * PE15 - PIN15 (analog).
904 */
905#define VAL_GPIOE_MODER (PIN_MODE_ANALOG(GPIOE_PIN0) | \
906 PIN_MODE_ANALOG(GPIOE_PIN1) | \
907 PIN_MODE_ANALOG(GPIOE_PIN2) | \
908 PIN_MODE_ANALOG(GPIOE_PIN3) | \
909 PIN_MODE_ANALOG(GPIOE_PIN4) | \
910 PIN_MODE_ANALOG(GPIOE_PIN5) | \
911 PIN_MODE_ANALOG(GPIOE_PIN6) | \
912 PIN_MODE_ANALOG(GPIOE_PIN7) | \
913 PIN_MODE_ANALOG(GPIOE_PIN8) | \
914 PIN_MODE_ANALOG(GPIOE_PIN9) | \
915 PIN_MODE_ANALOG(GPIOE_PIN10) | \
916 PIN_MODE_ANALOG(GPIOE_PIN11) | \
917 PIN_MODE_ANALOG(GPIOE_PIN12) | \
918 PIN_MODE_ANALOG(GPIOE_PIN13) | \
919 PIN_MODE_ANALOG(GPIOE_PIN14) | \
920 PIN_MODE_ANALOG(GPIOE_PIN15))
921#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \
922 PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \
923 PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \
924 PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \
925 PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \
926 PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \
927 PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \
928 PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \
929 PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \
930 PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \
931 PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \
932 PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \
933 PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \
934 PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \
935 PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \
936 PIN_OTYPE_PUSHPULL(GPIOE_PIN15))
937#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) | \
938 PIN_OSPEED_VERYLOW(GPIOE_PIN1) | \
939 PIN_OSPEED_VERYLOW(GPIOE_PIN2) | \
940 PIN_OSPEED_VERYLOW(GPIOE_PIN3) | \
941 PIN_OSPEED_VERYLOW(GPIOE_PIN4) | \
942 PIN_OSPEED_VERYLOW(GPIOE_PIN5) | \
943 PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \
944 PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \
945 PIN_OSPEED_VERYLOW(GPIOE_PIN8) | \
946 PIN_OSPEED_VERYLOW(GPIOE_PIN9) | \
947 PIN_OSPEED_VERYLOW(GPIOE_PIN10) | \
948 PIN_OSPEED_VERYLOW(GPIOE_PIN11) | \
949 PIN_OSPEED_VERYLOW(GPIOE_PIN12) | \
950 PIN_OSPEED_VERYLOW(GPIOE_PIN13) | \
951 PIN_OSPEED_VERYLOW(GPIOE_PIN14) | \
952 PIN_OSPEED_VERYLOW(GPIOE_PIN15))
953#define VAL_GPIOE_PUPDR (PIN_PUPDR_FLOATING(GPIOE_PIN0) | \
954 PIN_PUPDR_FLOATING(GPIOE_PIN1) | \
955 PIN_PUPDR_FLOATING(GPIOE_PIN2) | \
956 PIN_PUPDR_FLOATING(GPIOE_PIN3) | \
957 PIN_PUPDR_FLOATING(GPIOE_PIN4) | \
958 PIN_PUPDR_FLOATING(GPIOE_PIN5) | \
959 PIN_PUPDR_FLOATING(GPIOE_PIN6) | \
960 PIN_PUPDR_FLOATING(GPIOE_PIN7) | \
961 PIN_PUPDR_FLOATING(GPIOE_PIN8) | \
962 PIN_PUPDR_FLOATING(GPIOE_PIN9) | \
963 PIN_PUPDR_FLOATING(GPIOE_PIN10) | \
964 PIN_PUPDR_FLOATING(GPIOE_PIN11) | \
965 PIN_PUPDR_FLOATING(GPIOE_PIN12) | \
966 PIN_PUPDR_FLOATING(GPIOE_PIN13) | \
967 PIN_PUPDR_FLOATING(GPIOE_PIN14) | \
968 PIN_PUPDR_FLOATING(GPIOE_PIN15))
969#define VAL_GPIOE_ODR (PIN_ODR_LOW(GPIOE_PIN0) | \
970 PIN_ODR_LOW(GPIOE_PIN1) | \
971 PIN_ODR_LOW(GPIOE_PIN2) | \
972 PIN_ODR_LOW(GPIOE_PIN3) | \
973 PIN_ODR_LOW(GPIOE_PIN4) | \
974 PIN_ODR_LOW(GPIOE_PIN5) | \
975 PIN_ODR_LOW(GPIOE_PIN6) | \
976 PIN_ODR_LOW(GPIOE_PIN7) | \
977 PIN_ODR_LOW(GPIOE_PIN8) | \
978 PIN_ODR_LOW(GPIOE_PIN9) | \
979 PIN_ODR_LOW(GPIOE_PIN10) | \
980 PIN_ODR_LOW(GPIOE_PIN11) | \
981 PIN_ODR_LOW(GPIOE_PIN12) | \
982 PIN_ODR_LOW(GPIOE_PIN13) | \
983 PIN_ODR_LOW(GPIOE_PIN14) | \
984 PIN_ODR_LOW(GPIOE_PIN15))
985#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0U) | \
986 PIN_AFIO_AF(GPIOE_PIN1, 0U) | \
987 PIN_AFIO_AF(GPIOE_PIN2, 0U) | \
988 PIN_AFIO_AF(GPIOE_PIN3, 0U) | \
989 PIN_AFIO_AF(GPIOE_PIN4, 0U) | \
990 PIN_AFIO_AF(GPIOE_PIN5, 0U) | \
991 PIN_AFIO_AF(GPIOE_PIN6, 0U) | \
992 PIN_AFIO_AF(GPIOE_PIN7, 0U))
993#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0U) | \
994 PIN_AFIO_AF(GPIOE_PIN9, 0U) | \
995 PIN_AFIO_AF(GPIOE_PIN10, 0U) | \
996 PIN_AFIO_AF(GPIOE_PIN11, 0U) | \
997 PIN_AFIO_AF(GPIOE_PIN12, 0U) | \
998 PIN_AFIO_AF(GPIOE_PIN13, 0U) | \
999 PIN_AFIO_AF(GPIOE_PIN14, 0U) | \
1000 PIN_AFIO_AF(GPIOE_PIN15, 0U))
1001#define VAL_GPIOE_ASCR (PIN_ASCR_DISABLED(GPIOE_PIN0) | \
1002 PIN_ASCR_DISABLED(GPIOE_PIN1) | \
1003 PIN_ASCR_DISABLED(GPIOE_PIN2) | \
1004 PIN_ASCR_DISABLED(GPIOE_PIN3) | \
1005 PIN_ASCR_DISABLED(GPIOE_PIN4) | \
1006 PIN_ASCR_DISABLED(GPIOE_PIN5) | \
1007 PIN_ASCR_DISABLED(GPIOE_PIN6) | \
1008 PIN_ASCR_DISABLED(GPIOE_PIN7) | \
1009 PIN_ASCR_DISABLED(GPIOE_PIN8) | \
1010 PIN_ASCR_DISABLED(GPIOE_PIN9) | \
1011 PIN_ASCR_DISABLED(GPIOE_PIN10) | \
1012 PIN_ASCR_DISABLED(GPIOE_PIN11) | \
1013 PIN_ASCR_DISABLED(GPIOE_PIN12) | \
1014 PIN_ASCR_DISABLED(GPIOE_PIN13) | \
1015 PIN_ASCR_DISABLED(GPIOE_PIN14) | \
1016 PIN_ASCR_DISABLED(GPIOE_PIN15))
1017#define VAL_GPIOE_LOCKR (PIN_LOCKR_DISABLED(GPIOE_PIN0) | \
1018 PIN_LOCKR_DISABLED(GPIOE_PIN1) | \
1019 PIN_LOCKR_DISABLED(GPIOE_PIN2) | \
1020 PIN_LOCKR_DISABLED(GPIOE_PIN3) | \
1021 PIN_LOCKR_DISABLED(GPIOE_PIN4) | \
1022 PIN_LOCKR_DISABLED(GPIOE_PIN5) | \
1023 PIN_LOCKR_DISABLED(GPIOE_PIN6) | \
1024 PIN_LOCKR_DISABLED(GPIOE_PIN7) | \
1025 PIN_LOCKR_DISABLED(GPIOE_PIN8) | \
1026 PIN_LOCKR_DISABLED(GPIOE_PIN9) | \
1027 PIN_LOCKR_DISABLED(GPIOE_PIN10) | \
1028 PIN_LOCKR_DISABLED(GPIOE_PIN11) | \
1029 PIN_LOCKR_DISABLED(GPIOE_PIN12) | \
1030 PIN_LOCKR_DISABLED(GPIOE_PIN13) | \
1031 PIN_LOCKR_DISABLED(GPIOE_PIN14) | \
1032 PIN_LOCKR_DISABLED(GPIOE_PIN15))
1033
1034/*
1035 * GPIOF setup:
1036 *
1037 * PF0 - PIN0 (analog).
1038 * PF1 - PIN1 (analog).
1039 * PF2 - PIN2 (analog).
1040 * PF3 - PIN3 (analog).
1041 * PF4 - PIN4 (analog).
1042 * PF5 - PIN5 (analog).
1043 * PF6 - PIN6 (analog).
1044 * PF7 - PIN7 (analog).
1045 * PF8 - PIN8 (analog).
1046 * PF9 - PIN9 (analog).
1047 * PF10 - PIN10 (analog).
1048 * PF11 - PIN11 (analog).
1049 * PF12 - PIN12 (analog).
1050 * PF13 - PIN13 (analog).
1051 * PF14 - PIN14 (analog).
1052 * PF15 - PIN15 (analog).
1053 */
1054#define VAL_GPIOF_MODER (PIN_MODE_ANALOG(GPIOF_PIN0) | \
1055 PIN_MODE_ANALOG(GPIOF_PIN1) | \
1056 PIN_MODE_ANALOG(GPIOF_PIN2) | \
1057 PIN_MODE_ANALOG(GPIOF_PIN3) | \
1058 PIN_MODE_ANALOG(GPIOF_PIN4) | \
1059 PIN_MODE_ANALOG(GPIOF_PIN5) | \
1060 PIN_MODE_ANALOG(GPIOF_PIN6) | \
1061 PIN_MODE_ANALOG(GPIOF_PIN7) | \
1062 PIN_MODE_ANALOG(GPIOF_PIN8) | \
1063 PIN_MODE_ANALOG(GPIOF_PIN9) | \
1064 PIN_MODE_ANALOG(GPIOF_PIN10) | \
1065 PIN_MODE_ANALOG(GPIOF_PIN11) | \
1066 PIN_MODE_ANALOG(GPIOF_PIN12) | \
1067 PIN_MODE_ANALOG(GPIOF_PIN13) | \
1068 PIN_MODE_ANALOG(GPIOF_PIN14) | \
1069 PIN_MODE_ANALOG(GPIOF_PIN15))
1070#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_PIN0) | \
1071 PIN_OTYPE_PUSHPULL(GPIOF_PIN1) | \
1072 PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \
1073 PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \
1074 PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \
1075 PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \
1076 PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \
1077 PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \
1078 PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \
1079 PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \
1080 PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \
1081 PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \
1082 PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \
1083 PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \
1084 PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \
1085 PIN_OTYPE_PUSHPULL(GPIOF_PIN15))
1086#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOF_PIN0) | \
1087 PIN_OSPEED_VERYLOW(GPIOF_PIN1) | \
1088 PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \
1089 PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \
1090 PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \
1091 PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \
1092 PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \
1093 PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \
1094 PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \
1095 PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \
1096 PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \
1097 PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \
1098 PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \
1099 PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \
1100 PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \
1101 PIN_OSPEED_VERYLOW(GPIOF_PIN15))
1102#define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_PIN0) | \
1103 PIN_PUPDR_FLOATING(GPIOF_PIN1) | \
1104 PIN_PUPDR_FLOATING(GPIOF_PIN2) | \
1105 PIN_PUPDR_FLOATING(GPIOF_PIN3) | \
1106 PIN_PUPDR_FLOATING(GPIOF_PIN4) | \
1107 PIN_PUPDR_FLOATING(GPIOF_PIN5) | \
1108 PIN_PUPDR_FLOATING(GPIOF_PIN6) | \
1109 PIN_PUPDR_FLOATING(GPIOF_PIN7) | \
1110 PIN_PUPDR_FLOATING(GPIOF_PIN8) | \
1111 PIN_PUPDR_FLOATING(GPIOF_PIN9) | \
1112 PIN_PUPDR_FLOATING(GPIOF_PIN10) | \
1113 PIN_PUPDR_FLOATING(GPIOF_PIN11) | \
1114 PIN_PUPDR_FLOATING(GPIOF_PIN12) | \
1115 PIN_PUPDR_FLOATING(GPIOF_PIN13) | \
1116 PIN_PUPDR_FLOATING(GPIOF_PIN14) | \
1117 PIN_PUPDR_FLOATING(GPIOF_PIN15))
1118#define VAL_GPIOF_ODR (PIN_ODR_LOW(GPIOF_PIN0) | \
1119 PIN_ODR_LOW(GPIOF_PIN1) | \
1120 PIN_ODR_LOW(GPIOF_PIN2) | \
1121 PIN_ODR_LOW(GPIOF_PIN3) | \
1122 PIN_ODR_LOW(GPIOF_PIN4) | \
1123 PIN_ODR_LOW(GPIOF_PIN5) | \
1124 PIN_ODR_LOW(GPIOF_PIN6) | \
1125 PIN_ODR_LOW(GPIOF_PIN7) | \
1126 PIN_ODR_LOW(GPIOF_PIN8) | \
1127 PIN_ODR_LOW(GPIOF_PIN9) | \
1128 PIN_ODR_LOW(GPIOF_PIN10) | \
1129 PIN_ODR_LOW(GPIOF_PIN11) | \
1130 PIN_ODR_LOW(GPIOF_PIN12) | \
1131 PIN_ODR_LOW(GPIOF_PIN13) | \
1132 PIN_ODR_LOW(GPIOF_PIN14) | \
1133 PIN_ODR_LOW(GPIOF_PIN15))
1134#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_PIN0, 0U) | \
1135 PIN_AFIO_AF(GPIOF_PIN1, 0U) | \
1136 PIN_AFIO_AF(GPIOF_PIN2, 0U) | \
1137 PIN_AFIO_AF(GPIOF_PIN3, 0U) | \
1138 PIN_AFIO_AF(GPIOF_PIN4, 0U) | \
1139 PIN_AFIO_AF(GPIOF_PIN5, 0U) | \
1140 PIN_AFIO_AF(GPIOF_PIN6, 0U) | \
1141 PIN_AFIO_AF(GPIOF_PIN7, 0U))
1142#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \
1143 PIN_AFIO_AF(GPIOF_PIN9, 0U) | \
1144 PIN_AFIO_AF(GPIOF_PIN10, 0U) | \
1145 PIN_AFIO_AF(GPIOF_PIN11, 0U) | \
1146 PIN_AFIO_AF(GPIOF_PIN12, 0U) | \
1147 PIN_AFIO_AF(GPIOF_PIN13, 0U) | \
1148 PIN_AFIO_AF(GPIOF_PIN14, 0U) | \
1149 PIN_AFIO_AF(GPIOF_PIN15, 0U))
1150#define VAL_GPIOF_ASCR (PIN_ASCR_DISABLED(GPIOF_PIN0) | \
1151 PIN_ASCR_DISABLED(GPIOF_PIN1) | \
1152 PIN_ASCR_DISABLED(GPIOF_PIN2) | \
1153 PIN_ASCR_DISABLED(GPIOF_PIN3) | \
1154 PIN_ASCR_DISABLED(GPIOF_PIN4) | \
1155 PIN_ASCR_DISABLED(GPIOF_PIN5) | \
1156 PIN_ASCR_DISABLED(GPIOF_PIN6) | \
1157 PIN_ASCR_DISABLED(GPIOF_PIN7) | \
1158 PIN_ASCR_DISABLED(GPIOF_PIN8) | \
1159 PIN_ASCR_DISABLED(GPIOF_PIN9) | \
1160 PIN_ASCR_DISABLED(GPIOF_PIN10) | \
1161 PIN_ASCR_DISABLED(GPIOF_PIN11) | \
1162 PIN_ASCR_DISABLED(GPIOF_PIN12) | \
1163 PIN_ASCR_DISABLED(GPIOF_PIN13) | \
1164 PIN_ASCR_DISABLED(GPIOF_PIN14) | \
1165 PIN_ASCR_DISABLED(GPIOF_PIN15))
1166#define VAL_GPIOF_LOCKR (PIN_LOCKR_DISABLED(GPIOF_PIN0) | \
1167 PIN_LOCKR_DISABLED(GPIOF_PIN1) | \
1168 PIN_LOCKR_DISABLED(GPIOF_PIN2) | \
1169 PIN_LOCKR_DISABLED(GPIOF_PIN3) | \
1170 PIN_LOCKR_DISABLED(GPIOF_PIN4) | \
1171 PIN_LOCKR_DISABLED(GPIOF_PIN5) | \
1172 PIN_LOCKR_DISABLED(GPIOF_PIN6) | \
1173 PIN_LOCKR_DISABLED(GPIOF_PIN7) | \
1174 PIN_LOCKR_DISABLED(GPIOF_PIN8) | \
1175 PIN_LOCKR_DISABLED(GPIOF_PIN9) | \
1176 PIN_LOCKR_DISABLED(GPIOF_PIN10) | \
1177 PIN_LOCKR_DISABLED(GPIOF_PIN11) | \
1178 PIN_LOCKR_DISABLED(GPIOF_PIN12) | \
1179 PIN_LOCKR_DISABLED(GPIOF_PIN13) | \
1180 PIN_LOCKR_DISABLED(GPIOF_PIN14) | \
1181 PIN_LOCKR_DISABLED(GPIOF_PIN15))
1182
1183/*
1184 * GPIOG setup:
1185 *
1186 * PG0 - PIN0 (analog).
1187 * PG1 - PIN1 (analog).
1188 * PG2 - PIN2 (analog).
1189 * PG3 - PIN3 (analog).
1190 * PG4 - PIN4 (analog).
1191 * PG5 - USB_OVER_CURRENT (input floating).
1192 * PG6 - USB_POWER_SWITCH_ON (output pushpull maximum).
1193 * PG7 - LPUART1_TX (alternate 8).
1194 * PG8 - LPUART1_RX (alternate 8).
1195 * PG9 - PIN9 (analog).
1196 * PG10 - PIN10 (analog).
1197 * PG11 - PIN11 (analog).
1198 * PG12 - PIN12 (analog).
1199 * PG13 - PIN13 (analog).
1200 * PG14 - PIN14 (analog).
1201 * PG15 - PIN15 (analog).
1202 */
1203#define VAL_GPIOG_MODER (PIN_MODE_ANALOG(GPIOG_PIN0) | \
1204 PIN_MODE_ANALOG(GPIOG_PIN1) | \
1205 PIN_MODE_ANALOG(GPIOG_PIN2) | \
1206 PIN_MODE_ANALOG(GPIOG_PIN3) | \
1207 PIN_MODE_ANALOG(GPIOG_PIN4) | \
1208 PIN_MODE_INPUT(GPIOG_USB_OVER_CURRENT) |\
1209 PIN_MODE_OUTPUT(GPIOG_USB_POWER_SWITCH_ON) |\
1210 PIN_MODE_ALTERNATE(GPIOG_LPUART1_TX) | \
1211 PIN_MODE_ALTERNATE(GPIOG_LPUART1_RX) | \
1212 PIN_MODE_ANALOG(GPIOG_PIN9) | \
1213 PIN_MODE_ANALOG(GPIOG_PIN10) | \
1214 PIN_MODE_ANALOG(GPIOG_PIN11) | \
1215 PIN_MODE_ANALOG(GPIOG_PIN12) | \
1216 PIN_MODE_ANALOG(GPIOG_PIN13) | \
1217 PIN_MODE_ANALOG(GPIOG_PIN14) | \
1218 PIN_MODE_ANALOG(GPIOG_PIN15))
1219#define VAL_GPIOG_OTYPER (PIN_OTYPE_PUSHPULL(GPIOG_PIN0) | \
1220 PIN_OTYPE_PUSHPULL(GPIOG_PIN1) | \
1221 PIN_OTYPE_PUSHPULL(GPIOG_PIN2) | \
1222 PIN_OTYPE_PUSHPULL(GPIOG_PIN3) | \
1223 PIN_OTYPE_PUSHPULL(GPIOG_PIN4) | \
1224 PIN_OTYPE_PUSHPULL(GPIOG_USB_OVER_CURRENT) |\
1225 PIN_OTYPE_PUSHPULL(GPIOG_USB_POWER_SWITCH_ON) |\
1226 PIN_OTYPE_PUSHPULL(GPIOG_LPUART1_TX) | \
1227 PIN_OTYPE_PUSHPULL(GPIOG_LPUART1_RX) | \
1228 PIN_OTYPE_PUSHPULL(GPIOG_PIN9) | \
1229 PIN_OTYPE_PUSHPULL(GPIOG_PIN10) | \
1230 PIN_OTYPE_PUSHPULL(GPIOG_PIN11) | \
1231 PIN_OTYPE_PUSHPULL(GPIOG_PIN12) | \
1232 PIN_OTYPE_PUSHPULL(GPIOG_PIN13) | \
1233 PIN_OTYPE_PUSHPULL(GPIOG_PIN14) | \
1234 PIN_OTYPE_PUSHPULL(GPIOG_PIN15))
1235#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOG_PIN0) | \
1236 PIN_OSPEED_VERYLOW(GPIOG_PIN1) | \
1237 PIN_OSPEED_VERYLOW(GPIOG_PIN2) | \
1238 PIN_OSPEED_VERYLOW(GPIOG_PIN3) | \
1239 PIN_OSPEED_VERYLOW(GPIOG_PIN4) | \
1240 PIN_OSPEED_VERYLOW(GPIOG_USB_OVER_CURRENT) |\
1241 PIN_OSPEED_HIGH(GPIOG_USB_POWER_SWITCH_ON) |\
1242 PIN_OSPEED_VERYLOW(GPIOG_LPUART1_TX) | \
1243 PIN_OSPEED_VERYLOW(GPIOG_LPUART1_RX) | \
1244 PIN_OSPEED_VERYLOW(GPIOG_PIN9) | \
1245 PIN_OSPEED_VERYLOW(GPIOG_PIN10) | \
1246 PIN_OSPEED_VERYLOW(GPIOG_PIN11) | \
1247 PIN_OSPEED_VERYLOW(GPIOG_PIN12) | \
1248 PIN_OSPEED_VERYLOW(GPIOG_PIN13) | \
1249 PIN_OSPEED_VERYLOW(GPIOG_PIN14) | \
1250 PIN_OSPEED_VERYLOW(GPIOG_PIN15))
1251#define VAL_GPIOG_PUPDR (PIN_PUPDR_FLOATING(GPIOG_PIN0) | \
1252 PIN_PUPDR_FLOATING(GPIOG_PIN1) | \
1253 PIN_PUPDR_FLOATING(GPIOG_PIN2) | \
1254 PIN_PUPDR_FLOATING(GPIOG_PIN3) | \
1255 PIN_PUPDR_FLOATING(GPIOG_PIN4) | \
1256 PIN_PUPDR_FLOATING(GPIOG_USB_OVER_CURRENT) |\
1257 PIN_PUPDR_FLOATING(GPIOG_USB_POWER_SWITCH_ON) |\
1258 PIN_PUPDR_FLOATING(GPIOG_LPUART1_TX) | \
1259 PIN_PUPDR_FLOATING(GPIOG_LPUART1_RX) | \
1260 PIN_PUPDR_FLOATING(GPIOG_PIN9) | \
1261 PIN_PUPDR_FLOATING(GPIOG_PIN10) | \
1262 PIN_PUPDR_FLOATING(GPIOG_PIN11) | \
1263 PIN_PUPDR_FLOATING(GPIOG_PIN12) | \
1264 PIN_PUPDR_FLOATING(GPIOG_PIN13) | \
1265 PIN_PUPDR_FLOATING(GPIOG_PIN14) | \
1266 PIN_PUPDR_FLOATING(GPIOG_PIN15))
1267#define VAL_GPIOG_ODR (PIN_ODR_LOW(GPIOG_PIN0) | \
1268 PIN_ODR_LOW(GPIOG_PIN1) | \
1269 PIN_ODR_LOW(GPIOG_PIN2) | \
1270 PIN_ODR_LOW(GPIOG_PIN3) | \
1271 PIN_ODR_LOW(GPIOG_PIN4) | \
1272 PIN_ODR_LOW(GPIOG_USB_OVER_CURRENT) | \
1273 PIN_ODR_LOW(GPIOG_USB_POWER_SWITCH_ON) |\
1274 PIN_ODR_LOW(GPIOG_LPUART1_TX) | \
1275 PIN_ODR_LOW(GPIOG_LPUART1_RX) | \
1276 PIN_ODR_LOW(GPIOG_PIN9) | \
1277 PIN_ODR_LOW(GPIOG_PIN10) | \
1278 PIN_ODR_LOW(GPIOG_PIN11) | \
1279 PIN_ODR_LOW(GPIOG_PIN12) | \
1280 PIN_ODR_LOW(GPIOG_PIN13) | \
1281 PIN_ODR_LOW(GPIOG_PIN14) | \
1282 PIN_ODR_LOW(GPIOG_PIN15))
1283#define VAL_GPIOG_AFRL (PIN_AFIO_AF(GPIOG_PIN0, 0U) | \
1284 PIN_AFIO_AF(GPIOG_PIN1, 0U) | \
1285 PIN_AFIO_AF(GPIOG_PIN2, 0U) | \
1286 PIN_AFIO_AF(GPIOG_PIN3, 0U) | \
1287 PIN_AFIO_AF(GPIOG_PIN4, 0U) | \
1288 PIN_AFIO_AF(GPIOG_USB_OVER_CURRENT, 0U) |\
1289 PIN_AFIO_AF(GPIOG_USB_POWER_SWITCH_ON, 0U) |\
1290 PIN_AFIO_AF(GPIOG_LPUART1_TX, 8U))
1291#define VAL_GPIOG_AFRH (PIN_AFIO_AF(GPIOG_LPUART1_RX, 8U) | \
1292 PIN_AFIO_AF(GPIOG_PIN9, 0U) | \
1293 PIN_AFIO_AF(GPIOG_PIN10, 0U) | \
1294 PIN_AFIO_AF(GPIOG_PIN11, 0U) | \
1295 PIN_AFIO_AF(GPIOG_PIN12, 0U) | \
1296 PIN_AFIO_AF(GPIOG_PIN13, 0U) | \
1297 PIN_AFIO_AF(GPIOG_PIN14, 0U) | \
1298 PIN_AFIO_AF(GPIOG_PIN15, 0U))
1299#define VAL_GPIOG_ASCR (PIN_ASCR_DISABLED(GPIOG_PIN0) | \
1300 PIN_ASCR_DISABLED(GPIOG_PIN1) | \
1301 PIN_ASCR_DISABLED(GPIOG_PIN2) | \
1302 PIN_ASCR_DISABLED(GPIOG_PIN3) | \
1303 PIN_ASCR_DISABLED(GPIOG_PIN4) | \
1304 PIN_ASCR_DISABLED(GPIOG_USB_OVER_CURRENT) |\
1305 PIN_ASCR_DISABLED(GPIOG_USB_POWER_SWITCH_ON) |\
1306 PIN_ASCR_DISABLED(GPIOG_LPUART1_TX) | \
1307 PIN_ASCR_DISABLED(GPIOG_LPUART1_RX) | \
1308 PIN_ASCR_DISABLED(GPIOG_PIN9) | \
1309 PIN_ASCR_DISABLED(GPIOG_PIN10) | \
1310 PIN_ASCR_DISABLED(GPIOG_PIN11) | \
1311 PIN_ASCR_DISABLED(GPIOG_PIN12) | \
1312 PIN_ASCR_DISABLED(GPIOG_PIN13) | \
1313 PIN_ASCR_DISABLED(GPIOG_PIN14) | \
1314 PIN_ASCR_DISABLED(GPIOG_PIN15))
1315#define VAL_GPIOG_LOCKR (PIN_LOCKR_DISABLED(GPIOG_PIN0) | \
1316 PIN_LOCKR_DISABLED(GPIOG_PIN1) | \
1317 PIN_LOCKR_DISABLED(GPIOG_PIN2) | \
1318 PIN_LOCKR_DISABLED(GPIOG_PIN3) | \
1319 PIN_LOCKR_DISABLED(GPIOG_PIN4) | \
1320 PIN_LOCKR_DISABLED(GPIOG_USB_OVER_CURRENT) |\
1321 PIN_LOCKR_DISABLED(GPIOG_USB_POWER_SWITCH_ON) |\
1322 PIN_LOCKR_DISABLED(GPIOG_LPUART1_TX) | \
1323 PIN_LOCKR_DISABLED(GPIOG_LPUART1_RX) | \
1324 PIN_LOCKR_DISABLED(GPIOG_PIN9) | \
1325 PIN_LOCKR_DISABLED(GPIOG_PIN10) | \
1326 PIN_LOCKR_DISABLED(GPIOG_PIN11) | \
1327 PIN_LOCKR_DISABLED(GPIOG_PIN12) | \
1328 PIN_LOCKR_DISABLED(GPIOG_PIN13) | \
1329 PIN_LOCKR_DISABLED(GPIOG_PIN14) | \
1330 PIN_LOCKR_DISABLED(GPIOG_PIN15))
1331
1332/*
1333 * GPIOH setup:
1334 *
1335 * PH0 - PIN0 (analog).
1336 * PH1 - PIN1 (analog).
1337 * PH2 - PIN2 (analog).
1338 * PH3 - PIN3 (input floating).
1339 * PH4 - PIN4 (analog).
1340 * PH5 - PIN5 (analog).
1341 * PH6 - PIN6 (analog).
1342 * PH7 - PIN7 (analog).
1343 * PH8 - PIN8 (analog).
1344 * PH9 - PIN9 (analog).
1345 * PH10 - PIN10 (analog).
1346 * PH11 - PIN11 (analog).
1347 * PH12 - PIN12 (analog).
1348 * PH13 - PIN13 (analog).
1349 * PH14 - PIN14 (analog).
1350 * PH15 - PIN15 (analog).
1351 */
1352#define VAL_GPIOH_MODER (PIN_MODE_ANALOG(GPIOH_PIN0) | \
1353 PIN_MODE_ANALOG(GPIOH_PIN1) | \
1354 PIN_MODE_ANALOG(GPIOH_PIN2) | \
1355 PIN_MODE_INPUT(GPIOH_PIN3) | \
1356 PIN_MODE_ANALOG(GPIOH_PIN4) | \
1357 PIN_MODE_ANALOG(GPIOH_PIN5) | \
1358 PIN_MODE_ANALOG(GPIOH_PIN6) | \
1359 PIN_MODE_ANALOG(GPIOH_PIN7) | \
1360 PIN_MODE_ANALOG(GPIOH_PIN8) | \
1361 PIN_MODE_ANALOG(GPIOH_PIN9) | \
1362 PIN_MODE_ANALOG(GPIOH_PIN10) | \
1363 PIN_MODE_ANALOG(GPIOH_PIN11) | \
1364 PIN_MODE_ANALOG(GPIOH_PIN12) | \
1365 PIN_MODE_ANALOG(GPIOH_PIN13) | \
1366 PIN_MODE_ANALOG(GPIOH_PIN14) | \
1367 PIN_MODE_ANALOG(GPIOH_PIN15))
1368#define VAL_GPIOH_OTYPER (PIN_OTYPE_PUSHPULL(GPIOH_PIN0) | \
1369 PIN_OTYPE_PUSHPULL(GPIOH_PIN1) | \
1370 PIN_OTYPE_PUSHPULL(GPIOH_PIN2) | \
1371 PIN_OTYPE_PUSHPULL(GPIOH_PIN3) | \
1372 PIN_OTYPE_PUSHPULL(GPIOH_PIN4) | \
1373 PIN_OTYPE_PUSHPULL(GPIOH_PIN5) | \
1374 PIN_OTYPE_PUSHPULL(GPIOH_PIN6) | \
1375 PIN_OTYPE_PUSHPULL(GPIOH_PIN7) | \
1376 PIN_OTYPE_PUSHPULL(GPIOH_PIN8) | \
1377 PIN_OTYPE_PUSHPULL(GPIOH_PIN9) | \
1378 PIN_OTYPE_PUSHPULL(GPIOH_PIN10) | \
1379 PIN_OTYPE_PUSHPULL(GPIOH_PIN11) | \
1380 PIN_OTYPE_PUSHPULL(GPIOH_PIN12) | \
1381 PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \
1382 PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \
1383 PIN_OTYPE_PUSHPULL(GPIOH_PIN15))
1384#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOH_PIN0) | \
1385 PIN_OSPEED_VERYLOW(GPIOH_PIN1) | \
1386 PIN_OSPEED_VERYLOW(GPIOH_PIN2) | \
1387 PIN_OSPEED_VERYLOW(GPIOH_PIN3) | \
1388 PIN_OSPEED_VERYLOW(GPIOH_PIN4) | \
1389 PIN_OSPEED_VERYLOW(GPIOH_PIN5) | \
1390 PIN_OSPEED_VERYLOW(GPIOH_PIN6) | \
1391 PIN_OSPEED_VERYLOW(GPIOH_PIN7) | \
1392 PIN_OSPEED_VERYLOW(GPIOH_PIN8) | \
1393 PIN_OSPEED_VERYLOW(GPIOH_PIN9) | \
1394 PIN_OSPEED_VERYLOW(GPIOH_PIN10) | \
1395 PIN_OSPEED_VERYLOW(GPIOH_PIN11) | \
1396 PIN_OSPEED_VERYLOW(GPIOH_PIN12) | \
1397 PIN_OSPEED_VERYLOW(GPIOH_PIN13) | \
1398 PIN_OSPEED_VERYLOW(GPIOH_PIN14) | \
1399 PIN_OSPEED_VERYLOW(GPIOH_PIN15))
1400#define VAL_GPIOH_PUPDR (PIN_PUPDR_FLOATING(GPIOH_PIN0) | \
1401 PIN_PUPDR_FLOATING(GPIOH_PIN1) | \
1402 PIN_PUPDR_FLOATING(GPIOH_PIN2) | \
1403 PIN_PUPDR_FLOATING(GPIOH_PIN3) | \
1404 PIN_PUPDR_FLOATING(GPIOH_PIN4) | \
1405 PIN_PUPDR_FLOATING(GPIOH_PIN5) | \
1406 PIN_PUPDR_FLOATING(GPIOH_PIN6) | \
1407 PIN_PUPDR_FLOATING(GPIOH_PIN7) | \
1408 PIN_PUPDR_FLOATING(GPIOH_PIN8) | \
1409 PIN_PUPDR_FLOATING(GPIOH_PIN9) | \
1410 PIN_PUPDR_FLOATING(GPIOH_PIN10) | \
1411 PIN_PUPDR_FLOATING(GPIOH_PIN11) | \
1412 PIN_PUPDR_FLOATING(GPIOH_PIN12) | \
1413 PIN_PUPDR_FLOATING(GPIOH_PIN13) | \
1414 PIN_PUPDR_FLOATING(GPIOH_PIN14) | \
1415 PIN_PUPDR_FLOATING(GPIOH_PIN15))
1416#define VAL_GPIOH_ODR (PIN_ODR_LOW(GPIOH_PIN0) | \
1417 PIN_ODR_LOW(GPIOH_PIN1) | \
1418 PIN_ODR_LOW(GPIOH_PIN2) | \
1419 PIN_ODR_LOW(GPIOH_PIN3) | \
1420 PIN_ODR_LOW(GPIOH_PIN4) | \
1421 PIN_ODR_LOW(GPIOH_PIN5) | \
1422 PIN_ODR_LOW(GPIOH_PIN6) | \
1423 PIN_ODR_LOW(GPIOH_PIN7) | \
1424 PIN_ODR_LOW(GPIOH_PIN8) | \
1425 PIN_ODR_LOW(GPIOH_PIN9) | \
1426 PIN_ODR_LOW(GPIOH_PIN10) | \
1427 PIN_ODR_LOW(GPIOH_PIN11) | \
1428 PIN_ODR_LOW(GPIOH_PIN12) | \
1429 PIN_ODR_LOW(GPIOH_PIN13) | \
1430 PIN_ODR_LOW(GPIOH_PIN14) | \
1431 PIN_ODR_LOW(GPIOH_PIN15))
1432#define VAL_GPIOH_AFRL (PIN_AFIO_AF(GPIOH_PIN0, 0U) | \
1433 PIN_AFIO_AF(GPIOH_PIN1, 0U) | \
1434 PIN_AFIO_AF(GPIOH_PIN2, 0U) | \
1435 PIN_AFIO_AF(GPIOH_PIN3, 0U) | \
1436 PIN_AFIO_AF(GPIOH_PIN4, 0U) | \
1437 PIN_AFIO_AF(GPIOH_PIN5, 0U) | \
1438 PIN_AFIO_AF(GPIOH_PIN6, 0U) | \
1439 PIN_AFIO_AF(GPIOH_PIN7, 0U))
1440#define VAL_GPIOH_AFRH (PIN_AFIO_AF(GPIOH_PIN8, 0U) | \
1441 PIN_AFIO_AF(GPIOH_PIN9, 0U) | \
1442 PIN_AFIO_AF(GPIOH_PIN10, 0U) | \
1443 PIN_AFIO_AF(GPIOH_PIN11, 0U) | \
1444 PIN_AFIO_AF(GPIOH_PIN12, 0U) | \
1445 PIN_AFIO_AF(GPIOH_PIN13, 0U) | \
1446 PIN_AFIO_AF(GPIOH_PIN14, 0U) | \
1447 PIN_AFIO_AF(GPIOH_PIN15, 0U))
1448#define VAL_GPIOH_ASCR (PIN_ASCR_DISABLED(GPIOH_PIN0) | \
1449 PIN_ASCR_DISABLED(GPIOH_PIN1) | \
1450 PIN_ASCR_DISABLED(GPIOH_PIN2) | \
1451 PIN_ASCR_DISABLED(GPIOH_PIN3) | \
1452 PIN_ASCR_DISABLED(GPIOH_PIN4) | \
1453 PIN_ASCR_DISABLED(GPIOH_PIN5) | \
1454 PIN_ASCR_DISABLED(GPIOH_PIN6) | \
1455 PIN_ASCR_DISABLED(GPIOH_PIN7) | \
1456 PIN_ASCR_DISABLED(GPIOH_PIN8) | \
1457 PIN_ASCR_DISABLED(GPIOH_PIN9) | \
1458 PIN_ASCR_DISABLED(GPIOH_PIN10) | \
1459 PIN_ASCR_DISABLED(GPIOH_PIN11) | \
1460 PIN_ASCR_DISABLED(GPIOH_PIN12) | \
1461 PIN_ASCR_DISABLED(GPIOH_PIN13) | \
1462 PIN_ASCR_DISABLED(GPIOH_PIN14) | \
1463 PIN_ASCR_DISABLED(GPIOH_PIN15))
1464#define VAL_GPIOH_LOCKR (PIN_LOCKR_DISABLED(GPIOH_PIN0) | \
1465 PIN_LOCKR_DISABLED(GPIOH_PIN1) | \
1466 PIN_LOCKR_DISABLED(GPIOH_PIN2) | \
1467 PIN_LOCKR_DISABLED(GPIOH_PIN3) | \
1468 PIN_LOCKR_DISABLED(GPIOH_PIN4) | \
1469 PIN_LOCKR_DISABLED(GPIOH_PIN5) | \
1470 PIN_LOCKR_DISABLED(GPIOH_PIN6) | \
1471 PIN_LOCKR_DISABLED(GPIOH_PIN7) | \
1472 PIN_LOCKR_DISABLED(GPIOH_PIN8) | \
1473 PIN_LOCKR_DISABLED(GPIOH_PIN9) | \
1474 PIN_LOCKR_DISABLED(GPIOH_PIN10) | \
1475 PIN_LOCKR_DISABLED(GPIOH_PIN11) | \
1476 PIN_LOCKR_DISABLED(GPIOH_PIN12) | \
1477 PIN_LOCKR_DISABLED(GPIOH_PIN13) | \
1478 PIN_LOCKR_DISABLED(GPIOH_PIN14) | \
1479 PIN_LOCKR_DISABLED(GPIOH_PIN15))
1480
1481/*
1482 * GPIOI setup:
1483 *
1484 * PI0 - PIN0 (analog).
1485 * PI1 - PIN1 (analog).
1486 * PI2 - PIN2 (analog).
1487 * PI3 - PIN3 (analog).
1488 * PI4 - PIN4 (analog).
1489 * PI5 - PIN5 (analog).
1490 * PI6 - PIN6 (analog).
1491 * PI7 - PIN7 (analog).
1492 * PI8 - PIN8 (analog).
1493 * PI9 - PIN9 (analog).
1494 * PI10 - PIN10 (analog).
1495 * PI11 - PIN11 (analog).
1496 * PI12 - PIN12 (analog).
1497 * PI13 - PIN13 (analog).
1498 * PI14 - PIN14 (analog).
1499 * PI15 - PIN15 (analog).
1500 */
1501#define VAL_GPIOI_MODER (PIN_MODE_ANALOG(GPIOI_PIN0) | \
1502 PIN_MODE_ANALOG(GPIOI_PIN1) | \
1503 PIN_MODE_ANALOG(GPIOI_PIN2) | \
1504 PIN_MODE_ANALOG(GPIOI_PIN3) | \
1505 PIN_MODE_ANALOG(GPIOI_PIN4) | \
1506 PIN_MODE_ANALOG(GPIOI_PIN5) | \
1507 PIN_MODE_ANALOG(GPIOI_PIN6) | \
1508 PIN_MODE_ANALOG(GPIOI_PIN7) | \
1509 PIN_MODE_ANALOG(GPIOI_PIN8) | \
1510 PIN_MODE_ANALOG(GPIOI_PIN9) | \
1511 PIN_MODE_ANALOG(GPIOI_PIN10) | \
1512 PIN_MODE_ANALOG(GPIOI_PIN11) | \
1513 PIN_MODE_ANALOG(GPIOI_PIN12) | \
1514 PIN_MODE_ANALOG(GPIOI_PIN13) | \
1515 PIN_MODE_ANALOG(GPIOI_PIN14) | \
1516 PIN_MODE_ANALOG(GPIOI_PIN15))
1517#define VAL_GPIOI_OTYPER (PIN_OTYPE_PUSHPULL(GPIOI_PIN0) | \
1518 PIN_OTYPE_PUSHPULL(GPIOI_PIN1) | \
1519 PIN_OTYPE_PUSHPULL(GPIOI_PIN2) | \
1520 PIN_OTYPE_PUSHPULL(GPIOI_PIN3) | \
1521 PIN_OTYPE_PUSHPULL(GPIOI_PIN4) | \
1522 PIN_OTYPE_PUSHPULL(GPIOI_PIN5) | \
1523 PIN_OTYPE_PUSHPULL(GPIOI_PIN6) | \
1524 PIN_OTYPE_PUSHPULL(GPIOI_PIN7) | \
1525 PIN_OTYPE_PUSHPULL(GPIOI_PIN8) | \
1526 PIN_OTYPE_PUSHPULL(GPIOI_PIN9) | \
1527 PIN_OTYPE_PUSHPULL(GPIOI_PIN10) | \
1528 PIN_OTYPE_PUSHPULL(GPIOI_PIN11) | \
1529 PIN_OTYPE_PUSHPULL(GPIOI_PIN12) | \
1530 PIN_OTYPE_PUSHPULL(GPIOI_PIN13) | \
1531 PIN_OTYPE_PUSHPULL(GPIOI_PIN14) | \
1532 PIN_OTYPE_PUSHPULL(GPIOI_PIN15))
1533#define VAL_GPIOI_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOI_PIN0) | \
1534 PIN_OSPEED_VERYLOW(GPIOI_PIN1) | \
1535 PIN_OSPEED_VERYLOW(GPIOI_PIN2) | \
1536 PIN_OSPEED_VERYLOW(GPIOI_PIN3) | \
1537 PIN_OSPEED_VERYLOW(GPIOI_PIN4) | \
1538 PIN_OSPEED_VERYLOW(GPIOI_PIN5) | \
1539 PIN_OSPEED_VERYLOW(GPIOI_PIN6) | \
1540 PIN_OSPEED_VERYLOW(GPIOI_PIN7) | \
1541 PIN_OSPEED_VERYLOW(GPIOI_PIN8) | \
1542 PIN_OSPEED_VERYLOW(GPIOI_PIN9) | \
1543 PIN_OSPEED_VERYLOW(GPIOI_PIN10) | \
1544 PIN_OSPEED_VERYLOW(GPIOI_PIN11) | \
1545 PIN_OSPEED_VERYLOW(GPIOI_PIN12) | \
1546 PIN_OSPEED_VERYLOW(GPIOI_PIN13) | \
1547 PIN_OSPEED_VERYLOW(GPIOI_PIN14) | \
1548 PIN_OSPEED_VERYLOW(GPIOI_PIN15))
1549#define VAL_GPIOI_PUPDR (PIN_PUPDR_FLOATING(GPIOI_PIN0) | \
1550 PIN_PUPDR_FLOATING(GPIOI_PIN1) | \
1551 PIN_PUPDR_FLOATING(GPIOI_PIN2) | \
1552 PIN_PUPDR_FLOATING(GPIOI_PIN3) | \
1553 PIN_PUPDR_FLOATING(GPIOI_PIN4) | \
1554 PIN_PUPDR_FLOATING(GPIOI_PIN5) | \
1555 PIN_PUPDR_FLOATING(GPIOI_PIN6) | \
1556 PIN_PUPDR_FLOATING(GPIOI_PIN7) | \
1557 PIN_PUPDR_FLOATING(GPIOI_PIN8) | \
1558 PIN_PUPDR_FLOATING(GPIOI_PIN9) | \
1559 PIN_PUPDR_FLOATING(GPIOI_PIN10) | \
1560 PIN_PUPDR_FLOATING(GPIOI_PIN11) | \
1561 PIN_PUPDR_FLOATING(GPIOI_PIN12) | \
1562 PIN_PUPDR_FLOATING(GPIOI_PIN13) | \
1563 PIN_PUPDR_FLOATING(GPIOI_PIN14) | \
1564 PIN_PUPDR_FLOATING(GPIOI_PIN15))
1565#define VAL_GPIOI_ODR (PIN_ODR_LOW(GPIOI_PIN0) | \
1566 PIN_ODR_LOW(GPIOI_PIN1) | \
1567 PIN_ODR_LOW(GPIOI_PIN2) | \
1568 PIN_ODR_LOW(GPIOI_PIN3) | \
1569 PIN_ODR_LOW(GPIOI_PIN4) | \
1570 PIN_ODR_LOW(GPIOI_PIN5) | \
1571 PIN_ODR_LOW(GPIOI_PIN6) | \
1572 PIN_ODR_LOW(GPIOI_PIN7) | \
1573 PIN_ODR_LOW(GPIOI_PIN8) | \
1574 PIN_ODR_LOW(GPIOI_PIN9) | \
1575 PIN_ODR_LOW(GPIOI_PIN10) | \
1576 PIN_ODR_LOW(GPIOI_PIN11) | \
1577 PIN_ODR_LOW(GPIOI_PIN12) | \
1578 PIN_ODR_LOW(GPIOI_PIN13) | \
1579 PIN_ODR_LOW(GPIOI_PIN14) | \
1580 PIN_ODR_LOW(GPIOI_PIN15))
1581#define VAL_GPIOI_AFRL (PIN_AFIO_AF(GPIOI_PIN0, 0U) | \
1582 PIN_AFIO_AF(GPIOI_PIN1, 0U) | \
1583 PIN_AFIO_AF(GPIOI_PIN2, 0U) | \
1584 PIN_AFIO_AF(GPIOI_PIN3, 0U) | \
1585 PIN_AFIO_AF(GPIOI_PIN4, 0U) | \
1586 PIN_AFIO_AF(GPIOI_PIN5, 0U) | \
1587 PIN_AFIO_AF(GPIOI_PIN6, 0U) | \
1588 PIN_AFIO_AF(GPIOI_PIN7, 0U))
1589#define VAL_GPIOI_AFRH (PIN_AFIO_AF(GPIOI_PIN8, 0U) | \
1590 PIN_AFIO_AF(GPIOI_PIN9, 0U) | \
1591 PIN_AFIO_AF(GPIOI_PIN10, 0U) | \
1592 PIN_AFIO_AF(GPIOI_PIN11, 0U) | \
1593 PIN_AFIO_AF(GPIOI_PIN12, 0U) | \
1594 PIN_AFIO_AF(GPIOI_PIN13, 0U) | \
1595 PIN_AFIO_AF(GPIOI_PIN14, 0U) | \
1596 PIN_AFIO_AF(GPIOI_PIN15, 0U))
1597#define VAL_GPIOI_ASCR (PIN_ASCR_DISABLED(GPIOI_PIN0) | \
1598 PIN_ASCR_DISABLED(GPIOI_PIN1) | \
1599 PIN_ASCR_DISABLED(GPIOI_PIN2) | \
1600 PIN_ASCR_DISABLED(GPIOI_PIN3) | \
1601 PIN_ASCR_DISABLED(GPIOI_PIN4) | \
1602 PIN_ASCR_DISABLED(GPIOI_PIN5) | \
1603 PIN_ASCR_DISABLED(GPIOI_PIN6) | \
1604 PIN_ASCR_DISABLED(GPIOI_PIN7) | \
1605 PIN_ASCR_DISABLED(GPIOI_PIN8) | \
1606 PIN_ASCR_DISABLED(GPIOI_PIN9) | \
1607 PIN_ASCR_DISABLED(GPIOI_PIN10) | \
1608 PIN_ASCR_DISABLED(GPIOI_PIN11) | \
1609 PIN_ASCR_DISABLED(GPIOI_PIN12) | \
1610 PIN_ASCR_DISABLED(GPIOI_PIN13) | \
1611 PIN_ASCR_DISABLED(GPIOI_PIN14) | \
1612 PIN_ASCR_DISABLED(GPIOI_PIN15))
1613#define VAL_GPIOI_LOCKR (PIN_LOCKR_DISABLED(GPIOI_PIN0) | \
1614 PIN_LOCKR_DISABLED(GPIOI_PIN1) | \
1615 PIN_LOCKR_DISABLED(GPIOI_PIN2) | \
1616 PIN_LOCKR_DISABLED(GPIOI_PIN3) | \
1617 PIN_LOCKR_DISABLED(GPIOI_PIN4) | \
1618 PIN_LOCKR_DISABLED(GPIOI_PIN5) | \
1619 PIN_LOCKR_DISABLED(GPIOI_PIN6) | \
1620 PIN_LOCKR_DISABLED(GPIOI_PIN7) | \
1621 PIN_LOCKR_DISABLED(GPIOI_PIN8) | \
1622 PIN_LOCKR_DISABLED(GPIOI_PIN9) | \
1623 PIN_LOCKR_DISABLED(GPIOI_PIN10) | \
1624 PIN_LOCKR_DISABLED(GPIOI_PIN11) | \
1625 PIN_LOCKR_DISABLED(GPIOI_PIN12) | \
1626 PIN_LOCKR_DISABLED(GPIOI_PIN13) | \
1627 PIN_LOCKR_DISABLED(GPIOI_PIN14) | \
1628 PIN_LOCKR_DISABLED(GPIOI_PIN15))
1629
1630/*===========================================================================*/
1631/* External declarations. */
1632/*===========================================================================*/
1633
1634#if !defined(_FROM_ASM_)
1635#ifdef __cplusplus
1636extern "C" {
1637#endif
1638 void boardInit(void);
1639#ifdef __cplusplus
1640}
1641#endif
1642#endif /* _FROM_ASM_ */
1643
1644#endif /* BOARD_H */