aboutsummaryrefslogtreecommitdiff
path: root/lib/chibios/os/hal/boards/ST_NUCLEO64_G431RB/board.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chibios/os/hal/boards/ST_NUCLEO64_G431RB/board.h')
-rw-r--r--lib/chibios/os/hal/boards/ST_NUCLEO64_G431RB/board.h1078
1 files changed, 1078 insertions, 0 deletions
diff --git a/lib/chibios/os/hal/boards/ST_NUCLEO64_G431RB/board.h b/lib/chibios/os/hal/boards/ST_NUCLEO64_G431RB/board.h
new file mode 100644
index 000000000..ef4208855
--- /dev/null
+++ b/lib/chibios/os/hal/boards/ST_NUCLEO64_G431RB/board.h
@@ -0,0 +1,1078 @@
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 Nucleo64-G431RB board.
31 */
32
33/*
34 * Board identifier.
35 */
36#define BOARD_ST_NUCLEO64_G431RB
37#define BOARD_NAME "STMicroelectronics STM32 Nucleo64-G431RB"
38
39/*
40 * Board oscillators-related settings.
41 */
42#if !defined(STM32_LSECLK)
43#define STM32_LSECLK 32768U
44#endif
45
46#define STM32_LSEDRV (3U << 3U)
47
48#if !defined(STM32_HSECLK)
49#define STM32_HSECLK 24000000U
50#endif
51
52/*
53 * Board voltages.
54 * Required for performance limits calculation.
55 */
56#define STM32_VDD 300U
57
58/*
59 * MCU type as defined in the ST header.
60 */
61#define STM32G431xx
62
63/*
64 * IO pins assignments.
65 */
66#define GPIOA_PIN0 0U
67#define GPIOA_PIN1 1U
68#define GPIOA_STLINK_TX 2U
69#define GPIOA_STLINK_RX 3U
70#define GPIOA_PIN4 4U
71#define GPIOA_LED 5U
72#define GPIOA_LED_GREEN 5U
73#define GPIOA_PIN6 6U
74#define GPIOA_PIN7 7U
75#define GPIOA_PIN8 8U
76#define GPIOA_PIN9 9U
77#define GPIOA_PIN10 10U
78#define GPIOA_PIN11 11U
79#define GPIOA_PIN12 12U
80#define GPIOA_SWDIO 13U
81#define GPIOA_SWCLK 14U
82#define GPIOA_PIN15 15U
83
84#define GPIOB_PIN0 0U
85#define GPIOB_PIN1 1U
86#define GPIOB_BOOT1 2U
87#define GPIOB_TRACESWO 3U
88#define GPIOB_PIN4 4U
89#define GPIOB_PIN5 5U
90#define GPIOB_PIN6 6U
91#define GPIOB_PIN7 7U
92#define GPIOB_PIN8 8U
93#define GPIOB_PIN9 9U
94#define GPIOB_PIN10 10U
95#define GPIOB_PIN11 11U
96#define GPIOB_PIN12 12U
97#define GPIOB_PIN13 13U
98#define GPIOB_PIN14 14U
99#define GPIOB_PIN15 15U
100
101#define GPIOC_PIN0 0U
102#define GPIOC_PIN1 1U
103#define GPIOC_PIN2 2U
104#define GPIOC_PIN3 3U
105#define GPIOC_PIN4 4U
106#define GPIOC_PIN5 5U
107#define GPIOC_PIN6 6U
108#define GPIOC_PIN7 7U
109#define GPIOC_PIN8 8U
110#define GPIOC_PIN9 9U
111#define GPIOC_PIN10 10U
112#define GPIOC_PIN11 11U
113#define GPIOC_PIN12 12U
114#define GPIOC_BUTTON 13U
115#define GPIOC_USER_BUTTON 13U
116#define GPIOC_OSC32_IN 14U
117#define GPIOC_OSC32_OUT 15U
118
119#define GPIOD_PIN0 0U
120#define GPIOD_PIN1 1U
121#define GPIOD_PIN2 2U
122#define GPIOD_PIN3 3U
123#define GPIOD_PIN4 4U
124#define GPIOD_PIN5 5U
125#define GPIOD_PIN6 6U
126#define GPIOD_PIN7 7U
127#define GPIOD_PIN8 8U
128#define GPIOD_PIN9 9U
129#define GPIOD_PIN10 10U
130#define GPIOD_PIN11 11U
131#define GPIOD_PIN12 12U
132#define GPIOD_PIN13 13U
133#define GPIOD_PIN14 14U
134#define GPIOD_PIN15 15U
135
136#define GPIOE_PIN0 0U
137#define GPIOE_PIN1 1U
138#define GPIOE_PIN2 2U
139#define GPIOE_PIN3 3U
140#define GPIOE_PIN4 4U
141#define GPIOE_PIN5 5U
142#define GPIOE_PIN6 6U
143#define GPIOE_PIN7 7U
144#define GPIOE_PIN8 8U
145#define GPIOE_PIN9 9U
146#define GPIOE_PIN10 10U
147#define GPIOE_PIN11 11U
148#define GPIOE_PIN12 12U
149#define GPIOE_PIN13 13U
150#define GPIOE_PIN14 14U
151#define GPIOE_PIN15 15U
152
153#define GPIOF_OSC_IN 0U
154#define GPIOF_OSC_OUT 1U
155#define GPIOF_PIN2 2U
156#define GPIOF_PIN3 3U
157#define GPIOF_PIN4 4U
158#define GPIOF_PIN5 5U
159#define GPIOF_PIN6 6U
160#define GPIOF_PIN7 7U
161#define GPIOF_PIN8 8U
162#define GPIOF_PIN9 9U
163#define GPIOF_PIN10 10U
164#define GPIOF_PIN11 11U
165#define GPIOF_PIN12 12U
166#define GPIOF_PIN13 13U
167#define GPIOF_PIN14 14U
168#define GPIOF_PIN15 15U
169
170#define GPIOG_PIN0 0U
171#define GPIOG_PIN1 1U
172#define GPIOG_PIN2 2U
173#define GPIOG_PIN3 3U
174#define GPIOG_PIN4 4U
175#define GPIOG_PIN5 5U
176#define GPIOG_PIN6 6U
177#define GPIOG_PIN7 7U
178#define GPIOG_PIN8 8U
179#define GPIOG_PIN9 9U
180#define GPIOG_PIN10 10U
181#define GPIOG_PIN11 11U
182#define GPIOG_PIN12 12U
183#define GPIOG_PIN13 13U
184#define GPIOG_PIN14 14U
185#define GPIOG_PIN15 15U
186
187/*
188 * IO lines assignments.
189 */
190#define LINE_STLINK_TX PAL_LINE(GPIOA, 2U)
191#define LINE_STLINK_RX PAL_LINE(GPIOA, 3U)
192#define LINE_LED PAL_LINE(GPIOA, 5U)
193#define LINE_LED_GREEN PAL_LINE(GPIOA, 5U)
194#define LINE_SWDIO PAL_LINE(GPIOA, 13U)
195#define LINE_SWCLK PAL_LINE(GPIOA, 14U)
196#define LINE_BOOT1 PAL_LINE(GPIOB, 2U)
197#define LINE_TRACESWO PAL_LINE(GPIOB, 3U)
198#define LINE_BUTTON PAL_LINE(GPIOC, 13U)
199#define LINE_USER_BUTTON PAL_LINE(GPIOC, 13U)
200#define LINE_OSC32_IN PAL_LINE(GPIOC, 14U)
201#define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U)
202#define LINE_OSC_IN PAL_LINE(GPIOF, 0U)
203#define LINE_OSC_OUT PAL_LINE(GPIOF, 1U)
204
205/*===========================================================================*/
206/* Driver pre-compile time settings. */
207/*===========================================================================*/
208
209/*===========================================================================*/
210/* Derived constants and error checks. */
211/*===========================================================================*/
212
213/*===========================================================================*/
214/* Driver data structures and types. */
215/*===========================================================================*/
216
217/*===========================================================================*/
218/* Driver macros. */
219/*===========================================================================*/
220
221/*
222 * I/O ports initial setup, this configuration is established soon after reset
223 * in the initialization code.
224 * Please refer to the STM32 Reference Manual for details.
225 */
226#define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
227#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
228#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
229#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
230#define PIN_ODR_LOW(n) (0U << (n))
231#define PIN_ODR_HIGH(n) (1U << (n))
232#define PIN_OTYPE_PUSHPULL(n) (0U << (n))
233#define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
234#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U))
235#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U))
236#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U))
237#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U))
238#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
239#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
240#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
241#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
242#define PIN_LOCKR_DISABLED(n) (0U << (n))
243#define PIN_LOCKR_ENABLED(n) (1U << (n))
244
245/*
246 * GPIOA setup:
247 *
248 * PA0 - PIN0 (analog).
249 * PA1 - PIN1 (analog).
250 * PA2 - STLINK_TX (alternate 12).
251 * PA3 - STLINK_RX (alternate 12).
252 * PA4 - PIN4 (analog).
253 * PA5 - LED LED_GREEN (output pushpull maximum).
254 * PA6 - PIN6 (analog).
255 * PA7 - PIN7 (analog).
256 * PA8 - PIN8 (analog).
257 * PA9 - PIN9 (analog).
258 * PA10 - PIN10 (analog).
259 * PA11 - PIN11 (analog).
260 * PA12 - PIN12 (analog).
261 * PA13 - SWDIO (alternate 0).
262 * PA14 - SWCLK (alternate 0).
263 * PA15 - PIN15 (analog).
264 */
265#define VAL_GPIOA_MODER (PIN_MODE_ANALOG(GPIOA_PIN0) | \
266 PIN_MODE_ANALOG(GPIOA_PIN1) | \
267 PIN_MODE_ALTERNATE(GPIOA_STLINK_TX) | \
268 PIN_MODE_ALTERNATE(GPIOA_STLINK_RX) | \
269 PIN_MODE_ANALOG(GPIOA_PIN4) | \
270 PIN_MODE_OUTPUT(GPIOA_LED) | \
271 PIN_MODE_ANALOG(GPIOA_PIN6) | \
272 PIN_MODE_ANALOG(GPIOA_PIN7) | \
273 PIN_MODE_ANALOG(GPIOA_PIN8) | \
274 PIN_MODE_ANALOG(GPIOA_PIN9) | \
275 PIN_MODE_ANALOG(GPIOA_PIN10) | \
276 PIN_MODE_ANALOG(GPIOA_PIN11) | \
277 PIN_MODE_ANALOG(GPIOA_PIN12) | \
278 PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \
279 PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \
280 PIN_MODE_ANALOG(GPIOA_PIN15))
281#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_PIN0) | \
282 PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \
283 PIN_OTYPE_PUSHPULL(GPIOA_STLINK_TX) | \
284 PIN_OTYPE_PUSHPULL(GPIOA_STLINK_RX) | \
285 PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \
286 PIN_OTYPE_PUSHPULL(GPIOA_LED) | \
287 PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \
288 PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \
289 PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \
290 PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \
291 PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \
292 PIN_OTYPE_PUSHPULL(GPIOA_PIN11) | \
293 PIN_OTYPE_PUSHPULL(GPIOA_PIN12) | \
294 PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \
295 PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \
296 PIN_OTYPE_PUSHPULL(GPIOA_PIN15))
297#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_PIN0) | \
298 PIN_OSPEED_VERYLOW(GPIOA_PIN1) | \
299 PIN_OSPEED_VERYLOW(GPIOA_STLINK_TX) | \
300 PIN_OSPEED_VERYLOW(GPIOA_STLINK_RX) | \
301 PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \
302 PIN_OSPEED_HIGH(GPIOA_LED) | \
303 PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \
304 PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \
305 PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \
306 PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \
307 PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \
308 PIN_OSPEED_VERYLOW(GPIOA_PIN11) | \
309 PIN_OSPEED_VERYLOW(GPIOA_PIN12) | \
310 PIN_OSPEED_HIGH(GPIOA_SWDIO) | \
311 PIN_OSPEED_HIGH(GPIOA_SWCLK) | \
312 PIN_OSPEED_VERYLOW(GPIOA_PIN15))
313#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_PIN0) | \
314 PIN_PUPDR_FLOATING(GPIOA_PIN1) | \
315 PIN_PUPDR_FLOATING(GPIOA_STLINK_TX) | \
316 PIN_PUPDR_FLOATING(GPIOA_STLINK_RX) | \
317 PIN_PUPDR_FLOATING(GPIOA_PIN4) | \
318 PIN_PUPDR_FLOATING(GPIOA_LED) | \
319 PIN_PUPDR_FLOATING(GPIOA_PIN6) | \
320 PIN_PUPDR_FLOATING(GPIOA_PIN7) | \
321 PIN_PUPDR_FLOATING(GPIOA_PIN8) | \
322 PIN_PUPDR_FLOATING(GPIOA_PIN9) | \
323 PIN_PUPDR_FLOATING(GPIOA_PIN10) | \
324 PIN_PUPDR_FLOATING(GPIOA_PIN11) | \
325 PIN_PUPDR_FLOATING(GPIOA_PIN12) | \
326 PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \
327 PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \
328 PIN_PUPDR_FLOATING(GPIOA_PIN15))
329#define VAL_GPIOA_ODR (PIN_ODR_LOW(GPIOA_PIN0) | \
330 PIN_ODR_LOW(GPIOA_PIN1) | \
331 PIN_ODR_LOW(GPIOA_STLINK_TX) | \
332 PIN_ODR_LOW(GPIOA_STLINK_RX) | \
333 PIN_ODR_LOW(GPIOA_PIN4) | \
334 PIN_ODR_LOW(GPIOA_LED) | \
335 PIN_ODR_LOW(GPIOA_PIN6) | \
336 PIN_ODR_LOW(GPIOA_PIN7) | \
337 PIN_ODR_LOW(GPIOA_PIN8) | \
338 PIN_ODR_LOW(GPIOA_PIN9) | \
339 PIN_ODR_LOW(GPIOA_PIN10) | \
340 PIN_ODR_LOW(GPIOA_PIN11) | \
341 PIN_ODR_LOW(GPIOA_PIN12) | \
342 PIN_ODR_LOW(GPIOA_SWDIO) | \
343 PIN_ODR_LOW(GPIOA_SWCLK) | \
344 PIN_ODR_LOW(GPIOA_PIN15))
345#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_PIN0, 0U) | \
346 PIN_AFIO_AF(GPIOA_PIN1, 0U) | \
347 PIN_AFIO_AF(GPIOA_STLINK_TX, 12U) | \
348 PIN_AFIO_AF(GPIOA_STLINK_RX, 12U) | \
349 PIN_AFIO_AF(GPIOA_PIN4, 0U) | \
350 PIN_AFIO_AF(GPIOA_LED, 0U) | \
351 PIN_AFIO_AF(GPIOA_PIN6, 0U) | \
352 PIN_AFIO_AF(GPIOA_PIN7, 0U))
353#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0U) | \
354 PIN_AFIO_AF(GPIOA_PIN9, 0U) | \
355 PIN_AFIO_AF(GPIOA_PIN10, 0U) | \
356 PIN_AFIO_AF(GPIOA_PIN11, 0U) | \
357 PIN_AFIO_AF(GPIOA_PIN12, 0U) | \
358 PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \
359 PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \
360 PIN_AFIO_AF(GPIOA_PIN15, 0U))
361
362/*
363 * GPIOB setup:
364 *
365 * PB0 - PIN0 (analog).
366 * PB1 - PIN1 (analog).
367 * PB2 - BOOT1 (analog).
368 * PB3 - TRACESWO (alternate 0).
369 * PB4 - PIN4 (analog).
370 * PB5 - PIN5 (analog).
371 * PB6 - PIN6 (analog).
372 * PB7 - PIN7 (analog).
373 * PB8 - PIN8 (analog).
374 * PB9 - PIN9 (analog).
375 * PB10 - PIN10 (analog).
376 * PB11 - PIN11 (analog).
377 * PB12 - PIN12 (analog).
378 * PB13 - PIN13 (analog).
379 * PB14 - PIN14 (analog).
380 * PB15 - PIN15 (analog).
381 */
382#define VAL_GPIOB_MODER (PIN_MODE_ANALOG(GPIOB_PIN0) | \
383 PIN_MODE_ANALOG(GPIOB_PIN1) | \
384 PIN_MODE_ANALOG(GPIOB_BOOT1) | \
385 PIN_MODE_ALTERNATE(GPIOB_TRACESWO) | \
386 PIN_MODE_ANALOG(GPIOB_PIN4) | \
387 PIN_MODE_ANALOG(GPIOB_PIN5) | \
388 PIN_MODE_ANALOG(GPIOB_PIN6) | \
389 PIN_MODE_ANALOG(GPIOB_PIN7) | \
390 PIN_MODE_ANALOG(GPIOB_PIN8) | \
391 PIN_MODE_ANALOG(GPIOB_PIN9) | \
392 PIN_MODE_ANALOG(GPIOB_PIN10) | \
393 PIN_MODE_ANALOG(GPIOB_PIN11) | \
394 PIN_MODE_ANALOG(GPIOB_PIN12) | \
395 PIN_MODE_ANALOG(GPIOB_PIN13) | \
396 PIN_MODE_ANALOG(GPIOB_PIN14) | \
397 PIN_MODE_ANALOG(GPIOB_PIN15))
398#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \
399 PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \
400 PIN_OTYPE_PUSHPULL(GPIOB_BOOT1) | \
401 PIN_OTYPE_PUSHPULL(GPIOB_TRACESWO) | \
402 PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \
403 PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \
404 PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | \
405 PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \
406 PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \
407 PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \
408 PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \
409 PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \
410 PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \
411 PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \
412 PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \
413 PIN_OTYPE_PUSHPULL(GPIOB_PIN15))
414#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \
415 PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \
416 PIN_OSPEED_VERYLOW(GPIOB_BOOT1) | \
417 PIN_OSPEED_HIGH(GPIOB_TRACESWO) | \
418 PIN_OSPEED_VERYLOW(GPIOB_PIN4) | \
419 PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \
420 PIN_OSPEED_VERYLOW(GPIOB_PIN6) | \
421 PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \
422 PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \
423 PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \
424 PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \
425 PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \
426 PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \
427 PIN_OSPEED_VERYLOW(GPIOB_PIN13) | \
428 PIN_OSPEED_VERYLOW(GPIOB_PIN14) | \
429 PIN_OSPEED_VERYLOW(GPIOB_PIN15))
430#define VAL_GPIOB_PUPDR (PIN_PUPDR_FLOATING(GPIOB_PIN0) | \
431 PIN_PUPDR_FLOATING(GPIOB_PIN1) | \
432 PIN_PUPDR_FLOATING(GPIOB_BOOT1) | \
433 PIN_PUPDR_FLOATING(GPIOB_TRACESWO) | \
434 PIN_PUPDR_FLOATING(GPIOB_PIN4) | \
435 PIN_PUPDR_FLOATING(GPIOB_PIN5) | \
436 PIN_PUPDR_FLOATING(GPIOB_PIN6) | \
437 PIN_PUPDR_FLOATING(GPIOB_PIN7) | \
438 PIN_PUPDR_FLOATING(GPIOB_PIN8) | \
439 PIN_PUPDR_FLOATING(GPIOB_PIN9) | \
440 PIN_PUPDR_FLOATING(GPIOB_PIN10) | \
441 PIN_PUPDR_FLOATING(GPIOB_PIN11) | \
442 PIN_PUPDR_FLOATING(GPIOB_PIN12) | \
443 PIN_PUPDR_FLOATING(GPIOB_PIN13) | \
444 PIN_PUPDR_FLOATING(GPIOB_PIN14) | \
445 PIN_PUPDR_FLOATING(GPIOB_PIN15))
446#define VAL_GPIOB_ODR (PIN_ODR_LOW(GPIOB_PIN0) | \
447 PIN_ODR_LOW(GPIOB_PIN1) | \
448 PIN_ODR_LOW(GPIOB_BOOT1) | \
449 PIN_ODR_LOW(GPIOB_TRACESWO) | \
450 PIN_ODR_LOW(GPIOB_PIN4) | \
451 PIN_ODR_LOW(GPIOB_PIN5) | \
452 PIN_ODR_LOW(GPIOB_PIN6) | \
453 PIN_ODR_LOW(GPIOB_PIN7) | \
454 PIN_ODR_LOW(GPIOB_PIN8) | \
455 PIN_ODR_LOW(GPIOB_PIN9) | \
456 PIN_ODR_LOW(GPIOB_PIN10) | \
457 PIN_ODR_LOW(GPIOB_PIN11) | \
458 PIN_ODR_LOW(GPIOB_PIN12) | \
459 PIN_ODR_LOW(GPIOB_PIN13) | \
460 PIN_ODR_LOW(GPIOB_PIN14) | \
461 PIN_ODR_LOW(GPIOB_PIN15))
462#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0U) | \
463 PIN_AFIO_AF(GPIOB_PIN1, 0U) | \
464 PIN_AFIO_AF(GPIOB_BOOT1, 0U) | \
465 PIN_AFIO_AF(GPIOB_TRACESWO, 0U) | \
466 PIN_AFIO_AF(GPIOB_PIN4, 0U) | \
467 PIN_AFIO_AF(GPIOB_PIN5, 0U) | \
468 PIN_AFIO_AF(GPIOB_PIN6, 0U) | \
469 PIN_AFIO_AF(GPIOB_PIN7, 0U))
470#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \
471 PIN_AFIO_AF(GPIOB_PIN9, 0U) | \
472 PIN_AFIO_AF(GPIOB_PIN10, 0U) | \
473 PIN_AFIO_AF(GPIOB_PIN11, 0U) | \
474 PIN_AFIO_AF(GPIOB_PIN12, 0U) | \
475 PIN_AFIO_AF(GPIOB_PIN13, 0U) | \
476 PIN_AFIO_AF(GPIOB_PIN14, 0U) | \
477 PIN_AFIO_AF(GPIOB_PIN15, 0U))
478
479/*
480 * GPIOC setup:
481 *
482 * PC0 - PIN0 (analog).
483 * PC1 - PIN1 (analog).
484 * PC2 - PIN2 (analog).
485 * PC3 - PIN3 (analog).
486 * PC4 - PIN4 (analog).
487 * PC5 - PIN5 (analog).
488 * PC6 - PIN6 (analog).
489 * PC7 - PIN7 (analog).
490 * PC8 - PIN8 (analog).
491 * PC9 - PIN9 (analog).
492 * PC10 - PIN10 (analog).
493 * PC11 - PIN11 (analog).
494 * PC12 - PIN12 (analog).
495 * PC13 - BUTTON USER_BUTTON (input floating).
496 * PC14 - OSC32_IN (analog).
497 * PC15 - OSC32_OUT (analog).
498 */
499#define VAL_GPIOC_MODER (PIN_MODE_ANALOG(GPIOC_PIN0) | \
500 PIN_MODE_ANALOG(GPIOC_PIN1) | \
501 PIN_MODE_ANALOG(GPIOC_PIN2) | \
502 PIN_MODE_ANALOG(GPIOC_PIN3) | \
503 PIN_MODE_ANALOG(GPIOC_PIN4) | \
504 PIN_MODE_ANALOG(GPIOC_PIN5) | \
505 PIN_MODE_ANALOG(GPIOC_PIN6) | \
506 PIN_MODE_ANALOG(GPIOC_PIN7) | \
507 PIN_MODE_ANALOG(GPIOC_PIN8) | \
508 PIN_MODE_ANALOG(GPIOC_PIN9) | \
509 PIN_MODE_ANALOG(GPIOC_PIN10) | \
510 PIN_MODE_ANALOG(GPIOC_PIN11) | \
511 PIN_MODE_ANALOG(GPIOC_PIN12) | \
512 PIN_MODE_INPUT(GPIOC_BUTTON) | \
513 PIN_MODE_ANALOG(GPIOC_OSC32_IN) | \
514 PIN_MODE_ANALOG(GPIOC_OSC32_OUT))
515#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_PIN0) | \
516 PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \
517 PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \
518 PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \
519 PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \
520 PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \
521 PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | \
522 PIN_OTYPE_PUSHPULL(GPIOC_PIN7) | \
523 PIN_OTYPE_PUSHPULL(GPIOC_PIN8) | \
524 PIN_OTYPE_PUSHPULL(GPIOC_PIN9) | \
525 PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \
526 PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \
527 PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \
528 PIN_OTYPE_PUSHPULL(GPIOC_BUTTON) | \
529 PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \
530 PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT))
531#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOC_PIN0) | \
532 PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \
533 PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \
534 PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \
535 PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \
536 PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \
537 PIN_OSPEED_VERYLOW(GPIOC_PIN6) | \
538 PIN_OSPEED_VERYLOW(GPIOC_PIN7) | \
539 PIN_OSPEED_VERYLOW(GPIOC_PIN8) | \
540 PIN_OSPEED_VERYLOW(GPIOC_PIN9) | \
541 PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \
542 PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \
543 PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \
544 PIN_OSPEED_VERYLOW(GPIOC_BUTTON) | \
545 PIN_OSPEED_VERYLOW(GPIOC_OSC32_IN) | \
546 PIN_OSPEED_VERYLOW(GPIOC_OSC32_OUT))
547#define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_PIN0) | \
548 PIN_PUPDR_FLOATING(GPIOC_PIN1) | \
549 PIN_PUPDR_FLOATING(GPIOC_PIN2) | \
550 PIN_PUPDR_FLOATING(GPIOC_PIN3) | \
551 PIN_PUPDR_FLOATING(GPIOC_PIN4) | \
552 PIN_PUPDR_FLOATING(GPIOC_PIN5) | \
553 PIN_PUPDR_FLOATING(GPIOC_PIN6) | \
554 PIN_PUPDR_FLOATING(GPIOC_PIN7) | \
555 PIN_PUPDR_FLOATING(GPIOC_PIN8) | \
556 PIN_PUPDR_FLOATING(GPIOC_PIN9) | \
557 PIN_PUPDR_FLOATING(GPIOC_PIN10) | \
558 PIN_PUPDR_FLOATING(GPIOC_PIN11) | \
559 PIN_PUPDR_FLOATING(GPIOC_PIN12) | \
560 PIN_PUPDR_FLOATING(GPIOC_BUTTON) | \
561 PIN_PUPDR_FLOATING(GPIOC_OSC32_IN) | \
562 PIN_PUPDR_FLOATING(GPIOC_OSC32_OUT))
563#define VAL_GPIOC_ODR (PIN_ODR_LOW(GPIOC_PIN0) | \
564 PIN_ODR_LOW(GPIOC_PIN1) | \
565 PIN_ODR_LOW(GPIOC_PIN2) | \
566 PIN_ODR_LOW(GPIOC_PIN3) | \
567 PIN_ODR_LOW(GPIOC_PIN4) | \
568 PIN_ODR_LOW(GPIOC_PIN5) | \
569 PIN_ODR_LOW(GPIOC_PIN6) | \
570 PIN_ODR_LOW(GPIOC_PIN7) | \
571 PIN_ODR_LOW(GPIOC_PIN8) | \
572 PIN_ODR_LOW(GPIOC_PIN9) | \
573 PIN_ODR_LOW(GPIOC_PIN10) | \
574 PIN_ODR_LOW(GPIOC_PIN11) | \
575 PIN_ODR_LOW(GPIOC_PIN12) | \
576 PIN_ODR_LOW(GPIOC_BUTTON) | \
577 PIN_ODR_LOW(GPIOC_OSC32_IN) | \
578 PIN_ODR_LOW(GPIOC_OSC32_OUT))
579#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_PIN0, 0U) | \
580 PIN_AFIO_AF(GPIOC_PIN1, 0U) | \
581 PIN_AFIO_AF(GPIOC_PIN2, 0U) | \
582 PIN_AFIO_AF(GPIOC_PIN3, 0U) | \
583 PIN_AFIO_AF(GPIOC_PIN4, 0U) | \
584 PIN_AFIO_AF(GPIOC_PIN5, 0U) | \
585 PIN_AFIO_AF(GPIOC_PIN6, 0U) | \
586 PIN_AFIO_AF(GPIOC_PIN7, 0U))
587#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_PIN8, 0U) | \
588 PIN_AFIO_AF(GPIOC_PIN9, 0U) | \
589 PIN_AFIO_AF(GPIOC_PIN10, 0U) | \
590 PIN_AFIO_AF(GPIOC_PIN11, 0U) | \
591 PIN_AFIO_AF(GPIOC_PIN12, 0U) | \
592 PIN_AFIO_AF(GPIOC_BUTTON, 0U) | \
593 PIN_AFIO_AF(GPIOC_OSC32_IN, 0U) | \
594 PIN_AFIO_AF(GPIOC_OSC32_OUT, 0U))
595
596/*
597 * GPIOD setup:
598 *
599 * PD0 - PIN0 (analog).
600 * PD1 - PIN1 (analog).
601 * PD2 - PIN2 (analog).
602 * PD3 - PIN3 (analog).
603 * PD4 - PIN4 (analog).
604 * PD5 - PIN5 (analog).
605 * PD6 - PIN6 (analog).
606 * PD7 - PIN7 (analog).
607 * PD8 - PIN8 (analog).
608 * PD9 - PIN9 (analog).
609 * PD10 - PIN10 (analog).
610 * PD11 - PIN11 (analog).
611 * PD12 - PIN12 (analog).
612 * PD13 - PIN13 (analog).
613 * PD14 - PIN14 (analog).
614 * PD15 - PIN15 (analog).
615 */
616#define VAL_GPIOD_MODER (PIN_MODE_ANALOG(GPIOD_PIN0) | \
617 PIN_MODE_ANALOG(GPIOD_PIN1) | \
618 PIN_MODE_ANALOG(GPIOD_PIN2) | \
619 PIN_MODE_ANALOG(GPIOD_PIN3) | \
620 PIN_MODE_ANALOG(GPIOD_PIN4) | \
621 PIN_MODE_ANALOG(GPIOD_PIN5) | \
622 PIN_MODE_ANALOG(GPIOD_PIN6) | \
623 PIN_MODE_ANALOG(GPIOD_PIN7) | \
624 PIN_MODE_ANALOG(GPIOD_PIN8) | \
625 PIN_MODE_ANALOG(GPIOD_PIN9) | \
626 PIN_MODE_ANALOG(GPIOD_PIN10) | \
627 PIN_MODE_ANALOG(GPIOD_PIN11) | \
628 PIN_MODE_ANALOG(GPIOD_PIN12) | \
629 PIN_MODE_ANALOG(GPIOD_PIN13) | \
630 PIN_MODE_ANALOG(GPIOD_PIN14) | \
631 PIN_MODE_ANALOG(GPIOD_PIN15))
632#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \
633 PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \
634 PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \
635 PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \
636 PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \
637 PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \
638 PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \
639 PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \
640 PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \
641 PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \
642 PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \
643 PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \
644 PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \
645 PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \
646 PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \
647 PIN_OTYPE_PUSHPULL(GPIOD_PIN15))
648#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \
649 PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \
650 PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \
651 PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \
652 PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \
653 PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \
654 PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \
655 PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \
656 PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \
657 PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \
658 PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \
659 PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \
660 PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \
661 PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \
662 PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \
663 PIN_OSPEED_VERYLOW(GPIOD_PIN15))
664#define VAL_GPIOD_PUPDR (PIN_PUPDR_FLOATING(GPIOD_PIN0) | \
665 PIN_PUPDR_FLOATING(GPIOD_PIN1) | \
666 PIN_PUPDR_FLOATING(GPIOD_PIN2) | \
667 PIN_PUPDR_FLOATING(GPIOD_PIN3) | \
668 PIN_PUPDR_FLOATING(GPIOD_PIN4) | \
669 PIN_PUPDR_FLOATING(GPIOD_PIN5) | \
670 PIN_PUPDR_FLOATING(GPIOD_PIN6) | \
671 PIN_PUPDR_FLOATING(GPIOD_PIN7) | \
672 PIN_PUPDR_FLOATING(GPIOD_PIN8) | \
673 PIN_PUPDR_FLOATING(GPIOD_PIN9) | \
674 PIN_PUPDR_FLOATING(GPIOD_PIN10) | \
675 PIN_PUPDR_FLOATING(GPIOD_PIN11) | \
676 PIN_PUPDR_FLOATING(GPIOD_PIN12) | \
677 PIN_PUPDR_FLOATING(GPIOD_PIN13) | \
678 PIN_PUPDR_FLOATING(GPIOD_PIN14) | \
679 PIN_PUPDR_FLOATING(GPIOD_PIN15))
680#define VAL_GPIOD_ODR (PIN_ODR_LOW(GPIOD_PIN0) | \
681 PIN_ODR_LOW(GPIOD_PIN1) | \
682 PIN_ODR_LOW(GPIOD_PIN2) | \
683 PIN_ODR_LOW(GPIOD_PIN3) | \
684 PIN_ODR_LOW(GPIOD_PIN4) | \
685 PIN_ODR_LOW(GPIOD_PIN5) | \
686 PIN_ODR_LOW(GPIOD_PIN6) | \
687 PIN_ODR_LOW(GPIOD_PIN7) | \
688 PIN_ODR_LOW(GPIOD_PIN8) | \
689 PIN_ODR_LOW(GPIOD_PIN9) | \
690 PIN_ODR_LOW(GPIOD_PIN10) | \
691 PIN_ODR_LOW(GPIOD_PIN11) | \
692 PIN_ODR_LOW(GPIOD_PIN12) | \
693 PIN_ODR_LOW(GPIOD_PIN13) | \
694 PIN_ODR_LOW(GPIOD_PIN14) | \
695 PIN_ODR_LOW(GPIOD_PIN15))
696#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \
697 PIN_AFIO_AF(GPIOD_PIN1, 0U) | \
698 PIN_AFIO_AF(GPIOD_PIN2, 0U) | \
699 PIN_AFIO_AF(GPIOD_PIN3, 0U) | \
700 PIN_AFIO_AF(GPIOD_PIN4, 0U) | \
701 PIN_AFIO_AF(GPIOD_PIN5, 0U) | \
702 PIN_AFIO_AF(GPIOD_PIN6, 0U) | \
703 PIN_AFIO_AF(GPIOD_PIN7, 0U))
704#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \
705 PIN_AFIO_AF(GPIOD_PIN9, 0U) | \
706 PIN_AFIO_AF(GPIOD_PIN10, 0U) | \
707 PIN_AFIO_AF(GPIOD_PIN11, 0U) | \
708 PIN_AFIO_AF(GPIOD_PIN12, 0U) | \
709 PIN_AFIO_AF(GPIOD_PIN13, 0U) | \
710 PIN_AFIO_AF(GPIOD_PIN14, 0U) | \
711 PIN_AFIO_AF(GPIOD_PIN15, 0U))
712
713/*
714 * GPIOE setup:
715 *
716 * PE0 - PIN0 (analog).
717 * PE1 - PIN1 (analog).
718 * PE2 - PIN2 (analog).
719 * PE3 - PIN3 (analog).
720 * PE4 - PIN4 (analog).
721 * PE5 - PIN5 (analog).
722 * PE6 - PIN6 (analog).
723 * PE7 - PIN7 (analog).
724 * PE8 - PIN8 (analog).
725 * PE9 - PIN9 (analog).
726 * PE10 - PIN10 (analog).
727 * PE11 - PIN11 (analog).
728 * PE12 - PIN12 (analog).
729 * PE13 - PIN13 (analog).
730 * PE14 - PIN14 (analog).
731 * PE15 - PIN15 (analog).
732 */
733#define VAL_GPIOE_MODER (PIN_MODE_ANALOG(GPIOE_PIN0) | \
734 PIN_MODE_ANALOG(GPIOE_PIN1) | \
735 PIN_MODE_ANALOG(GPIOE_PIN2) | \
736 PIN_MODE_ANALOG(GPIOE_PIN3) | \
737 PIN_MODE_ANALOG(GPIOE_PIN4) | \
738 PIN_MODE_ANALOG(GPIOE_PIN5) | \
739 PIN_MODE_ANALOG(GPIOE_PIN6) | \
740 PIN_MODE_ANALOG(GPIOE_PIN7) | \
741 PIN_MODE_ANALOG(GPIOE_PIN8) | \
742 PIN_MODE_ANALOG(GPIOE_PIN9) | \
743 PIN_MODE_ANALOG(GPIOE_PIN10) | \
744 PIN_MODE_ANALOG(GPIOE_PIN11) | \
745 PIN_MODE_ANALOG(GPIOE_PIN12) | \
746 PIN_MODE_ANALOG(GPIOE_PIN13) | \
747 PIN_MODE_ANALOG(GPIOE_PIN14) | \
748 PIN_MODE_ANALOG(GPIOE_PIN15))
749#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \
750 PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \
751 PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \
752 PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \
753 PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \
754 PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \
755 PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \
756 PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \
757 PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \
758 PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \
759 PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \
760 PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \
761 PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \
762 PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \
763 PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \
764 PIN_OTYPE_PUSHPULL(GPIOE_PIN15))
765#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) | \
766 PIN_OSPEED_VERYLOW(GPIOE_PIN1) | \
767 PIN_OSPEED_VERYLOW(GPIOE_PIN2) | \
768 PIN_OSPEED_VERYLOW(GPIOE_PIN3) | \
769 PIN_OSPEED_VERYLOW(GPIOE_PIN4) | \
770 PIN_OSPEED_VERYLOW(GPIOE_PIN5) | \
771 PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \
772 PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \
773 PIN_OSPEED_VERYLOW(GPIOE_PIN8) | \
774 PIN_OSPEED_VERYLOW(GPIOE_PIN9) | \
775 PIN_OSPEED_VERYLOW(GPIOE_PIN10) | \
776 PIN_OSPEED_VERYLOW(GPIOE_PIN11) | \
777 PIN_OSPEED_VERYLOW(GPIOE_PIN12) | \
778 PIN_OSPEED_VERYLOW(GPIOE_PIN13) | \
779 PIN_OSPEED_VERYLOW(GPIOE_PIN14) | \
780 PIN_OSPEED_VERYLOW(GPIOE_PIN15))
781#define VAL_GPIOE_PUPDR (PIN_PUPDR_FLOATING(GPIOE_PIN0) | \
782 PIN_PUPDR_FLOATING(GPIOE_PIN1) | \
783 PIN_PUPDR_FLOATING(GPIOE_PIN2) | \
784 PIN_PUPDR_FLOATING(GPIOE_PIN3) | \
785 PIN_PUPDR_FLOATING(GPIOE_PIN4) | \
786 PIN_PUPDR_FLOATING(GPIOE_PIN5) | \
787 PIN_PUPDR_FLOATING(GPIOE_PIN6) | \
788 PIN_PUPDR_FLOATING(GPIOE_PIN7) | \
789 PIN_PUPDR_FLOATING(GPIOE_PIN8) | \
790 PIN_PUPDR_FLOATING(GPIOE_PIN9) | \
791 PIN_PUPDR_FLOATING(GPIOE_PIN10) | \
792 PIN_PUPDR_FLOATING(GPIOE_PIN11) | \
793 PIN_PUPDR_FLOATING(GPIOE_PIN12) | \
794 PIN_PUPDR_FLOATING(GPIOE_PIN13) | \
795 PIN_PUPDR_FLOATING(GPIOE_PIN14) | \
796 PIN_PUPDR_FLOATING(GPIOE_PIN15))
797#define VAL_GPIOE_ODR (PIN_ODR_LOW(GPIOE_PIN0) | \
798 PIN_ODR_LOW(GPIOE_PIN1) | \
799 PIN_ODR_LOW(GPIOE_PIN2) | \
800 PIN_ODR_LOW(GPIOE_PIN3) | \
801 PIN_ODR_LOW(GPIOE_PIN4) | \
802 PIN_ODR_LOW(GPIOE_PIN5) | \
803 PIN_ODR_LOW(GPIOE_PIN6) | \
804 PIN_ODR_LOW(GPIOE_PIN7) | \
805 PIN_ODR_LOW(GPIOE_PIN8) | \
806 PIN_ODR_LOW(GPIOE_PIN9) | \
807 PIN_ODR_LOW(GPIOE_PIN10) | \
808 PIN_ODR_LOW(GPIOE_PIN11) | \
809 PIN_ODR_LOW(GPIOE_PIN12) | \
810 PIN_ODR_LOW(GPIOE_PIN13) | \
811 PIN_ODR_LOW(GPIOE_PIN14) | \
812 PIN_ODR_LOW(GPIOE_PIN15))
813#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0U) | \
814 PIN_AFIO_AF(GPIOE_PIN1, 0U) | \
815 PIN_AFIO_AF(GPIOE_PIN2, 0U) | \
816 PIN_AFIO_AF(GPIOE_PIN3, 0U) | \
817 PIN_AFIO_AF(GPIOE_PIN4, 0U) | \
818 PIN_AFIO_AF(GPIOE_PIN5, 0U) | \
819 PIN_AFIO_AF(GPIOE_PIN6, 0U) | \
820 PIN_AFIO_AF(GPIOE_PIN7, 0U))
821#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0U) | \
822 PIN_AFIO_AF(GPIOE_PIN9, 0U) | \
823 PIN_AFIO_AF(GPIOE_PIN10, 0U) | \
824 PIN_AFIO_AF(GPIOE_PIN11, 0U) | \
825 PIN_AFIO_AF(GPIOE_PIN12, 0U) | \
826 PIN_AFIO_AF(GPIOE_PIN13, 0U) | \
827 PIN_AFIO_AF(GPIOE_PIN14, 0U) | \
828 PIN_AFIO_AF(GPIOE_PIN15, 0U))
829
830/*
831 * GPIOF setup:
832 *
833 * PF0 - OSC_IN (analog).
834 * PF1 - OSC_OUT (analog).
835 * PF2 - PIN2 (analog).
836 * PF3 - PIN3 (analog).
837 * PF4 - PIN4 (analog).
838 * PF5 - PIN5 (analog).
839 * PF6 - PIN6 (analog).
840 * PF7 - PIN7 (analog).
841 * PF8 - PIN8 (analog).
842 * PF9 - PIN9 (analog).
843 * PF10 - PIN10 (analog).
844 * PF11 - PIN11 (analog).
845 * PF12 - PIN12 (analog).
846 * PF13 - PIN13 (analog).
847 * PF14 - PIN14 (analog).
848 * PF15 - PIN15 (analog).
849 */
850#define VAL_GPIOF_MODER (PIN_MODE_ANALOG(GPIOF_OSC_IN) | \
851 PIN_MODE_ANALOG(GPIOF_OSC_OUT) | \
852 PIN_MODE_ANALOG(GPIOF_PIN2) | \
853 PIN_MODE_ANALOG(GPIOF_PIN3) | \
854 PIN_MODE_ANALOG(GPIOF_PIN4) | \
855 PIN_MODE_ANALOG(GPIOF_PIN5) | \
856 PIN_MODE_ANALOG(GPIOF_PIN6) | \
857 PIN_MODE_ANALOG(GPIOF_PIN7) | \
858 PIN_MODE_ANALOG(GPIOF_PIN8) | \
859 PIN_MODE_ANALOG(GPIOF_PIN9) | \
860 PIN_MODE_ANALOG(GPIOF_PIN10) | \
861 PIN_MODE_ANALOG(GPIOF_PIN11) | \
862 PIN_MODE_ANALOG(GPIOF_PIN12) | \
863 PIN_MODE_ANALOG(GPIOF_PIN13) | \
864 PIN_MODE_ANALOG(GPIOF_PIN14) | \
865 PIN_MODE_ANALOG(GPIOF_PIN15))
866#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_OSC_IN) | \
867 PIN_OTYPE_PUSHPULL(GPIOF_OSC_OUT) | \
868 PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \
869 PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \
870 PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \
871 PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \
872 PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \
873 PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \
874 PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \
875 PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \
876 PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \
877 PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \
878 PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \
879 PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \
880 PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \
881 PIN_OTYPE_PUSHPULL(GPIOF_PIN15))
882#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOF_OSC_IN) | \
883 PIN_OSPEED_VERYLOW(GPIOF_OSC_OUT) | \
884 PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \
885 PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \
886 PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \
887 PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \
888 PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \
889 PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \
890 PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \
891 PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \
892 PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \
893 PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \
894 PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \
895 PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \
896 PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \
897 PIN_OSPEED_VERYLOW(GPIOF_PIN15))
898#define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_OSC_IN) | \
899 PIN_PUPDR_FLOATING(GPIOF_OSC_OUT) | \
900 PIN_PUPDR_FLOATING(GPIOF_PIN2) | \
901 PIN_PUPDR_FLOATING(GPIOF_PIN3) | \
902 PIN_PUPDR_FLOATING(GPIOF_PIN4) | \
903 PIN_PUPDR_FLOATING(GPIOF_PIN5) | \
904 PIN_PUPDR_FLOATING(GPIOF_PIN6) | \
905 PIN_PUPDR_FLOATING(GPIOF_PIN7) | \
906 PIN_PUPDR_FLOATING(GPIOF_PIN8) | \
907 PIN_PUPDR_FLOATING(GPIOF_PIN9) | \
908 PIN_PUPDR_FLOATING(GPIOF_PIN10) | \
909 PIN_PUPDR_FLOATING(GPIOF_PIN11) | \
910 PIN_PUPDR_FLOATING(GPIOF_PIN12) | \
911 PIN_PUPDR_FLOATING(GPIOF_PIN13) | \
912 PIN_PUPDR_FLOATING(GPIOF_PIN14) | \
913 PIN_PUPDR_FLOATING(GPIOF_PIN15))
914#define VAL_GPIOF_ODR (PIN_ODR_LOW(GPIOF_OSC_IN) | \
915 PIN_ODR_LOW(GPIOF_OSC_OUT) | \
916 PIN_ODR_LOW(GPIOF_PIN2) | \
917 PIN_ODR_LOW(GPIOF_PIN3) | \
918 PIN_ODR_LOW(GPIOF_PIN4) | \
919 PIN_ODR_LOW(GPIOF_PIN5) | \
920 PIN_ODR_LOW(GPIOF_PIN6) | \
921 PIN_ODR_LOW(GPIOF_PIN7) | \
922 PIN_ODR_LOW(GPIOF_PIN8) | \
923 PIN_ODR_LOW(GPIOF_PIN9) | \
924 PIN_ODR_LOW(GPIOF_PIN10) | \
925 PIN_ODR_LOW(GPIOF_PIN11) | \
926 PIN_ODR_LOW(GPIOF_PIN12) | \
927 PIN_ODR_LOW(GPIOF_PIN13) | \
928 PIN_ODR_LOW(GPIOF_PIN14) | \
929 PIN_ODR_LOW(GPIOF_PIN15))
930#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_OSC_IN, 0U) | \
931 PIN_AFIO_AF(GPIOF_OSC_OUT, 0U) | \
932 PIN_AFIO_AF(GPIOF_PIN2, 0U) | \
933 PIN_AFIO_AF(GPIOF_PIN3, 0U) | \
934 PIN_AFIO_AF(GPIOF_PIN4, 0U) | \
935 PIN_AFIO_AF(GPIOF_PIN5, 0U) | \
936 PIN_AFIO_AF(GPIOF_PIN6, 0U) | \
937 PIN_AFIO_AF(GPIOF_PIN7, 0U))
938#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \
939 PIN_AFIO_AF(GPIOF_PIN9, 0U) | \
940 PIN_AFIO_AF(GPIOF_PIN10, 0U) | \
941 PIN_AFIO_AF(GPIOF_PIN11, 0U) | \
942 PIN_AFIO_AF(GPIOF_PIN12, 0U) | \
943 PIN_AFIO_AF(GPIOF_PIN13, 0U) | \
944 PIN_AFIO_AF(GPIOF_PIN14, 0U) | \
945 PIN_AFIO_AF(GPIOF_PIN15, 0U))
946
947/*
948 * GPIOG setup:
949 *
950 * PG0 - PIN0 (analog).
951 * PG1 - PIN1 (analog).
952 * PG2 - PIN2 (analog).
953 * PG3 - PIN3 (analog).
954 * PG4 - PIN4 (analog).
955 * PG5 - PIN5 (analog).
956 * PG6 - PIN6 (analog).
957 * PG7 - PIN7 (analog).
958 * PG8 - PIN8 (analog).
959 * PG9 - PIN9 (analog).
960 * PG10 - PIN10 (analog).
961 * PG11 - PIN11 (analog).
962 * PG12 - PIN12 (analog).
963 * PG13 - PIN13 (analog).
964 * PG14 - PIN14 (analog).
965 * PG15 - PIN15 (analog).
966 */
967#define VAL_GPIOG_MODER (PIN_MODE_ANALOG(GPIOG_PIN0) | \
968 PIN_MODE_ANALOG(GPIOG_PIN1) | \
969 PIN_MODE_ANALOG(GPIOG_PIN2) | \
970 PIN_MODE_ANALOG(GPIOG_PIN3) | \
971 PIN_MODE_ANALOG(GPIOG_PIN4) | \
972 PIN_MODE_ANALOG(GPIOG_PIN5) | \
973 PIN_MODE_ANALOG(GPIOG_PIN6) | \
974 PIN_MODE_ANALOG(GPIOG_PIN7) | \
975 PIN_MODE_ANALOG(GPIOG_PIN8) | \
976 PIN_MODE_ANALOG(GPIOG_PIN9) | \
977 PIN_MODE_ANALOG(GPIOG_PIN10) | \
978 PIN_MODE_ANALOG(GPIOG_PIN11) | \
979 PIN_MODE_ANALOG(GPIOG_PIN12) | \
980 PIN_MODE_ANALOG(GPIOG_PIN13) | \
981 PIN_MODE_ANALOG(GPIOG_PIN14) | \
982 PIN_MODE_ANALOG(GPIOG_PIN15))
983#define VAL_GPIOG_OTYPER (PIN_OTYPE_PUSHPULL(GPIOG_PIN0) | \
984 PIN_OTYPE_PUSHPULL(GPIOG_PIN1) | \
985 PIN_OTYPE_PUSHPULL(GPIOG_PIN2) | \
986 PIN_OTYPE_PUSHPULL(GPIOG_PIN3) | \
987 PIN_OTYPE_PUSHPULL(GPIOG_PIN4) | \
988 PIN_OTYPE_PUSHPULL(GPIOG_PIN5) | \
989 PIN_OTYPE_PUSHPULL(GPIOG_PIN6) | \
990 PIN_OTYPE_PUSHPULL(GPIOG_PIN7) | \
991 PIN_OTYPE_PUSHPULL(GPIOG_PIN8) | \
992 PIN_OTYPE_PUSHPULL(GPIOG_PIN9) | \
993 PIN_OTYPE_PUSHPULL(GPIOG_PIN10) | \
994 PIN_OTYPE_PUSHPULL(GPIOG_PIN11) | \
995 PIN_OTYPE_PUSHPULL(GPIOG_PIN12) | \
996 PIN_OTYPE_PUSHPULL(GPIOG_PIN13) | \
997 PIN_OTYPE_PUSHPULL(GPIOG_PIN14) | \
998 PIN_OTYPE_PUSHPULL(GPIOG_PIN15))
999#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOG_PIN0) | \
1000 PIN_OSPEED_VERYLOW(GPIOG_PIN1) | \
1001 PIN_OSPEED_VERYLOW(GPIOG_PIN2) | \
1002 PIN_OSPEED_VERYLOW(GPIOG_PIN3) | \
1003 PIN_OSPEED_VERYLOW(GPIOG_PIN4) | \
1004 PIN_OSPEED_VERYLOW(GPIOG_PIN5) | \
1005 PIN_OSPEED_VERYLOW(GPIOG_PIN6) | \
1006 PIN_OSPEED_VERYLOW(GPIOG_PIN7) | \
1007 PIN_OSPEED_VERYLOW(GPIOG_PIN8) | \
1008 PIN_OSPEED_VERYLOW(GPIOG_PIN9) | \
1009 PIN_OSPEED_VERYLOW(GPIOG_PIN10) | \
1010 PIN_OSPEED_VERYLOW(GPIOG_PIN11) | \
1011 PIN_OSPEED_VERYLOW(GPIOG_PIN12) | \
1012 PIN_OSPEED_VERYLOW(GPIOG_PIN13) | \
1013 PIN_OSPEED_VERYLOW(GPIOG_PIN14) | \
1014 PIN_OSPEED_VERYLOW(GPIOG_PIN15))
1015#define VAL_GPIOG_PUPDR (PIN_PUPDR_FLOATING(GPIOG_PIN0) | \
1016 PIN_PUPDR_FLOATING(GPIOG_PIN1) | \
1017 PIN_PUPDR_FLOATING(GPIOG_PIN2) | \
1018 PIN_PUPDR_FLOATING(GPIOG_PIN3) | \
1019 PIN_PUPDR_FLOATING(GPIOG_PIN4) | \
1020 PIN_PUPDR_FLOATING(GPIOG_PIN5) | \
1021 PIN_PUPDR_FLOATING(GPIOG_PIN6) | \
1022 PIN_PUPDR_FLOATING(GPIOG_PIN7) | \
1023 PIN_PUPDR_FLOATING(GPIOG_PIN8) | \
1024 PIN_PUPDR_FLOATING(GPIOG_PIN9) | \
1025 PIN_PUPDR_FLOATING(GPIOG_PIN10) | \
1026 PIN_PUPDR_FLOATING(GPIOG_PIN11) | \
1027 PIN_PUPDR_FLOATING(GPIOG_PIN12) | \
1028 PIN_PUPDR_FLOATING(GPIOG_PIN13) | \
1029 PIN_PUPDR_FLOATING(GPIOG_PIN14) | \
1030 PIN_PUPDR_FLOATING(GPIOG_PIN15))
1031#define VAL_GPIOG_ODR (PIN_ODR_LOW(GPIOG_PIN0) | \
1032 PIN_ODR_LOW(GPIOG_PIN1) | \
1033 PIN_ODR_LOW(GPIOG_PIN2) | \
1034 PIN_ODR_LOW(GPIOG_PIN3) | \
1035 PIN_ODR_LOW(GPIOG_PIN4) | \
1036 PIN_ODR_LOW(GPIOG_PIN5) | \
1037 PIN_ODR_LOW(GPIOG_PIN6) | \
1038 PIN_ODR_LOW(GPIOG_PIN7) | \
1039 PIN_ODR_LOW(GPIOG_PIN8) | \
1040 PIN_ODR_LOW(GPIOG_PIN9) | \
1041 PIN_ODR_LOW(GPIOG_PIN10) | \
1042 PIN_ODR_LOW(GPIOG_PIN11) | \
1043 PIN_ODR_LOW(GPIOG_PIN12) | \
1044 PIN_ODR_LOW(GPIOG_PIN13) | \
1045 PIN_ODR_LOW(GPIOG_PIN14) | \
1046 PIN_ODR_LOW(GPIOG_PIN15))
1047#define VAL_GPIOG_AFRL (PIN_AFIO_AF(GPIOG_PIN0, 0U) | \
1048 PIN_AFIO_AF(GPIOG_PIN1, 0U) | \
1049 PIN_AFIO_AF(GPIOG_PIN2, 0U) | \
1050 PIN_AFIO_AF(GPIOG_PIN3, 0U) | \
1051 PIN_AFIO_AF(GPIOG_PIN4, 0U) | \
1052 PIN_AFIO_AF(GPIOG_PIN5, 0U) | \
1053 PIN_AFIO_AF(GPIOG_PIN6, 0U) | \
1054 PIN_AFIO_AF(GPIOG_PIN7, 0U))
1055#define VAL_GPIOG_AFRH (PIN_AFIO_AF(GPIOG_PIN8, 0U) | \
1056 PIN_AFIO_AF(GPIOG_PIN9, 0U) | \
1057 PIN_AFIO_AF(GPIOG_PIN10, 0U) | \
1058 PIN_AFIO_AF(GPIOG_PIN11, 0U) | \
1059 PIN_AFIO_AF(GPIOG_PIN12, 0U) | \
1060 PIN_AFIO_AF(GPIOG_PIN13, 0U) | \
1061 PIN_AFIO_AF(GPIOG_PIN14, 0U) | \
1062 PIN_AFIO_AF(GPIOG_PIN15, 0U))
1063
1064/*===========================================================================*/
1065/* External declarations. */
1066/*===========================================================================*/
1067
1068#if !defined(_FROM_ASM_)
1069#ifdef __cplusplus
1070extern "C" {
1071#endif
1072 void boardInit(void);
1073#ifdef __cplusplus
1074}
1075#endif
1076#endif /* _FROM_ASM_ */
1077
1078#endif /* BOARD_H */