aboutsummaryrefslogtreecommitdiff
path: root/lib/chibios/os/hal/boards/ST_STM32F769I_DISCOVERY/board.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chibios/os/hal/boards/ST_STM32F769I_DISCOVERY/board.h')
-rw-r--r--lib/chibios/os/hal/boards/ST_STM32F769I_DISCOVERY/board.h1764
1 files changed, 1764 insertions, 0 deletions
diff --git a/lib/chibios/os/hal/boards/ST_STM32F769I_DISCOVERY/board.h b/lib/chibios/os/hal/boards/ST_STM32F769I_DISCOVERY/board.h
new file mode 100644
index 000000000..d77377a6d
--- /dev/null
+++ b/lib/chibios/os/hal/boards/ST_STM32F769I_DISCOVERY/board.h
@@ -0,0 +1,1764 @@
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 STM32F769I-Discovery board.
31 */
32
33/*
34 * Board identifier.
35 */
36#define BOARD_ST_STM32F769I_DISCOVERY
37#define BOARD_NAME "STMicroelectronics STM32F769I-Discovery"
38
39/*
40 * Ethernet PHY type.
41 */
42#define BOARD_PHY_ID MII_LAN8742A_ID
43#define BOARD_PHY_RMII
44
45/*
46 * The board has an ULPI USB PHY.
47 */
48#define BOARD_OTG2_USES_ULPI
49
50/*
51 * Board oscillators-related settings.
52 */
53#if !defined(STM32_LSECLK)
54#define STM32_LSECLK 32768U
55#endif
56
57#define STM32_LSEDRV (3U << 3U)
58
59#if !defined(STM32_HSECLK)
60#define STM32_HSECLK 25000000U
61#endif
62
63#define STM32_HSE_BYPASS
64
65/*
66 * Board voltages.
67 * Required for performance limits calculation.
68 */
69#define STM32_VDD 300U
70
71/*
72 * MCU type as defined in the ST header.
73 */
74#define STM32F769xx
75
76/*
77 * IO pins assignments.
78 */
79#define GPIOA_BUTTON_USER 0U
80#define GPIOA_RMII_REF_CLK 1U
81#define GPIOA_RMII_MDIO 2U
82#define GPIOA_ULPI_D0 3U
83#define GPIOA_ARD_A1 4U
84#define GPIOA_ULPI_CK 5U
85#define GPIOA_ARD_A0 6U
86#define GPIOA_RMII_CRS_DV 7U
87#define GPIOA_CEC_CLK 8U
88#define GPIOA_VCP_TX 9U
89#define GPIOA_VCP_RX 10U
90#define GPIOA_ARD_D10 11U
91#define GPIOA_ARD_D13 12U
92#define GPIOA_SWDIO 13U
93#define GPIOA_SWCLK 14U
94#define GPIOA_CEC 15U
95
96#define GPIOB_ULPI_D1 0U
97#define GPIOB_ULPI_D2 1U
98#define GPIOB_QSPI_CLK 2U
99#define GPIOB_SD_D2 3U
100#define GPIOB_SD_D3 4U
101#define GPIOB_ULPI_D7 5U
102#define GPIOB_QSPI_NCS 6U
103#define GPIOB_AUDIO_SDA 7U
104#define GPIOB_LCD_SDA 7U
105#define GPIOB_ARD_D15 8U
106#define GPIOB_ARD_D14 9U
107#define GPIOB_ULPI_D3 10U
108#define GPIOB_ULPI_D4 11U
109#define GPIOB_ULPI_D5 12U
110#define GPIOB_ULPI_D6 13U
111#define GPIOB_ARD_D12 14U
112#define GPIOB_ARD_D11 15U
113
114#define GPIOC_ULPI_STP 0U
115#define GPIOC_RMII_MDC 1U
116#define GPIOC_ARD_A2 2U
117#define GPIOC_DFSDM_DATIN1 3U
118#define GPIOC_RMII_RXD0 4U
119#define GPIOC_RMII_RXD1 5U
120#define GPIOC_ARD_D1 6U
121#define GPIOC_ARD_D0 7U
122#define GPIOC_ARD_D5 8U
123#define GPIOC_QSPI_D0 9U
124#define GPIOC_QSPI_D1 10U
125#define GPIOC_DFSDM_DATIN5 11U
126#define GPIOC_WIFI_RX 12U
127#define GPIOC_PIN13 13U
128#define GPIOC_OSC32_IN 14U
129#define GPIOC_OSC32_OUT 15U
130
131#define GPIOD_FMC_D2 0U
132#define GPIOD_FMC_D3 1U
133#define GPIOD_WIFI_TX 2U
134#define GPIOD_DFSDM_CKOUT 3U
135#define GPIOD_OTG_HS_OVER_CURRENT 4U
136#define GPIOD_RMII_RXER 5U
137#define GPIOD_SD_CLK 6U
138#define GPIOD_SD_CMD 7U
139#define GPIOD_FMC_D13 8U
140#define GPIOD_FMC_D14 9U
141#define GPIOD_FMC_D15 10U
142#define GPIOD_SPDIF_I2S 11U
143#define GPIOD_AUDIO_SCL 12U
144#define GPIOD_LCD_SCL 12U
145#define GPIOD_QSPI_D3 13U
146#define GPIOD_FMC_D0 14U
147#define GPIOD_FMC_D1 15U
148
149#define GPIOE_FMC_NBL0 0U
150#define GPIOE_FMC_NBL1 1U
151#define GPIOE_QSPI_D2 2U
152#define GPIOE_SAI1_SDB 3U
153#define GPIOE_SAI1_FSA 4U
154#define GPIOE_SAI1_SCKA 5U
155#define GPIOE_SAI1_SDA 6U
156#define GPIOE_FMC_D4 7U
157#define GPIOE_FMC_D5 8U
158#define GPIOE_FMC_D6 9U
159#define GPIOE_FMC_D7 10U
160#define GPIOE_FMC_D8 11U
161#define GPIOE_FMC_D9 12U
162#define GPIOE_FMC_D10 13U
163#define GPIOE_FMC_11 14U
164#define GPIOE_FMC_D12 15U
165
166#define GPIOF_FMC_A0 0U
167#define GPIOF_FMC_A1 1U
168#define GPIOF_FMC_A2 2U
169#define GPIOF_FMC_A3 3U
170#define GPIOF_FMC_A4 4U
171#define GPIOF_FMC_A5 5U
172#define GPIOF_ARD_D3 6U
173#define GPIOF_ARD_D6 7U
174#define GPIOF_ARD_A4 8U
175#define GPIOF_ARD_A5 9U
176#define GPIOF_ARD_A3 10U
177#define GPIOF_FMC_SDNRAS 11U
178#define GPIOF_FMC_A6 12U
179#define GPIOF_FMC_A7 13U
180#define GPIOF_FMC_A8 14U
181#define GPIOF_FMC_A9 15U
182
183#define GPIOG_FMC_A10 0U
184#define GPIOG_FMC_A11 1U
185#define GPIOG_FMC_A12 2U
186#define GPIOG_EXT_SCL 3U
187#define GPIOG_FMC_BA0 4U
188#define GPIOG_FMC_BA1 5U
189#define GPIOG_EXT_SDA 6U
190#define GPIOG_SAI1_MCLKA 7U
191#define GPIOG_FMC_SDCLK 8U
192#define GPIOG_SD_D0 9U
193#define GPIOG_SD_D1 10U
194#define GPIOG_RMII_TX_EN 11U
195#define GPIOG_SPDIF_RX 12U
196#define GPIOG_RMII_TXD0 13U
197#define GPIOG_RMII_TXD1 14U
198#define GPIOG_FMC_SDNCAS 15U
199
200#define GPIOH_OSC_IN 0U
201#define GPIOH_OSC_OUT 1U
202#define GPIOH_FMC_SDCKE0 2U
203#define GPIOH_FMC_SDNE0 3U
204#define GPIOH_ULPI_NXT 4U
205#define GPIOH_FMC_SDNWE 5U
206#define GPIOH_ARD_D9 6U
207#define GPIOH_EXT_RST 7U
208#define GPIOH_FMC_D16 8U
209#define GPIOH_FMC_D17 9U
210#define GPIOH_FMC_D18 10U
211#define GPIOH_FMC_D19 11U
212#define GPIOH_FMC_D20 12U
213#define GPIOH_FMC_D21 13U
214#define GPIOH_FMC_D22 14U
215#define GPIOH_FMC_D23 15U
216
217#define GPIOI_FMC_D24 0U
218#define GPIOI_FMC_D25 1U
219#define GPIOI_FMC_D26 2U
220#define GPIOI_FMC_D27 3U
221#define GPIOI_FMC_NBL2 4U
222#define GPIOI_FMC_NBL3 5U
223#define GPIOI_FMC_D28 6U
224#define GPIOI_FMC_D29 7U
225#define GPIOI_PIN8 8U
226#define GPIOI_FMC_D30 9U
227#define GPIOI_FMC_D31 10U
228#define GPIOI_ULPI_DIR 11U
229#define GPIOI_PIN12 12U
230#define GPIOI_LCD_INT 13U
231#define GPIOI_LCD_BL_CTRL 14U
232#define GPIOI_SD_DETECT 15U
233
234#define GPIOJ_ARD_D4 0U
235#define GPIOJ_ARD_D2 1U
236#define GPIOJ_DSI_TE 2U
237#define GPIOJ_ARD_D7 3U
238#define GPIOJ_ARD_D8 4U
239#define GPIOJ_LED2_GREEN 5U
240#define GPIOJ_PIN6 6U
241#define GPIOJ_PIN7 7U
242#define GPIOJ_PIN8 8U
243#define GPIOJ_PIN9 9U
244#define GPIOJ_PIN10 10U
245#define GPIOJ_PIN11 11U
246#define GPIOJ_AUDIO_INT 12U
247#define GPIOJ_LED1_RED 13U
248#define GPIOJ_WIFI_RST 14U
249#define GPIOJ_DSI_RESET 15U
250
251#define GPIOK_PIN0 0U
252#define GPIOK_PIN1 1U
253#define GPIOK_PIN2 2U
254#define GPIOK_PIN3 3U
255#define GPIOK_PIN4 4U
256#define GPIOK_PIN5 5U
257#define GPIOK_PIN6 6U
258#define GPIOK_PIN7 7U
259#define GPIOK_PIN8 8U
260#define GPIOK_PIN9 9U
261#define GPIOK_PIN10 10U
262#define GPIOK_PIN11 11U
263#define GPIOK_PIN12 12U
264#define GPIOK_PIN13 13U
265#define GPIOK_PIN14 14U
266#define GPIOK_PIN15 15U
267
268/*
269 * IO lines assignments.
270 */
271#define LINE_BUTTON_USER PAL_LINE(GPIOA, 0U)
272#define LINE_RMII_REF_CLK PAL_LINE(GPIOA, 1U)
273#define LINE_RMII_MDIO PAL_LINE(GPIOA, 2U)
274#define LINE_ULPI_D0 PAL_LINE(GPIOA, 3U)
275#define LINE_ARD_A1 PAL_LINE(GPIOA, 4U)
276#define LINE_ULPI_CK PAL_LINE(GPIOA, 5U)
277#define LINE_ARD_A0 PAL_LINE(GPIOA, 6U)
278#define LINE_RMII_CRS_DV PAL_LINE(GPIOA, 7U)
279#define LINE_CEC_CLK PAL_LINE(GPIOA, 8U)
280#define LINE_VCP_TX PAL_LINE(GPIOA, 9U)
281#define LINE_VCP_RX PAL_LINE(GPIOA, 10U)
282#define LINE_ARD_D10 PAL_LINE(GPIOA, 11U)
283#define LINE_ARD_D13 PAL_LINE(GPIOA, 12U)
284#define LINE_SWDIO PAL_LINE(GPIOA, 13U)
285#define LINE_SWCLK PAL_LINE(GPIOA, 14U)
286#define LINE_CEC PAL_LINE(GPIOA, 15U)
287#define LINE_ULPI_D1 PAL_LINE(GPIOB, 0U)
288#define LINE_ULPI_D2 PAL_LINE(GPIOB, 1U)
289#define LINE_QSPI_CLK PAL_LINE(GPIOB, 2U)
290#define LINE_SD_D2 PAL_LINE(GPIOB, 3U)
291#define LINE_SD_D3 PAL_LINE(GPIOB, 4U)
292#define LINE_ULPI_D7 PAL_LINE(GPIOB, 5U)
293#define LINE_QSPI_NCS PAL_LINE(GPIOB, 6U)
294#define LINE_AUDIO_SDA PAL_LINE(GPIOB, 7U)
295#define LINE_LCD_SDA PAL_LINE(GPIOB, 7U)
296#define LINE_ARD_D15 PAL_LINE(GPIOB, 8U)
297#define LINE_ARD_D14 PAL_LINE(GPIOB, 9U)
298#define LINE_ULPI_D3 PAL_LINE(GPIOB, 10U)
299#define LINE_ULPI_D4 PAL_LINE(GPIOB, 11U)
300#define LINE_ULPI_D5 PAL_LINE(GPIOB, 12U)
301#define LINE_ULPI_D6 PAL_LINE(GPIOB, 13U)
302#define LINE_ARD_D12 PAL_LINE(GPIOB, 14U)
303#define LINE_ARD_D11 PAL_LINE(GPIOB, 15U)
304#define LINE_ULPI_STP PAL_LINE(GPIOC, 0U)
305#define LINE_RMII_MDC PAL_LINE(GPIOC, 1U)
306#define LINE_ARD_A2 PAL_LINE(GPIOC, 2U)
307#define LINE_DFSDM_DATIN1 PAL_LINE(GPIOC, 3U)
308#define LINE_RMII_RXD0 PAL_LINE(GPIOC, 4U)
309#define LINE_RMII_RXD1 PAL_LINE(GPIOC, 5U)
310#define LINE_ARD_D1 PAL_LINE(GPIOC, 6U)
311#define LINE_ARD_D0 PAL_LINE(GPIOC, 7U)
312#define LINE_ARD_D5 PAL_LINE(GPIOC, 8U)
313#define LINE_QSPI_D0 PAL_LINE(GPIOC, 9U)
314#define LINE_QSPI_D1 PAL_LINE(GPIOC, 10U)
315#define LINE_DFSDM_DATIN5 PAL_LINE(GPIOC, 11U)
316#define LINE_WIFI_RX PAL_LINE(GPIOC, 12U)
317#define LINE_OSC32_IN PAL_LINE(GPIOC, 14U)
318#define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U)
319#define LINE_FMC_D2 PAL_LINE(GPIOD, 0U)
320#define LINE_FMC_D3 PAL_LINE(GPIOD, 1U)
321#define LINE_WIFI_TX PAL_LINE(GPIOD, 2U)
322#define LINE_DFSDM_CKOUT PAL_LINE(GPIOD, 3U)
323#define LINE_OTG_HS_OVER_CURRENT PAL_LINE(GPIOD, 4U)
324#define LINE_RMII_RXER PAL_LINE(GPIOD, 5U)
325#define LINE_SD_CLK PAL_LINE(GPIOD, 6U)
326#define LINE_SD_CMD PAL_LINE(GPIOD, 7U)
327#define LINE_FMC_D13 PAL_LINE(GPIOD, 8U)
328#define LINE_FMC_D14 PAL_LINE(GPIOD, 9U)
329#define LINE_FMC_D15 PAL_LINE(GPIOD, 10U)
330#define LINE_SPDIF_I2S PAL_LINE(GPIOD, 11U)
331#define LINE_AUDIO_SCL PAL_LINE(GPIOD, 12U)
332#define LINE_LCD_SCL PAL_LINE(GPIOD, 12U)
333#define LINE_QSPI_D3 PAL_LINE(GPIOD, 13U)
334#define LINE_FMC_D0 PAL_LINE(GPIOD, 14U)
335#define LINE_FMC_D1 PAL_LINE(GPIOD, 15U)
336#define LINE_FMC_NBL0 PAL_LINE(GPIOE, 0U)
337#define LINE_FMC_NBL1 PAL_LINE(GPIOE, 1U)
338#define LINE_QSPI_D2 PAL_LINE(GPIOE, 2U)
339#define LINE_SAI1_SDB PAL_LINE(GPIOE, 3U)
340#define LINE_SAI1_FSA PAL_LINE(GPIOE, 4U)
341#define LINE_SAI1_SCKA PAL_LINE(GPIOE, 5U)
342#define LINE_SAI1_SDA PAL_LINE(GPIOE, 6U)
343#define LINE_FMC_D4 PAL_LINE(GPIOE, 7U)
344#define LINE_FMC_D5 PAL_LINE(GPIOE, 8U)
345#define LINE_FMC_D6 PAL_LINE(GPIOE, 9U)
346#define LINE_FMC_D7 PAL_LINE(GPIOE, 10U)
347#define LINE_FMC_D8 PAL_LINE(GPIOE, 11U)
348#define LINE_FMC_D9 PAL_LINE(GPIOE, 12U)
349#define LINE_FMC_D10 PAL_LINE(GPIOE, 13U)
350#define LINE_FMC_11 PAL_LINE(GPIOE, 14U)
351#define LINE_FMC_D12 PAL_LINE(GPIOE, 15U)
352#define LINE_FMC_A0 PAL_LINE(GPIOF, 0U)
353#define LINE_FMC_A1 PAL_LINE(GPIOF, 1U)
354#define LINE_FMC_A2 PAL_LINE(GPIOF, 2U)
355#define LINE_FMC_A3 PAL_LINE(GPIOF, 3U)
356#define LINE_FMC_A4 PAL_LINE(GPIOF, 4U)
357#define LINE_FMC_A5 PAL_LINE(GPIOF, 5U)
358#define LINE_ARD_D3 PAL_LINE(GPIOF, 6U)
359#define LINE_ARD_D6 PAL_LINE(GPIOF, 7U)
360#define LINE_ARD_A4 PAL_LINE(GPIOF, 8U)
361#define LINE_ARD_A5 PAL_LINE(GPIOF, 9U)
362#define LINE_ARD_A3 PAL_LINE(GPIOF, 10U)
363#define LINE_FMC_SDNRAS PAL_LINE(GPIOF, 11U)
364#define LINE_FMC_A6 PAL_LINE(GPIOF, 12U)
365#define LINE_FMC_A7 PAL_LINE(GPIOF, 13U)
366#define LINE_FMC_A8 PAL_LINE(GPIOF, 14U)
367#define LINE_FMC_A9 PAL_LINE(GPIOF, 15U)
368#define LINE_FMC_A10 PAL_LINE(GPIOG, 0U)
369#define LINE_FMC_A11 PAL_LINE(GPIOG, 1U)
370#define LINE_FMC_A12 PAL_LINE(GPIOG, 2U)
371#define LINE_EXT_SCL PAL_LINE(GPIOG, 3U)
372#define LINE_FMC_BA0 PAL_LINE(GPIOG, 4U)
373#define LINE_FMC_BA1 PAL_LINE(GPIOG, 5U)
374#define LINE_EXT_SDA PAL_LINE(GPIOG, 6U)
375#define LINE_SAI1_MCLKA PAL_LINE(GPIOG, 7U)
376#define LINE_FMC_SDCLK PAL_LINE(GPIOG, 8U)
377#define LINE_SD_D0 PAL_LINE(GPIOG, 9U)
378#define LINE_SD_D1 PAL_LINE(GPIOG, 10U)
379#define LINE_RMII_TX_EN PAL_LINE(GPIOG, 11U)
380#define LINE_SPDIF_RX PAL_LINE(GPIOG, 12U)
381#define LINE_RMII_TXD0 PAL_LINE(GPIOG, 13U)
382#define LINE_RMII_TXD1 PAL_LINE(GPIOG, 14U)
383#define LINE_FMC_SDNCAS PAL_LINE(GPIOG, 15U)
384#define LINE_OSC_IN PAL_LINE(GPIOH, 0U)
385#define LINE_OSC_OUT PAL_LINE(GPIOH, 1U)
386#define LINE_FMC_SDCKE0 PAL_LINE(GPIOH, 2U)
387#define LINE_FMC_SDNE0 PAL_LINE(GPIOH, 3U)
388#define LINE_ULPI_NXT PAL_LINE(GPIOH, 4U)
389#define LINE_FMC_SDNWE PAL_LINE(GPIOH, 5U)
390#define LINE_ARD_D9 PAL_LINE(GPIOH, 6U)
391#define LINE_EXT_RST PAL_LINE(GPIOH, 7U)
392#define LINE_FMC_D16 PAL_LINE(GPIOH, 8U)
393#define LINE_FMC_D17 PAL_LINE(GPIOH, 9U)
394#define LINE_FMC_D18 PAL_LINE(GPIOH, 10U)
395#define LINE_FMC_D19 PAL_LINE(GPIOH, 11U)
396#define LINE_FMC_D20 PAL_LINE(GPIOH, 12U)
397#define LINE_FMC_D21 PAL_LINE(GPIOH, 13U)
398#define LINE_FMC_D22 PAL_LINE(GPIOH, 14U)
399#define LINE_FMC_D23 PAL_LINE(GPIOH, 15U)
400#define LINE_FMC_D24 PAL_LINE(GPIOI, 0U)
401#define LINE_FMC_D25 PAL_LINE(GPIOI, 1U)
402#define LINE_FMC_D26 PAL_LINE(GPIOI, 2U)
403#define LINE_FMC_D27 PAL_LINE(GPIOI, 3U)
404#define LINE_FMC_NBL2 PAL_LINE(GPIOI, 4U)
405#define LINE_FMC_NBL3 PAL_LINE(GPIOI, 5U)
406#define LINE_FMC_D28 PAL_LINE(GPIOI, 6U)
407#define LINE_FMC_D29 PAL_LINE(GPIOI, 7U)
408#define LINE_FMC_D30 PAL_LINE(GPIOI, 9U)
409#define LINE_FMC_D31 PAL_LINE(GPIOI, 10U)
410#define LINE_ULPI_DIR PAL_LINE(GPIOI, 11U)
411#define LINE_LCD_INT PAL_LINE(GPIOI, 13U)
412#define LINE_LCD_BL_CTRL PAL_LINE(GPIOI, 14U)
413#define LINE_SD_DETECT PAL_LINE(GPIOI, 15U)
414#define LINE_ARD_D4 PAL_LINE(GPIOJ, 0U)
415#define LINE_ARD_D2 PAL_LINE(GPIOJ, 1U)
416#define LINE_DSI_TE PAL_LINE(GPIOJ, 2U)
417#define LINE_ARD_D7 PAL_LINE(GPIOJ, 3U)
418#define LINE_ARD_D8 PAL_LINE(GPIOJ, 4U)
419#define LINE_LED2_GREEN PAL_LINE(GPIOJ, 5U)
420#define LINE_AUDIO_INT PAL_LINE(GPIOJ, 12U)
421#define LINE_LED1_RED PAL_LINE(GPIOJ, 13U)
422#define LINE_WIFI_RST PAL_LINE(GPIOJ, 14U)
423#define LINE_DSI_RESET PAL_LINE(GPIOJ, 15U)
424
425/*===========================================================================*/
426/* Driver pre-compile time settings. */
427/*===========================================================================*/
428
429/*===========================================================================*/
430/* Derived constants and error checks. */
431/*===========================================================================*/
432
433/*===========================================================================*/
434/* Driver data structures and types. */
435/*===========================================================================*/
436
437/*===========================================================================*/
438/* Driver macros. */
439/*===========================================================================*/
440
441/*
442 * I/O ports initial setup, this configuration is established soon after reset
443 * in the initialization code.
444 * Please refer to the STM32 Reference Manual for details.
445 */
446#define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
447#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
448#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
449#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
450#define PIN_ODR_LOW(n) (0U << (n))
451#define PIN_ODR_HIGH(n) (1U << (n))
452#define PIN_OTYPE_PUSHPULL(n) (0U << (n))
453#define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
454#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U))
455#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U))
456#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U))
457#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U))
458#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
459#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
460#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
461#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
462
463/*
464 * GPIOA setup:
465 *
466 * PA0 - BUTTON_USER (input floating).
467 * PA1 - RMII_REF_CLK (alternate 11).
468 * PA2 - RMII_MDIO (alternate 11).
469 * PA3 - ULPI_D0 (alternate 10).
470 * PA4 - ARD_A1 (input pullup).
471 * PA5 - ULPI_CK (alternate 10).
472 * PA6 - ARD_A0 (input pullup).
473 * PA7 - RMII_CRS_DV (alternate 11).
474 * PA8 - CEC_CLK (alternate 0).
475 * PA9 - VCP_TX (alternate 7).
476 * PA10 - VCP_RX (alternate 7).
477 * PA11 - ARD_D10 (input pullup).
478 * PA12 - ARD_D13 (input pullup).
479 * PA13 - SWDIO (alternate 0).
480 * PA14 - SWCLK (alternate 0).
481 * PA15 - CEC (alternate 3).
482 */
483#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_BUTTON_USER) | \
484 PIN_MODE_ALTERNATE(GPIOA_RMII_REF_CLK) |\
485 PIN_MODE_ALTERNATE(GPIOA_RMII_MDIO) | \
486 PIN_MODE_ALTERNATE(GPIOA_ULPI_D0) | \
487 PIN_MODE_INPUT(GPIOA_ARD_A1) | \
488 PIN_MODE_ALTERNATE(GPIOA_ULPI_CK) | \
489 PIN_MODE_INPUT(GPIOA_ARD_A0) | \
490 PIN_MODE_ALTERNATE(GPIOA_RMII_CRS_DV) |\
491 PIN_MODE_ALTERNATE(GPIOA_CEC_CLK) | \
492 PIN_MODE_ALTERNATE(GPIOA_VCP_TX) | \
493 PIN_MODE_ALTERNATE(GPIOA_VCP_RX) | \
494 PIN_MODE_INPUT(GPIOA_ARD_D10) | \
495 PIN_MODE_INPUT(GPIOA_ARD_D13) | \
496 PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \
497 PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \
498 PIN_MODE_ALTERNATE(GPIOA_CEC))
499#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_BUTTON_USER) |\
500 PIN_OTYPE_PUSHPULL(GPIOA_RMII_REF_CLK) |\
501 PIN_OTYPE_PUSHPULL(GPIOA_RMII_MDIO) | \
502 PIN_OTYPE_PUSHPULL(GPIOA_ULPI_D0) | \
503 PIN_OTYPE_PUSHPULL(GPIOA_ARD_A1) | \
504 PIN_OTYPE_PUSHPULL(GPIOA_ULPI_CK) | \
505 PIN_OTYPE_PUSHPULL(GPIOA_ARD_A0) | \
506 PIN_OTYPE_PUSHPULL(GPIOA_RMII_CRS_DV) |\
507 PIN_OTYPE_PUSHPULL(GPIOA_CEC_CLK) | \
508 PIN_OTYPE_PUSHPULL(GPIOA_VCP_TX) | \
509 PIN_OTYPE_PUSHPULL(GPIOA_VCP_RX) | \
510 PIN_OTYPE_PUSHPULL(GPIOA_ARD_D10) | \
511 PIN_OTYPE_PUSHPULL(GPIOA_ARD_D13) | \
512 PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \
513 PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \
514 PIN_OTYPE_PUSHPULL(GPIOA_CEC))
515#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_HIGH(GPIOA_BUTTON_USER) | \
516 PIN_OSPEED_HIGH(GPIOA_RMII_REF_CLK) | \
517 PIN_OSPEED_HIGH(GPIOA_RMII_MDIO) | \
518 PIN_OSPEED_HIGH(GPIOA_ULPI_D0) | \
519 PIN_OSPEED_VERYLOW(GPIOA_ARD_A1) | \
520 PIN_OSPEED_HIGH(GPIOA_ULPI_CK) | \
521 PIN_OSPEED_VERYLOW(GPIOA_ARD_A0) | \
522 PIN_OSPEED_HIGH(GPIOA_RMII_CRS_DV) | \
523 PIN_OSPEED_HIGH(GPIOA_CEC_CLK) | \
524 PIN_OSPEED_HIGH(GPIOA_VCP_TX) | \
525 PIN_OSPEED_HIGH(GPIOA_VCP_RX) | \
526 PIN_OSPEED_VERYLOW(GPIOA_ARD_D10) | \
527 PIN_OSPEED_VERYLOW(GPIOA_ARD_D13) | \
528 PIN_OSPEED_HIGH(GPIOA_SWDIO) | \
529 PIN_OSPEED_HIGH(GPIOA_SWCLK) | \
530 PIN_OSPEED_HIGH(GPIOA_CEC))
531#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON_USER) |\
532 PIN_PUPDR_FLOATING(GPIOA_RMII_REF_CLK) |\
533 PIN_PUPDR_PULLUP(GPIOA_RMII_MDIO) | \
534 PIN_PUPDR_FLOATING(GPIOA_ULPI_D0) | \
535 PIN_PUPDR_PULLUP(GPIOA_ARD_A1) | \
536 PIN_PUPDR_FLOATING(GPIOA_ULPI_CK) | \
537 PIN_PUPDR_PULLUP(GPIOA_ARD_A0) | \
538 PIN_PUPDR_FLOATING(GPIOA_RMII_CRS_DV) |\
539 PIN_PUPDR_FLOATING(GPIOA_CEC_CLK) | \
540 PIN_PUPDR_FLOATING(GPIOA_VCP_TX) | \
541 PIN_PUPDR_FLOATING(GPIOA_VCP_RX) | \
542 PIN_PUPDR_PULLUP(GPIOA_ARD_D10) | \
543 PIN_PUPDR_PULLUP(GPIOA_ARD_D13) | \
544 PIN_PUPDR_FLOATING(GPIOA_SWDIO) | \
545 PIN_PUPDR_FLOATING(GPIOA_SWCLK) | \
546 PIN_PUPDR_FLOATING(GPIOA_CEC))
547#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_BUTTON_USER) | \
548 PIN_ODR_HIGH(GPIOA_RMII_REF_CLK) | \
549 PIN_ODR_HIGH(GPIOA_RMII_MDIO) | \
550 PIN_ODR_HIGH(GPIOA_ULPI_D0) | \
551 PIN_ODR_HIGH(GPIOA_ARD_A1) | \
552 PIN_ODR_HIGH(GPIOA_ULPI_CK) | \
553 PIN_ODR_HIGH(GPIOA_ARD_A0) | \
554 PIN_ODR_HIGH(GPIOA_RMII_CRS_DV) | \
555 PIN_ODR_HIGH(GPIOA_CEC_CLK) | \
556 PIN_ODR_HIGH(GPIOA_VCP_TX) | \
557 PIN_ODR_HIGH(GPIOA_VCP_RX) | \
558 PIN_ODR_HIGH(GPIOA_ARD_D10) | \
559 PIN_ODR_HIGH(GPIOA_ARD_D13) | \
560 PIN_ODR_HIGH(GPIOA_SWDIO) | \
561 PIN_ODR_HIGH(GPIOA_SWCLK) | \
562 PIN_ODR_HIGH(GPIOA_CEC))
563#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_BUTTON_USER, 0U) | \
564 PIN_AFIO_AF(GPIOA_RMII_REF_CLK, 11U) | \
565 PIN_AFIO_AF(GPIOA_RMII_MDIO, 11U) | \
566 PIN_AFIO_AF(GPIOA_ULPI_D0, 10U) | \
567 PIN_AFIO_AF(GPIOA_ARD_A1, 0U) | \
568 PIN_AFIO_AF(GPIOA_ULPI_CK, 10U) | \
569 PIN_AFIO_AF(GPIOA_ARD_A0, 0U) | \
570 PIN_AFIO_AF(GPIOA_RMII_CRS_DV, 11U))
571#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_CEC_CLK, 0U) | \
572 PIN_AFIO_AF(GPIOA_VCP_TX, 7U) | \
573 PIN_AFIO_AF(GPIOA_VCP_RX, 7U) | \
574 PIN_AFIO_AF(GPIOA_ARD_D10, 0U) | \
575 PIN_AFIO_AF(GPIOA_ARD_D13, 0U) | \
576 PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \
577 PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \
578 PIN_AFIO_AF(GPIOA_CEC, 3U))
579
580/*
581 * GPIOB setup:
582 *
583 * PB0 - ULPI_D1 (alternate 10).
584 * PB1 - ULPI_D2 (alternate 10).
585 * PB2 - QSPI_CLK (input pullup).
586 * PB3 - SD_D2 (alternate 10).
587 * PB4 - SD_D3 (alternate 10).
588 * PB5 - ULPI_D7 (alternate 10).
589 * PB6 - QSPI_NCS (input pullup).
590 * PB7 - AUDIO_SDA LCD_SDA (alternate 11).
591 * PB8 - ARD_D15 (input pullup).
592 * PB9 - ARD_D14 (input pullup).
593 * PB10 - ULPI_D3 (alternate 10).
594 * PB11 - ULPI_D4 (alternate 10).
595 * PB12 - ULPI_D5 (alternate 10).
596 * PB13 - ULPI_D6 (alternate 10).
597 * PB14 - ARD_D12 (input pullup).
598 * PB15 - ARD_D11 (input pullup).
599 */
600#define VAL_GPIOB_MODER (PIN_MODE_ALTERNATE(GPIOB_ULPI_D1) | \
601 PIN_MODE_ALTERNATE(GPIOB_ULPI_D2) | \
602 PIN_MODE_INPUT(GPIOB_QSPI_CLK) | \
603 PIN_MODE_ALTERNATE(GPIOB_SD_D2) | \
604 PIN_MODE_ALTERNATE(GPIOB_SD_D3) | \
605 PIN_MODE_ALTERNATE(GPIOB_ULPI_D7) | \
606 PIN_MODE_INPUT(GPIOB_QSPI_NCS) | \
607 PIN_MODE_ALTERNATE(GPIOB_AUDIO_SDA) | \
608 PIN_MODE_INPUT(GPIOB_ARD_D15) | \
609 PIN_MODE_INPUT(GPIOB_ARD_D14) | \
610 PIN_MODE_ALTERNATE(GPIOB_ULPI_D3) | \
611 PIN_MODE_ALTERNATE(GPIOB_ULPI_D4) | \
612 PIN_MODE_ALTERNATE(GPIOB_ULPI_D5) | \
613 PIN_MODE_ALTERNATE(GPIOB_ULPI_D6) | \
614 PIN_MODE_INPUT(GPIOB_ARD_D12) | \
615 PIN_MODE_INPUT(GPIOB_ARD_D11))
616#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_ULPI_D1) | \
617 PIN_OTYPE_PUSHPULL(GPIOB_ULPI_D2) | \
618 PIN_OTYPE_PUSHPULL(GPIOB_QSPI_CLK) | \
619 PIN_OTYPE_PUSHPULL(GPIOB_SD_D2) | \
620 PIN_OTYPE_PUSHPULL(GPIOB_SD_D3) | \
621 PIN_OTYPE_PUSHPULL(GPIOB_ULPI_D7) | \
622 PIN_OTYPE_PUSHPULL(GPIOB_QSPI_NCS) | \
623 PIN_OTYPE_PUSHPULL(GPIOB_AUDIO_SDA) | \
624 PIN_OTYPE_PUSHPULL(GPIOB_ARD_D15) | \
625 PIN_OTYPE_PUSHPULL(GPIOB_ARD_D14) | \
626 PIN_OTYPE_PUSHPULL(GPIOB_ULPI_D3) | \
627 PIN_OTYPE_PUSHPULL(GPIOB_ULPI_D4) | \
628 PIN_OTYPE_PUSHPULL(GPIOB_ULPI_D5) | \
629 PIN_OTYPE_PUSHPULL(GPIOB_ULPI_D6) | \
630 PIN_OTYPE_PUSHPULL(GPIOB_ARD_D12) | \
631 PIN_OTYPE_PUSHPULL(GPIOB_ARD_D11))
632#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_HIGH(GPIOB_ULPI_D1) | \
633 PIN_OSPEED_HIGH(GPIOB_ULPI_D2) | \
634 PIN_OSPEED_HIGH(GPIOB_QSPI_CLK) | \
635 PIN_OSPEED_HIGH(GPIOB_SD_D2) | \
636 PIN_OSPEED_HIGH(GPIOB_SD_D3) | \
637 PIN_OSPEED_HIGH(GPIOB_ULPI_D7) | \
638 PIN_OSPEED_HIGH(GPIOB_QSPI_NCS) | \
639 PIN_OSPEED_HIGH(GPIOB_AUDIO_SDA) | \
640 PIN_OSPEED_VERYLOW(GPIOB_ARD_D15) | \
641 PIN_OSPEED_VERYLOW(GPIOB_ARD_D14) | \
642 PIN_OSPEED_HIGH(GPIOB_ULPI_D3) | \
643 PIN_OSPEED_HIGH(GPIOB_ULPI_D4) | \
644 PIN_OSPEED_HIGH(GPIOB_ULPI_D5) | \
645 PIN_OSPEED_HIGH(GPIOB_ULPI_D6) | \
646 PIN_OSPEED_VERYLOW(GPIOB_ARD_D12) | \
647 PIN_OSPEED_VERYLOW(GPIOB_ARD_D11))
648#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_ULPI_D1) | \
649 PIN_PUPDR_FLOATING(GPIOB_ULPI_D2) | \
650 PIN_PUPDR_PULLUP(GPIOB_QSPI_CLK) | \
651 PIN_PUPDR_FLOATING(GPIOB_SD_D2) | \
652 PIN_PUPDR_FLOATING(GPIOB_SD_D3) | \
653 PIN_PUPDR_PULLUP(GPIOB_ULPI_D7) | \
654 PIN_PUPDR_PULLUP(GPIOB_QSPI_NCS) | \
655 PIN_PUPDR_FLOATING(GPIOB_AUDIO_SDA) | \
656 PIN_PUPDR_PULLUP(GPIOB_ARD_D15) | \
657 PIN_PUPDR_PULLUP(GPIOB_ARD_D14) | \
658 PIN_PUPDR_FLOATING(GPIOB_ULPI_D3) | \
659 PIN_PUPDR_FLOATING(GPIOB_ULPI_D4) | \
660 PIN_PUPDR_FLOATING(GPIOB_ULPI_D5) | \
661 PIN_PUPDR_FLOATING(GPIOB_ULPI_D6) | \
662 PIN_PUPDR_PULLUP(GPIOB_ARD_D12) | \
663 PIN_PUPDR_PULLUP(GPIOB_ARD_D11))
664#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_ULPI_D1) | \
665 PIN_ODR_HIGH(GPIOB_ULPI_D2) | \
666 PIN_ODR_HIGH(GPIOB_QSPI_CLK) | \
667 PIN_ODR_HIGH(GPIOB_SD_D2) | \
668 PIN_ODR_HIGH(GPIOB_SD_D3) | \
669 PIN_ODR_HIGH(GPIOB_ULPI_D7) | \
670 PIN_ODR_HIGH(GPIOB_QSPI_NCS) | \
671 PIN_ODR_HIGH(GPIOB_AUDIO_SDA) | \
672 PIN_ODR_HIGH(GPIOB_ARD_D15) | \
673 PIN_ODR_HIGH(GPIOB_ARD_D14) | \
674 PIN_ODR_HIGH(GPIOB_ULPI_D3) | \
675 PIN_ODR_HIGH(GPIOB_ULPI_D4) | \
676 PIN_ODR_HIGH(GPIOB_ULPI_D5) | \
677 PIN_ODR_HIGH(GPIOB_ULPI_D6) | \
678 PIN_ODR_HIGH(GPIOB_ARD_D12) | \
679 PIN_ODR_HIGH(GPIOB_ARD_D11))
680#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_ULPI_D1, 10U) | \
681 PIN_AFIO_AF(GPIOB_ULPI_D2, 10U) | \
682 PIN_AFIO_AF(GPIOB_QSPI_CLK, 0U) | \
683 PIN_AFIO_AF(GPIOB_SD_D2, 10U) | \
684 PIN_AFIO_AF(GPIOB_SD_D3, 10U) | \
685 PIN_AFIO_AF(GPIOB_ULPI_D7, 10U) | \
686 PIN_AFIO_AF(GPIOB_QSPI_NCS, 0U) | \
687 PIN_AFIO_AF(GPIOB_AUDIO_SDA, 11U))
688#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_ARD_D15, 0U) | \
689 PIN_AFIO_AF(GPIOB_ARD_D14, 0U) | \
690 PIN_AFIO_AF(GPIOB_ULPI_D3, 10U) | \
691 PIN_AFIO_AF(GPIOB_ULPI_D4, 10U) | \
692 PIN_AFIO_AF(GPIOB_ULPI_D5, 10U) | \
693 PIN_AFIO_AF(GPIOB_ULPI_D6, 10U) | \
694 PIN_AFIO_AF(GPIOB_ARD_D12, 0U) | \
695 PIN_AFIO_AF(GPIOB_ARD_D11, 0U))
696
697/*
698 * GPIOC setup:
699 *
700 * PC0 - ULPI_STP (alternate 10).
701 * PC1 - RMII_MDC (alternate 11).
702 * PC2 - ARD_A2 (input pullup).
703 * PC3 - DFSDM_DATIN1 (alternate 3).
704 * PC4 - RMII_RXD0 (alternate 11).
705 * PC5 - RMII_RXD1 (alternate 11).
706 * PC6 - ARD_D1 (input pullup).
707 * PC7 - ARD_D0 (input floating).
708 * PC8 - ARD_D5 (input floating).
709 * PC9 - QSPI_D0 (alternate 9).
710 * PC10 - QSPI_D1 (alternate 9).
711 * PC11 - DFSDM_DATIN5 (alternate 3).
712 * PC12 - WIFI_RX (alternate 8).
713 * PC13 - PIN13 (input pullup).
714 * PC14 - OSC32_IN (input floating).
715 * PC15 - OSC32_OUT (input floating).
716 */
717#define VAL_GPIOC_MODER (PIN_MODE_ALTERNATE(GPIOC_ULPI_STP) | \
718 PIN_MODE_ALTERNATE(GPIOC_RMII_MDC) | \
719 PIN_MODE_INPUT(GPIOC_ARD_A2) | \
720 PIN_MODE_ALTERNATE(GPIOC_DFSDM_DATIN1) |\
721 PIN_MODE_ALTERNATE(GPIOC_RMII_RXD0) | \
722 PIN_MODE_ALTERNATE(GPIOC_RMII_RXD1) | \
723 PIN_MODE_INPUT(GPIOC_ARD_D1) | \
724 PIN_MODE_INPUT(GPIOC_ARD_D0) | \
725 PIN_MODE_INPUT(GPIOC_ARD_D5) | \
726 PIN_MODE_ALTERNATE(GPIOC_QSPI_D0) | \
727 PIN_MODE_ALTERNATE(GPIOC_QSPI_D1) | \
728 PIN_MODE_ALTERNATE(GPIOC_DFSDM_DATIN5) |\
729 PIN_MODE_ALTERNATE(GPIOC_WIFI_RX) | \
730 PIN_MODE_INPUT(GPIOC_PIN13) | \
731 PIN_MODE_INPUT(GPIOC_OSC32_IN) | \
732 PIN_MODE_INPUT(GPIOC_OSC32_OUT))
733#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_ULPI_STP) | \
734 PIN_OTYPE_PUSHPULL(GPIOC_RMII_MDC) | \
735 PIN_OTYPE_PUSHPULL(GPIOC_ARD_A2) | \
736 PIN_OTYPE_PUSHPULL(GPIOC_DFSDM_DATIN1) |\
737 PIN_OTYPE_PUSHPULL(GPIOC_RMII_RXD0) | \
738 PIN_OTYPE_PUSHPULL(GPIOC_RMII_RXD1) | \
739 PIN_OTYPE_PUSHPULL(GPIOC_ARD_D1) | \
740 PIN_OTYPE_PUSHPULL(GPIOC_ARD_D0) | \
741 PIN_OTYPE_PUSHPULL(GPIOC_ARD_D5) | \
742 PIN_OTYPE_PUSHPULL(GPIOC_QSPI_D0) | \
743 PIN_OTYPE_PUSHPULL(GPIOC_QSPI_D1) | \
744 PIN_OTYPE_PUSHPULL(GPIOC_DFSDM_DATIN5) |\
745 PIN_OTYPE_PUSHPULL(GPIOC_WIFI_RX) | \
746 PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \
747 PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \
748 PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT))
749#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_ULPI_STP) | \
750 PIN_OSPEED_HIGH(GPIOC_RMII_MDC) | \
751 PIN_OSPEED_VERYLOW(GPIOC_ARD_A2) | \
752 PIN_OSPEED_HIGH(GPIOC_DFSDM_DATIN1) | \
753 PIN_OSPEED_HIGH(GPIOC_RMII_RXD0) | \
754 PIN_OSPEED_HIGH(GPIOC_RMII_RXD1) | \
755 PIN_OSPEED_VERYLOW(GPIOC_ARD_D1) | \
756 PIN_OSPEED_VERYLOW(GPIOC_ARD_D0) | \
757 PIN_OSPEED_VERYLOW(GPIOC_ARD_D5) | \
758 PIN_OSPEED_HIGH(GPIOC_QSPI_D0) | \
759 PIN_OSPEED_HIGH(GPIOC_QSPI_D1) | \
760 PIN_OSPEED_HIGH(GPIOC_DFSDM_DATIN5) | \
761 PIN_OSPEED_HIGH(GPIOC_WIFI_RX) | \
762 PIN_OSPEED_HIGH(GPIOC_PIN13) | \
763 PIN_OSPEED_VERYLOW(GPIOC_OSC32_IN) | \
764 PIN_OSPEED_VERYLOW(GPIOC_OSC32_OUT))
765#define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_ULPI_STP) | \
766 PIN_PUPDR_FLOATING(GPIOC_RMII_MDC) | \
767 PIN_PUPDR_PULLUP(GPIOC_ARD_A2) | \
768 PIN_PUPDR_FLOATING(GPIOC_DFSDM_DATIN1) |\
769 PIN_PUPDR_FLOATING(GPIOC_RMII_RXD0) | \
770 PIN_PUPDR_FLOATING(GPIOC_RMII_RXD1) | \
771 PIN_PUPDR_PULLUP(GPIOC_ARD_D1) | \
772 PIN_PUPDR_FLOATING(GPIOC_ARD_D0) | \
773 PIN_PUPDR_FLOATING(GPIOC_ARD_D5) | \
774 PIN_PUPDR_FLOATING(GPIOC_QSPI_D0) | \
775 PIN_PUPDR_FLOATING(GPIOC_QSPI_D1) | \
776 PIN_PUPDR_FLOATING(GPIOC_DFSDM_DATIN5) |\
777 PIN_PUPDR_FLOATING(GPIOC_WIFI_RX) | \
778 PIN_PUPDR_PULLUP(GPIOC_PIN13) | \
779 PIN_PUPDR_FLOATING(GPIOC_OSC32_IN) | \
780 PIN_PUPDR_FLOATING(GPIOC_OSC32_OUT))
781#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_ULPI_STP) | \
782 PIN_ODR_HIGH(GPIOC_RMII_MDC) | \
783 PIN_ODR_HIGH(GPIOC_ARD_A2) | \
784 PIN_ODR_HIGH(GPIOC_DFSDM_DATIN1) | \
785 PIN_ODR_HIGH(GPIOC_RMII_RXD0) | \
786 PIN_ODR_HIGH(GPIOC_RMII_RXD1) | \
787 PIN_ODR_HIGH(GPIOC_ARD_D1) | \
788 PIN_ODR_HIGH(GPIOC_ARD_D0) | \
789 PIN_ODR_HIGH(GPIOC_ARD_D5) | \
790 PIN_ODR_HIGH(GPIOC_QSPI_D0) | \
791 PIN_ODR_HIGH(GPIOC_QSPI_D1) | \
792 PIN_ODR_HIGH(GPIOC_DFSDM_DATIN5) | \
793 PIN_ODR_HIGH(GPIOC_WIFI_RX) | \
794 PIN_ODR_HIGH(GPIOC_PIN13) | \
795 PIN_ODR_HIGH(GPIOC_OSC32_IN) | \
796 PIN_ODR_HIGH(GPIOC_OSC32_OUT))
797#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_ULPI_STP, 10U) | \
798 PIN_AFIO_AF(GPIOC_RMII_MDC, 11U) | \
799 PIN_AFIO_AF(GPIOC_ARD_A2, 0U) | \
800 PIN_AFIO_AF(GPIOC_DFSDM_DATIN1, 3U) | \
801 PIN_AFIO_AF(GPIOC_RMII_RXD0, 11U) | \
802 PIN_AFIO_AF(GPIOC_RMII_RXD1, 11U) | \
803 PIN_AFIO_AF(GPIOC_ARD_D1, 0U) | \
804 PIN_AFIO_AF(GPIOC_ARD_D0, 0U))
805#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_ARD_D5, 0U) | \
806 PIN_AFIO_AF(GPIOC_QSPI_D0, 9U) | \
807 PIN_AFIO_AF(GPIOC_QSPI_D1, 9U) | \
808 PIN_AFIO_AF(GPIOC_DFSDM_DATIN5, 3U) | \
809 PIN_AFIO_AF(GPIOC_WIFI_RX, 8U) | \
810 PIN_AFIO_AF(GPIOC_PIN13, 0U) | \
811 PIN_AFIO_AF(GPIOC_OSC32_IN, 0U) | \
812 PIN_AFIO_AF(GPIOC_OSC32_OUT, 0U))
813
814/*
815 * GPIOD setup:
816 *
817 * PD0 - FMC_D2 (alternate 12).
818 * PD1 - FMC_D3 (alternate 12).
819 * PD2 - WIFI_TX (alternate 8).
820 * PD3 - DFSDM_CKOUT (alternate 3).
821 * PD4 - OTG_HS_OVER_CURRENT (input floating).
822 * PD5 - RMII_RXER (alternate 7).
823 * PD6 - SD_CLK (alternate 11).
824 * PD7 - SD_CMD (alternate 11).
825 * PD8 - FMC_D13 (alternate 12).
826 * PD9 - FMC_D14 (alternate 12).
827 * PD10 - FMC_D15 (alternate 12).
828 * PD11 - SPDIF_I2S (alternate 10).
829 * PD12 - AUDIO_SCL LCD_SCL (alternate 4).
830 * PD13 - QSPI_D3 (input pullup).
831 * PD14 - FMC_D0 (alternate 12).
832 * PD15 - FMC_D1 (alternate 12).
833 */
834#define VAL_GPIOD_MODER (PIN_MODE_ALTERNATE(GPIOD_FMC_D2) | \
835 PIN_MODE_ALTERNATE(GPIOD_FMC_D3) | \
836 PIN_MODE_ALTERNATE(GPIOD_WIFI_TX) | \
837 PIN_MODE_ALTERNATE(GPIOD_DFSDM_CKOUT) |\
838 PIN_MODE_INPUT(GPIOD_OTG_HS_OVER_CURRENT) |\
839 PIN_MODE_ALTERNATE(GPIOD_RMII_RXER) | \
840 PIN_MODE_ALTERNATE(GPIOD_SD_CLK) | \
841 PIN_MODE_ALTERNATE(GPIOD_SD_CMD) | \
842 PIN_MODE_ALTERNATE(GPIOD_FMC_D13) | \
843 PIN_MODE_ALTERNATE(GPIOD_FMC_D14) | \
844 PIN_MODE_ALTERNATE(GPIOD_FMC_D15) | \
845 PIN_MODE_ALTERNATE(GPIOD_SPDIF_I2S) | \
846 PIN_MODE_ALTERNATE(GPIOD_AUDIO_SCL) | \
847 PIN_MODE_INPUT(GPIOD_QSPI_D3) | \
848 PIN_MODE_ALTERNATE(GPIOD_FMC_D0) | \
849 PIN_MODE_ALTERNATE(GPIOD_FMC_D1))
850#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_FMC_D2) | \
851 PIN_OTYPE_PUSHPULL(GPIOD_FMC_D3) | \
852 PIN_OTYPE_PUSHPULL(GPIOD_WIFI_TX) | \
853 PIN_OTYPE_PUSHPULL(GPIOD_DFSDM_CKOUT) |\
854 PIN_OTYPE_PUSHPULL(GPIOD_OTG_HS_OVER_CURRENT) |\
855 PIN_OTYPE_PUSHPULL(GPIOD_RMII_RXER) | \
856 PIN_OTYPE_PUSHPULL(GPIOD_SD_CLK) | \
857 PIN_OTYPE_PUSHPULL(GPIOD_SD_CMD) | \
858 PIN_OTYPE_PUSHPULL(GPIOD_FMC_D13) | \
859 PIN_OTYPE_PUSHPULL(GPIOD_FMC_D14) | \
860 PIN_OTYPE_PUSHPULL(GPIOD_FMC_D15) | \
861 PIN_OTYPE_PUSHPULL(GPIOD_SPDIF_I2S) | \
862 PIN_OTYPE_PUSHPULL(GPIOD_AUDIO_SCL) | \
863 PIN_OTYPE_PUSHPULL(GPIOD_QSPI_D3) | \
864 PIN_OTYPE_PUSHPULL(GPIOD_FMC_D0) | \
865 PIN_OTYPE_PUSHPULL(GPIOD_FMC_D1))
866#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_HIGH(GPIOD_FMC_D2) | \
867 PIN_OSPEED_HIGH(GPIOD_FMC_D3) | \
868 PIN_OSPEED_HIGH(GPIOD_WIFI_TX) | \
869 PIN_OSPEED_HIGH(GPIOD_DFSDM_CKOUT) | \
870 PIN_OSPEED_HIGH(GPIOD_OTG_HS_OVER_CURRENT) |\
871 PIN_OSPEED_HIGH(GPIOD_RMII_RXER) | \
872 PIN_OSPEED_HIGH(GPIOD_SD_CLK) | \
873 PIN_OSPEED_HIGH(GPIOD_SD_CMD) | \
874 PIN_OSPEED_HIGH(GPIOD_FMC_D13) | \
875 PIN_OSPEED_HIGH(GPIOD_FMC_D14) | \
876 PIN_OSPEED_HIGH(GPIOD_FMC_D15) | \
877 PIN_OSPEED_HIGH(GPIOD_SPDIF_I2S) | \
878 PIN_OSPEED_HIGH(GPIOD_AUDIO_SCL) | \
879 PIN_OSPEED_HIGH(GPIOD_QSPI_D3) | \
880 PIN_OSPEED_HIGH(GPIOD_FMC_D0) | \
881 PIN_OSPEED_HIGH(GPIOD_FMC_D1))
882#define VAL_GPIOD_PUPDR (PIN_PUPDR_FLOATING(GPIOD_FMC_D2) | \
883 PIN_PUPDR_FLOATING(GPIOD_FMC_D3) | \
884 PIN_PUPDR_FLOATING(GPIOD_WIFI_TX) | \
885 PIN_PUPDR_FLOATING(GPIOD_DFSDM_CKOUT) |\
886 PIN_PUPDR_FLOATING(GPIOD_OTG_HS_OVER_CURRENT) |\
887 PIN_PUPDR_FLOATING(GPIOD_RMII_RXER) | \
888 PIN_PUPDR_FLOATING(GPIOD_SD_CLK) | \
889 PIN_PUPDR_FLOATING(GPIOD_SD_CMD) | \
890 PIN_PUPDR_FLOATING(GPIOD_FMC_D13) | \
891 PIN_PUPDR_FLOATING(GPIOD_FMC_D14) | \
892 PIN_PUPDR_FLOATING(GPIOD_FMC_D15) | \
893 PIN_PUPDR_FLOATING(GPIOD_SPDIF_I2S) | \
894 PIN_PUPDR_FLOATING(GPIOD_AUDIO_SCL) | \
895 PIN_PUPDR_PULLUP(GPIOD_QSPI_D3) | \
896 PIN_PUPDR_FLOATING(GPIOD_FMC_D0) | \
897 PIN_PUPDR_FLOATING(GPIOD_FMC_D1))
898#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_FMC_D2) | \
899 PIN_ODR_HIGH(GPIOD_FMC_D3) | \
900 PIN_ODR_HIGH(GPIOD_WIFI_TX) | \
901 PIN_ODR_HIGH(GPIOD_DFSDM_CKOUT) | \
902 PIN_ODR_HIGH(GPIOD_OTG_HS_OVER_CURRENT) |\
903 PIN_ODR_HIGH(GPIOD_RMII_RXER) | \
904 PIN_ODR_HIGH(GPIOD_SD_CLK) | \
905 PIN_ODR_HIGH(GPIOD_SD_CMD) | \
906 PIN_ODR_HIGH(GPIOD_FMC_D13) | \
907 PIN_ODR_HIGH(GPIOD_FMC_D14) | \
908 PIN_ODR_HIGH(GPIOD_FMC_D15) | \
909 PIN_ODR_HIGH(GPIOD_SPDIF_I2S) | \
910 PIN_ODR_HIGH(GPIOD_AUDIO_SCL) | \
911 PIN_ODR_LOW(GPIOD_QSPI_D3) | \
912 PIN_ODR_LOW(GPIOD_FMC_D0) | \
913 PIN_ODR_LOW(GPIOD_FMC_D1))
914#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_FMC_D2, 12U) | \
915 PIN_AFIO_AF(GPIOD_FMC_D3, 12U) | \
916 PIN_AFIO_AF(GPIOD_WIFI_TX, 8U) | \
917 PIN_AFIO_AF(GPIOD_DFSDM_CKOUT, 3U) | \
918 PIN_AFIO_AF(GPIOD_OTG_HS_OVER_CURRENT, 0U) |\
919 PIN_AFIO_AF(GPIOD_RMII_RXER, 7U) | \
920 PIN_AFIO_AF(GPIOD_SD_CLK, 11U) | \
921 PIN_AFIO_AF(GPIOD_SD_CMD, 11U))
922#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_FMC_D13, 12U) | \
923 PIN_AFIO_AF(GPIOD_FMC_D14, 12U) | \
924 PIN_AFIO_AF(GPIOD_FMC_D15, 12U) | \
925 PIN_AFIO_AF(GPIOD_SPDIF_I2S, 10U) | \
926 PIN_AFIO_AF(GPIOD_AUDIO_SCL, 4U) | \
927 PIN_AFIO_AF(GPIOD_QSPI_D3, 0U) | \
928 PIN_AFIO_AF(GPIOD_FMC_D0, 12U) | \
929 PIN_AFIO_AF(GPIOD_FMC_D1, 12U))
930
931/*
932 * GPIOE setup:
933 *
934 * PE0 - FMC_NBL0 (alternate 12).
935 * PE1 - FMC_NBL1 (alternate 12).
936 * PE2 - QSPI_D2 (input pullup).
937 * PE3 - SAI1_SDB (alternate 6).
938 * PE4 - SAI1_FSA (alternate 6).
939 * PE5 - SAI1_SCKA (alternate 6).
940 * PE6 - SAI1_SDA (alternate 6).
941 * PE7 - FMC_D4 (alternate 12).
942 * PE8 - FMC_D5 (alternate 12).
943 * PE9 - FMC_D6 (alternate 12).
944 * PE10 - FMC_D7 (alternate 12).
945 * PE11 - FMC_D8 (alternate 12).
946 * PE12 - FMC_D9 (alternate 12).
947 * PE13 - FMC_D10 (alternate 12).
948 * PE14 - FMC_11 (alternate 12).
949 * PE15 - FMC_D12 (alternate 12).
950 */
951#define VAL_GPIOE_MODER (PIN_MODE_ALTERNATE(GPIOE_FMC_NBL0) | \
952 PIN_MODE_ALTERNATE(GPIOE_FMC_NBL1) | \
953 PIN_MODE_INPUT(GPIOE_QSPI_D2) | \
954 PIN_MODE_ALTERNATE(GPIOE_SAI1_SDB) | \
955 PIN_MODE_ALTERNATE(GPIOE_SAI1_FSA) | \
956 PIN_MODE_ALTERNATE(GPIOE_SAI1_SCKA) | \
957 PIN_MODE_ALTERNATE(GPIOE_SAI1_SDA) | \
958 PIN_MODE_ALTERNATE(GPIOE_FMC_D4) | \
959 PIN_MODE_ALTERNATE(GPIOE_FMC_D5) | \
960 PIN_MODE_ALTERNATE(GPIOE_FMC_D6) | \
961 PIN_MODE_ALTERNATE(GPIOE_FMC_D7) | \
962 PIN_MODE_ALTERNATE(GPIOE_FMC_D8) | \
963 PIN_MODE_ALTERNATE(GPIOE_FMC_D9) | \
964 PIN_MODE_ALTERNATE(GPIOE_FMC_D10) | \
965 PIN_MODE_ALTERNATE(GPIOE_FMC_11) | \
966 PIN_MODE_ALTERNATE(GPIOE_FMC_D12))
967#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_FMC_NBL0) | \
968 PIN_OTYPE_PUSHPULL(GPIOE_FMC_NBL1) | \
969 PIN_OTYPE_PUSHPULL(GPIOE_QSPI_D2) | \
970 PIN_OTYPE_PUSHPULL(GPIOE_SAI1_SDB) | \
971 PIN_OTYPE_PUSHPULL(GPIOE_SAI1_FSA) | \
972 PIN_OTYPE_PUSHPULL(GPIOE_SAI1_SCKA) | \
973 PIN_OTYPE_PUSHPULL(GPIOE_SAI1_SDA) | \
974 PIN_OTYPE_PUSHPULL(GPIOE_FMC_D4) | \
975 PIN_OTYPE_PUSHPULL(GPIOE_FMC_D5) | \
976 PIN_OTYPE_PUSHPULL(GPIOE_FMC_D6) | \
977 PIN_OTYPE_PUSHPULL(GPIOE_FMC_D7) | \
978 PIN_OTYPE_PUSHPULL(GPIOE_FMC_D8) | \
979 PIN_OTYPE_PUSHPULL(GPIOE_FMC_D9) | \
980 PIN_OTYPE_PUSHPULL(GPIOE_FMC_D10) | \
981 PIN_OTYPE_PUSHPULL(GPIOE_FMC_11) | \
982 PIN_OTYPE_PUSHPULL(GPIOE_FMC_D12))
983#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_HIGH(GPIOE_FMC_NBL0) | \
984 PIN_OSPEED_HIGH(GPIOE_FMC_NBL1) | \
985 PIN_OSPEED_HIGH(GPIOE_QSPI_D2) | \
986 PIN_OSPEED_HIGH(GPIOE_SAI1_SDB) | \
987 PIN_OSPEED_HIGH(GPIOE_SAI1_FSA) | \
988 PIN_OSPEED_HIGH(GPIOE_SAI1_SCKA) | \
989 PIN_OSPEED_HIGH(GPIOE_SAI1_SDA) | \
990 PIN_OSPEED_HIGH(GPIOE_FMC_D4) | \
991 PIN_OSPEED_HIGH(GPIOE_FMC_D5) | \
992 PIN_OSPEED_HIGH(GPIOE_FMC_D6) | \
993 PIN_OSPEED_HIGH(GPIOE_FMC_D7) | \
994 PIN_OSPEED_HIGH(GPIOE_FMC_D8) | \
995 PIN_OSPEED_HIGH(GPIOE_FMC_D9) | \
996 PIN_OSPEED_HIGH(GPIOE_FMC_D10) | \
997 PIN_OSPEED_HIGH(GPIOE_FMC_11) | \
998 PIN_OSPEED_HIGH(GPIOE_FMC_D12))
999#define VAL_GPIOE_PUPDR (PIN_PUPDR_FLOATING(GPIOE_FMC_NBL0) | \
1000 PIN_PUPDR_FLOATING(GPIOE_FMC_NBL1) | \
1001 PIN_PUPDR_PULLUP(GPIOE_QSPI_D2) | \
1002 PIN_PUPDR_FLOATING(GPIOE_SAI1_SDB) | \
1003 PIN_PUPDR_FLOATING(GPIOE_SAI1_FSA) | \
1004 PIN_PUPDR_FLOATING(GPIOE_SAI1_SCKA) | \
1005 PIN_PUPDR_FLOATING(GPIOE_SAI1_SDA) | \
1006 PIN_PUPDR_FLOATING(GPIOE_FMC_D4) | \
1007 PIN_PUPDR_FLOATING(GPIOE_FMC_D5) | \
1008 PIN_PUPDR_FLOATING(GPIOE_FMC_D6) | \
1009 PIN_PUPDR_FLOATING(GPIOE_FMC_D7) | \
1010 PIN_PUPDR_FLOATING(GPIOE_FMC_D8) | \
1011 PIN_PUPDR_FLOATING(GPIOE_FMC_D9) | \
1012 PIN_PUPDR_FLOATING(GPIOE_FMC_D10) | \
1013 PIN_PUPDR_FLOATING(GPIOE_FMC_11) | \
1014 PIN_PUPDR_FLOATING(GPIOE_FMC_D12))
1015#define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_FMC_NBL0) | \
1016 PIN_ODR_HIGH(GPIOE_FMC_NBL1) | \
1017 PIN_ODR_HIGH(GPIOE_QSPI_D2) | \
1018 PIN_ODR_HIGH(GPIOE_SAI1_SDB) | \
1019 PIN_ODR_HIGH(GPIOE_SAI1_FSA) | \
1020 PIN_ODR_HIGH(GPIOE_SAI1_SCKA) | \
1021 PIN_ODR_HIGH(GPIOE_SAI1_SDA) | \
1022 PIN_ODR_HIGH(GPIOE_FMC_D4) | \
1023 PIN_ODR_HIGH(GPIOE_FMC_D5) | \
1024 PIN_ODR_HIGH(GPIOE_FMC_D6) | \
1025 PIN_ODR_HIGH(GPIOE_FMC_D7) | \
1026 PIN_ODR_HIGH(GPIOE_FMC_D8) | \
1027 PIN_ODR_HIGH(GPIOE_FMC_D9) | \
1028 PIN_ODR_HIGH(GPIOE_FMC_D10) | \
1029 PIN_ODR_HIGH(GPIOE_FMC_11) | \
1030 PIN_ODR_HIGH(GPIOE_FMC_D12))
1031#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_FMC_NBL0, 12U) | \
1032 PIN_AFIO_AF(GPIOE_FMC_NBL1, 12U) | \
1033 PIN_AFIO_AF(GPIOE_QSPI_D2, 0U) | \
1034 PIN_AFIO_AF(GPIOE_SAI1_SDB, 6U) | \
1035 PIN_AFIO_AF(GPIOE_SAI1_FSA, 6U) | \
1036 PIN_AFIO_AF(GPIOE_SAI1_SCKA, 6U) | \
1037 PIN_AFIO_AF(GPIOE_SAI1_SDA, 6U) | \
1038 PIN_AFIO_AF(GPIOE_FMC_D4, 12U))
1039#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_FMC_D5, 12U) | \
1040 PIN_AFIO_AF(GPIOE_FMC_D6, 12U) | \
1041 PIN_AFIO_AF(GPIOE_FMC_D7, 12U) | \
1042 PIN_AFIO_AF(GPIOE_FMC_D8, 12U) | \
1043 PIN_AFIO_AF(GPIOE_FMC_D9, 12U) | \
1044 PIN_AFIO_AF(GPIOE_FMC_D10, 12U) | \
1045 PIN_AFIO_AF(GPIOE_FMC_11, 12U) | \
1046 PIN_AFIO_AF(GPIOE_FMC_D12, 12U))
1047
1048/*
1049 * GPIOF setup:
1050 *
1051 * PF0 - FMC_A0 (alternate 12).
1052 * PF1 - FMC_A1 (alternate 12).
1053 * PF2 - FMC_A2 (alternate 12).
1054 * PF3 - FMC_A3 (alternate 12).
1055 * PF4 - FMC_A4 (alternate 12).
1056 * PF5 - FMC_A5 (alternate 12).
1057 * PF6 - ARD_D3 (input pullup).
1058 * PF7 - ARD_D6 (input pullup).
1059 * PF8 - ARD_A4 (input pullup).
1060 * PF9 - ARD_A5 (input pullup).
1061 * PF10 - ARD_A3 (input pullup).
1062 * PF11 - FMC_SDNRAS (alternate 12).
1063 * PF12 - FMC_A6 (alternate 12).
1064 * PF13 - FMC_A7 (alternate 12).
1065 * PF14 - FMC_A8 (alternate 12).
1066 * PF15 - FMC_A9 (alternate 12).
1067 */
1068#define VAL_GPIOF_MODER (PIN_MODE_ALTERNATE(GPIOF_FMC_A0) | \
1069 PIN_MODE_ALTERNATE(GPIOF_FMC_A1) | \
1070 PIN_MODE_ALTERNATE(GPIOF_FMC_A2) | \
1071 PIN_MODE_ALTERNATE(GPIOF_FMC_A3) | \
1072 PIN_MODE_ALTERNATE(GPIOF_FMC_A4) | \
1073 PIN_MODE_ALTERNATE(GPIOF_FMC_A5) | \
1074 PIN_MODE_INPUT(GPIOF_ARD_D3) | \
1075 PIN_MODE_INPUT(GPIOF_ARD_D6) | \
1076 PIN_MODE_INPUT(GPIOF_ARD_A4) | \
1077 PIN_MODE_INPUT(GPIOF_ARD_A5) | \
1078 PIN_MODE_INPUT(GPIOF_ARD_A3) | \
1079 PIN_MODE_ALTERNATE(GPIOF_FMC_SDNRAS) | \
1080 PIN_MODE_ALTERNATE(GPIOF_FMC_A6) | \
1081 PIN_MODE_ALTERNATE(GPIOF_FMC_A7) | \
1082 PIN_MODE_ALTERNATE(GPIOF_FMC_A8) | \
1083 PIN_MODE_ALTERNATE(GPIOF_FMC_A9))
1084#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_FMC_A0) | \
1085 PIN_OTYPE_PUSHPULL(GPIOF_FMC_A1) | \
1086 PIN_OTYPE_PUSHPULL(GPIOF_FMC_A2) | \
1087 PIN_OTYPE_PUSHPULL(GPIOF_FMC_A3) | \
1088 PIN_OTYPE_PUSHPULL(GPIOF_FMC_A4) | \
1089 PIN_OTYPE_PUSHPULL(GPIOF_FMC_A5) | \
1090 PIN_OTYPE_PUSHPULL(GPIOF_ARD_D3) | \
1091 PIN_OTYPE_PUSHPULL(GPIOF_ARD_D6) | \
1092 PIN_OTYPE_PUSHPULL(GPIOF_ARD_A4) | \
1093 PIN_OTYPE_PUSHPULL(GPIOF_ARD_A5) | \
1094 PIN_OTYPE_PUSHPULL(GPIOF_ARD_A3) | \
1095 PIN_OTYPE_PUSHPULL(GPIOF_FMC_SDNRAS) | \
1096 PIN_OTYPE_PUSHPULL(GPIOF_FMC_A6) | \
1097 PIN_OTYPE_PUSHPULL(GPIOF_FMC_A7) | \
1098 PIN_OTYPE_PUSHPULL(GPIOF_FMC_A8) | \
1099 PIN_OTYPE_PUSHPULL(GPIOF_FMC_A9))
1100#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_FMC_A0) | \
1101 PIN_OSPEED_HIGH(GPIOF_FMC_A1) | \
1102 PIN_OSPEED_HIGH(GPIOF_FMC_A2) | \
1103 PIN_OSPEED_HIGH(GPIOF_FMC_A3) | \
1104 PIN_OSPEED_HIGH(GPIOF_FMC_A4) | \
1105 PIN_OSPEED_HIGH(GPIOF_FMC_A5) | \
1106 PIN_OSPEED_VERYLOW(GPIOF_ARD_D3) | \
1107 PIN_OSPEED_VERYLOW(GPIOF_ARD_D6) | \
1108 PIN_OSPEED_VERYLOW(GPIOF_ARD_A4) | \
1109 PIN_OSPEED_VERYLOW(GPIOF_ARD_A5) | \
1110 PIN_OSPEED_VERYLOW(GPIOF_ARD_A3) | \
1111 PIN_OSPEED_HIGH(GPIOF_FMC_SDNRAS) | \
1112 PIN_OSPEED_HIGH(GPIOF_FMC_A6) | \
1113 PIN_OSPEED_HIGH(GPIOF_FMC_A7) | \
1114 PIN_OSPEED_HIGH(GPIOF_FMC_A8) | \
1115 PIN_OSPEED_HIGH(GPIOF_FMC_A9))
1116#define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_FMC_A0) | \
1117 PIN_PUPDR_FLOATING(GPIOF_FMC_A1) | \
1118 PIN_PUPDR_FLOATING(GPIOF_FMC_A2) | \
1119 PIN_PUPDR_FLOATING(GPIOF_FMC_A3) | \
1120 PIN_PUPDR_FLOATING(GPIOF_FMC_A4) | \
1121 PIN_PUPDR_FLOATING(GPIOF_FMC_A5) | \
1122 PIN_PUPDR_PULLUP(GPIOF_ARD_D3) | \
1123 PIN_PUPDR_PULLUP(GPIOF_ARD_D6) | \
1124 PIN_PUPDR_PULLUP(GPIOF_ARD_A4) | \
1125 PIN_PUPDR_PULLUP(GPIOF_ARD_A5) | \
1126 PIN_PUPDR_PULLUP(GPIOF_ARD_A3) | \
1127 PIN_PUPDR_FLOATING(GPIOF_FMC_SDNRAS) | \
1128 PIN_PUPDR_FLOATING(GPIOF_FMC_A6) | \
1129 PIN_PUPDR_FLOATING(GPIOF_FMC_A7) | \
1130 PIN_PUPDR_FLOATING(GPIOF_FMC_A8) | \
1131 PIN_PUPDR_FLOATING(GPIOF_FMC_A9))
1132#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_FMC_A0) | \
1133 PIN_ODR_HIGH(GPIOF_FMC_A1) | \
1134 PIN_ODR_HIGH(GPIOF_FMC_A2) | \
1135 PIN_ODR_HIGH(GPIOF_FMC_A3) | \
1136 PIN_ODR_HIGH(GPIOF_FMC_A4) | \
1137 PIN_ODR_HIGH(GPIOF_FMC_A5) | \
1138 PIN_ODR_HIGH(GPIOF_ARD_D3) | \
1139 PIN_ODR_HIGH(GPIOF_ARD_D6) | \
1140 PIN_ODR_HIGH(GPIOF_ARD_A4) | \
1141 PIN_ODR_HIGH(GPIOF_ARD_A5) | \
1142 PIN_ODR_HIGH(GPIOF_ARD_A3) | \
1143 PIN_ODR_HIGH(GPIOF_FMC_SDNRAS) | \
1144 PIN_ODR_HIGH(GPIOF_FMC_A6) | \
1145 PIN_ODR_HIGH(GPIOF_FMC_A7) | \
1146 PIN_ODR_HIGH(GPIOF_FMC_A8) | \
1147 PIN_ODR_HIGH(GPIOF_FMC_A9))
1148#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_FMC_A0, 12U) | \
1149 PIN_AFIO_AF(GPIOF_FMC_A1, 12U) | \
1150 PIN_AFIO_AF(GPIOF_FMC_A2, 12U) | \
1151 PIN_AFIO_AF(GPIOF_FMC_A3, 12U) | \
1152 PIN_AFIO_AF(GPIOF_FMC_A4, 12U) | \
1153 PIN_AFIO_AF(GPIOF_FMC_A5, 12U) | \
1154 PIN_AFIO_AF(GPIOF_ARD_D3, 0U) | \
1155 PIN_AFIO_AF(GPIOF_ARD_D6, 0U))
1156#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_ARD_A4, 0U) | \
1157 PIN_AFIO_AF(GPIOF_ARD_A5, 0U) | \
1158 PIN_AFIO_AF(GPIOF_ARD_A3, 0U) | \
1159 PIN_AFIO_AF(GPIOF_FMC_SDNRAS, 12U) | \
1160 PIN_AFIO_AF(GPIOF_FMC_A6, 12U) | \
1161 PIN_AFIO_AF(GPIOF_FMC_A7, 12U) | \
1162 PIN_AFIO_AF(GPIOF_FMC_A8, 12U) | \
1163 PIN_AFIO_AF(GPIOF_FMC_A9, 12U))
1164
1165/*
1166 * GPIOG setup:
1167 *
1168 * PG0 - FMC_A10 (alternate 12).
1169 * PG1 - FMC_A11 (alternate 12).
1170 * PG2 - FMC_A12 (alternate 12).
1171 * PG3 - EXT_SCL (input pullup).
1172 * PG4 - FMC_BA0 (alternate 12).
1173 * PG5 - FMC_BA1 (alternate 12).
1174 * PG6 - EXT_SDA (input pullup).
1175 * PG7 - SAI1_MCLKA (alternate 6).
1176 * PG8 - FMC_SDCLK (alternate 12).
1177 * PG9 - SD_D0 (alternate 11).
1178 * PG10 - SD_D1 (alternate 11).
1179 * PG11 - RMII_TX_EN (alternate 11).
1180 * PG12 - SPDIF_RX (alternate 7).
1181 * PG13 - RMII_TXD0 (alternate 11).
1182 * PG14 - RMII_TXD1 (alternate 11).
1183 * PG15 - FMC_SDNCAS (alternate 12).
1184 */
1185#define VAL_GPIOG_MODER (PIN_MODE_ALTERNATE(GPIOG_FMC_A10) | \
1186 PIN_MODE_ALTERNATE(GPIOG_FMC_A11) | \
1187 PIN_MODE_ALTERNATE(GPIOG_FMC_A12) | \
1188 PIN_MODE_INPUT(GPIOG_EXT_SCL) | \
1189 PIN_MODE_ALTERNATE(GPIOG_FMC_BA0) | \
1190 PIN_MODE_ALTERNATE(GPIOG_FMC_BA1) | \
1191 PIN_MODE_INPUT(GPIOG_EXT_SDA) | \
1192 PIN_MODE_ALTERNATE(GPIOG_SAI1_MCLKA) | \
1193 PIN_MODE_ALTERNATE(GPIOG_FMC_SDCLK) | \
1194 PIN_MODE_ALTERNATE(GPIOG_SD_D0) | \
1195 PIN_MODE_ALTERNATE(GPIOG_SD_D1) | \
1196 PIN_MODE_ALTERNATE(GPIOG_RMII_TX_EN) | \
1197 PIN_MODE_ALTERNATE(GPIOG_SPDIF_RX) | \
1198 PIN_MODE_ALTERNATE(GPIOG_RMII_TXD0) | \
1199 PIN_MODE_ALTERNATE(GPIOG_RMII_TXD1) | \
1200 PIN_MODE_ALTERNATE(GPIOG_FMC_SDNCAS))
1201#define VAL_GPIOG_OTYPER (PIN_OTYPE_PUSHPULL(GPIOG_FMC_A10) | \
1202 PIN_OTYPE_PUSHPULL(GPIOG_FMC_A11) | \
1203 PIN_OTYPE_PUSHPULL(GPIOG_FMC_A12) | \
1204 PIN_OTYPE_PUSHPULL(GPIOG_EXT_SCL) | \
1205 PIN_OTYPE_PUSHPULL(GPIOG_FMC_BA0) | \
1206 PIN_OTYPE_PUSHPULL(GPIOG_FMC_BA1) | \
1207 PIN_OTYPE_PUSHPULL(GPIOG_EXT_SDA) | \
1208 PIN_OTYPE_PUSHPULL(GPIOG_SAI1_MCLKA) | \
1209 PIN_OTYPE_PUSHPULL(GPIOG_FMC_SDCLK) | \
1210 PIN_OTYPE_PUSHPULL(GPIOG_SD_D0) | \
1211 PIN_OTYPE_PUSHPULL(GPIOG_SD_D1) | \
1212 PIN_OTYPE_PUSHPULL(GPIOG_RMII_TX_EN) | \
1213 PIN_OTYPE_PUSHPULL(GPIOG_SPDIF_RX) | \
1214 PIN_OTYPE_PUSHPULL(GPIOG_RMII_TXD0) | \
1215 PIN_OTYPE_PUSHPULL(GPIOG_RMII_TXD1) | \
1216 PIN_OTYPE_PUSHPULL(GPIOG_FMC_SDNCAS))
1217#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_HIGH(GPIOG_FMC_A10) | \
1218 PIN_OSPEED_HIGH(GPIOG_FMC_A11) | \
1219 PIN_OSPEED_HIGH(GPIOG_FMC_A12) | \
1220 PIN_OSPEED_HIGH(GPIOG_EXT_SCL) | \
1221 PIN_OSPEED_HIGH(GPIOG_FMC_BA0) | \
1222 PIN_OSPEED_HIGH(GPIOG_FMC_BA1) | \
1223 PIN_OSPEED_HIGH(GPIOG_EXT_SDA) | \
1224 PIN_OSPEED_HIGH(GPIOG_SAI1_MCLKA) | \
1225 PIN_OSPEED_HIGH(GPIOG_FMC_SDCLK) | \
1226 PIN_OSPEED_HIGH(GPIOG_SD_D0) | \
1227 PIN_OSPEED_HIGH(GPIOG_SD_D1) | \
1228 PIN_OSPEED_HIGH(GPIOG_RMII_TX_EN) | \
1229 PIN_OSPEED_HIGH(GPIOG_SPDIF_RX) | \
1230 PIN_OSPEED_HIGH(GPIOG_RMII_TXD0) | \
1231 PIN_OSPEED_HIGH(GPIOG_RMII_TXD1) | \
1232 PIN_OSPEED_HIGH(GPIOG_FMC_SDNCAS))
1233#define VAL_GPIOG_PUPDR (PIN_PUPDR_FLOATING(GPIOG_FMC_A10) | \
1234 PIN_PUPDR_FLOATING(GPIOG_FMC_A11) | \
1235 PIN_PUPDR_FLOATING(GPIOG_FMC_A12) | \
1236 PIN_PUPDR_PULLUP(GPIOG_EXT_SCL) | \
1237 PIN_PUPDR_FLOATING(GPIOG_FMC_BA0) | \
1238 PIN_PUPDR_FLOATING(GPIOG_FMC_BA1) | \
1239 PIN_PUPDR_PULLUP(GPIOG_EXT_SDA) | \
1240 PIN_PUPDR_PULLUP(GPIOG_SAI1_MCLKA) | \
1241 PIN_PUPDR_FLOATING(GPIOG_FMC_SDCLK) | \
1242 PIN_PUPDR_FLOATING(GPIOG_SD_D0) | \
1243 PIN_PUPDR_FLOATING(GPIOG_SD_D1) | \
1244 PIN_PUPDR_FLOATING(GPIOG_RMII_TX_EN) | \
1245 PIN_PUPDR_FLOATING(GPIOG_SPDIF_RX) | \
1246 PIN_PUPDR_FLOATING(GPIOG_RMII_TXD0) | \
1247 PIN_PUPDR_FLOATING(GPIOG_RMII_TXD1) | \
1248 PIN_PUPDR_FLOATING(GPIOG_FMC_SDNCAS))
1249#define VAL_GPIOG_ODR (PIN_ODR_HIGH(GPIOG_FMC_A10) | \
1250 PIN_ODR_HIGH(GPIOG_FMC_A11) | \
1251 PIN_ODR_HIGH(GPIOG_FMC_A12) | \
1252 PIN_ODR_HIGH(GPIOG_EXT_SCL) | \
1253 PIN_ODR_HIGH(GPIOG_FMC_BA0) | \
1254 PIN_ODR_HIGH(GPIOG_FMC_BA1) | \
1255 PIN_ODR_HIGH(GPIOG_EXT_SDA) | \
1256 PIN_ODR_HIGH(GPIOG_SAI1_MCLKA) | \
1257 PIN_ODR_HIGH(GPIOG_FMC_SDCLK) | \
1258 PIN_ODR_HIGH(GPIOG_SD_D0) | \
1259 PIN_ODR_HIGH(GPIOG_SD_D1) | \
1260 PIN_ODR_HIGH(GPIOG_RMII_TX_EN) | \
1261 PIN_ODR_HIGH(GPIOG_SPDIF_RX) | \
1262 PIN_ODR_HIGH(GPIOG_RMII_TXD0) | \
1263 PIN_ODR_HIGH(GPIOG_RMII_TXD1) | \
1264 PIN_ODR_HIGH(GPIOG_FMC_SDNCAS))
1265#define VAL_GPIOG_AFRL (PIN_AFIO_AF(GPIOG_FMC_A10, 12U) | \
1266 PIN_AFIO_AF(GPIOG_FMC_A11, 12U) | \
1267 PIN_AFIO_AF(GPIOG_FMC_A12, 12U) | \
1268 PIN_AFIO_AF(GPIOG_EXT_SCL, 0U) | \
1269 PIN_AFIO_AF(GPIOG_FMC_BA0, 12U) | \
1270 PIN_AFIO_AF(GPIOG_FMC_BA1, 12U) | \
1271 PIN_AFIO_AF(GPIOG_EXT_SDA, 0U) | \
1272 PIN_AFIO_AF(GPIOG_SAI1_MCLKA, 6U))
1273#define VAL_GPIOG_AFRH (PIN_AFIO_AF(GPIOG_FMC_SDCLK, 12U) | \
1274 PIN_AFIO_AF(GPIOG_SD_D0, 11U) | \
1275 PIN_AFIO_AF(GPIOG_SD_D1, 11U) | \
1276 PIN_AFIO_AF(GPIOG_RMII_TX_EN, 11U) | \
1277 PIN_AFIO_AF(GPIOG_SPDIF_RX, 7U) | \
1278 PIN_AFIO_AF(GPIOG_RMII_TXD0, 11U) | \
1279 PIN_AFIO_AF(GPIOG_RMII_TXD1, 11U) | \
1280 PIN_AFIO_AF(GPIOG_FMC_SDNCAS, 12U))
1281
1282/*
1283 * GPIOH setup:
1284 *
1285 * PH0 - OSC_IN (input floating).
1286 * PH1 - OSC_OUT (input floating).
1287 * PH2 - FMC_SDCKE0 (alternate 12).
1288 * PH3 - FMC_SDNE0 (alternate 12).
1289 * PH4 - ULPI_NXT (alternate 10).
1290 * PH5 - FMC_SDNWE (alternate 12).
1291 * PH6 - ARD_D9 (input pullup).
1292 * PH7 - EXT_RST (input floating).
1293 * PH8 - FMC_D16 (alternate 12).
1294 * PH9 - FMC_D17 (alternate 12).
1295 * PH10 - FMC_D18 (alternate 12).
1296 * PH11 - FMC_D19 (alternate 12).
1297 * PH12 - FMC_D20 (alternate 12).
1298 * PH13 - FMC_D21 (alternate 12).
1299 * PH14 - FMC_D22 (alternate 12).
1300 * PH15 - FMC_D23 (alternate 12).
1301 */
1302#define VAL_GPIOH_MODER (PIN_MODE_INPUT(GPIOH_OSC_IN) | \
1303 PIN_MODE_INPUT(GPIOH_OSC_OUT) | \
1304 PIN_MODE_ALTERNATE(GPIOH_FMC_SDCKE0) | \
1305 PIN_MODE_ALTERNATE(GPIOH_FMC_SDNE0) | \
1306 PIN_MODE_ALTERNATE(GPIOH_ULPI_NXT) | \
1307 PIN_MODE_ALTERNATE(GPIOH_FMC_SDNWE) | \
1308 PIN_MODE_INPUT(GPIOH_ARD_D9) | \
1309 PIN_MODE_INPUT(GPIOH_EXT_RST) | \
1310 PIN_MODE_ALTERNATE(GPIOH_FMC_D16) | \
1311 PIN_MODE_ALTERNATE(GPIOH_FMC_D17) | \
1312 PIN_MODE_ALTERNATE(GPIOH_FMC_D18) | \
1313 PIN_MODE_ALTERNATE(GPIOH_FMC_D19) | \
1314 PIN_MODE_ALTERNATE(GPIOH_FMC_D20) | \
1315 PIN_MODE_ALTERNATE(GPIOH_FMC_D21) | \
1316 PIN_MODE_ALTERNATE(GPIOH_FMC_D22) | \
1317 PIN_MODE_ALTERNATE(GPIOH_FMC_D23))
1318#define VAL_GPIOH_OTYPER (PIN_OTYPE_PUSHPULL(GPIOH_OSC_IN) | \
1319 PIN_OTYPE_PUSHPULL(GPIOH_OSC_OUT) | \
1320 PIN_OTYPE_PUSHPULL(GPIOH_FMC_SDCKE0) | \
1321 PIN_OTYPE_PUSHPULL(GPIOH_FMC_SDNE0) | \
1322 PIN_OTYPE_PUSHPULL(GPIOH_ULPI_NXT) | \
1323 PIN_OTYPE_PUSHPULL(GPIOH_FMC_SDNWE) | \
1324 PIN_OTYPE_PUSHPULL(GPIOH_ARD_D9) | \
1325 PIN_OTYPE_OPENDRAIN(GPIOH_EXT_RST) | \
1326 PIN_OTYPE_PUSHPULL(GPIOH_FMC_D16) | \
1327 PIN_OTYPE_PUSHPULL(GPIOH_FMC_D17) | \
1328 PIN_OTYPE_PUSHPULL(GPIOH_FMC_D18) | \
1329 PIN_OTYPE_PUSHPULL(GPIOH_FMC_D19) | \
1330 PIN_OTYPE_PUSHPULL(GPIOH_FMC_D20) | \
1331 PIN_OTYPE_PUSHPULL(GPIOH_FMC_D21) | \
1332 PIN_OTYPE_PUSHPULL(GPIOH_FMC_D22) | \
1333 PIN_OTYPE_PUSHPULL(GPIOH_FMC_D23))
1334#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_HIGH(GPIOH_OSC_IN) | \
1335 PIN_OSPEED_HIGH(GPIOH_OSC_OUT) | \
1336 PIN_OSPEED_HIGH(GPIOH_FMC_SDCKE0) | \
1337 PIN_OSPEED_HIGH(GPIOH_FMC_SDNE0) | \
1338 PIN_OSPEED_HIGH(GPIOH_ULPI_NXT) | \
1339 PIN_OSPEED_HIGH(GPIOH_FMC_SDNWE) | \
1340 PIN_OSPEED_VERYLOW(GPIOH_ARD_D9) | \
1341 PIN_OSPEED_HIGH(GPIOH_EXT_RST) | \
1342 PIN_OSPEED_HIGH(GPIOH_FMC_D16) | \
1343 PIN_OSPEED_HIGH(GPIOH_FMC_D17) | \
1344 PIN_OSPEED_HIGH(GPIOH_FMC_D18) | \
1345 PIN_OSPEED_HIGH(GPIOH_FMC_D19) | \
1346 PIN_OSPEED_HIGH(GPIOH_FMC_D20) | \
1347 PIN_OSPEED_HIGH(GPIOH_FMC_D21) | \
1348 PIN_OSPEED_HIGH(GPIOH_FMC_D22) | \
1349 PIN_OSPEED_HIGH(GPIOH_FMC_D23))
1350#define VAL_GPIOH_PUPDR (PIN_PUPDR_FLOATING(GPIOH_OSC_IN) | \
1351 PIN_PUPDR_FLOATING(GPIOH_OSC_OUT) | \
1352 PIN_PUPDR_FLOATING(GPIOH_FMC_SDCKE0) | \
1353 PIN_PUPDR_FLOATING(GPIOH_FMC_SDNE0) | \
1354 PIN_PUPDR_FLOATING(GPIOH_ULPI_NXT) | \
1355 PIN_PUPDR_FLOATING(GPIOH_FMC_SDNWE) | \
1356 PIN_PUPDR_PULLUP(GPIOH_ARD_D9) | \
1357 PIN_PUPDR_FLOATING(GPIOH_EXT_RST) | \
1358 PIN_PUPDR_FLOATING(GPIOH_FMC_D16) | \
1359 PIN_PUPDR_FLOATING(GPIOH_FMC_D17) | \
1360 PIN_PUPDR_FLOATING(GPIOH_FMC_D18) | \
1361 PIN_PUPDR_FLOATING(GPIOH_FMC_D19) | \
1362 PIN_PUPDR_FLOATING(GPIOH_FMC_D20) | \
1363 PIN_PUPDR_FLOATING(GPIOH_FMC_D21) | \
1364 PIN_PUPDR_FLOATING(GPIOH_FMC_D22) | \
1365 PIN_PUPDR_FLOATING(GPIOH_FMC_D23))
1366#define VAL_GPIOH_ODR (PIN_ODR_HIGH(GPIOH_OSC_IN) | \
1367 PIN_ODR_HIGH(GPIOH_OSC_OUT) | \
1368 PIN_ODR_HIGH(GPIOH_FMC_SDCKE0) | \
1369 PIN_ODR_HIGH(GPIOH_FMC_SDNE0) | \
1370 PIN_ODR_HIGH(GPIOH_ULPI_NXT) | \
1371 PIN_ODR_HIGH(GPIOH_FMC_SDNWE) | \
1372 PIN_ODR_HIGH(GPIOH_ARD_D9) | \
1373 PIN_ODR_HIGH(GPIOH_EXT_RST) | \
1374 PIN_ODR_HIGH(GPIOH_FMC_D16) | \
1375 PIN_ODR_HIGH(GPIOH_FMC_D17) | \
1376 PIN_ODR_HIGH(GPIOH_FMC_D18) | \
1377 PIN_ODR_HIGH(GPIOH_FMC_D19) | \
1378 PIN_ODR_HIGH(GPIOH_FMC_D20) | \
1379 PIN_ODR_HIGH(GPIOH_FMC_D21) | \
1380 PIN_ODR_HIGH(GPIOH_FMC_D22) | \
1381 PIN_ODR_HIGH(GPIOH_FMC_D23))
1382#define VAL_GPIOH_AFRL (PIN_AFIO_AF(GPIOH_OSC_IN, 0U) | \
1383 PIN_AFIO_AF(GPIOH_OSC_OUT, 0U) | \
1384 PIN_AFIO_AF(GPIOH_FMC_SDCKE0, 12U) | \
1385 PIN_AFIO_AF(GPIOH_FMC_SDNE0, 12U) | \
1386 PIN_AFIO_AF(GPIOH_ULPI_NXT, 10U) | \
1387 PIN_AFIO_AF(GPIOH_FMC_SDNWE, 12U) | \
1388 PIN_AFIO_AF(GPIOH_ARD_D9, 0U) | \
1389 PIN_AFIO_AF(GPIOH_EXT_RST, 0U))
1390#define VAL_GPIOH_AFRH (PIN_AFIO_AF(GPIOH_FMC_D16, 12U) | \
1391 PIN_AFIO_AF(GPIOH_FMC_D17, 12U) | \
1392 PIN_AFIO_AF(GPIOH_FMC_D18, 12U) | \
1393 PIN_AFIO_AF(GPIOH_FMC_D19, 12U) | \
1394 PIN_AFIO_AF(GPIOH_FMC_D20, 12U) | \
1395 PIN_AFIO_AF(GPIOH_FMC_D21, 12U) | \
1396 PIN_AFIO_AF(GPIOH_FMC_D22, 12U) | \
1397 PIN_AFIO_AF(GPIOH_FMC_D23, 12U))
1398
1399/*
1400 * GPIOI setup:
1401 *
1402 * PI0 - FMC_D24 (alternate 12).
1403 * PI1 - FMC_D25 (alternate 12).
1404 * PI2 - FMC_D26 (alternate 12).
1405 * PI3 - FMC_D27 (alternate 12).
1406 * PI4 - FMC_NBL2 (alternate 12).
1407 * PI5 - FMC_NBL3 (alternate 12).
1408 * PI6 - FMC_D28 (alternate 12).
1409 * PI7 - FMC_D29 (alternate 12).
1410 * PI8 - PIN8 (input pullup).
1411 * PI9 - FMC_D30 (alternate 12).
1412 * PI10 - FMC_D31 (alternate 12).
1413 * PI11 - ULPI_DIR (alternate 10).
1414 * PI12 - PIN12 (input pullup).
1415 * PI13 - LCD_INT (alternate 14).
1416 * PI14 - LCD_BL_CTRL (alternate 14).
1417 * PI15 - SD_DETECT (input pullup).
1418 */
1419#define VAL_GPIOI_MODER (PIN_MODE_ALTERNATE(GPIOI_FMC_D24) | \
1420 PIN_MODE_ALTERNATE(GPIOI_FMC_D25) | \
1421 PIN_MODE_ALTERNATE(GPIOI_FMC_D26) | \
1422 PIN_MODE_ALTERNATE(GPIOI_FMC_D27) | \
1423 PIN_MODE_ALTERNATE(GPIOI_FMC_NBL2) | \
1424 PIN_MODE_ALTERNATE(GPIOI_FMC_NBL3) | \
1425 PIN_MODE_ALTERNATE(GPIOI_FMC_D28) | \
1426 PIN_MODE_ALTERNATE(GPIOI_FMC_D29) | \
1427 PIN_MODE_INPUT(GPIOI_PIN8) | \
1428 PIN_MODE_ALTERNATE(GPIOI_FMC_D30) | \
1429 PIN_MODE_ALTERNATE(GPIOI_FMC_D31) | \
1430 PIN_MODE_ALTERNATE(GPIOI_ULPI_DIR) | \
1431 PIN_MODE_INPUT(GPIOI_PIN12) | \
1432 PIN_MODE_ALTERNATE(GPIOI_LCD_INT) | \
1433 PIN_MODE_ALTERNATE(GPIOI_LCD_BL_CTRL) |\
1434 PIN_MODE_INPUT(GPIOI_SD_DETECT))
1435#define VAL_GPIOI_OTYPER (PIN_OTYPE_PUSHPULL(GPIOI_FMC_D24) | \
1436 PIN_OTYPE_PUSHPULL(GPIOI_FMC_D25) | \
1437 PIN_OTYPE_PUSHPULL(GPIOI_FMC_D26) | \
1438 PIN_OTYPE_PUSHPULL(GPIOI_FMC_D27) | \
1439 PIN_OTYPE_PUSHPULL(GPIOI_FMC_NBL2) | \
1440 PIN_OTYPE_PUSHPULL(GPIOI_FMC_NBL3) | \
1441 PIN_OTYPE_PUSHPULL(GPIOI_FMC_D28) | \
1442 PIN_OTYPE_PUSHPULL(GPIOI_FMC_D29) | \
1443 PIN_OTYPE_PUSHPULL(GPIOI_PIN8) | \
1444 PIN_OTYPE_PUSHPULL(GPIOI_FMC_D30) | \
1445 PIN_OTYPE_PUSHPULL(GPIOI_FMC_D31) | \
1446 PIN_OTYPE_PUSHPULL(GPIOI_ULPI_DIR) | \
1447 PIN_OTYPE_PUSHPULL(GPIOI_PIN12) | \
1448 PIN_OTYPE_PUSHPULL(GPIOI_LCD_INT) | \
1449 PIN_OTYPE_PUSHPULL(GPIOI_LCD_BL_CTRL) |\
1450 PIN_OTYPE_PUSHPULL(GPIOI_SD_DETECT))
1451#define VAL_GPIOI_OSPEEDR (PIN_OSPEED_HIGH(GPIOI_FMC_D24) | \
1452 PIN_OSPEED_HIGH(GPIOI_FMC_D25) | \
1453 PIN_OSPEED_HIGH(GPIOI_FMC_D26) | \
1454 PIN_OSPEED_HIGH(GPIOI_FMC_D27) | \
1455 PIN_OSPEED_HIGH(GPIOI_FMC_NBL2) | \
1456 PIN_OSPEED_HIGH(GPIOI_FMC_NBL3) | \
1457 PIN_OSPEED_HIGH(GPIOI_FMC_D28) | \
1458 PIN_OSPEED_HIGH(GPIOI_FMC_D29) | \
1459 PIN_OSPEED_HIGH(GPIOI_PIN8) | \
1460 PIN_OSPEED_HIGH(GPIOI_FMC_D30) | \
1461 PIN_OSPEED_HIGH(GPIOI_FMC_D31) | \
1462 PIN_OSPEED_HIGH(GPIOI_ULPI_DIR) | \
1463 PIN_OSPEED_HIGH(GPIOI_PIN12) | \
1464 PIN_OSPEED_HIGH(GPIOI_LCD_INT) | \
1465 PIN_OSPEED_HIGH(GPIOI_LCD_BL_CTRL) | \
1466 PIN_OSPEED_HIGH(GPIOI_SD_DETECT))
1467#define VAL_GPIOI_PUPDR (PIN_PUPDR_FLOATING(GPIOI_FMC_D24) | \
1468 PIN_PUPDR_FLOATING(GPIOI_FMC_D25) | \
1469 PIN_PUPDR_FLOATING(GPIOI_FMC_D26) | \
1470 PIN_PUPDR_FLOATING(GPIOI_FMC_D27) | \
1471 PIN_PUPDR_FLOATING(GPIOI_FMC_NBL2) | \
1472 PIN_PUPDR_FLOATING(GPIOI_FMC_NBL3) | \
1473 PIN_PUPDR_FLOATING(GPIOI_FMC_D28) | \
1474 PIN_PUPDR_FLOATING(GPIOI_FMC_D29) | \
1475 PIN_PUPDR_PULLUP(GPIOI_PIN8) | \
1476 PIN_PUPDR_FLOATING(GPIOI_FMC_D30) | \
1477 PIN_PUPDR_FLOATING(GPIOI_FMC_D31) | \
1478 PIN_PUPDR_FLOATING(GPIOI_ULPI_DIR) | \
1479 PIN_PUPDR_PULLUP(GPIOI_PIN12) | \
1480 PIN_PUPDR_FLOATING(GPIOI_LCD_INT) | \
1481 PIN_PUPDR_FLOATING(GPIOI_LCD_BL_CTRL) |\
1482 PIN_PUPDR_PULLUP(GPIOI_SD_DETECT))
1483#define VAL_GPIOI_ODR (PIN_ODR_HIGH(GPIOI_FMC_D24) | \
1484 PIN_ODR_HIGH(GPIOI_FMC_D25) | \
1485 PIN_ODR_HIGH(GPIOI_FMC_D26) | \
1486 PIN_ODR_HIGH(GPIOI_FMC_D27) | \
1487 PIN_ODR_HIGH(GPIOI_FMC_NBL2) | \
1488 PIN_ODR_HIGH(GPIOI_FMC_NBL3) | \
1489 PIN_ODR_HIGH(GPIOI_FMC_D28) | \
1490 PIN_ODR_HIGH(GPIOI_FMC_D29) | \
1491 PIN_ODR_HIGH(GPIOI_PIN8) | \
1492 PIN_ODR_HIGH(GPIOI_FMC_D30) | \
1493 PIN_ODR_HIGH(GPIOI_FMC_D31) | \
1494 PIN_ODR_HIGH(GPIOI_ULPI_DIR) | \
1495 PIN_ODR_HIGH(GPIOI_PIN12) | \
1496 PIN_ODR_HIGH(GPIOI_LCD_INT) | \
1497 PIN_ODR_HIGH(GPIOI_LCD_BL_CTRL) | \
1498 PIN_ODR_HIGH(GPIOI_SD_DETECT))
1499#define VAL_GPIOI_AFRL (PIN_AFIO_AF(GPIOI_FMC_D24, 12U) | \
1500 PIN_AFIO_AF(GPIOI_FMC_D25, 12U) | \
1501 PIN_AFIO_AF(GPIOI_FMC_D26, 12U) | \
1502 PIN_AFIO_AF(GPIOI_FMC_D27, 12U) | \
1503 PIN_AFIO_AF(GPIOI_FMC_NBL2, 12U) | \
1504 PIN_AFIO_AF(GPIOI_FMC_NBL3, 12U) | \
1505 PIN_AFIO_AF(GPIOI_FMC_D28, 12U) | \
1506 PIN_AFIO_AF(GPIOI_FMC_D29, 12U))
1507#define VAL_GPIOI_AFRH (PIN_AFIO_AF(GPIOI_PIN8, 0U) | \
1508 PIN_AFIO_AF(GPIOI_FMC_D30, 12U) | \
1509 PIN_AFIO_AF(GPIOI_FMC_D31, 12U) | \
1510 PIN_AFIO_AF(GPIOI_ULPI_DIR, 10U) | \
1511 PIN_AFIO_AF(GPIOI_PIN12, 0U) | \
1512 PIN_AFIO_AF(GPIOI_LCD_INT, 14U) | \
1513 PIN_AFIO_AF(GPIOI_LCD_BL_CTRL, 14U) | \
1514 PIN_AFIO_AF(GPIOI_SD_DETECT, 0U))
1515
1516/*
1517 * GPIOJ setup:
1518 *
1519 * PJ0 - ARD_D4 (input floating).
1520 * PJ1 - ARD_D2 (input floating).
1521 * PJ2 - DSI_TE (alternate 13).
1522 * PJ3 - ARD_D7 (input floating).
1523 * PJ4 - ARD_D8 (input floating).
1524 * PJ5 - LED2_GREEN (output pushpull maximum).
1525 * PJ6 - PIN6 (input floating).
1526 * PJ7 - PIN7 (input floating).
1527 * PJ8 - PIN8 (input floating).
1528 * PJ9 - PIN9 (input floating).
1529 * PJ10 - PIN10 (input floating).
1530 * PJ11 - PIN11 (input floating).
1531 * PJ12 - AUDIO_INT (input floating).
1532 * PJ13 - LED1_RED (output pushpull maximum).
1533 * PJ14 - WIFI_RST (input floating).
1534 * PJ15 - DSI_RESET (input floating).
1535 */
1536#define VAL_GPIOJ_MODER (PIN_MODE_INPUT(GPIOJ_ARD_D4) | \
1537 PIN_MODE_INPUT(GPIOJ_ARD_D2) | \
1538 PIN_MODE_ALTERNATE(GPIOJ_DSI_TE) | \
1539 PIN_MODE_INPUT(GPIOJ_ARD_D7) | \
1540 PIN_MODE_INPUT(GPIOJ_ARD_D8) | \
1541 PIN_MODE_OUTPUT(GPIOJ_LED2_GREEN) | \
1542 PIN_MODE_INPUT(GPIOJ_PIN6) | \
1543 PIN_MODE_INPUT(GPIOJ_PIN7) | \
1544 PIN_MODE_INPUT(GPIOJ_PIN8) | \
1545 PIN_MODE_INPUT(GPIOJ_PIN9) | \
1546 PIN_MODE_INPUT(GPIOJ_PIN10) | \
1547 PIN_MODE_INPUT(GPIOJ_PIN11) | \
1548 PIN_MODE_INPUT(GPIOJ_AUDIO_INT) | \
1549 PIN_MODE_OUTPUT(GPIOJ_LED1_RED) | \
1550 PIN_MODE_INPUT(GPIOJ_WIFI_RST) | \
1551 PIN_MODE_INPUT(GPIOJ_DSI_RESET))
1552#define VAL_GPIOJ_OTYPER (PIN_OTYPE_PUSHPULL(GPIOJ_ARD_D4) | \
1553 PIN_OTYPE_PUSHPULL(GPIOJ_ARD_D2) | \
1554 PIN_OTYPE_PUSHPULL(GPIOJ_DSI_TE) | \
1555 PIN_OTYPE_PUSHPULL(GPIOJ_ARD_D7) | \
1556 PIN_OTYPE_PUSHPULL(GPIOJ_ARD_D8) | \
1557 PIN_OTYPE_PUSHPULL(GPIOJ_LED2_GREEN) | \
1558 PIN_OTYPE_PUSHPULL(GPIOJ_PIN6) | \
1559 PIN_OTYPE_PUSHPULL(GPIOJ_PIN7) | \
1560 PIN_OTYPE_PUSHPULL(GPIOJ_PIN8) | \
1561 PIN_OTYPE_PUSHPULL(GPIOJ_PIN9) | \
1562 PIN_OTYPE_PUSHPULL(GPIOJ_PIN10) | \
1563 PIN_OTYPE_PUSHPULL(GPIOJ_PIN11) | \
1564 PIN_OTYPE_PUSHPULL(GPIOJ_AUDIO_INT) | \
1565 PIN_OTYPE_PUSHPULL(GPIOJ_LED1_RED) | \
1566 PIN_OTYPE_PUSHPULL(GPIOJ_WIFI_RST) | \
1567 PIN_OTYPE_PUSHPULL(GPIOJ_DSI_RESET))
1568#define VAL_GPIOJ_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOJ_ARD_D4) | \
1569 PIN_OSPEED_VERYLOW(GPIOJ_ARD_D2) | \
1570 PIN_OSPEED_HIGH(GPIOJ_DSI_TE) | \
1571 PIN_OSPEED_VERYLOW(GPIOJ_ARD_D7) | \
1572 PIN_OSPEED_VERYLOW(GPIOJ_ARD_D8) | \
1573 PIN_OSPEED_HIGH(GPIOJ_LED2_GREEN) | \
1574 PIN_OSPEED_VERYLOW(GPIOJ_PIN6) | \
1575 PIN_OSPEED_VERYLOW(GPIOJ_PIN7) | \
1576 PIN_OSPEED_VERYLOW(GPIOJ_PIN8) | \
1577 PIN_OSPEED_VERYLOW(GPIOJ_PIN9) | \
1578 PIN_OSPEED_VERYLOW(GPIOJ_PIN10) | \
1579 PIN_OSPEED_VERYLOW(GPIOJ_PIN11) | \
1580 PIN_OSPEED_VERYLOW(GPIOJ_AUDIO_INT) | \
1581 PIN_OSPEED_HIGH(GPIOJ_LED1_RED) | \
1582 PIN_OSPEED_VERYLOW(GPIOJ_WIFI_RST) | \
1583 PIN_OSPEED_VERYLOW(GPIOJ_DSI_RESET))
1584#define VAL_GPIOJ_PUPDR (PIN_PUPDR_FLOATING(GPIOJ_ARD_D4) | \
1585 PIN_PUPDR_FLOATING(GPIOJ_ARD_D2) | \
1586 PIN_PUPDR_FLOATING(GPIOJ_DSI_TE) | \
1587 PIN_PUPDR_FLOATING(GPIOJ_ARD_D7) | \
1588 PIN_PUPDR_FLOATING(GPIOJ_ARD_D8) | \
1589 PIN_PUPDR_FLOATING(GPIOJ_LED2_GREEN) | \
1590 PIN_PUPDR_FLOATING(GPIOJ_PIN6) | \
1591 PIN_PUPDR_FLOATING(GPIOJ_PIN7) | \
1592 PIN_PUPDR_FLOATING(GPIOJ_PIN8) | \
1593 PIN_PUPDR_FLOATING(GPIOJ_PIN9) | \
1594 PIN_PUPDR_FLOATING(GPIOJ_PIN10) | \
1595 PIN_PUPDR_FLOATING(GPIOJ_PIN11) | \
1596 PIN_PUPDR_FLOATING(GPIOJ_AUDIO_INT) | \
1597 PIN_PUPDR_FLOATING(GPIOJ_LED1_RED) | \
1598 PIN_PUPDR_FLOATING(GPIOJ_WIFI_RST) | \
1599 PIN_PUPDR_FLOATING(GPIOJ_DSI_RESET))
1600#define VAL_GPIOJ_ODR (PIN_ODR_HIGH(GPIOJ_ARD_D4) | \
1601 PIN_ODR_HIGH(GPIOJ_ARD_D2) | \
1602 PIN_ODR_HIGH(GPIOJ_DSI_TE) | \
1603 PIN_ODR_HIGH(GPIOJ_ARD_D7) | \
1604 PIN_ODR_HIGH(GPIOJ_ARD_D8) | \
1605 PIN_ODR_LOW(GPIOJ_LED2_GREEN) | \
1606 PIN_ODR_HIGH(GPIOJ_PIN6) | \
1607 PIN_ODR_HIGH(GPIOJ_PIN7) | \
1608 PIN_ODR_HIGH(GPIOJ_PIN8) | \
1609 PIN_ODR_HIGH(GPIOJ_PIN9) | \
1610 PIN_ODR_HIGH(GPIOJ_PIN10) | \
1611 PIN_ODR_HIGH(GPIOJ_PIN11) | \
1612 PIN_ODR_HIGH(GPIOJ_AUDIO_INT) | \
1613 PIN_ODR_LOW(GPIOJ_LED1_RED) | \
1614 PIN_ODR_HIGH(GPIOJ_WIFI_RST) | \
1615 PIN_ODR_HIGH(GPIOJ_DSI_RESET))
1616#define VAL_GPIOJ_AFRL (PIN_AFIO_AF(GPIOJ_ARD_D4, 0U) | \
1617 PIN_AFIO_AF(GPIOJ_ARD_D2, 0U) | \
1618 PIN_AFIO_AF(GPIOJ_DSI_TE, 13U) | \
1619 PIN_AFIO_AF(GPIOJ_ARD_D7, 0U) | \
1620 PIN_AFIO_AF(GPIOJ_ARD_D8, 0U) | \
1621 PIN_AFIO_AF(GPIOJ_LED2_GREEN, 0U) | \
1622 PIN_AFIO_AF(GPIOJ_PIN6, 0U) | \
1623 PIN_AFIO_AF(GPIOJ_PIN7, 0U))
1624#define VAL_GPIOJ_AFRH (PIN_AFIO_AF(GPIOJ_PIN8, 0U) | \
1625 PIN_AFIO_AF(GPIOJ_PIN9, 0U) | \
1626 PIN_AFIO_AF(GPIOJ_PIN10, 0U) | \
1627 PIN_AFIO_AF(GPIOJ_PIN11, 0U) | \
1628 PIN_AFIO_AF(GPIOJ_AUDIO_INT, 0U) | \
1629 PIN_AFIO_AF(GPIOJ_LED1_RED, 0U) | \
1630 PIN_AFIO_AF(GPIOJ_WIFI_RST, 0U) | \
1631 PIN_AFIO_AF(GPIOJ_DSI_RESET, 0U))
1632
1633/*
1634 * GPIOK setup:
1635 *
1636 * PK0 - PIN0 (input floating).
1637 * PK1 - PIN1 (input floating).
1638 * PK2 - PIN2 (input floating).
1639 * PK3 - PIN3 (input floating).
1640 * PK4 - PIN4 (input floating).
1641 * PK5 - PIN5 (input floating).
1642 * PK6 - PIN6 (input floating).
1643 * PK7 - PIN7 (input floating).
1644 * PK8 - PIN8 (input floating).
1645 * PK9 - PIN9 (input floating).
1646 * PK10 - PIN10 (input floating).
1647 * PK11 - PIN11 (input floating).
1648 * PK12 - PIN12 (input floating).
1649 * PK13 - PIN13 (input floating).
1650 * PK14 - PIN14 (input floating).
1651 * PK15 - PIN15 (input floating).
1652 */
1653#define VAL_GPIOK_MODER (PIN_MODE_INPUT(GPIOK_PIN0) | \
1654 PIN_MODE_INPUT(GPIOK_PIN1) | \
1655 PIN_MODE_INPUT(GPIOK_PIN2) | \
1656 PIN_MODE_INPUT(GPIOK_PIN3) | \
1657 PIN_MODE_INPUT(GPIOK_PIN4) | \
1658 PIN_MODE_INPUT(GPIOK_PIN5) | \
1659 PIN_MODE_INPUT(GPIOK_PIN6) | \
1660 PIN_MODE_INPUT(GPIOK_PIN7) | \
1661 PIN_MODE_INPUT(GPIOK_PIN8) | \
1662 PIN_MODE_INPUT(GPIOK_PIN9) | \
1663 PIN_MODE_INPUT(GPIOK_PIN10) | \
1664 PIN_MODE_INPUT(GPIOK_PIN11) | \
1665 PIN_MODE_INPUT(GPIOK_PIN12) | \
1666 PIN_MODE_INPUT(GPIOK_PIN13) | \
1667 PIN_MODE_INPUT(GPIOK_PIN14) | \
1668 PIN_MODE_INPUT(GPIOK_PIN15))
1669#define VAL_GPIOK_OTYPER (PIN_OTYPE_PUSHPULL(GPIOK_PIN0) | \
1670 PIN_OTYPE_PUSHPULL(GPIOK_PIN1) | \
1671 PIN_OTYPE_PUSHPULL(GPIOK_PIN2) | \
1672 PIN_OTYPE_PUSHPULL(GPIOK_PIN3) | \
1673 PIN_OTYPE_PUSHPULL(GPIOK_PIN4) | \
1674 PIN_OTYPE_PUSHPULL(GPIOK_PIN5) | \
1675 PIN_OTYPE_PUSHPULL(GPIOK_PIN6) | \
1676 PIN_OTYPE_PUSHPULL(GPIOK_PIN7) | \
1677 PIN_OTYPE_PUSHPULL(GPIOK_PIN8) | \
1678 PIN_OTYPE_PUSHPULL(GPIOK_PIN9) | \
1679 PIN_OTYPE_PUSHPULL(GPIOK_PIN10) | \
1680 PIN_OTYPE_PUSHPULL(GPIOK_PIN11) | \
1681 PIN_OTYPE_PUSHPULL(GPIOK_PIN12) | \
1682 PIN_OTYPE_PUSHPULL(GPIOK_PIN13) | \
1683 PIN_OTYPE_PUSHPULL(GPIOK_PIN14) | \
1684 PIN_OTYPE_PUSHPULL(GPIOK_PIN15))
1685#define VAL_GPIOK_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOK_PIN0) | \
1686 PIN_OSPEED_VERYLOW(GPIOK_PIN1) | \
1687 PIN_OSPEED_VERYLOW(GPIOK_PIN2) | \
1688 PIN_OSPEED_VERYLOW(GPIOK_PIN3) | \
1689 PIN_OSPEED_VERYLOW(GPIOK_PIN4) | \
1690 PIN_OSPEED_VERYLOW(GPIOK_PIN5) | \
1691 PIN_OSPEED_VERYLOW(GPIOK_PIN6) | \
1692 PIN_OSPEED_VERYLOW(GPIOK_PIN7) | \
1693 PIN_OSPEED_VERYLOW(GPIOK_PIN8) | \
1694 PIN_OSPEED_VERYLOW(GPIOK_PIN9) | \
1695 PIN_OSPEED_VERYLOW(GPIOK_PIN10) | \
1696 PIN_OSPEED_VERYLOW(GPIOK_PIN11) | \
1697 PIN_OSPEED_VERYLOW(GPIOK_PIN12) | \
1698 PIN_OSPEED_VERYLOW(GPIOK_PIN13) | \
1699 PIN_OSPEED_VERYLOW(GPIOK_PIN14) | \
1700 PIN_OSPEED_VERYLOW(GPIOK_PIN15))
1701#define VAL_GPIOK_PUPDR (PIN_PUPDR_FLOATING(GPIOK_PIN0) | \
1702 PIN_PUPDR_FLOATING(GPIOK_PIN1) | \
1703 PIN_PUPDR_FLOATING(GPIOK_PIN2) | \
1704 PIN_PUPDR_FLOATING(GPIOK_PIN3) | \
1705 PIN_PUPDR_FLOATING(GPIOK_PIN4) | \
1706 PIN_PUPDR_FLOATING(GPIOK_PIN5) | \
1707 PIN_PUPDR_FLOATING(GPIOK_PIN6) | \
1708 PIN_PUPDR_FLOATING(GPIOK_PIN7) | \
1709 PIN_PUPDR_FLOATING(GPIOK_PIN8) | \
1710 PIN_PUPDR_FLOATING(GPIOK_PIN9) | \
1711 PIN_PUPDR_FLOATING(GPIOK_PIN10) | \
1712 PIN_PUPDR_FLOATING(GPIOK_PIN11) | \
1713 PIN_PUPDR_FLOATING(GPIOK_PIN12) | \
1714 PIN_PUPDR_FLOATING(GPIOK_PIN13) | \
1715 PIN_PUPDR_FLOATING(GPIOK_PIN14) | \
1716 PIN_PUPDR_FLOATING(GPIOK_PIN15))
1717#define VAL_GPIOK_ODR (PIN_ODR_HIGH(GPIOK_PIN0) | \
1718 PIN_ODR_HIGH(GPIOK_PIN1) | \
1719 PIN_ODR_HIGH(GPIOK_PIN2) | \
1720 PIN_ODR_HIGH(GPIOK_PIN3) | \
1721 PIN_ODR_HIGH(GPIOK_PIN4) | \
1722 PIN_ODR_HIGH(GPIOK_PIN5) | \
1723 PIN_ODR_HIGH(GPIOK_PIN6) | \
1724 PIN_ODR_HIGH(GPIOK_PIN7) | \
1725 PIN_ODR_HIGH(GPIOK_PIN8) | \
1726 PIN_ODR_HIGH(GPIOK_PIN9) | \
1727 PIN_ODR_HIGH(GPIOK_PIN10) | \
1728 PIN_ODR_HIGH(GPIOK_PIN11) | \
1729 PIN_ODR_HIGH(GPIOK_PIN12) | \
1730 PIN_ODR_HIGH(GPIOK_PIN13) | \
1731 PIN_ODR_HIGH(GPIOK_PIN14) | \
1732 PIN_ODR_HIGH(GPIOK_PIN15))
1733#define VAL_GPIOK_AFRL (PIN_AFIO_AF(GPIOK_PIN0, 0U) | \
1734 PIN_AFIO_AF(GPIOK_PIN1, 0U) | \
1735 PIN_AFIO_AF(GPIOK_PIN2, 0U) | \
1736 PIN_AFIO_AF(GPIOK_PIN3, 0U) | \
1737 PIN_AFIO_AF(GPIOK_PIN4, 0U) | \
1738 PIN_AFIO_AF(GPIOK_PIN5, 0U) | \
1739 PIN_AFIO_AF(GPIOK_PIN6, 0U) | \
1740 PIN_AFIO_AF(GPIOK_PIN7, 0U))
1741#define VAL_GPIOK_AFRH (PIN_AFIO_AF(GPIOK_PIN8, 0U) | \
1742 PIN_AFIO_AF(GPIOK_PIN9, 0U) | \
1743 PIN_AFIO_AF(GPIOK_PIN10, 0U) | \
1744 PIN_AFIO_AF(GPIOK_PIN11, 0U) | \
1745 PIN_AFIO_AF(GPIOK_PIN12, 0U) | \
1746 PIN_AFIO_AF(GPIOK_PIN13, 0U) | \
1747 PIN_AFIO_AF(GPIOK_PIN14, 0U) | \
1748 PIN_AFIO_AF(GPIOK_PIN15, 0U))
1749
1750/*===========================================================================*/
1751/* External declarations. */
1752/*===========================================================================*/
1753
1754#if !defined(_FROM_ASM_)
1755#ifdef __cplusplus
1756extern "C" {
1757#endif
1758 void boardInit(void);
1759#ifdef __cplusplus
1760}
1761#endif
1762#endif /* _FROM_ASM_ */
1763
1764#endif /* BOARD_H */