aboutsummaryrefslogtreecommitdiff
path: root/lib/chibios/os/hal/boards/ST_NUCLEO32_F031K6/board.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chibios/os/hal/boards/ST_NUCLEO32_F031K6/board.h')
-rw-r--r--lib/chibios/os/hal/boards/ST_NUCLEO32_F031K6/board.h953
1 files changed, 953 insertions, 0 deletions
diff --git a/lib/chibios/os/hal/boards/ST_NUCLEO32_F031K6/board.h b/lib/chibios/os/hal/boards/ST_NUCLEO32_F031K6/board.h
new file mode 100644
index 000000000..8ff81abcb
--- /dev/null
+++ b/lib/chibios/os/hal/boards/ST_NUCLEO32_F031K6/board.h
@@ -0,0 +1,953 @@
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 Nucleo32-F031K6 board.
31 */
32
33/*
34 * Board identifier.
35 */
36#define BOARD_ST_NUCLEO32_F031K6
37#define BOARD_NAME "STMicroelectronics STM32 Nucleo32-F031K6"
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 * MCU type as defined in the ST header.
56 */
57#define STM32F031x6
58
59/*
60 * IO pins assignments.
61 */
62#define GPIOA_ARD_A0 0U
63#define GPIOA_ARD_A1 1U
64#define GPIOA_VCP_TX 2U
65#define GPIOA_ARD_A2 3U
66#define GPIOA_ARD_A3 4U
67#define GPIOA_ARD_A4 5U
68#define GPIOA_ARD_A5 6U
69#define GPIOA_ARD_A6 7U
70#define GPIOA_ARD_D9 8U
71#define GPIOA_ARD_D1 9U
72#define GPIOA_ARD_D0 10U
73#define GPIOA_ARD_D10 11U
74#define GPIOA_ARD_D2 12U
75#define GPIOA_SWDIO 13U
76#define GPIOA_SWCLK 14U
77#define GPIOA_VCP_RX 15U
78
79#define GPIOB_ARD_D3 0U
80#define GPIOB_ARD_D6 1U
81#define GPIOB_PIN2 2U
82#define GPIOB_ARD_D13 3U
83#define GPIOB_LED_GREEN 3U
84#define GPIOB_ARD_D12 4U
85#define GPIOB_ARD_D11 5U
86#define GPIOB_ARD_D5 6U
87#define GPIOB_ARD_A5_ALT 6U
88#define GPIOB_ARD_D4 7U
89#define GPIOB_ARD_A4_ALT 7U
90#define GPIOB_PIN8 8U
91#define GPIOB_PIN9 9U
92#define GPIOB_PIN10 10U
93#define GPIOB_PIN11 11U
94#define GPIOB_PIN12 12U
95#define GPIOB_PIN13 13U
96#define GPIOB_PIN14 14U
97#define GPIOB_PIN15 15U
98
99#define GPIOC_PIN0 0U
100#define GPIOC_PIN1 1U
101#define GPIOC_PIN2 2U
102#define GPIOC_PIN3 3U
103#define GPIOC_PIN4 4U
104#define GPIOC_PIN5 5U
105#define GPIOC_PIN6 6U
106#define GPIOC_PIN7 7U
107#define GPIOC_PIN8 8U
108#define GPIOC_PIN9 9U
109#define GPIOC_PIN10 10U
110#define GPIOC_PIN11 11U
111#define GPIOC_PIN12 12U
112#define GPIOC_PIN13 13U
113#define GPIOC_PIN14 14U
114#define GPIOC_PIN15 15U
115
116#define GPIOD_PIN0 0U
117#define GPIOD_PIN1 1U
118#define GPIOD_PIN2 2U
119#define GPIOD_PIN3 3U
120#define GPIOD_PIN4 4U
121#define GPIOD_PIN5 5U
122#define GPIOD_PIN6 6U
123#define GPIOD_PIN7 7U
124#define GPIOD_PIN8 8U
125#define GPIOD_PIN9 9U
126#define GPIOD_PIN10 10U
127#define GPIOD_PIN11 11U
128#define GPIOD_PIN12 12U
129#define GPIOD_PIN13 13U
130#define GPIOD_PIN14 14U
131#define GPIOD_PIN15 15U
132
133#define GPIOE_PIN0 0U
134#define GPIOE_PIN1 1U
135#define GPIOE_PIN2 2U
136#define GPIOE_PIN3 3U
137#define GPIOE_PIN4 4U
138#define GPIOE_PIN5 5U
139#define GPIOE_PIN6 6U
140#define GPIOE_PIN7 7U
141#define GPIOE_PIN8 8U
142#define GPIOE_PIN9 9U
143#define GPIOE_PIN10 10U
144#define GPIOE_PIN11 11U
145#define GPIOE_PIN12 12U
146#define GPIOE_PIN13 13U
147#define GPIOE_PIN14 14U
148#define GPIOE_PIN15 15U
149
150#define GPIOF_ARD_D7 0U
151#define GPIOF_ARD_D8 1U
152#define GPIOF_PIN2 2U
153#define GPIOF_PIN3 3U
154#define GPIOF_PIN4 4U
155#define GPIOF_PIN5 5U
156#define GPIOF_PIN6 6U
157#define GPIOF_PIN7 7U
158#define GPIOF_PIN8 8U
159#define GPIOF_PIN9 9U
160#define GPIOF_PIN10 10U
161#define GPIOF_PIN11 11U
162#define GPIOF_PIN12 12U
163#define GPIOF_PIN13 13U
164#define GPIOF_PIN14 14U
165#define GPIOF_PIN15 15U
166
167/*
168 * IO lines assignments.
169 */
170#define LINE_ARD_A0 PAL_LINE(GPIOA, 0U)
171#define LINE_ARD_A1 PAL_LINE(GPIOA, 1U)
172#define LINE_VCP_TX PAL_LINE(GPIOA, 2U)
173#define LINE_ARD_A2 PAL_LINE(GPIOA, 3U)
174#define LINE_ARD_A3 PAL_LINE(GPIOA, 4U)
175#define LINE_ARD_A4 PAL_LINE(GPIOA, 5U)
176#define LINE_ARD_A5 PAL_LINE(GPIOA, 6U)
177#define LINE_ARD_A6 PAL_LINE(GPIOA, 7U)
178#define LINE_ARD_D9 PAL_LINE(GPIOA, 8U)
179#define LINE_ARD_D1 PAL_LINE(GPIOA, 9U)
180#define LINE_ARD_D0 PAL_LINE(GPIOA, 10U)
181#define LINE_ARD_D10 PAL_LINE(GPIOA, 11U)
182#define LINE_ARD_D2 PAL_LINE(GPIOA, 12U)
183#define LINE_SWDIO PAL_LINE(GPIOA, 13U)
184#define LINE_SWCLK PAL_LINE(GPIOA, 14U)
185#define LINE_VCP_RX PAL_LINE(GPIOA, 15U)
186#define LINE_ARD_D3 PAL_LINE(GPIOB, 0U)
187#define LINE_ARD_D6 PAL_LINE(GPIOB, 1U)
188#define LINE_ARD_D13 PAL_LINE(GPIOB, 3U)
189#define LINE_LED_GREEN PAL_LINE(GPIOB, 3U)
190#define LINE_ARD_D12 PAL_LINE(GPIOB, 4U)
191#define LINE_ARD_D11 PAL_LINE(GPIOB, 5U)
192#define LINE_ARD_D5 PAL_LINE(GPIOB, 6U)
193#define LINE_ARD_A5_ALT PAL_LINE(GPIOB, 6U)
194#define LINE_ARD_D4 PAL_LINE(GPIOB, 7U)
195#define LINE_ARD_A4_ALT PAL_LINE(GPIOB, 7U)
196#define LINE_ARD_D7 PAL_LINE(GPIOF, 0U)
197#define LINE_ARD_D8 PAL_LINE(GPIOF, 1U)
198
199/*===========================================================================*/
200/* Driver pre-compile time settings. */
201/*===========================================================================*/
202
203/*===========================================================================*/
204/* Derived constants and error checks. */
205/*===========================================================================*/
206
207/*===========================================================================*/
208/* Driver data structures and types. */
209/*===========================================================================*/
210
211/*===========================================================================*/
212/* Driver macros. */
213/*===========================================================================*/
214
215/*
216 * I/O ports initial setup, this configuration is established soon after reset
217 * in the initialization code.
218 * Please refer to the STM32 Reference Manual for details.
219 */
220#define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
221#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
222#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
223#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
224#define PIN_ODR_LOW(n) (0U << (n))
225#define PIN_ODR_HIGH(n) (1U << (n))
226#define PIN_OTYPE_PUSHPULL(n) (0U << (n))
227#define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
228#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U))
229#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U))
230#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U))
231#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U))
232#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
233#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
234#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
235#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
236
237/*
238 * GPIOA setup:
239 *
240 * PA0 - ARD_A0 (input pullup).
241 * PA1 - ARD_A1 (input pullup).
242 * PA2 - VCP_TX (alternate 1).
243 * PA3 - ARD_A2 (input pullup).
244 * PA4 - ARD_A3 (input pullup).
245 * PA5 - ARD_A4 (input pullup).
246 * PA6 - ARD_A5 (input pullup).
247 * PA7 - ARD_A6 (input pullup).
248 * PA8 - ARD_D9 (input pullup).
249 * PA9 - ARD_D1 (input pullup).
250 * PA10 - ARD_D0 (input pullup).
251 * PA11 - ARD_D10 (input pullup).
252 * PA12 - ARD_D2 (input pullup).
253 * PA13 - SWDIO (alternate 0).
254 * PA14 - SWCLK (alternate 0).
255 * PA15 - VCP_RX (alternate 1).
256 */
257#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_ARD_A0) | \
258 PIN_MODE_INPUT(GPIOA_ARD_A1) | \
259 PIN_MODE_ALTERNATE(GPIOA_VCP_TX) | \
260 PIN_MODE_INPUT(GPIOA_ARD_A2) | \
261 PIN_MODE_INPUT(GPIOA_ARD_A3) | \
262 PIN_MODE_INPUT(GPIOA_ARD_A4) | \
263 PIN_MODE_INPUT(GPIOA_ARD_A5) | \
264 PIN_MODE_INPUT(GPIOA_ARD_A6) | \
265 PIN_MODE_INPUT(GPIOA_ARD_D9) | \
266 PIN_MODE_INPUT(GPIOA_ARD_D1) | \
267 PIN_MODE_INPUT(GPIOA_ARD_D0) | \
268 PIN_MODE_INPUT(GPIOA_ARD_D10) | \
269 PIN_MODE_INPUT(GPIOA_ARD_D2) | \
270 PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \
271 PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \
272 PIN_MODE_ALTERNATE(GPIOA_VCP_RX))
273#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_ARD_A0) | \
274 PIN_OTYPE_PUSHPULL(GPIOA_ARD_A1) | \
275 PIN_OTYPE_PUSHPULL(GPIOA_VCP_TX) | \
276 PIN_OTYPE_PUSHPULL(GPIOA_ARD_A2) | \
277 PIN_OTYPE_PUSHPULL(GPIOA_ARD_A3) | \
278 PIN_OTYPE_PUSHPULL(GPIOA_ARD_A4) | \
279 PIN_OTYPE_PUSHPULL(GPIOA_ARD_A5) | \
280 PIN_OTYPE_PUSHPULL(GPIOA_ARD_A6) | \
281 PIN_OTYPE_PUSHPULL(GPIOA_ARD_D9) | \
282 PIN_OTYPE_PUSHPULL(GPIOA_ARD_D1) | \
283 PIN_OTYPE_PUSHPULL(GPIOA_ARD_D0) | \
284 PIN_OTYPE_PUSHPULL(GPIOA_ARD_D10) | \
285 PIN_OTYPE_PUSHPULL(GPIOA_ARD_D2) | \
286 PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \
287 PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \
288 PIN_OTYPE_PUSHPULL(GPIOA_VCP_RX))
289#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_HIGH(GPIOA_ARD_A0) | \
290 PIN_OSPEED_HIGH(GPIOA_ARD_A1) | \
291 PIN_OSPEED_LOW(GPIOA_VCP_TX) | \
292 PIN_OSPEED_LOW(GPIOA_ARD_A2) | \
293 PIN_OSPEED_HIGH(GPIOA_ARD_A3) | \
294 PIN_OSPEED_LOW(GPIOA_ARD_A4) | \
295 PIN_OSPEED_HIGH(GPIOA_ARD_A5) | \
296 PIN_OSPEED_HIGH(GPIOA_ARD_A6) | \
297 PIN_OSPEED_HIGH(GPIOA_ARD_D9) | \
298 PIN_OSPEED_HIGH(GPIOA_ARD_D1) | \
299 PIN_OSPEED_HIGH(GPIOA_ARD_D0) | \
300 PIN_OSPEED_HIGH(GPIOA_ARD_D10) | \
301 PIN_OSPEED_HIGH(GPIOA_ARD_D2) | \
302 PIN_OSPEED_HIGH(GPIOA_SWDIO) | \
303 PIN_OSPEED_HIGH(GPIOA_SWCLK) | \
304 PIN_OSPEED_HIGH(GPIOA_VCP_RX))
305#define VAL_GPIOA_PUPDR (PIN_PUPDR_PULLUP(GPIOA_ARD_A0) | \
306 PIN_PUPDR_PULLUP(GPIOA_ARD_A1) | \
307 PIN_PUPDR_FLOATING(GPIOA_VCP_TX) | \
308 PIN_PUPDR_PULLUP(GPIOA_ARD_A2) | \
309 PIN_PUPDR_PULLUP(GPIOA_ARD_A3) | \
310 PIN_PUPDR_PULLUP(GPIOA_ARD_A4) | \
311 PIN_PUPDR_PULLUP(GPIOA_ARD_A5) | \
312 PIN_PUPDR_PULLUP(GPIOA_ARD_A6) | \
313 PIN_PUPDR_PULLUP(GPIOA_ARD_D9) | \
314 PIN_PUPDR_PULLUP(GPIOA_ARD_D1) | \
315 PIN_PUPDR_PULLUP(GPIOA_ARD_D0) | \
316 PIN_PUPDR_PULLUP(GPIOA_ARD_D10) | \
317 PIN_PUPDR_PULLUP(GPIOA_ARD_D2) | \
318 PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \
319 PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \
320 PIN_PUPDR_FLOATING(GPIOA_VCP_RX))
321#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_ARD_A0) | \
322 PIN_ODR_HIGH(GPIOA_ARD_A1) | \
323 PIN_ODR_HIGH(GPIOA_VCP_TX) | \
324 PIN_ODR_HIGH(GPIOA_ARD_A2) | \
325 PIN_ODR_HIGH(GPIOA_ARD_A3) | \
326 PIN_ODR_LOW(GPIOA_ARD_A4) | \
327 PIN_ODR_HIGH(GPIOA_ARD_A5) | \
328 PIN_ODR_HIGH(GPIOA_ARD_A6) | \
329 PIN_ODR_HIGH(GPIOA_ARD_D9) | \
330 PIN_ODR_HIGH(GPIOA_ARD_D1) | \
331 PIN_ODR_HIGH(GPIOA_ARD_D0) | \
332 PIN_ODR_HIGH(GPIOA_ARD_D10) | \
333 PIN_ODR_HIGH(GPIOA_ARD_D2) | \
334 PIN_ODR_HIGH(GPIOA_SWDIO) | \
335 PIN_ODR_HIGH(GPIOA_SWCLK) | \
336 PIN_ODR_HIGH(GPIOA_VCP_RX))
337#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_ARD_A0, 0U) | \
338 PIN_AFIO_AF(GPIOA_ARD_A1, 0U) | \
339 PIN_AFIO_AF(GPIOA_VCP_TX, 1U) | \
340 PIN_AFIO_AF(GPIOA_ARD_A2, 0U) | \
341 PIN_AFIO_AF(GPIOA_ARD_A3, 0U) | \
342 PIN_AFIO_AF(GPIOA_ARD_A4, 0U) | \
343 PIN_AFIO_AF(GPIOA_ARD_A5, 0U) | \
344 PIN_AFIO_AF(GPIOA_ARD_A6, 0U))
345#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_ARD_D9, 0U) | \
346 PIN_AFIO_AF(GPIOA_ARD_D1, 0U) | \
347 PIN_AFIO_AF(GPIOA_ARD_D0, 0U) | \
348 PIN_AFIO_AF(GPIOA_ARD_D10, 0U) | \
349 PIN_AFIO_AF(GPIOA_ARD_D2, 0U) | \
350 PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \
351 PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \
352 PIN_AFIO_AF(GPIOA_VCP_RX, 1U))
353
354/*
355 * GPIOB setup:
356 *
357 * PB0 - ARD_D3 (input pullup).
358 * PB1 - ARD_D6 (input pullup).
359 * PB2 - PIN2 (input pullup).
360 * PB3 - ARD_D13 LED_GREEN (output pushpull maximum).
361 * PB4 - ARD_D12 (input pullup).
362 * PB5 - ARD_D11 (input pullup).
363 * PB6 - ARD_D5 ARD_A5_ALT (input pullup).
364 * PB7 - ARD_D4 ARD_A4_ALT (input pullup).
365 * PB8 - PIN8 (input pullup).
366 * PB9 - PIN9 (input pullup).
367 * PB10 - PIN10 (input pullup).
368 * PB11 - PIN11 (input pullup).
369 * PB12 - PIN12 (input pullup).
370 * PB13 - PIN13 (input pullup).
371 * PB14 - PIN14 (input pullup).
372 * PB15 - PIN15 (input pullup).
373 */
374#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_ARD_D3) | \
375 PIN_MODE_INPUT(GPIOB_ARD_D6) | \
376 PIN_MODE_INPUT(GPIOB_PIN2) | \
377 PIN_MODE_OUTPUT(GPIOB_ARD_D13) | \
378 PIN_MODE_INPUT(GPIOB_ARD_D12) | \
379 PIN_MODE_INPUT(GPIOB_ARD_D11) | \
380 PIN_MODE_INPUT(GPIOB_ARD_D5) | \
381 PIN_MODE_INPUT(GPIOB_ARD_D4) | \
382 PIN_MODE_INPUT(GPIOB_PIN8) | \
383 PIN_MODE_INPUT(GPIOB_PIN9) | \
384 PIN_MODE_INPUT(GPIOB_PIN10) | \
385 PIN_MODE_INPUT(GPIOB_PIN11) | \
386 PIN_MODE_INPUT(GPIOB_PIN12) | \
387 PIN_MODE_INPUT(GPIOB_PIN13) | \
388 PIN_MODE_INPUT(GPIOB_PIN14) | \
389 PIN_MODE_INPUT(GPIOB_PIN15))
390#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_ARD_D3) | \
391 PIN_OTYPE_PUSHPULL(GPIOB_ARD_D6) | \
392 PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \
393 PIN_OTYPE_PUSHPULL(GPIOB_ARD_D13) | \
394 PIN_OTYPE_PUSHPULL(GPIOB_ARD_D12) | \
395 PIN_OTYPE_PUSHPULL(GPIOB_ARD_D11) | \
396 PIN_OTYPE_PUSHPULL(GPIOB_ARD_D5) | \
397 PIN_OTYPE_PUSHPULL(GPIOB_ARD_D4) | \
398 PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \
399 PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \
400 PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \
401 PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \
402 PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \
403 PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \
404 PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \
405 PIN_OTYPE_PUSHPULL(GPIOB_PIN15))
406#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_HIGH(GPIOB_ARD_D3) | \
407 PIN_OSPEED_HIGH(GPIOB_ARD_D6) | \
408 PIN_OSPEED_HIGH(GPIOB_PIN2) | \
409 PIN_OSPEED_HIGH(GPIOB_ARD_D13) | \
410 PIN_OSPEED_HIGH(GPIOB_ARD_D12) | \
411 PIN_OSPEED_HIGH(GPIOB_ARD_D11) | \
412 PIN_OSPEED_HIGH(GPIOB_ARD_D5) | \
413 PIN_OSPEED_HIGH(GPIOB_ARD_D4) | \
414 PIN_OSPEED_HIGH(GPIOB_PIN8) | \
415 PIN_OSPEED_HIGH(GPIOB_PIN9) | \
416 PIN_OSPEED_HIGH(GPIOB_PIN10) | \
417 PIN_OSPEED_HIGH(GPIOB_PIN11) | \
418 PIN_OSPEED_HIGH(GPIOB_PIN12) | \
419 PIN_OSPEED_HIGH(GPIOB_PIN13) | \
420 PIN_OSPEED_HIGH(GPIOB_PIN14) | \
421 PIN_OSPEED_HIGH(GPIOB_PIN15))
422#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_ARD_D3) | \
423 PIN_PUPDR_PULLUP(GPIOB_ARD_D6) | \
424 PIN_PUPDR_PULLUP(GPIOB_PIN2) | \
425 PIN_PUPDR_FLOATING(GPIOB_ARD_D13) | \
426 PIN_PUPDR_PULLUP(GPIOB_ARD_D12) | \
427 PIN_PUPDR_PULLUP(GPIOB_ARD_D11) | \
428 PIN_PUPDR_PULLUP(GPIOB_ARD_D5) | \
429 PIN_PUPDR_PULLUP(GPIOB_ARD_D4) | \
430 PIN_PUPDR_PULLUP(GPIOB_PIN8) | \
431 PIN_PUPDR_PULLUP(GPIOB_PIN9) | \
432 PIN_PUPDR_PULLUP(GPIOB_PIN10) | \
433 PIN_PUPDR_PULLUP(GPIOB_PIN11) | \
434 PIN_PUPDR_PULLUP(GPIOB_PIN12) | \
435 PIN_PUPDR_PULLUP(GPIOB_PIN13) | \
436 PIN_PUPDR_PULLUP(GPIOB_PIN14) | \
437 PIN_PUPDR_PULLUP(GPIOB_PIN15))
438#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_ARD_D3) | \
439 PIN_ODR_HIGH(GPIOB_ARD_D6) | \
440 PIN_ODR_HIGH(GPIOB_PIN2) | \
441 PIN_ODR_LOW(GPIOB_ARD_D13) | \
442 PIN_ODR_HIGH(GPIOB_ARD_D12) | \
443 PIN_ODR_HIGH(GPIOB_ARD_D11) | \
444 PIN_ODR_HIGH(GPIOB_ARD_D5) | \
445 PIN_ODR_HIGH(GPIOB_ARD_D4) | \
446 PIN_ODR_HIGH(GPIOB_PIN8) | \
447 PIN_ODR_HIGH(GPIOB_PIN9) | \
448 PIN_ODR_HIGH(GPIOB_PIN10) | \
449 PIN_ODR_HIGH(GPIOB_PIN11) | \
450 PIN_ODR_HIGH(GPIOB_PIN12) | \
451 PIN_ODR_HIGH(GPIOB_PIN13) | \
452 PIN_ODR_HIGH(GPIOB_PIN14) | \
453 PIN_ODR_HIGH(GPIOB_PIN15))
454#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_ARD_D3, 0U) | \
455 PIN_AFIO_AF(GPIOB_ARD_D6, 0U) | \
456 PIN_AFIO_AF(GPIOB_PIN2, 0U) | \
457 PIN_AFIO_AF(GPIOB_ARD_D13, 0U) | \
458 PIN_AFIO_AF(GPIOB_ARD_D12, 0U) | \
459 PIN_AFIO_AF(GPIOB_ARD_D11, 0U) | \
460 PIN_AFIO_AF(GPIOB_ARD_D5, 0U) | \
461 PIN_AFIO_AF(GPIOB_ARD_D4, 0U))
462#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \
463 PIN_AFIO_AF(GPIOB_PIN9, 0U) | \
464 PIN_AFIO_AF(GPIOB_PIN10, 0U) | \
465 PIN_AFIO_AF(GPIOB_PIN11, 0U) | \
466 PIN_AFIO_AF(GPIOB_PIN12, 0U) | \
467 PIN_AFIO_AF(GPIOB_PIN13, 0U) | \
468 PIN_AFIO_AF(GPIOB_PIN14, 0U) | \
469 PIN_AFIO_AF(GPIOB_PIN15, 0U))
470
471/*
472 * GPIOC setup:
473 *
474 * PC0 - PIN0 (input pullup).
475 * PC1 - PIN1 (input pullup).
476 * PC2 - PIN2 (input pullup).
477 * PC3 - PIN3 (input pullup).
478 * PC4 - PIN4 (input pullup).
479 * PC5 - PIN5 (input pullup).
480 * PC6 - PIN6 (input pullup).
481 * PC7 - PIN7 (input pullup).
482 * PC8 - PIN8 (input pullup).
483 * PC9 - PIN9 (input pullup).
484 * PC10 - PIN10 (input pullup).
485 * PC11 - PIN11 (input pullup).
486 * PC12 - PIN12 (input pullup).
487 * PC13 - PIN13 (input pullup).
488 * PC14 - PIN14 (input pullup).
489 * PC15 - PIN15 (input pullup).
490 */
491#define VAL_GPIOC_MODER (PIN_MODE_INPUT(GPIOC_PIN0) | \
492 PIN_MODE_INPUT(GPIOC_PIN1) | \
493 PIN_MODE_INPUT(GPIOC_PIN2) | \
494 PIN_MODE_INPUT(GPIOC_PIN3) | \
495 PIN_MODE_INPUT(GPIOC_PIN4) | \
496 PIN_MODE_INPUT(GPIOC_PIN5) | \
497 PIN_MODE_INPUT(GPIOC_PIN6) | \
498 PIN_MODE_INPUT(GPIOC_PIN7) | \
499 PIN_MODE_INPUT(GPIOC_PIN8) | \
500 PIN_MODE_INPUT(GPIOC_PIN9) | \
501 PIN_MODE_INPUT(GPIOC_PIN10) | \
502 PIN_MODE_INPUT(GPIOC_PIN11) | \
503 PIN_MODE_INPUT(GPIOC_PIN12) | \
504 PIN_MODE_INPUT(GPIOC_PIN13) | \
505 PIN_MODE_INPUT(GPIOC_PIN14) | \
506 PIN_MODE_INPUT(GPIOC_PIN15))
507#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_PIN0) | \
508 PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \
509 PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \
510 PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \
511 PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \
512 PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \
513 PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | \
514 PIN_OTYPE_PUSHPULL(GPIOC_PIN7) | \
515 PIN_OTYPE_PUSHPULL(GPIOC_PIN8) | \
516 PIN_OTYPE_PUSHPULL(GPIOC_PIN9) | \
517 PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \
518 PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \
519 PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \
520 PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \
521 PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | \
522 PIN_OTYPE_PUSHPULL(GPIOC_PIN15))
523#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_PIN0) | \
524 PIN_OSPEED_HIGH(GPIOC_PIN1) | \
525 PIN_OSPEED_HIGH(GPIOC_PIN2) | \
526 PIN_OSPEED_HIGH(GPIOC_PIN3) | \
527 PIN_OSPEED_HIGH(GPIOC_PIN4) | \
528 PIN_OSPEED_HIGH(GPIOC_PIN5) | \
529 PIN_OSPEED_HIGH(GPIOC_PIN6) | \
530 PIN_OSPEED_HIGH(GPIOC_PIN7) | \
531 PIN_OSPEED_HIGH(GPIOC_PIN8) | \
532 PIN_OSPEED_HIGH(GPIOC_PIN9) | \
533 PIN_OSPEED_HIGH(GPIOC_PIN10) | \
534 PIN_OSPEED_HIGH(GPIOC_PIN11) | \
535 PIN_OSPEED_HIGH(GPIOC_PIN12) | \
536 PIN_OSPEED_HIGH(GPIOC_PIN13) | \
537 PIN_OSPEED_HIGH(GPIOC_PIN14) | \
538 PIN_OSPEED_HIGH(GPIOC_PIN15))
539#define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \
540 PIN_PUPDR_PULLUP(GPIOC_PIN1) | \
541 PIN_PUPDR_PULLUP(GPIOC_PIN2) | \
542 PIN_PUPDR_PULLUP(GPIOC_PIN3) | \
543 PIN_PUPDR_PULLUP(GPIOC_PIN4) | \
544 PIN_PUPDR_PULLUP(GPIOC_PIN5) | \
545 PIN_PUPDR_PULLUP(GPIOC_PIN6) | \
546 PIN_PUPDR_PULLUP(GPIOC_PIN7) | \
547 PIN_PUPDR_PULLUP(GPIOC_PIN8) | \
548 PIN_PUPDR_PULLUP(GPIOC_PIN9) | \
549 PIN_PUPDR_PULLUP(GPIOC_PIN10) | \
550 PIN_PUPDR_PULLUP(GPIOC_PIN11) | \
551 PIN_PUPDR_PULLUP(GPIOC_PIN12) | \
552 PIN_PUPDR_PULLUP(GPIOC_PIN13) | \
553 PIN_PUPDR_PULLUP(GPIOC_PIN14) | \
554 PIN_PUPDR_PULLUP(GPIOC_PIN15))
555#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_PIN0) | \
556 PIN_ODR_HIGH(GPIOC_PIN1) | \
557 PIN_ODR_HIGH(GPIOC_PIN2) | \
558 PIN_ODR_HIGH(GPIOC_PIN3) | \
559 PIN_ODR_HIGH(GPIOC_PIN4) | \
560 PIN_ODR_HIGH(GPIOC_PIN5) | \
561 PIN_ODR_HIGH(GPIOC_PIN6) | \
562 PIN_ODR_HIGH(GPIOC_PIN7) | \
563 PIN_ODR_HIGH(GPIOC_PIN8) | \
564 PIN_ODR_HIGH(GPIOC_PIN9) | \
565 PIN_ODR_HIGH(GPIOC_PIN10) | \
566 PIN_ODR_HIGH(GPIOC_PIN11) | \
567 PIN_ODR_HIGH(GPIOC_PIN12) | \
568 PIN_ODR_HIGH(GPIOC_PIN13) | \
569 PIN_ODR_HIGH(GPIOC_PIN14) | \
570 PIN_ODR_HIGH(GPIOC_PIN15))
571#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_PIN0, 0U) | \
572 PIN_AFIO_AF(GPIOC_PIN1, 0U) | \
573 PIN_AFIO_AF(GPIOC_PIN2, 0U) | \
574 PIN_AFIO_AF(GPIOC_PIN3, 0U) | \
575 PIN_AFIO_AF(GPIOC_PIN4, 0U) | \
576 PIN_AFIO_AF(GPIOC_PIN5, 0U) | \
577 PIN_AFIO_AF(GPIOC_PIN6, 0U) | \
578 PIN_AFIO_AF(GPIOC_PIN7, 0U))
579#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_PIN8, 0U) | \
580 PIN_AFIO_AF(GPIOC_PIN9, 0U) | \
581 PIN_AFIO_AF(GPIOC_PIN10, 0U) | \
582 PIN_AFIO_AF(GPIOC_PIN11, 0U) | \
583 PIN_AFIO_AF(GPIOC_PIN12, 0U) | \
584 PIN_AFIO_AF(GPIOC_PIN13, 0U) | \
585 PIN_AFIO_AF(GPIOC_PIN14, 0U) | \
586 PIN_AFIO_AF(GPIOC_PIN15, 0U))
587
588/*
589 * GPIOD setup:
590 *
591 * PD0 - PIN0 (input pullup).
592 * PD1 - PIN1 (input pullup).
593 * PD2 - PIN2 (input pullup).
594 * PD3 - PIN3 (input pullup).
595 * PD4 - PIN4 (input pullup).
596 * PD5 - PIN5 (input pullup).
597 * PD6 - PIN6 (input pullup).
598 * PD7 - PIN7 (input pullup).
599 * PD8 - PIN8 (input pullup).
600 * PD9 - PIN9 (input pullup).
601 * PD10 - PIN10 (input pullup).
602 * PD11 - PIN11 (input pullup).
603 * PD12 - PIN12 (input pullup).
604 * PD13 - PIN13 (input pullup).
605 * PD14 - PIN14 (input pullup).
606 * PD15 - PIN15 (input pullup).
607 */
608#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \
609 PIN_MODE_INPUT(GPIOD_PIN1) | \
610 PIN_MODE_INPUT(GPIOD_PIN2) | \
611 PIN_MODE_INPUT(GPIOD_PIN3) | \
612 PIN_MODE_INPUT(GPIOD_PIN4) | \
613 PIN_MODE_INPUT(GPIOD_PIN5) | \
614 PIN_MODE_INPUT(GPIOD_PIN6) | \
615 PIN_MODE_INPUT(GPIOD_PIN7) | \
616 PIN_MODE_INPUT(GPIOD_PIN8) | \
617 PIN_MODE_INPUT(GPIOD_PIN9) | \
618 PIN_MODE_INPUT(GPIOD_PIN10) | \
619 PIN_MODE_INPUT(GPIOD_PIN11) | \
620 PIN_MODE_INPUT(GPIOD_PIN12) | \
621 PIN_MODE_INPUT(GPIOD_PIN13) | \
622 PIN_MODE_INPUT(GPIOD_PIN14) | \
623 PIN_MODE_INPUT(GPIOD_PIN15))
624#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \
625 PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \
626 PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \
627 PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \
628 PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \
629 PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \
630 PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \
631 PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \
632 PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \
633 PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \
634 PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \
635 PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \
636 PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \
637 PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \
638 PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \
639 PIN_OTYPE_PUSHPULL(GPIOD_PIN15))
640#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_HIGH(GPIOD_PIN0) | \
641 PIN_OSPEED_HIGH(GPIOD_PIN1) | \
642 PIN_OSPEED_HIGH(GPIOD_PIN2) | \
643 PIN_OSPEED_HIGH(GPIOD_PIN3) | \
644 PIN_OSPEED_HIGH(GPIOD_PIN4) | \
645 PIN_OSPEED_HIGH(GPIOD_PIN5) | \
646 PIN_OSPEED_HIGH(GPIOD_PIN6) | \
647 PIN_OSPEED_HIGH(GPIOD_PIN7) | \
648 PIN_OSPEED_HIGH(GPIOD_PIN8) | \
649 PIN_OSPEED_HIGH(GPIOD_PIN9) | \
650 PIN_OSPEED_HIGH(GPIOD_PIN10) | \
651 PIN_OSPEED_HIGH(GPIOD_PIN11) | \
652 PIN_OSPEED_HIGH(GPIOD_PIN12) | \
653 PIN_OSPEED_HIGH(GPIOD_PIN13) | \
654 PIN_OSPEED_HIGH(GPIOD_PIN14) | \
655 PIN_OSPEED_HIGH(GPIOD_PIN15))
656#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \
657 PIN_PUPDR_PULLUP(GPIOD_PIN1) | \
658 PIN_PUPDR_PULLUP(GPIOD_PIN2) | \
659 PIN_PUPDR_PULLUP(GPIOD_PIN3) | \
660 PIN_PUPDR_PULLUP(GPIOD_PIN4) | \
661 PIN_PUPDR_PULLUP(GPIOD_PIN5) | \
662 PIN_PUPDR_PULLUP(GPIOD_PIN6) | \
663 PIN_PUPDR_PULLUP(GPIOD_PIN7) | \
664 PIN_PUPDR_PULLUP(GPIOD_PIN8) | \
665 PIN_PUPDR_PULLUP(GPIOD_PIN9) | \
666 PIN_PUPDR_PULLUP(GPIOD_PIN10) | \
667 PIN_PUPDR_PULLUP(GPIOD_PIN11) | \
668 PIN_PUPDR_PULLUP(GPIOD_PIN12) | \
669 PIN_PUPDR_PULLUP(GPIOD_PIN13) | \
670 PIN_PUPDR_PULLUP(GPIOD_PIN14) | \
671 PIN_PUPDR_PULLUP(GPIOD_PIN15))
672#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \
673 PIN_ODR_HIGH(GPIOD_PIN1) | \
674 PIN_ODR_HIGH(GPIOD_PIN2) | \
675 PIN_ODR_HIGH(GPIOD_PIN3) | \
676 PIN_ODR_HIGH(GPIOD_PIN4) | \
677 PIN_ODR_HIGH(GPIOD_PIN5) | \
678 PIN_ODR_HIGH(GPIOD_PIN6) | \
679 PIN_ODR_HIGH(GPIOD_PIN7) | \
680 PIN_ODR_HIGH(GPIOD_PIN8) | \
681 PIN_ODR_HIGH(GPIOD_PIN9) | \
682 PIN_ODR_HIGH(GPIOD_PIN10) | \
683 PIN_ODR_HIGH(GPIOD_PIN11) | \
684 PIN_ODR_HIGH(GPIOD_PIN12) | \
685 PIN_ODR_HIGH(GPIOD_PIN13) | \
686 PIN_ODR_HIGH(GPIOD_PIN14) | \
687 PIN_ODR_HIGH(GPIOD_PIN15))
688#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \
689 PIN_AFIO_AF(GPIOD_PIN1, 0U) | \
690 PIN_AFIO_AF(GPIOD_PIN2, 0U) | \
691 PIN_AFIO_AF(GPIOD_PIN3, 0U) | \
692 PIN_AFIO_AF(GPIOD_PIN4, 0U) | \
693 PIN_AFIO_AF(GPIOD_PIN5, 0U) | \
694 PIN_AFIO_AF(GPIOD_PIN6, 0U) | \
695 PIN_AFIO_AF(GPIOD_PIN7, 0U))
696#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \
697 PIN_AFIO_AF(GPIOD_PIN9, 0U) | \
698 PIN_AFIO_AF(GPIOD_PIN10, 0U) | \
699 PIN_AFIO_AF(GPIOD_PIN11, 0U) | \
700 PIN_AFIO_AF(GPIOD_PIN12, 0U) | \
701 PIN_AFIO_AF(GPIOD_PIN13, 0U) | \
702 PIN_AFIO_AF(GPIOD_PIN14, 0U) | \
703 PIN_AFIO_AF(GPIOD_PIN15, 0U))
704
705/*
706 * GPIOE setup:
707 *
708 * PE0 - PIN0 (input pullup).
709 * PE1 - PIN1 (input pullup).
710 * PE2 - PIN2 (input pullup).
711 * PE3 - PIN3 (input pullup).
712 * PE4 - PIN4 (input pullup).
713 * PE5 - PIN5 (input pullup).
714 * PE6 - PIN6 (input pullup).
715 * PE7 - PIN7 (input pullup).
716 * PE8 - PIN8 (input pullup).
717 * PE9 - PIN9 (input pullup).
718 * PE10 - PIN10 (input pullup).
719 * PE11 - PIN11 (input pullup).
720 * PE12 - PIN12 (input pullup).
721 * PE13 - PIN13 (input pullup).
722 * PE14 - PIN14 (input pullup).
723 * PE15 - PIN15 (input pullup).
724 */
725#define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \
726 PIN_MODE_INPUT(GPIOE_PIN1) | \
727 PIN_MODE_INPUT(GPIOE_PIN2) | \
728 PIN_MODE_INPUT(GPIOE_PIN3) | \
729 PIN_MODE_INPUT(GPIOE_PIN4) | \
730 PIN_MODE_INPUT(GPIOE_PIN5) | \
731 PIN_MODE_INPUT(GPIOE_PIN6) | \
732 PIN_MODE_INPUT(GPIOE_PIN7) | \
733 PIN_MODE_INPUT(GPIOE_PIN8) | \
734 PIN_MODE_INPUT(GPIOE_PIN9) | \
735 PIN_MODE_INPUT(GPIOE_PIN10) | \
736 PIN_MODE_INPUT(GPIOE_PIN11) | \
737 PIN_MODE_INPUT(GPIOE_PIN12) | \
738 PIN_MODE_INPUT(GPIOE_PIN13) | \
739 PIN_MODE_INPUT(GPIOE_PIN14) | \
740 PIN_MODE_INPUT(GPIOE_PIN15))
741#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \
742 PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \
743 PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \
744 PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \
745 PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \
746 PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \
747 PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \
748 PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \
749 PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \
750 PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \
751 PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \
752 PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \
753 PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \
754 PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \
755 PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \
756 PIN_OTYPE_PUSHPULL(GPIOE_PIN15))
757#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_HIGH(GPIOE_PIN0) | \
758 PIN_OSPEED_HIGH(GPIOE_PIN1) | \
759 PIN_OSPEED_HIGH(GPIOE_PIN2) | \
760 PIN_OSPEED_HIGH(GPIOE_PIN3) | \
761 PIN_OSPEED_HIGH(GPIOE_PIN4) | \
762 PIN_OSPEED_HIGH(GPIOE_PIN5) | \
763 PIN_OSPEED_HIGH(GPIOE_PIN6) | \
764 PIN_OSPEED_HIGH(GPIOE_PIN7) | \
765 PIN_OSPEED_HIGH(GPIOE_PIN8) | \
766 PIN_OSPEED_HIGH(GPIOE_PIN9) | \
767 PIN_OSPEED_HIGH(GPIOE_PIN10) | \
768 PIN_OSPEED_HIGH(GPIOE_PIN11) | \
769 PIN_OSPEED_HIGH(GPIOE_PIN12) | \
770 PIN_OSPEED_HIGH(GPIOE_PIN13) | \
771 PIN_OSPEED_HIGH(GPIOE_PIN14) | \
772 PIN_OSPEED_HIGH(GPIOE_PIN15))
773#define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \
774 PIN_PUPDR_PULLUP(GPIOE_PIN1) | \
775 PIN_PUPDR_PULLUP(GPIOE_PIN2) | \
776 PIN_PUPDR_PULLUP(GPIOE_PIN3) | \
777 PIN_PUPDR_PULLUP(GPIOE_PIN4) | \
778 PIN_PUPDR_PULLUP(GPIOE_PIN5) | \
779 PIN_PUPDR_PULLUP(GPIOE_PIN6) | \
780 PIN_PUPDR_PULLUP(GPIOE_PIN7) | \
781 PIN_PUPDR_PULLUP(GPIOE_PIN8) | \
782 PIN_PUPDR_PULLUP(GPIOE_PIN9) | \
783 PIN_PUPDR_PULLUP(GPIOE_PIN10) | \
784 PIN_PUPDR_PULLUP(GPIOE_PIN11) | \
785 PIN_PUPDR_PULLUP(GPIOE_PIN12) | \
786 PIN_PUPDR_PULLUP(GPIOE_PIN13) | \
787 PIN_PUPDR_PULLUP(GPIOE_PIN14) | \
788 PIN_PUPDR_PULLUP(GPIOE_PIN15))
789#define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \
790 PIN_ODR_HIGH(GPIOE_PIN1) | \
791 PIN_ODR_HIGH(GPIOE_PIN2) | \
792 PIN_ODR_HIGH(GPIOE_PIN3) | \
793 PIN_ODR_HIGH(GPIOE_PIN4) | \
794 PIN_ODR_HIGH(GPIOE_PIN5) | \
795 PIN_ODR_HIGH(GPIOE_PIN6) | \
796 PIN_ODR_HIGH(GPIOE_PIN7) | \
797 PIN_ODR_HIGH(GPIOE_PIN8) | \
798 PIN_ODR_HIGH(GPIOE_PIN9) | \
799 PIN_ODR_HIGH(GPIOE_PIN10) | \
800 PIN_ODR_HIGH(GPIOE_PIN11) | \
801 PIN_ODR_HIGH(GPIOE_PIN12) | \
802 PIN_ODR_HIGH(GPIOE_PIN13) | \
803 PIN_ODR_HIGH(GPIOE_PIN14) | \
804 PIN_ODR_HIGH(GPIOE_PIN15))
805#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0U) | \
806 PIN_AFIO_AF(GPIOE_PIN1, 0U) | \
807 PIN_AFIO_AF(GPIOE_PIN2, 0U) | \
808 PIN_AFIO_AF(GPIOE_PIN3, 0U) | \
809 PIN_AFIO_AF(GPIOE_PIN4, 0U) | \
810 PIN_AFIO_AF(GPIOE_PIN5, 0U) | \
811 PIN_AFIO_AF(GPIOE_PIN6, 0U) | \
812 PIN_AFIO_AF(GPIOE_PIN7, 0U))
813#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0U) | \
814 PIN_AFIO_AF(GPIOE_PIN9, 0U) | \
815 PIN_AFIO_AF(GPIOE_PIN10, 0U) | \
816 PIN_AFIO_AF(GPIOE_PIN11, 0U) | \
817 PIN_AFIO_AF(GPIOE_PIN12, 0U) | \
818 PIN_AFIO_AF(GPIOE_PIN13, 0U) | \
819 PIN_AFIO_AF(GPIOE_PIN14, 0U) | \
820 PIN_AFIO_AF(GPIOE_PIN15, 0U))
821
822/*
823 * GPIOF setup:
824 *
825 * PF0 - ARD_D7 (input pullup).
826 * PF1 - ARD_D8 (input pullup).
827 * PF2 - PIN2 (input pullup).
828 * PF3 - PIN3 (input pullup).
829 * PF4 - PIN4 (input pullup).
830 * PF5 - PIN5 (input pullup).
831 * PF6 - PIN6 (input pullup).
832 * PF7 - PIN7 (input pullup).
833 * PF8 - PIN8 (input pullup).
834 * PF9 - PIN9 (input pullup).
835 * PF10 - PIN10 (input pullup).
836 * PF11 - PIN11 (input pullup).
837 * PF12 - PIN12 (input pullup).
838 * PF13 - PIN13 (input pullup).
839 * PF14 - PIN14 (input pullup).
840 * PF15 - PIN15 (input pullup).
841 */
842#define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_ARD_D7) | \
843 PIN_MODE_INPUT(GPIOF_ARD_D8) | \
844 PIN_MODE_INPUT(GPIOF_PIN2) | \
845 PIN_MODE_INPUT(GPIOF_PIN3) | \
846 PIN_MODE_INPUT(GPIOF_PIN4) | \
847 PIN_MODE_INPUT(GPIOF_PIN5) | \
848 PIN_MODE_INPUT(GPIOF_PIN6) | \
849 PIN_MODE_INPUT(GPIOF_PIN7) | \
850 PIN_MODE_INPUT(GPIOF_PIN8) | \
851 PIN_MODE_INPUT(GPIOF_PIN9) | \
852 PIN_MODE_INPUT(GPIOF_PIN10) | \
853 PIN_MODE_INPUT(GPIOF_PIN11) | \
854 PIN_MODE_INPUT(GPIOF_PIN12) | \
855 PIN_MODE_INPUT(GPIOF_PIN13) | \
856 PIN_MODE_INPUT(GPIOF_PIN14) | \
857 PIN_MODE_INPUT(GPIOF_PIN15))
858#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_ARD_D7) | \
859 PIN_OTYPE_PUSHPULL(GPIOF_ARD_D8) | \
860 PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \
861 PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \
862 PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \
863 PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \
864 PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \
865 PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \
866 PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \
867 PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \
868 PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \
869 PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \
870 PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \
871 PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \
872 PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \
873 PIN_OTYPE_PUSHPULL(GPIOF_PIN15))
874#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_ARD_D7) | \
875 PIN_OSPEED_HIGH(GPIOF_ARD_D8) | \
876 PIN_OSPEED_HIGH(GPIOF_PIN2) | \
877 PIN_OSPEED_HIGH(GPIOF_PIN3) | \
878 PIN_OSPEED_HIGH(GPIOF_PIN4) | \
879 PIN_OSPEED_HIGH(GPIOF_PIN5) | \
880 PIN_OSPEED_HIGH(GPIOF_PIN6) | \
881 PIN_OSPEED_HIGH(GPIOF_PIN7) | \
882 PIN_OSPEED_HIGH(GPIOF_PIN8) | \
883 PIN_OSPEED_HIGH(GPIOF_PIN9) | \
884 PIN_OSPEED_HIGH(GPIOF_PIN10) | \
885 PIN_OSPEED_HIGH(GPIOF_PIN11) | \
886 PIN_OSPEED_HIGH(GPIOF_PIN12) | \
887 PIN_OSPEED_HIGH(GPIOF_PIN13) | \
888 PIN_OSPEED_HIGH(GPIOF_PIN14) | \
889 PIN_OSPEED_HIGH(GPIOF_PIN15))
890#define VAL_GPIOF_PUPDR (PIN_PUPDR_PULLUP(GPIOF_ARD_D7) | \
891 PIN_PUPDR_PULLUP(GPIOF_ARD_D8) | \
892 PIN_PUPDR_PULLUP(GPIOF_PIN2) | \
893 PIN_PUPDR_PULLUP(GPIOF_PIN3) | \
894 PIN_PUPDR_PULLUP(GPIOF_PIN4) | \
895 PIN_PUPDR_PULLUP(GPIOF_PIN5) | \
896 PIN_PUPDR_PULLUP(GPIOF_PIN6) | \
897 PIN_PUPDR_PULLUP(GPIOF_PIN7) | \
898 PIN_PUPDR_PULLUP(GPIOF_PIN8) | \
899 PIN_PUPDR_PULLUP(GPIOF_PIN9) | \
900 PIN_PUPDR_PULLUP(GPIOF_PIN10) | \
901 PIN_PUPDR_PULLUP(GPIOF_PIN11) | \
902 PIN_PUPDR_PULLUP(GPIOF_PIN12) | \
903 PIN_PUPDR_PULLUP(GPIOF_PIN13) | \
904 PIN_PUPDR_PULLUP(GPIOF_PIN14) | \
905 PIN_PUPDR_PULLUP(GPIOF_PIN15))
906#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_ARD_D7) | \
907 PIN_ODR_HIGH(GPIOF_ARD_D8) | \
908 PIN_ODR_HIGH(GPIOF_PIN2) | \
909 PIN_ODR_HIGH(GPIOF_PIN3) | \
910 PIN_ODR_HIGH(GPIOF_PIN4) | \
911 PIN_ODR_HIGH(GPIOF_PIN5) | \
912 PIN_ODR_HIGH(GPIOF_PIN6) | \
913 PIN_ODR_HIGH(GPIOF_PIN7) | \
914 PIN_ODR_HIGH(GPIOF_PIN8) | \
915 PIN_ODR_HIGH(GPIOF_PIN9) | \
916 PIN_ODR_HIGH(GPIOF_PIN10) | \
917 PIN_ODR_HIGH(GPIOF_PIN11) | \
918 PIN_ODR_HIGH(GPIOF_PIN12) | \
919 PIN_ODR_HIGH(GPIOF_PIN13) | \
920 PIN_ODR_HIGH(GPIOF_PIN14) | \
921 PIN_ODR_HIGH(GPIOF_PIN15))
922#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_ARD_D7, 0U) | \
923 PIN_AFIO_AF(GPIOF_ARD_D8, 0U) | \
924 PIN_AFIO_AF(GPIOF_PIN2, 0U) | \
925 PIN_AFIO_AF(GPIOF_PIN3, 0U) | \
926 PIN_AFIO_AF(GPIOF_PIN4, 0U) | \
927 PIN_AFIO_AF(GPIOF_PIN5, 0U) | \
928 PIN_AFIO_AF(GPIOF_PIN6, 0U) | \
929 PIN_AFIO_AF(GPIOF_PIN7, 0U))
930#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \
931 PIN_AFIO_AF(GPIOF_PIN9, 0U) | \
932 PIN_AFIO_AF(GPIOF_PIN10, 0U) | \
933 PIN_AFIO_AF(GPIOF_PIN11, 0U) | \
934 PIN_AFIO_AF(GPIOF_PIN12, 0U) | \
935 PIN_AFIO_AF(GPIOF_PIN13, 0U) | \
936 PIN_AFIO_AF(GPIOF_PIN14, 0U) | \
937 PIN_AFIO_AF(GPIOF_PIN15, 0U))
938
939/*===========================================================================*/
940/* External declarations. */
941/*===========================================================================*/
942
943#if !defined(_FROM_ASM_)
944#ifdef __cplusplus
945extern "C" {
946#endif
947 void boardInit(void);
948#ifdef __cplusplus
949}
950#endif
951#endif /* _FROM_ASM_ */
952
953#endif /* BOARD_H */