Statistics
| Branch: | Tag: | Revision:

amiro-os / modules / STM32F407G-DISC1 / board.h @ 4684a9d9

History | View | Annotate | Download (85.793 KB)

1 07ff44a7 Thomas Schöpping
/*
2 0f60c8ad Thomas Schöpping
AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
3
Copyright (C) 2016..2019  Thomas Schöpping et al.
4 07ff44a7 Thomas Schöpping

5 0f60c8ad Thomas Schöpping
This program is free software: you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation, either version 3 of the License, or
8
(at your option) any later version.
9 07ff44a7 Thomas Schöpping

10 0f60c8ad Thomas Schöpping
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
GNU General Public License for more details.
14 07ff44a7 Thomas Schöpping

15 0f60c8ad Thomas Schöpping
You should have received a copy of the GNU General Public License
16
along with this program.  If not, see <http://www.gnu.org/licenses/>.
17 07ff44a7 Thomas Schöpping
*/
18
19
#ifndef BOARD_H
20
#define BOARD_H
21
22
/*===========================================================================*/
23
/* Driver constants.                                                         */
24
/*===========================================================================*/
25
26
/*
27
 * Setup for STMicroelectronics STM32F4-Discovery board.
28
 */
29
30
/*
31
 * Board identifier.
32
 */
33
#define BOARD_ST_STM32F4_DISCOVERY
34
#define BOARD_NAME                  "STMicroelectronics STM32F4-Discovery"
35
36
/*
37
 * Board oscillators-related settings.
38
 * NOTE: LSE not fitted.
39
 */
40
#if !defined(STM32_LSECLK)
41
#define STM32_LSECLK                0U
42
#endif
43
44
#if !defined(STM32_HSECLK)
45
#define STM32_HSECLK                8000000U
46
#endif
47
48
/*
49
 * Board voltages.
50
 * Required for performance limits calculation.
51
 */
52
#define STM32_VDD                   300U
53
54
/*
55
 * MCU type as defined in the ST header.
56
 */
57
#define STM32F407xx
58
59
/*
60
 * IO pins assignments.
61
 */
62
#define GPIOA_BUTTON                0U
63
#define GPIOA_PIN1                  1U
64
#define GPIOA_PIN2                  2U
65
#define GPIOA_PIN3                  3U
66
#define GPIOA_LRCK                  4U
67
#define GPIOA_SPC                   5U
68
#define GPIOA_SDO                   6U
69
#define GPIOA_SDI                   7U
70
#define GPIOA_PIN8                  8U
71
#define GPIOA_VBUS_FS               9U
72
#define GPIOA_OTG_FS_ID             10U
73
#define GPIOA_OTG_FS_DM             11U
74
#define GPIOA_OTG_FS_DP             12U
75
#define GPIOA_SWDIO                 13U
76
#define GPIOA_SWCLK                 14U
77
#define GPIOA_PIN15                 15U
78
79
#define GPIOB_PIN0                  0U
80
#define GPIOB_PIN1                  1U
81
#define GPIOB_PIN2                  2U
82
#define GPIOB_SWO                   3U
83
#define GPIOB_PIN4                  4U
84
#define GPIOB_PIN5                  5U
85
#define GPIOB_SCL                   6U
86
#define GPIOB_PIN7                  7U
87
#define GPIOB_PIN8                  8U
88
#define GPIOB_SDA                   9U
89
#define GPIOB_CLK_IN                10U
90
#define GPIOB_PIN11                 11U
91
#define GPIOB_PIN12                 12U
92
#define GPIOB_PIN13                 13U
93
#define GPIOB_PIN14                 14U
94
#define GPIOB_PIN15                 15U
95
96
#define GPIOC_OTG_FS_POWER_ON       0U
97
#define GPIOC_PIN1                  1U
98
#define GPIOC_PIN2                  2U
99
#define GPIOC_PDM_OUT               3U
100
#define GPIOC_PIN4                  4U
101
#define GPIOC_PIN5                  5U
102
#define GPIOC_PIN6                  6U
103
#define GPIOC_MCLK                  7U
104
#define GPIOC_PIN8                  8U
105
#define GPIOC_PIN9                  9U
106
#define GPIOC_SCLK                  10U
107
#define GPIOC_PIN11                 11U
108
#define GPIOC_SDIN                  12U
109
#define GPIOC_PIN13                 13U
110
#define GPIOC_PIN14                 14U
111
#define GPIOC_PIN15                 15U
112
113
#define GPIOD_PIN0                  0U
114
#define GPIOD_PIN1                  1U
115
#define GPIOD_PIN2                  2U
116
#define GPIOD_PIN3                  3U
117
#define GPIOD_RESET                 4U
118
#define GPIOD_OVER_CURRENT          5U
119
#define GPIOD_PIN6                  6U
120
#define GPIOD_PIN7                  7U
121
#define GPIOD_PIN8                  8U
122
#define GPIOD_PIN9                  9U
123
#define GPIOD_PIN10                 10U
124
#define GPIOD_PIN11                 11U
125
#define GPIOD_LED4                  12U
126
#define GPIOD_LED3                  13U
127
#define GPIOD_LED5                  14U
128
#define GPIOD_LED6                  15U
129
130
#define GPIOE_INT1                  0U
131
#define GPIOE_INT2                  1U
132
#define GPIOE_PIN2                  2U
133
#define GPIOE_CS_SPI                3U
134
#define GPIOE_PIN4                  4U
135
#define GPIOE_PIN5                  5U
136
#define GPIOE_PIN6                  6U
137
#define GPIOE_PIN7                  7U
138
#define GPIOE_PIN8                  8U
139
#define GPIOE_PIN9                  9U
140
#define GPIOE_PIN10                 10U
141
#define GPIOE_PIN11                 11U
142
#define GPIOE_PIN12                 12U
143
#define GPIOE_PIN13                 13U
144
#define GPIOE_PIN14                 14U
145
#define GPIOE_PIN15                 15U
146
147
#define GPIOF_PIN0                  0U
148
#define GPIOF_PIN1                  1U
149
#define GPIOF_PIN2                  2U
150
#define GPIOF_PIN3                  3U
151
#define GPIOF_PIN4                  4U
152
#define GPIOF_PIN5                  5U
153
#define GPIOF_PIN6                  6U
154
#define GPIOF_PIN7                  7U
155
#define GPIOF_PIN8                  8U
156
#define GPIOF_PIN9                  9U
157
#define GPIOF_PIN10                 10U
158
#define GPIOF_PIN11                 11U
159
#define GPIOF_PIN12                 12U
160
#define GPIOF_PIN13                 13U
161
#define GPIOF_PIN14                 14U
162
#define GPIOF_PIN15                 15U
163
164
#define GPIOG_PIN0                  0U
165
#define GPIOG_PIN1                  1U
166
#define GPIOG_PIN2                  2U
167
#define GPIOG_PIN3                  3U
168
#define GPIOG_PIN4                  4U
169
#define GPIOG_PIN5                  5U
170
#define GPIOG_PIN6                  6U
171
#define GPIOG_PIN7                  7U
172
#define GPIOG_PIN8                  8U
173
#define GPIOG_PIN9                  9U
174
#define GPIOG_PIN10                 10U
175
#define GPIOG_PIN11                 11U
176
#define GPIOG_PIN12                 12U
177
#define GPIOG_PIN13                 13U
178
#define GPIOG_PIN14                 14U
179
#define GPIOG_PIN15                 15U
180
181
#define GPIOH_OSC_IN                0U
182
#define GPIOH_OSC_OUT               1U
183
#define GPIOH_PIN2                  2U
184
#define GPIOH_PIN3                  3U
185
#define GPIOH_PIN4                  4U
186
#define GPIOH_PIN5                  5U
187
#define GPIOH_PIN6                  6U
188
#define GPIOH_PIN7                  7U
189
#define GPIOH_PIN8                  8U
190
#define GPIOH_PIN9                  9U
191
#define GPIOH_PIN10                 10U
192
#define GPIOH_PIN11                 11U
193
#define GPIOH_PIN12                 12U
194
#define GPIOH_PIN13                 13U
195
#define GPIOH_PIN14                 14U
196
#define GPIOH_PIN15                 15U
197
198
#define GPIOI_PIN0                  0U
199
#define GPIOI_PIN1                  1U
200
#define GPIOI_PIN2                  2U
201
#define GPIOI_PIN3                  3U
202
#define GPIOI_PIN4                  4U
203
#define GPIOI_PIN5                  5U
204
#define GPIOI_PIN6                  6U
205
#define GPIOI_PIN7                  7U
206
#define GPIOI_PIN8                  8U
207
#define GPIOI_PIN9                  9U
208
#define GPIOI_PIN10                 10U
209
#define GPIOI_PIN11                 11U
210
#define GPIOI_PIN12                 12U
211
#define GPIOI_PIN13                 13U
212
#define GPIOI_PIN14                 14U
213
#define GPIOI_PIN15                 15U
214
215
/*
216
 * IO lines assignments.
217
 */
218 3106e8cc Thomas Schöpping
#define LINE_BUTTON                 PAL_LINE(GPIOA, GPIOA_BUTTON)
219
#define LINE_LRCK                   PAL_LINE(GPIOA, GPIOA_LRCK)
220
#define LINE_SPC                    PAL_LINE(GPIOA, GPIOA_SPC)
221
#define LINE_SDO                    PAL_LINE(GPIOA, GPIOA_SDO)
222
#define LINE_SDI                    PAL_LINE(GPIOA, GPIOA_SDI)
223
#define LINE_VBUS_FS                PAL_LINE(GPIOA, GPIOA_VBUS_FS)
224
#define LINE_OTG_FS_ID              PAL_LINE(GPIOA, GPIOA_OTG_FS_ID)
225
#define LINE_OTG_FS_DM              PAL_LINE(GPIOA, GPIOA_FS_DM)
226
#define LINE_OTG_FS_DP              PAL_LINE(GPIOA, GPIOA_FS_DP)
227
#define LINE_SWDIO                  PAL_LINE(GPIOA, GPIOA_SWDIO)
228
#define LINE_SWCLK                  PAL_LINE(GPIOA, GPIOA_SWCLK)
229
230
#define LINE_SWO                    PAL_LINE(GPIOB, GPIOB_SWO)
231
#define LINE_SCL                    PAL_LINE(GPIOB, GPIOA_SCL)
232
#define LINE_SDA                    PAL_LINE(GPIOB, GPIOA_SDA)
233
#define LINE_CLK_IN                 PAL_LINE(GPIOB, GPIOA_CLK_IN)
234
235
#define LINE_OTG_FS_POWER_ON        PAL_LINE(GPIOC, GPIOC_OTG_FS_POWER_ON)
236
#define LINE_PDM_OUT                PAL_LINE(GPIOC, GPIOC_PDM_OUT)
237
#define LINE_MCLK                   PAL_LINE(GPIOC, GPIOC_MCLK)
238
#define LINE_SCLK                   PAL_LINE(GPIOC, GPIOC_SCLK)
239
#define LINE_SDIN                   PAL_LINE(GPIOC, GPIOC_SDIN)
240
241
#define LINE_RESET                  PAL_LINE(GPIOD, GPIOD_RESET)
242
#define LINE_OVER_CURRENT           PAL_LINE(GPIOD, GPIOD_OVER_CURRENT)
243
#define LINE_LED4                   PAL_LINE(GPIOD, GPIOD_LED4)
244
#define LINE_LED3                   PAL_LINE(GPIOD, GPIOD_LED3)
245
#define LINE_LED5                   PAL_LINE(GPIOD, GPIOD_LED5)
246
#define LINE_LED6                   PAL_LINE(GPIOD, GPIOD_LED6)
247
248
#define LINE_INT1                   PAL_LINE(GPIOE, GPIOE_INT1)
249
#define LINE_INT2                   PAL_LINE(GPIOE, GPIOE_INT2)
250
#define LINE_CS_SPI                 PAL_LINE(GPIOE, GPIOE_VS_SPI)
251
252
#define LINE_OSC_IN                 PAL_LINE(GPIOH, GPIOH_OSC_IN)
253
#define LINE_OSC_OUT                PAL_LINE(GPIOH, GPIOE_OSC_OUT)
254 07ff44a7 Thomas Schöpping
255
/*===========================================================================*/
256
/* Driver pre-compile time settings.                                         */
257
/*===========================================================================*/
258
259
/*===========================================================================*/
260
/* Derived constants and error checks.                                       */
261
/*===========================================================================*/
262
263
/*===========================================================================*/
264
/* Driver data structures and types.                                         */
265
/*===========================================================================*/
266
267
/*===========================================================================*/
268
/* Driver macros.                                                            */
269
/*===========================================================================*/
270
271
/*
272
 * I/O ports initial setup, this configuration is established soon after reset
273
 * in the initialization code.
274
 * Please refer to the STM32 Reference Manual for details.
275
 */
276
#define PIN_MODE_INPUT(n)           (0U << ((n) * 2U))
277
#define PIN_MODE_OUTPUT(n)          (1U << ((n) * 2U))
278
#define PIN_MODE_ALTERNATE(n)       (2U << ((n) * 2U))
279
#define PIN_MODE_ANALOG(n)          (3U << ((n) * 2U))
280
#define PIN_ODR_LOW(n)              (0U << (n))
281
#define PIN_ODR_HIGH(n)             (1U << (n))
282
#define PIN_OTYPE_PUSHPULL(n)       (0U << (n))
283
#define PIN_OTYPE_OPENDRAIN(n)      (1U << (n))
284
#define PIN_OSPEED_VERYLOW(n)       (0U << ((n) * 2U))
285
#define PIN_OSPEED_LOW(n)           (1U << ((n) * 2U))
286
#define PIN_OSPEED_MEDIUM(n)        (2U << ((n) * 2U))
287
#define PIN_OSPEED_HIGH(n)          (3U << ((n) * 2U))
288
#define PIN_PUPDR_FLOATING(n)       (0U << ((n) * 2U))
289
#define PIN_PUPDR_PULLUP(n)         (1U << ((n) * 2U))
290
#define PIN_PUPDR_PULLDOWN(n)       (2U << ((n) * 2U))
291
#define PIN_AFIO_AF(n, v)           ((v) << (((n) % 8U) * 4U))
292
293
/*
294
 * GPIOA setup:
295
 *
296
 * PA0  - BUTTON                    (input floating).
297
 * PA1  - PIN1                      (input pullup).
298
 * PA2  - PIN2                      (input pullup).
299
 * PA3  - PIN3                      (input pullup).
300
 * PA4  - LRCK                      (alternate 6).
301
 * PA5  - SPC                       (alternate 5).
302
 * PA6  - SDO                       (alternate 5).
303
 * PA7  - SDI                       (alternate 5).
304
 * PA8  - PIN8                      (input pullup).
305
 * PA9  - VBUS_FS                   (input floating).
306
 * PA10 - OTG_FS_ID                 (alternate 10).
307
 * PA11 - OTG_FS_DM                 (alternate 10).
308
 * PA12 - OTG_FS_DP                 (alternate 10).
309
 * PA13 - SWDIO                     (alternate 0).
310
 * PA14 - SWCLK                     (alternate 0).
311
 * PA15 - PIN15                     (input pullup).
312
 */
313
#define VAL_GPIOA_MODER             (PIN_MODE_INPUT(GPIOA_BUTTON) |         \
314
                                     PIN_MODE_INPUT(GPIOA_PIN1) |           \
315
                                     PIN_MODE_ALTERNATE(GPIOA_PIN2) |       \
316
                                     PIN_MODE_ALTERNATE(GPIOA_PIN3) |       \
317
                                     PIN_MODE_ALTERNATE(GPIOA_LRCK) |       \
318
                                     PIN_MODE_ALTERNATE(GPIOA_SPC) |        \
319
                                     PIN_MODE_ALTERNATE(GPIOA_SDO) |        \
320
                                     PIN_MODE_ALTERNATE(GPIOA_SDI) |        \
321
                                     PIN_MODE_INPUT(GPIOA_PIN8) |           \
322
                                     PIN_MODE_INPUT(GPIOA_VBUS_FS) |        \
323
                                     PIN_MODE_ALTERNATE(GPIOA_OTG_FS_ID) |  \
324
                                     PIN_MODE_ALTERNATE(GPIOA_OTG_FS_DM) |  \
325
                                     PIN_MODE_ALTERNATE(GPIOA_OTG_FS_DP) |  \
326
                                     PIN_MODE_ALTERNATE(GPIOA_SWDIO) |      \
327
                                     PIN_MODE_ALTERNATE(GPIOA_SWCLK) |      \
328
                                     PIN_MODE_INPUT(GPIOA_PIN15))
329
#define VAL_GPIOA_OTYPER            (PIN_OTYPE_PUSHPULL(GPIOA_BUTTON) |     \
330
                                     PIN_OTYPE_PUSHPULL(GPIOA_PIN1) |       \
331
                                     PIN_OTYPE_PUSHPULL(GPIOA_PIN2) |       \
332
                                     PIN_OTYPE_PUSHPULL(GPIOA_PIN3) |       \
333
                                     PIN_OTYPE_PUSHPULL(GPIOA_LRCK) |       \
334
                                     PIN_OTYPE_PUSHPULL(GPIOA_SPC) |        \
335
                                     PIN_OTYPE_PUSHPULL(GPIOA_SDO) |        \
336
                                     PIN_OTYPE_PUSHPULL(GPIOA_SDI) |        \
337
                                     PIN_OTYPE_PUSHPULL(GPIOA_PIN8) |       \
338
                                     PIN_OTYPE_PUSHPULL(GPIOA_VBUS_FS) |    \
339
                                     PIN_OTYPE_PUSHPULL(GPIOA_OTG_FS_ID) |  \
340
                                     PIN_OTYPE_PUSHPULL(GPIOA_OTG_FS_DM) |  \
341
                                     PIN_OTYPE_PUSHPULL(GPIOA_OTG_FS_DP) |  \
342
                                     PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) |      \
343
                                     PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) |      \
344
                                     PIN_OTYPE_PUSHPULL(GPIOA_PIN15))
345
#define VAL_GPIOA_OSPEEDR           (PIN_OSPEED_HIGH(GPIOA_BUTTON) |        \
346
                                     PIN_OSPEED_HIGH(GPIOA_PIN1) |          \
347
                                     PIN_OSPEED_HIGH(GPIOA_PIN2) |          \
348
                                     PIN_OSPEED_HIGH(GPIOA_PIN3) |          \
349
                                     PIN_OSPEED_HIGH(GPIOA_LRCK) |          \
350
                                     PIN_OSPEED_MEDIUM(GPIOA_SPC) |         \
351
                                     PIN_OSPEED_MEDIUM(GPIOA_SDO) |         \
352
                                     PIN_OSPEED_MEDIUM(GPIOA_SDI) |         \
353
                                     PIN_OSPEED_HIGH(GPIOA_PIN8) |          \
354
                                     PIN_OSPEED_HIGH(GPIOA_VBUS_FS) |       \
355
                                     PIN_OSPEED_HIGH(GPIOA_OTG_FS_ID) |     \
356
                                     PIN_OSPEED_HIGH(GPIOA_OTG_FS_DM) |     \
357
                                     PIN_OSPEED_HIGH(GPIOA_OTG_FS_DP) |     \
358
                                     PIN_OSPEED_HIGH(GPIOA_SWDIO) |         \
359
                                     PIN_OSPEED_HIGH(GPIOA_SWCLK) |         \
360
                                     PIN_OSPEED_HIGH(GPIOA_PIN15))
361
#define VAL_GPIOA_PUPDR             (PIN_PUPDR_FLOATING(GPIOA_BUTTON) |     \
362
                                     PIN_PUPDR_PULLUP(GPIOA_PIN1) |         \
363
                                     PIN_PUPDR_PULLUP(GPIOA_PIN2) |         \
364
                                     PIN_PUPDR_PULLUP(GPIOA_PIN3) |         \
365
                                     PIN_PUPDR_FLOATING(GPIOA_LRCK) |       \
366
                                     PIN_PUPDR_FLOATING(GPIOA_SPC) |        \
367
                                     PIN_PUPDR_FLOATING(GPIOA_SDO) |        \
368
                                     PIN_PUPDR_FLOATING(GPIOA_SDI) |        \
369
                                     PIN_PUPDR_PULLUP(GPIOA_PIN8) |         \
370
                                     PIN_PUPDR_FLOATING(GPIOA_VBUS_FS) |    \
371
                                     PIN_PUPDR_FLOATING(GPIOA_OTG_FS_ID) |  \
372
                                     PIN_PUPDR_FLOATING(GPIOA_OTG_FS_DM) |  \
373
                                     PIN_PUPDR_FLOATING(GPIOA_OTG_FS_DP) |  \
374
                                     PIN_PUPDR_FLOATING(GPIOA_SWDIO) |      \
375
                                     PIN_PUPDR_FLOATING(GPIOA_SWCLK) |      \
376
                                     PIN_PUPDR_PULLUP(GPIOA_PIN15))
377
#define VAL_GPIOA_ODR               (PIN_ODR_HIGH(GPIOA_BUTTON) |           \
378
                                     PIN_ODR_HIGH(GPIOA_PIN1) |             \
379
                                     PIN_ODR_HIGH(GPIOA_PIN2) |             \
380
                                     PIN_ODR_HIGH(GPIOA_PIN3) |             \
381
                                     PIN_ODR_HIGH(GPIOA_LRCK) |             \
382
                                     PIN_ODR_HIGH(GPIOA_SPC) |              \
383
                                     PIN_ODR_HIGH(GPIOA_SDO) |              \
384
                                     PIN_ODR_HIGH(GPIOA_SDI) |              \
385
                                     PIN_ODR_HIGH(GPIOA_PIN8) |             \
386
                                     PIN_ODR_HIGH(GPIOA_VBUS_FS) |          \
387
                                     PIN_ODR_HIGH(GPIOA_OTG_FS_ID) |        \
388
                                     PIN_ODR_HIGH(GPIOA_OTG_FS_DM) |        \
389
                                     PIN_ODR_HIGH(GPIOA_OTG_FS_DP) |        \
390
                                     PIN_ODR_HIGH(GPIOA_SWDIO) |            \
391
                                     PIN_ODR_HIGH(GPIOA_SWCLK) |            \
392
                                     PIN_ODR_HIGH(GPIOA_PIN15))
393
#define VAL_GPIOA_AFRL              (PIN_AFIO_AF(GPIOA_BUTTON, 0U) |        \
394
                                     PIN_AFIO_AF(GPIOA_PIN1, 0U) |          \
395
                                     PIN_AFIO_AF(GPIOA_PIN2, 7U) |          \
396
                                     PIN_AFIO_AF(GPIOA_PIN3, 7U) |          \
397
                                     PIN_AFIO_AF(GPIOA_LRCK, 6U) |          \
398
                                     PIN_AFIO_AF(GPIOA_SPC, 5U) |           \
399
                                     PIN_AFIO_AF(GPIOA_SDO, 5U) |           \
400
                                     PIN_AFIO_AF(GPIOA_SDI, 5U))
401
#define VAL_GPIOA_AFRH              (PIN_AFIO_AF(GPIOA_PIN8, 0U) |          \
402
                                     PIN_AFIO_AF(GPIOA_VBUS_FS, 0U) |       \
403
                                     PIN_AFIO_AF(GPIOA_OTG_FS_ID, 10U) |    \
404
                                     PIN_AFIO_AF(GPIOA_OTG_FS_DM, 10U) |    \
405
                                     PIN_AFIO_AF(GPIOA_OTG_FS_DP, 10U) |    \
406
                                     PIN_AFIO_AF(GPIOA_SWDIO, 0U) |         \
407
                                     PIN_AFIO_AF(GPIOA_SWCLK, 0U) |         \
408
                                     PIN_AFIO_AF(GPIOA_PIN15, 0U))
409
410
/*
411
 * GPIOB setup:
412
 *
413
 * PB0  - PIN0                      (input pullup).
414
 * PB1  - PIN1                      (input pullup).
415
 * PB2  - PIN2                      (input pullup).
416
 * PB3  - SWO                       (alternate 0).
417
 * PB4  - PIN4                      (input pullup).
418
 * PB5  - PIN5                      (input pullup).
419
 * PB6  - SCL                       (alternate 4).
420
 * PB7  - PIN7                      (input pullup).
421
 * PB8  - PIN8                      (input pullup).
422
 * PB9  - SDA                       (alternate 4).
423
 * PB10 - CLK_IN                    (input pullup).
424
 * PB11 - PIN11                     (input pullup).
425
 * PB12 - PIN12                     (input pullup).
426
 * PB13 - PIN13                     (input pullup).
427
 * PB14 - PIN14                     (input pullup).
428
 * PB15 - PIN15                     (input pullup).
429
 */
430
#define VAL_GPIOB_MODER             (PIN_MODE_INPUT(GPIOB_PIN0) |           \
431
                                     PIN_MODE_INPUT(GPIOB_PIN1) |           \
432
                                     PIN_MODE_INPUT(GPIOB_PIN2) |           \
433
                                     PIN_MODE_ALTERNATE(GPIOB_SWO) |        \
434
                                     PIN_MODE_INPUT(GPIOB_PIN4) |           \
435
                                     PIN_MODE_INPUT(GPIOB_PIN5) |           \
436
                                     PIN_MODE_ALTERNATE(GPIOB_SCL) |        \
437
                                     PIN_MODE_INPUT(GPIOB_PIN7) |           \
438
                                     PIN_MODE_INPUT(GPIOB_PIN8) |           \
439
                                     PIN_MODE_ALTERNATE(GPIOB_SDA) |        \
440
                                     PIN_MODE_INPUT(GPIOB_CLK_IN) |         \
441
                                     PIN_MODE_INPUT(GPIOB_PIN11) |          \
442
                                     PIN_MODE_INPUT(GPIOB_PIN12) |          \
443
                                     PIN_MODE_INPUT(GPIOB_PIN13) |          \
444
                                     PIN_MODE_INPUT(GPIOB_PIN14) |          \
445
                                     PIN_MODE_INPUT(GPIOB_PIN15))
446
#define VAL_GPIOB_OTYPER            (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) |       \
447
                                     PIN_OTYPE_PUSHPULL(GPIOB_PIN1) |       \
448
                                     PIN_OTYPE_PUSHPULL(GPIOB_PIN2) |       \
449
                                     PIN_OTYPE_PUSHPULL(GPIOB_SWO) |        \
450
                                     PIN_OTYPE_PUSHPULL(GPIOB_PIN4) |       \
451
                                     PIN_OTYPE_PUSHPULL(GPIOB_PIN5) |       \
452
                                     PIN_OTYPE_OPENDRAIN(GPIOB_SCL) |       \
453
                                     PIN_OTYPE_PUSHPULL(GPIOB_PIN7) |       \
454
                                     PIN_OTYPE_PUSHPULL(GPIOB_PIN8) |       \
455
                                     PIN_OTYPE_OPENDRAIN(GPIOB_SDA) |       \
456
                                     PIN_OTYPE_PUSHPULL(GPIOB_CLK_IN) |     \
457
                                     PIN_OTYPE_PUSHPULL(GPIOB_PIN11) |      \
458
                                     PIN_OTYPE_PUSHPULL(GPIOB_PIN12) |      \
459
                                     PIN_OTYPE_PUSHPULL(GPIOB_PIN13) |      \
460
                                     PIN_OTYPE_PUSHPULL(GPIOB_PIN14) |      \
461
                                     PIN_OTYPE_PUSHPULL(GPIOB_PIN15))
462
#define VAL_GPIOB_OSPEEDR           (PIN_OSPEED_HIGH(GPIOB_PIN0) |          \
463
                                     PIN_OSPEED_HIGH(GPIOB_PIN1) |          \
464
                                     PIN_OSPEED_HIGH(GPIOB_PIN2) |          \
465
                                     PIN_OSPEED_HIGH(GPIOB_SWO) |           \
466
                                     PIN_OSPEED_HIGH(GPIOB_PIN4) |          \
467
                                     PIN_OSPEED_HIGH(GPIOB_PIN5) |          \
468
                                     PIN_OSPEED_HIGH(GPIOB_SCL) |           \
469
                                     PIN_OSPEED_HIGH(GPIOB_PIN7) |          \
470
                                     PIN_OSPEED_HIGH(GPIOB_PIN8) |          \
471
                                     PIN_OSPEED_HIGH(GPIOB_SDA) |           \
472
                                     PIN_OSPEED_HIGH(GPIOB_CLK_IN) |        \
473
                                     PIN_OSPEED_HIGH(GPIOB_PIN11) |         \
474
                                     PIN_OSPEED_HIGH(GPIOB_PIN12) |         \
475
                                     PIN_OSPEED_HIGH(GPIOB_PIN13) |         \
476
                                     PIN_OSPEED_HIGH(GPIOB_PIN14) |         \
477
                                     PIN_OSPEED_HIGH(GPIOB_PIN15))
478
#define VAL_GPIOB_PUPDR             (PIN_PUPDR_PULLUP(GPIOB_PIN0) |         \
479
                                     PIN_PUPDR_PULLUP(GPIOB_PIN1) |         \
480
                                     PIN_PUPDR_PULLUP(GPIOB_PIN2) |         \
481
                                     PIN_PUPDR_FLOATING(GPIOB_SWO) |        \
482
                                     PIN_PUPDR_PULLUP(GPIOB_PIN4) |         \
483
                                     PIN_PUPDR_PULLUP(GPIOB_PIN5) |         \
484
                                     PIN_PUPDR_FLOATING(GPIOB_SCL) |        \
485
                                     PIN_PUPDR_PULLUP(GPIOB_PIN7) |         \
486
                                     PIN_PUPDR_PULLUP(GPIOB_PIN8) |         \
487
                                     PIN_PUPDR_FLOATING(GPIOB_SDA) |        \
488
                                     PIN_PUPDR_PULLUP(GPIOB_CLK_IN) |       \
489
                                     PIN_PUPDR_PULLUP(GPIOB_PIN11) |        \
490
                                     PIN_PUPDR_PULLUP(GPIOB_PIN12) |        \
491
                                     PIN_PUPDR_PULLUP(GPIOB_PIN13) |        \
492
                                     PIN_PUPDR_PULLUP(GPIOB_PIN14) |        \
493
                                     PIN_PUPDR_PULLUP(GPIOB_PIN15))
494
#define VAL_GPIOB_ODR               (PIN_ODR_HIGH(GPIOB_PIN0) |             \
495
                                     PIN_ODR_HIGH(GPIOB_PIN1) |             \
496
                                     PIN_ODR_HIGH(GPIOB_PIN2) |             \
497
                                     PIN_ODR_HIGH(GPIOB_SWO) |              \
498
                                     PIN_ODR_HIGH(GPIOB_PIN4) |             \
499
                                     PIN_ODR_HIGH(GPIOB_PIN5) |             \
500
                                     PIN_ODR_HIGH(GPIOB_SCL) |              \
501
                                     PIN_ODR_HIGH(GPIOB_PIN7) |             \
502
                                     PIN_ODR_HIGH(GPIOB_PIN8) |             \
503
                                     PIN_ODR_HIGH(GPIOB_SDA) |              \
504
                                     PIN_ODR_HIGH(GPIOB_CLK_IN) |           \
505
                                     PIN_ODR_HIGH(GPIOB_PIN11) |            \
506
                                     PIN_ODR_HIGH(GPIOB_PIN12) |            \
507
                                     PIN_ODR_HIGH(GPIOB_PIN13) |            \
508
                                     PIN_ODR_HIGH(GPIOB_PIN14) |            \
509
                                     PIN_ODR_HIGH(GPIOB_PIN15))
510
#define VAL_GPIOB_AFRL              (PIN_AFIO_AF(GPIOB_PIN0, 0U) |          \
511
                                     PIN_AFIO_AF(GPIOB_PIN1, 0U) |          \
512
                                     PIN_AFIO_AF(GPIOB_PIN2, 0U) |          \
513
                                     PIN_AFIO_AF(GPIOB_SWO, 0U) |           \
514
                                     PIN_AFIO_AF(GPIOB_PIN4, 0U) |          \
515
                                     PIN_AFIO_AF(GPIOB_PIN5, 0U) |          \
516
                                     PIN_AFIO_AF(GPIOB_SCL, 4U) |           \
517
                                     PIN_AFIO_AF(GPIOB_PIN7, 0U))
518
#define VAL_GPIOB_AFRH              (PIN_AFIO_AF(GPIOB_PIN8, 0U) |          \
519
                                     PIN_AFIO_AF(GPIOB_SDA, 4U) |           \
520
                                     PIN_AFIO_AF(GPIOB_CLK_IN, 0U) |        \
521
                                     PIN_AFIO_AF(GPIOB_PIN11, 0U) |         \
522
                                     PIN_AFIO_AF(GPIOB_PIN12, 0U) |         \
523
                                     PIN_AFIO_AF(GPIOB_PIN13, 0U) |         \
524
                                     PIN_AFIO_AF(GPIOB_PIN14, 0U) |         \
525
                                     PIN_AFIO_AF(GPIOB_PIN15, 0U))
526
527
/*
528
 * GPIOC setup:
529
 *
530
 * PC0  - OTG_FS_POWER_ON           (output pushpull maximum).
531
 * PC1  - PIN1                      (input pullup).
532
 * PC2  - PIN2                      (input pullup).
533
 * PC3  - PDM_OUT                   (input pullup).
534
 * PC4  - PIN4                      (input pullup).
535
 * PC5  - PIN5                      (input pullup).
536
 * PC6  - PIN6                      (input pullup).
537
 * PC7  - MCLK                      (alternate 6).
538
 * PC8  - PIN8                      (input pullup).
539
 * PC9  - PIN9                      (input pullup).
540
 * PC10 - SCLK                      (alternate 6).
541
 * PC11 - PIN11                     (input pullup).
542
 * PC12 - SDIN                      (alternate 6).
543
 * PC13 - PIN13                     (input pullup).
544
 * PC14 - PIN14                     (input pullup).
545
 * PC15 - PIN15                     (input pullup).
546
 */
547
#define VAL_GPIOC_MODER             (PIN_MODE_OUTPUT(GPIOC_OTG_FS_POWER_ON) |\
548
                                     PIN_MODE_INPUT(GPIOC_PIN1) |           \
549
                                     PIN_MODE_INPUT(GPIOC_PIN2) |           \
550
                                     PIN_MODE_INPUT(GPIOC_PDM_OUT) |        \
551
                                     PIN_MODE_INPUT(GPIOC_PIN4) |           \
552
                                     PIN_MODE_INPUT(GPIOC_PIN5) |           \
553
                                     PIN_MODE_INPUT(GPIOC_PIN6) |           \
554
                                     PIN_MODE_ALTERNATE(GPIOC_MCLK) |       \
555
                                     PIN_MODE_INPUT(GPIOC_PIN8) |           \
556
                                     PIN_MODE_INPUT(GPIOC_PIN9) |           \
557
                                     PIN_MODE_ALTERNATE(GPIOC_SCLK) |       \
558
                                     PIN_MODE_INPUT(GPIOC_PIN11) |          \
559
                                     PIN_MODE_ALTERNATE(GPIOC_SDIN) |       \
560
                                     PIN_MODE_INPUT(GPIOC_PIN13) |          \
561
                                     PIN_MODE_INPUT(GPIOC_PIN14) |          \
562
                                     PIN_MODE_INPUT(GPIOC_PIN15))
563
#define VAL_GPIOC_OTYPER            (PIN_OTYPE_PUSHPULL(GPIOC_OTG_FS_POWER_ON) |\
564
                                     PIN_OTYPE_PUSHPULL(GPIOC_PIN1) |       \
565
                                     PIN_OTYPE_PUSHPULL(GPIOC_PIN2) |       \
566
                                     PIN_OTYPE_PUSHPULL(GPIOC_PDM_OUT) |    \
567
                                     PIN_OTYPE_PUSHPULL(GPIOC_PIN4) |       \
568
                                     PIN_OTYPE_PUSHPULL(GPIOC_PIN5) |       \
569
                                     PIN_OTYPE_PUSHPULL(GPIOC_PIN6) |       \
570
                                     PIN_OTYPE_PUSHPULL(GPIOC_MCLK) |       \
571
                                     PIN_OTYPE_PUSHPULL(GPIOC_PIN8) |       \
572
                                     PIN_OTYPE_PUSHPULL(GPIOC_PIN9) |       \
573
                                     PIN_OTYPE_PUSHPULL(GPIOC_SCLK) |       \
574
                                     PIN_OTYPE_PUSHPULL(GPIOC_PIN11) |      \
575
                                     PIN_OTYPE_PUSHPULL(GPIOC_SDIN) |       \
576
                                     PIN_OTYPE_PUSHPULL(GPIOC_PIN13) |      \
577
                                     PIN_OTYPE_PUSHPULL(GPIOC_PIN14) |      \
578
                                     PIN_OTYPE_PUSHPULL(GPIOC_PIN15))
579
#define VAL_GPIOC_OSPEEDR           (PIN_OSPEED_HIGH(GPIOC_OTG_FS_POWER_ON) |\
580
                                     PIN_OSPEED_HIGH(GPIOC_PIN1) |          \
581
                                     PIN_OSPEED_HIGH(GPIOC_PIN2) |          \
582
                                     PIN_OSPEED_HIGH(GPIOC_PDM_OUT) |       \
583
                                     PIN_OSPEED_HIGH(GPIOC_PIN4) |          \
584
                                     PIN_OSPEED_HIGH(GPIOC_PIN5) |          \
585
                                     PIN_OSPEED_HIGH(GPIOC_PIN6) |          \
586
                                     PIN_OSPEED_HIGH(GPIOC_MCLK) |          \
587
                                     PIN_OSPEED_HIGH(GPIOC_PIN8) |          \
588
                                     PIN_OSPEED_HIGH(GPIOC_PIN9) |          \
589
                                     PIN_OSPEED_HIGH(GPIOC_SCLK) |          \
590
                                     PIN_OSPEED_HIGH(GPIOC_PIN11) |         \
591
                                     PIN_OSPEED_HIGH(GPIOC_SDIN) |          \
592
                                     PIN_OSPEED_HIGH(GPIOC_PIN13) |         \
593
                                     PIN_OSPEED_HIGH(GPIOC_PIN14) |         \
594
                                     PIN_OSPEED_HIGH(GPIOC_PIN15))
595
#define VAL_GPIOC_PUPDR             (PIN_PUPDR_FLOATING(GPIOC_OTG_FS_POWER_ON) |\
596
                                     PIN_PUPDR_PULLUP(GPIOC_PIN1) |         \
597
                                     PIN_PUPDR_PULLUP(GPIOC_PIN2) |         \
598
                                     PIN_PUPDR_PULLUP(GPIOC_PDM_OUT) |      \
599
                                     PIN_PUPDR_PULLUP(GPIOC_PIN4) |         \
600
                                     PIN_PUPDR_PULLUP(GPIOC_PIN5) |         \
601
                                     PIN_PUPDR_PULLUP(GPIOC_PIN6) |         \
602
                                     PIN_PUPDR_FLOATING(GPIOC_MCLK) |       \
603
                                     PIN_PUPDR_PULLUP(GPIOC_PIN8) |         \
604
                                     PIN_PUPDR_PULLUP(GPIOC_PIN9) |         \
605
                                     PIN_PUPDR_FLOATING(GPIOC_SCLK) |       \
606
                                     PIN_PUPDR_PULLUP(GPIOC_PIN11) |        \
607
                                     PIN_PUPDR_FLOATING(GPIOC_SDIN) |       \
608
                                     PIN_PUPDR_PULLUP(GPIOC_PIN13) |        \
609
                                     PIN_PUPDR_PULLUP(GPIOC_PIN14) |        \
610
                                     PIN_PUPDR_PULLUP(GPIOC_PIN15))
611
#define VAL_GPIOC_ODR               (PIN_ODR_HIGH(GPIOC_OTG_FS_POWER_ON) |  \
612
                                     PIN_ODR_HIGH(GPIOC_PIN1) |             \
613
                                     PIN_ODR_HIGH(GPIOC_PIN2) |             \
614
                                     PIN_ODR_HIGH(GPIOC_PDM_OUT) |          \
615
                                     PIN_ODR_HIGH(GPIOC_PIN4) |             \
616
                                     PIN_ODR_HIGH(GPIOC_PIN5) |             \
617
                                     PIN_ODR_HIGH(GPIOC_PIN6) |             \
618
                                     PIN_ODR_HIGH(GPIOC_MCLK) |             \
619
                                     PIN_ODR_HIGH(GPIOC_PIN8) |             \
620
                                     PIN_ODR_HIGH(GPIOC_PIN9) |             \
621
                                     PIN_ODR_HIGH(GPIOC_SCLK) |             \
622
                                     PIN_ODR_HIGH(GPIOC_PIN11) |            \
623
                                     PIN_ODR_HIGH(GPIOC_SDIN) |             \
624
                                     PIN_ODR_HIGH(GPIOC_PIN13) |            \
625
                                     PIN_ODR_HIGH(GPIOC_PIN14) |            \
626
                                     PIN_ODR_HIGH(GPIOC_PIN15))
627
#define VAL_GPIOC_AFRL              (PIN_AFIO_AF(GPIOC_OTG_FS_POWER_ON, 0U) |\
628
                                     PIN_AFIO_AF(GPIOC_PIN1, 0U) |          \
629
                                     PIN_AFIO_AF(GPIOC_PIN2, 0U) |          \
630
                                     PIN_AFIO_AF(GPIOC_PDM_OUT, 0U) |       \
631
                                     PIN_AFIO_AF(GPIOC_PIN4, 0U) |          \
632
                                     PIN_AFIO_AF(GPIOC_PIN5, 0U) |          \
633
                                     PIN_AFIO_AF(GPIOC_PIN6, 0U) |          \
634
                                     PIN_AFIO_AF(GPIOC_MCLK, 6U))
635
#define VAL_GPIOC_AFRH              (PIN_AFIO_AF(GPIOC_PIN8, 0U) |          \
636
                                     PIN_AFIO_AF(GPIOC_PIN9, 0U) |          \
637
                                     PIN_AFIO_AF(GPIOC_SCLK, 6U) |          \
638
                                     PIN_AFIO_AF(GPIOC_PIN11, 0U) |         \
639
                                     PIN_AFIO_AF(GPIOC_SDIN, 6U) |          \
640
                                     PIN_AFIO_AF(GPIOC_PIN13, 0U) |         \
641
                                     PIN_AFIO_AF(GPIOC_PIN14, 0U) |         \
642
                                     PIN_AFIO_AF(GPIOC_PIN15, 0U))
643
644
/*
645
 * GPIOD setup:
646
 *
647
 * PD0  - PIN0                      (input pullup).
648
 * PD1  - PIN1                      (input pullup).
649
 * PD2  - PIN2                      (input pullup).
650
 * PD3  - PIN3                      (input pullup).
651
 * PD4  - RESET                     (output pushpull maximum).
652
 * PD5  - OVER_CURRENT              (input floating).
653
 * PD6  - PIN6                      (input pullup).
654
 * PD7  - PIN7                      (input pullup).
655
 * PD8  - PIN8                      (input pullup).
656
 * PD9  - PIN9                      (input pullup).
657
 * PD10 - PIN10                     (input pullup).
658
 * PD11 - PIN11                     (input pullup).
659
 * PD12 - LED4                      (output pushpull maximum).
660
 * PD13 - LED3                      (output pushpull maximum).
661
 * PD14 - LED5                      (output pushpull maximum).
662
 * PD15 - LED6                      (output pushpull maximum).
663
 */
664
#define VAL_GPIOD_MODER             (PIN_MODE_INPUT(GPIOD_PIN0) |           \
665
                                     PIN_MODE_INPUT(GPIOD_PIN1) |           \
666
                                     PIN_MODE_INPUT(GPIOD_PIN2) |           \
667
                                     PIN_MODE_INPUT(GPIOD_PIN3) |           \
668
                                     PIN_MODE_OUTPUT(GPIOD_RESET) |         \
669
                                     PIN_MODE_INPUT(GPIOD_OVER_CURRENT) |   \
670
                                     PIN_MODE_INPUT(GPIOD_PIN6) |           \
671
                                     PIN_MODE_INPUT(GPIOD_PIN7) |           \
672
                                     PIN_MODE_INPUT(GPIOD_PIN8) |           \
673
                                     PIN_MODE_INPUT(GPIOD_PIN9) |           \
674
                                     PIN_MODE_INPUT(GPIOD_PIN10) |          \
675
                                     PIN_MODE_INPUT(GPIOD_PIN11) |          \
676
                                     PIN_MODE_OUTPUT(GPIOD_LED4) |          \
677
                                     PIN_MODE_OUTPUT(GPIOD_LED3) |          \
678
                                     PIN_MODE_OUTPUT(GPIOD_LED5) |          \
679
                                     PIN_MODE_OUTPUT(GPIOD_LED6))
680
#define VAL_GPIOD_OTYPER            (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) |       \
681
                                     PIN_OTYPE_PUSHPULL(GPIOD_PIN1) |       \
682
                                     PIN_OTYPE_PUSHPULL(GPIOD_PIN2) |       \
683
                                     PIN_OTYPE_PUSHPULL(GPIOD_PIN3) |       \
684
                                     PIN_OTYPE_PUSHPULL(GPIOD_RESET) |      \
685
                                     PIN_OTYPE_PUSHPULL(GPIOD_OVER_CURRENT) |\
686
                                     PIN_OTYPE_PUSHPULL(GPIOD_PIN6) |       \
687
                                     PIN_OTYPE_PUSHPULL(GPIOD_PIN7) |       \
688
                                     PIN_OTYPE_PUSHPULL(GPIOD_PIN8) |       \
689
                                     PIN_OTYPE_PUSHPULL(GPIOD_PIN9) |       \
690
                                     PIN_OTYPE_PUSHPULL(GPIOD_PIN10) |      \
691
                                     PIN_OTYPE_PUSHPULL(GPIOD_PIN11) |      \
692
                                     PIN_OTYPE_PUSHPULL(GPIOD_LED4) |       \
693
                                     PIN_OTYPE_PUSHPULL(GPIOD_LED3) |       \
694
                                     PIN_OTYPE_PUSHPULL(GPIOD_LED5) |       \
695
                                     PIN_OTYPE_PUSHPULL(GPIOD_LED6))
696
#define VAL_GPIOD_OSPEEDR           (PIN_OSPEED_HIGH(GPIOD_PIN0) |          \
697
                                     PIN_OSPEED_HIGH(GPIOD_PIN1) |          \
698
                                     PIN_OSPEED_HIGH(GPIOD_PIN2) |          \
699
                                     PIN_OSPEED_HIGH(GPIOD_PIN3) |          \
700
                                     PIN_OSPEED_HIGH(GPIOD_RESET) |         \
701
                                     PIN_OSPEED_HIGH(GPIOD_OVER_CURRENT) |  \
702
                                     PIN_OSPEED_HIGH(GPIOD_PIN6) |          \
703
                                     PIN_OSPEED_HIGH(GPIOD_PIN7) |          \
704
                                     PIN_OSPEED_HIGH(GPIOD_PIN8) |          \
705
                                     PIN_OSPEED_HIGH(GPIOD_PIN9) |          \
706
                                     PIN_OSPEED_HIGH(GPIOD_PIN10) |         \
707
                                     PIN_OSPEED_HIGH(GPIOD_PIN11) |         \
708
                                     PIN_OSPEED_HIGH(GPIOD_LED4) |          \
709
                                     PIN_OSPEED_HIGH(GPIOD_LED3) |          \
710
                                     PIN_OSPEED_HIGH(GPIOD_LED5) |          \
711
                                     PIN_OSPEED_HIGH(GPIOD_LED6))
712
#define VAL_GPIOD_PUPDR             (PIN_PUPDR_PULLUP(GPIOD_PIN0) |         \
713
                                     PIN_PUPDR_PULLUP(GPIOD_PIN1) |         \
714
                                     PIN_PUPDR_PULLUP(GPIOD_PIN2) |         \
715
                                     PIN_PUPDR_PULLUP(GPIOD_PIN3) |         \
716
                                     PIN_PUPDR_FLOATING(GPIOD_RESET) |      \
717
                                     PIN_PUPDR_FLOATING(GPIOD_OVER_CURRENT) |\
718
                                     PIN_PUPDR_PULLUP(GPIOD_PIN6) |         \
719
                                     PIN_PUPDR_PULLUP(GPIOD_PIN7) |         \
720
                                     PIN_PUPDR_PULLUP(GPIOD_PIN8) |         \
721
                                     PIN_PUPDR_PULLUP(GPIOD_PIN9) |         \
722
                                     PIN_PUPDR_PULLUP(GPIOD_PIN10) |        \
723
                                     PIN_PUPDR_PULLUP(GPIOD_PIN11) |        \
724
                                     PIN_PUPDR_FLOATING(GPIOD_LED4) |       \
725
                                     PIN_PUPDR_FLOATING(GPIOD_LED3) |       \
726
                                     PIN_PUPDR_FLOATING(GPIOD_LED5) |       \
727
                                     PIN_PUPDR_FLOATING(GPIOD_LED6))
728
#define VAL_GPIOD_ODR               (PIN_ODR_HIGH(GPIOD_PIN0) |             \
729
                                     PIN_ODR_HIGH(GPIOD_PIN1) |             \
730
                                     PIN_ODR_HIGH(GPIOD_PIN2) |             \
731
                                     PIN_ODR_HIGH(GPIOD_PIN3) |             \
732
                                     PIN_ODR_HIGH(GPIOD_RESET) |            \
733
                                     PIN_ODR_HIGH(GPIOD_OVER_CURRENT) |     \
734
                                     PIN_ODR_HIGH(GPIOD_PIN6) |             \
735
                                     PIN_ODR_HIGH(GPIOD_PIN7) |             \
736
                                     PIN_ODR_HIGH(GPIOD_PIN8) |             \
737
                                     PIN_ODR_HIGH(GPIOD_PIN9) |             \
738
                                     PIN_ODR_HIGH(GPIOD_PIN10) |            \
739
                                     PIN_ODR_HIGH(GPIOD_PIN11) |            \
740
                                     PIN_ODR_LOW(GPIOD_LED4) |              \
741
                                     PIN_ODR_LOW(GPIOD_LED3) |              \
742
                                     PIN_ODR_LOW(GPIOD_LED5) |              \
743
                                     PIN_ODR_LOW(GPIOD_LED6))
744
#define VAL_GPIOD_AFRL              (PIN_AFIO_AF(GPIOD_PIN0, 0U) |          \
745
                                     PIN_AFIO_AF(GPIOD_PIN1, 0U) |          \
746
                                     PIN_AFIO_AF(GPIOD_PIN2, 0U) |          \
747
                                     PIN_AFIO_AF(GPIOD_PIN3, 0U) |          \
748
                                     PIN_AFIO_AF(GPIOD_RESET, 0U) |         \
749
                                     PIN_AFIO_AF(GPIOD_OVER_CURRENT, 0U) |  \
750
                                     PIN_AFIO_AF(GPIOD_PIN6, 0U) |          \
751
                                     PIN_AFIO_AF(GPIOD_PIN7, 0U))
752
#define VAL_GPIOD_AFRH              (PIN_AFIO_AF(GPIOD_PIN8, 0U) |          \
753
                                     PIN_AFIO_AF(GPIOD_PIN9, 0U) |          \
754
                                     PIN_AFIO_AF(GPIOD_PIN10, 0U) |         \
755
                                     PIN_AFIO_AF(GPIOD_PIN11, 0U) |         \
756
                                     PIN_AFIO_AF(GPIOD_LED4, 0U) |          \
757
                                     PIN_AFIO_AF(GPIOD_LED3, 0U) |          \
758
                                     PIN_AFIO_AF(GPIOD_LED5, 0U) |          \
759
                                     PIN_AFIO_AF(GPIOD_LED6, 0U))
760
761
/*
762
 * GPIOE setup:
763
 *
764
 * PE0  - INT1                      (input floating).
765
 * PE1  - INT2                      (input floating).
766
 * PE2  - PIN2                      (input floating).
767
 * PE3  - CS_SPI                    (output pushpull maximum).
768
 * PE4  - PIN4                      (input floating).
769
 * PE5  - PIN5                      (input floating).
770
 * PE6  - PIN6                      (input floating).
771
 * PE7  - PIN7                      (input floating).
772
 * PE8  - PIN8                      (input floating).
773
 * PE9  - PIN9                      (input floating).
774
 * PE10 - PIN10                     (input floating).
775
 * PE11 - PIN11                     (input floating).
776
 * PE12 - PIN12                     (input floating).
777
 * PE13 - PIN13                     (input floating).
778
 * PE14 - PIN14                     (input floating).
779
 * PE15 - PIN15                     (input floating).
780
 */
781
#define VAL_GPIOE_MODER             (PIN_MODE_INPUT(GPIOE_INT1) |           \
782
                                     PIN_MODE_INPUT(GPIOE_INT2) |           \
783
                                     PIN_MODE_INPUT(GPIOE_PIN2) |           \
784
                                     PIN_MODE_OUTPUT(GPIOE_CS_SPI) |        \
785
                                     PIN_MODE_INPUT(GPIOE_PIN4) |           \
786
                                     PIN_MODE_INPUT(GPIOE_PIN5) |           \
787
                                     PIN_MODE_INPUT(GPIOE_PIN6) |           \
788
                                     PIN_MODE_INPUT(GPIOE_PIN7) |           \
789
                                     PIN_MODE_INPUT(GPIOE_PIN8) |           \
790
                                     PIN_MODE_INPUT(GPIOE_PIN9) |           \
791
                                     PIN_MODE_INPUT(GPIOE_PIN10) |          \
792
                                     PIN_MODE_INPUT(GPIOE_PIN11) |          \
793
                                     PIN_MODE_INPUT(GPIOE_PIN12) |          \
794
                                     PIN_MODE_INPUT(GPIOE_PIN13) |          \
795
                                     PIN_MODE_INPUT(GPIOE_PIN14) |          \
796
                                     PIN_MODE_INPUT(GPIOE_PIN15))
797
#define VAL_GPIOE_OTYPER            (PIN_OTYPE_PUSHPULL(GPIOE_INT1) |       \
798
                                     PIN_OTYPE_PUSHPULL(GPIOE_INT2) |       \
799
                                     PIN_OTYPE_PUSHPULL(GPIOE_PIN2) |       \
800
                                     PIN_OTYPE_PUSHPULL(GPIOE_CS_SPI) |     \
801
                                     PIN_OTYPE_PUSHPULL(GPIOE_PIN4) |       \
802
                                     PIN_OTYPE_PUSHPULL(GPIOE_PIN5) |       \
803
                                     PIN_OTYPE_PUSHPULL(GPIOE_PIN6) |       \
804
                                     PIN_OTYPE_PUSHPULL(GPIOE_PIN7) |       \
805
                                     PIN_OTYPE_PUSHPULL(GPIOE_PIN8) |       \
806
                                     PIN_OTYPE_PUSHPULL(GPIOE_PIN9) |       \
807
                                     PIN_OTYPE_PUSHPULL(GPIOE_PIN10) |      \
808
                                     PIN_OTYPE_PUSHPULL(GPIOE_PIN11) |      \
809
                                     PIN_OTYPE_PUSHPULL(GPIOE_PIN12) |      \
810
                                     PIN_OTYPE_PUSHPULL(GPIOE_PIN13) |      \
811
                                     PIN_OTYPE_PUSHPULL(GPIOE_PIN14) |      \
812
                                     PIN_OTYPE_PUSHPULL(GPIOE_PIN15))
813
#define VAL_GPIOE_OSPEEDR           (PIN_OSPEED_HIGH(GPIOE_INT1) |          \
814
                                     PIN_OSPEED_HIGH(GPIOE_INT2) |          \
815
                                     PIN_OSPEED_HIGH(GPIOE_PIN2) |          \
816
                                     PIN_OSPEED_HIGH(GPIOE_CS_SPI) |        \
817
                                     PIN_OSPEED_HIGH(GPIOE_PIN4) |          \
818
                                     PIN_OSPEED_HIGH(GPIOE_PIN5) |          \
819
                                     PIN_OSPEED_HIGH(GPIOE_PIN6) |          \
820
                                     PIN_OSPEED_HIGH(GPIOE_PIN7) |          \
821
                                     PIN_OSPEED_HIGH(GPIOE_PIN8) |          \
822
                                     PIN_OSPEED_HIGH(GPIOE_PIN9) |          \
823
                                     PIN_OSPEED_HIGH(GPIOE_PIN10) |         \
824
                                     PIN_OSPEED_HIGH(GPIOE_PIN11) |         \
825
                                     PIN_OSPEED_HIGH(GPIOE_PIN12) |         \
826
                                     PIN_OSPEED_HIGH(GPIOE_PIN13) |         \
827
                                     PIN_OSPEED_HIGH(GPIOE_PIN14) |         \
828
                                     PIN_OSPEED_HIGH(GPIOE_PIN15))
829
#define VAL_GPIOE_PUPDR             (PIN_PUPDR_FLOATING(GPIOE_INT1) |       \
830
                                     PIN_PUPDR_FLOATING(GPIOE_INT2) |       \
831
                                     PIN_PUPDR_FLOATING(GPIOE_PIN2) |       \
832
                                     PIN_PUPDR_FLOATING(GPIOE_CS_SPI) |     \
833
                                     PIN_PUPDR_FLOATING(GPIOE_PIN4) |       \
834
                                     PIN_PUPDR_FLOATING(GPIOE_PIN5) |       \
835
                                     PIN_PUPDR_FLOATING(GPIOE_PIN6) |       \
836
                                     PIN_PUPDR_FLOATING(GPIOE_PIN7) |       \
837
                                     PIN_PUPDR_FLOATING(GPIOE_PIN8) |       \
838
                                     PIN_PUPDR_FLOATING(GPIOE_PIN9) |       \
839
                                     PIN_PUPDR_FLOATING(GPIOE_PIN10) |      \
840
                                     PIN_PUPDR_FLOATING(GPIOE_PIN11) |      \
841
                                     PIN_PUPDR_FLOATING(GPIOE_PIN12) |      \
842
                                     PIN_PUPDR_FLOATING(GPIOE_PIN13) |      \
843
                                     PIN_PUPDR_FLOATING(GPIOE_PIN14) |      \
844
                                     PIN_PUPDR_FLOATING(GPIOE_PIN15))
845
#define VAL_GPIOE_ODR               (PIN_ODR_HIGH(GPIOE_INT1) |             \
846
                                     PIN_ODR_HIGH(GPIOE_INT2) |             \
847
                                     PIN_ODR_HIGH(GPIOE_PIN2) |             \
848
                                     PIN_ODR_HIGH(GPIOE_CS_SPI) |           \
849
                                     PIN_ODR_HIGH(GPIOE_PIN4) |             \
850
                                     PIN_ODR_HIGH(GPIOE_PIN5) |             \
851
                                     PIN_ODR_HIGH(GPIOE_PIN6) |             \
852
                                     PIN_ODR_HIGH(GPIOE_PIN7) |             \
853
                                     PIN_ODR_HIGH(GPIOE_PIN8) |             \
854
                                     PIN_ODR_HIGH(GPIOE_PIN9) |             \
855
                                     PIN_ODR_HIGH(GPIOE_PIN10) |            \
856
                                     PIN_ODR_HIGH(GPIOE_PIN11) |            \
857
                                     PIN_ODR_HIGH(GPIOE_PIN12) |            \
858
                                     PIN_ODR_HIGH(GPIOE_PIN13) |            \
859
                                     PIN_ODR_HIGH(GPIOE_PIN14) |            \
860
                                     PIN_ODR_HIGH(GPIOE_PIN15))
861
#define VAL_GPIOE_AFRL              (PIN_AFIO_AF(GPIOE_INT1, 0U) |          \
862
                                     PIN_AFIO_AF(GPIOE_INT2, 0U) |          \
863
                                     PIN_AFIO_AF(GPIOE_PIN2, 0U) |          \
864
                                     PIN_AFIO_AF(GPIOE_CS_SPI, 0U) |        \
865
                                     PIN_AFIO_AF(GPIOE_PIN4, 0U) |          \
866
                                     PIN_AFIO_AF(GPIOE_PIN5, 0U) |          \
867
                                     PIN_AFIO_AF(GPIOE_PIN6, 0U) |          \
868
                                     PIN_AFIO_AF(GPIOE_PIN7, 0U))
869
#define VAL_GPIOE_AFRH              (PIN_AFIO_AF(GPIOE_PIN8, 0U) |          \
870
                                     PIN_AFIO_AF(GPIOE_PIN9, 0U) |          \
871
                                     PIN_AFIO_AF(GPIOE_PIN10, 0U) |         \
872
                                     PIN_AFIO_AF(GPIOE_PIN11, 0U) |         \
873
                                     PIN_AFIO_AF(GPIOE_PIN12, 0U) |         \
874
                                     PIN_AFIO_AF(GPIOE_PIN13, 0U) |         \
875
                                     PIN_AFIO_AF(GPIOE_PIN14, 0U) |         \
876
                                     PIN_AFIO_AF(GPIOE_PIN15, 0U))
877
878
/*
879
 * GPIOF setup:
880
 *
881
 * PF0  - PIN0                      (input floating).
882
 * PF1  - PIN1                      (input floating).
883
 * PF2  - PIN2                      (input floating).
884
 * PF3  - PIN3                      (input floating).
885
 * PF4  - PIN4                      (input floating).
886
 * PF5  - PIN5                      (input floating).
887
 * PF6  - PIN6                      (input floating).
888
 * PF7  - PIN7                      (input floating).
889
 * PF8  - PIN8                      (input floating).
890
 * PF9  - PIN9                      (input floating).
891
 * PF10 - PIN10                     (input floating).
892
 * PF11 - PIN11                     (input floating).
893
 * PF12 - PIN12                     (input floating).
894
 * PF13 - PIN13                     (input floating).
895
 * PF14 - PIN14                     (input floating).
896
 * PF15 - PIN15                     (input floating).
897
 */
898
#define VAL_GPIOF_MODER             (PIN_MODE_INPUT(GPIOF_PIN0) |           \
899
                                     PIN_MODE_INPUT(GPIOF_PIN1) |           \
900
                                     PIN_MODE_INPUT(GPIOF_PIN2) |           \
901
                                     PIN_MODE_INPUT(GPIOF_PIN3) |           \
902
                                     PIN_MODE_INPUT(GPIOF_PIN4) |           \
903
                                     PIN_MODE_INPUT(GPIOF_PIN5) |           \
904
                                     PIN_MODE_INPUT(GPIOF_PIN6) |           \
905
                                     PIN_MODE_INPUT(GPIOF_PIN7) |           \
906
                                     PIN_MODE_INPUT(GPIOF_PIN8) |           \
907
                                     PIN_MODE_INPUT(GPIOF_PIN9) |           \
908
                                     PIN_MODE_INPUT(GPIOF_PIN10) |          \
909
                                     PIN_MODE_INPUT(GPIOF_PIN11) |          \
910
                                     PIN_MODE_INPUT(GPIOF_PIN12) |          \
911
                                     PIN_MODE_INPUT(GPIOF_PIN13) |          \
912
                                     PIN_MODE_INPUT(GPIOF_PIN14) |          \
913
                                     PIN_MODE_INPUT(GPIOF_PIN15))
914
#define VAL_GPIOF_OTYPER            (PIN_OTYPE_PUSHPULL(GPIOF_PIN0) |       \
915
                                     PIN_OTYPE_PUSHPULL(GPIOF_PIN1) |       \
916
                                     PIN_OTYPE_PUSHPULL(GPIOF_PIN2) |       \
917
                                     PIN_OTYPE_PUSHPULL(GPIOF_PIN3) |       \
918
                                     PIN_OTYPE_PUSHPULL(GPIOF_PIN4) |       \
919
                                     PIN_OTYPE_PUSHPULL(GPIOF_PIN5) |       \
920
                                     PIN_OTYPE_PUSHPULL(GPIOF_PIN6) |       \
921
                                     PIN_OTYPE_PUSHPULL(GPIOF_PIN7) |       \
922
                                     PIN_OTYPE_PUSHPULL(GPIOF_PIN8) |       \
923
                                     PIN_OTYPE_PUSHPULL(GPIOF_PIN9) |       \
924
                                     PIN_OTYPE_PUSHPULL(GPIOF_PIN10) |      \
925
                                     PIN_OTYPE_PUSHPULL(GPIOF_PIN11) |      \
926
                                     PIN_OTYPE_PUSHPULL(GPIOF_PIN12) |      \
927
                                     PIN_OTYPE_PUSHPULL(GPIOF_PIN13) |      \
928
                                     PIN_OTYPE_PUSHPULL(GPIOF_PIN14) |      \
929
                                     PIN_OTYPE_PUSHPULL(GPIOF_PIN15))
930
#define VAL_GPIOF_OSPEEDR           (PIN_OSPEED_HIGH(GPIOF_PIN0) |          \
931
                                     PIN_OSPEED_HIGH(GPIOF_PIN1) |          \
932
                                     PIN_OSPEED_HIGH(GPIOF_PIN2) |          \
933
                                     PIN_OSPEED_HIGH(GPIOF_PIN3) |          \
934
                                     PIN_OSPEED_HIGH(GPIOF_PIN4) |          \
935
                                     PIN_OSPEED_HIGH(GPIOF_PIN5) |          \
936
                                     PIN_OSPEED_HIGH(GPIOF_PIN6) |          \
937
                                     PIN_OSPEED_HIGH(GPIOF_PIN7) |          \
938
                                     PIN_OSPEED_HIGH(GPIOF_PIN8) |          \
939
                                     PIN_OSPEED_HIGH(GPIOF_PIN9) |          \
940
                                     PIN_OSPEED_HIGH(GPIOF_PIN10) |         \
941
                                     PIN_OSPEED_HIGH(GPIOF_PIN11) |         \
942
                                     PIN_OSPEED_HIGH(GPIOF_PIN12) |         \
943
                                     PIN_OSPEED_HIGH(GPIOF_PIN13) |         \
944
                                     PIN_OSPEED_HIGH(GPIOF_PIN14) |         \
945
                                     PIN_OSPEED_HIGH(GPIOF_PIN15))
946
#define VAL_GPIOF_PUPDR             (PIN_PUPDR_FLOATING(GPIOF_PIN0) |       \
947
                                     PIN_PUPDR_FLOATING(GPIOF_PIN1) |       \
948
                                     PIN_PUPDR_FLOATING(GPIOF_PIN2) |       \
949
                                     PIN_PUPDR_FLOATING(GPIOF_PIN3) |       \
950
                                     PIN_PUPDR_FLOATING(GPIOF_PIN4) |       \
951
                                     PIN_PUPDR_FLOATING(GPIOF_PIN5) |       \
952
                                     PIN_PUPDR_FLOATING(GPIOF_PIN6) |       \
953
                                     PIN_PUPDR_FLOATING(GPIOF_PIN7) |       \
954
                                     PIN_PUPDR_FLOATING(GPIOF_PIN8) |       \
955
                                     PIN_PUPDR_FLOATING(GPIOF_PIN9) |       \
956
                                     PIN_PUPDR_FLOATING(GPIOF_PIN10) |      \
957
                                     PIN_PUPDR_FLOATING(GPIOF_PIN11) |      \
958
                                     PIN_PUPDR_FLOATING(GPIOF_PIN12) |      \
959
                                     PIN_PUPDR_FLOATING(GPIOF_PIN13) |      \
960
                                     PIN_PUPDR_FLOATING(GPIOF_PIN14) |      \
961
                                     PIN_PUPDR_FLOATING(GPIOF_PIN15))
962
#define VAL_GPIOF_ODR               (PIN_ODR_HIGH(GPIOF_PIN0) |             \
963
                                     PIN_ODR_HIGH(GPIOF_PIN1) |             \
964
                                     PIN_ODR_HIGH(GPIOF_PIN2) |             \
965
                                     PIN_ODR_HIGH(GPIOF_PIN3) |             \
966
                                     PIN_ODR_HIGH(GPIOF_PIN4) |             \
967
                                     PIN_ODR_HIGH(GPIOF_PIN5) |             \
968
                                     PIN_ODR_HIGH(GPIOF_PIN6) |             \
969
                                     PIN_ODR_HIGH(GPIOF_PIN7) |             \
970
                                     PIN_ODR_HIGH(GPIOF_PIN8) |             \
971
                                     PIN_ODR_HIGH(GPIOF_PIN9) |             \
972
                                     PIN_ODR_HIGH(GPIOF_PIN10) |            \
973
                                     PIN_ODR_HIGH(GPIOF_PIN11) |            \
974
                                     PIN_ODR_HIGH(GPIOF_PIN12) |            \
975
                                     PIN_ODR_HIGH(GPIOF_PIN13) |            \
976
                                     PIN_ODR_HIGH(GPIOF_PIN14) |            \
977
                                     PIN_ODR_HIGH(GPIOF_PIN15))
978
#define VAL_GPIOF_AFRL              (PIN_AFIO_AF(GPIOF_PIN0, 0U) |          \
979
                                     PIN_AFIO_AF(GPIOF_PIN1, 0U) |          \
980
                                     PIN_AFIO_AF(GPIOF_PIN2, 0U) |          \
981
                                     PIN_AFIO_AF(GPIOF_PIN3, 0U) |          \
982
                                     PIN_AFIO_AF(GPIOF_PIN4, 0U) |          \
983
                                     PIN_AFIO_AF(GPIOF_PIN5, 0U) |          \
984
                                     PIN_AFIO_AF(GPIOF_PIN6, 0U) |          \
985
                                     PIN_AFIO_AF(GPIOF_PIN7, 0U))
986
#define VAL_GPIOF_AFRH              (PIN_AFIO_AF(GPIOF_PIN8, 0U) |          \
987
                                     PIN_AFIO_AF(GPIOF_PIN9, 0U) |          \
988
                                     PIN_AFIO_AF(GPIOF_PIN10, 0U) |         \
989
                                     PIN_AFIO_AF(GPIOF_PIN11, 0U) |         \
990
                                     PIN_AFIO_AF(GPIOF_PIN12, 0U) |         \
991
                                     PIN_AFIO_AF(GPIOF_PIN13, 0U) |         \
992
                                     PIN_AFIO_AF(GPIOF_PIN14, 0U) |         \
993
                                     PIN_AFIO_AF(GPIOF_PIN15, 0U))
994
995
/*
996
 * GPIOG setup:
997
 *
998
 * PG0  - PIN0                      (input floating).
999
 * PG1  - PIN1                      (input floating).
1000
 * PG2  - PIN2                      (input floating).
1001
 * PG3  - PIN3                      (input floating).
1002
 * PG4  - PIN4                      (input floating).
1003
 * PG5  - PIN5                      (input floating).
1004
 * PG6  - PIN6                      (input floating).
1005
 * PG7  - PIN7                      (input floating).
1006
 * PG8  - PIN8                      (input floating).
1007
 * PG9  - PIN9                      (input floating).
1008
 * PG10 - PIN10                     (input floating).
1009
 * PG11 - PIN11                     (input floating).
1010
 * PG12 - PIN12                     (input floating).
1011
 * PG13 - PIN13                     (input floating).
1012
 * PG14 - PIN14                     (input floating).
1013
 * PG15 - PIN15                     (input floating).
1014
 */
1015
#define VAL_GPIOG_MODER             (PIN_MODE_INPUT(GPIOG_PIN0) |           \
1016
                                     PIN_MODE_INPUT(GPIOG_PIN1) |           \
1017
                                     PIN_MODE_INPUT(GPIOG_PIN2) |           \
1018
                                     PIN_MODE_INPUT(GPIOG_PIN3) |           \
1019
                                     PIN_MODE_INPUT(GPIOG_PIN4) |           \
1020
                                     PIN_MODE_INPUT(GPIOG_PIN5) |           \
1021
                                     PIN_MODE_INPUT(GPIOG_PIN6) |           \
1022
                                     PIN_MODE_INPUT(GPIOG_PIN7) |           \
1023
                                     PIN_MODE_INPUT(GPIOG_PIN8) |           \
1024
                                     PIN_MODE_INPUT(GPIOG_PIN9) |           \
1025
                                     PIN_MODE_INPUT(GPIOG_PIN10) |          \
1026
                                     PIN_MODE_INPUT(GPIOG_PIN11) |          \
1027
                                     PIN_MODE_INPUT(GPIOG_PIN12) |          \
1028
                                     PIN_MODE_INPUT(GPIOG_PIN13) |          \
1029
                                     PIN_MODE_INPUT(GPIOG_PIN14) |          \
1030
                                     PIN_MODE_INPUT(GPIOG_PIN15))
1031
#define VAL_GPIOG_OTYPER            (PIN_OTYPE_PUSHPULL(GPIOG_PIN0) |       \
1032
                                     PIN_OTYPE_PUSHPULL(GPIOG_PIN1) |       \
1033
                                     PIN_OTYPE_PUSHPULL(GPIOG_PIN2) |       \
1034
                                     PIN_OTYPE_PUSHPULL(GPIOG_PIN3) |       \
1035
                                     PIN_OTYPE_PUSHPULL(GPIOG_PIN4) |       \
1036
                                     PIN_OTYPE_PUSHPULL(GPIOG_PIN5) |       \
1037
                                     PIN_OTYPE_PUSHPULL(GPIOG_PIN6) |       \
1038
                                     PIN_OTYPE_PUSHPULL(GPIOG_PIN7) |       \
1039
                                     PIN_OTYPE_PUSHPULL(GPIOG_PIN8) |       \
1040
                                     PIN_OTYPE_PUSHPULL(GPIOG_PIN9) |       \
1041
                                     PIN_OTYPE_PUSHPULL(GPIOG_PIN10) |      \
1042
                                     PIN_OTYPE_PUSHPULL(GPIOG_PIN11) |      \
1043
                                     PIN_OTYPE_PUSHPULL(GPIOG_PIN12) |      \
1044
                                     PIN_OTYPE_PUSHPULL(GPIOG_PIN13) |      \
1045
                                     PIN_OTYPE_PUSHPULL(GPIOG_PIN14) |      \
1046
                                     PIN_OTYPE_PUSHPULL(GPIOG_PIN15))
1047
#define VAL_GPIOG_OSPEEDR           (PIN_OSPEED_HIGH(GPIOG_PIN0) |          \
1048
                                     PIN_OSPEED_HIGH(GPIOG_PIN1) |          \
1049
                                     PIN_OSPEED_HIGH(GPIOG_PIN2) |          \
1050
                                     PIN_OSPEED_HIGH(GPIOG_PIN3) |          \
1051
                                     PIN_OSPEED_HIGH(GPIOG_PIN4) |          \
1052
                                     PIN_OSPEED_HIGH(GPIOG_PIN5) |          \
1053
                                     PIN_OSPEED_HIGH(GPIOG_PIN6) |          \
1054
                                     PIN_OSPEED_HIGH(GPIOG_PIN7) |          \
1055
                                     PIN_OSPEED_HIGH(GPIOG_PIN8) |          \
1056
                                     PIN_OSPEED_HIGH(GPIOG_PIN9) |          \
1057
                                     PIN_OSPEED_HIGH(GPIOG_PIN10) |         \
1058
                                     PIN_OSPEED_HIGH(GPIOG_PIN11) |         \
1059
                                     PIN_OSPEED_HIGH(GPIOG_PIN12) |         \
1060
                                     PIN_OSPEED_HIGH(GPIOG_PIN13) |         \
1061
                                     PIN_OSPEED_HIGH(GPIOG_PIN14) |         \
1062
                                     PIN_OSPEED_HIGH(GPIOG_PIN15))
1063
#define VAL_GPIOG_PUPDR             (PIN_PUPDR_FLOATING(GPIOG_PIN0) |       \
1064
                                     PIN_PUPDR_FLOATING(GPIOG_PIN1) |       \
1065
                                     PIN_PUPDR_FLOATING(GPIOG_PIN2) |       \
1066
                                     PIN_PUPDR_FLOATING(GPIOG_PIN3) |       \
1067
                                     PIN_PUPDR_FLOATING(GPIOG_PIN4) |       \
1068
                                     PIN_PUPDR_FLOATING(GPIOG_PIN5) |       \
1069
                                     PIN_PUPDR_FLOATING(GPIOG_PIN6) |       \
1070
                                     PIN_PUPDR_FLOATING(GPIOG_PIN7) |       \
1071
                                     PIN_PUPDR_FLOATING(GPIOG_PIN8) |       \
1072
                                     PIN_PUPDR_FLOATING(GPIOG_PIN9) |       \
1073
                                     PIN_PUPDR_FLOATING(GPIOG_PIN10) |      \
1074
                                     PIN_PUPDR_FLOATING(GPIOG_PIN11) |      \
1075
                                     PIN_PUPDR_FLOATING(GPIOG_PIN12) |      \
1076
                                     PIN_PUPDR_FLOATING(GPIOG_PIN13) |      \
1077
                                     PIN_PUPDR_FLOATING(GPIOG_PIN14) |      \
1078
                                     PIN_PUPDR_FLOATING(GPIOG_PIN15))
1079
#define VAL_GPIOG_ODR               (PIN_ODR_HIGH(GPIOG_PIN0) |             \
1080
                                     PIN_ODR_HIGH(GPIOG_PIN1) |             \
1081
                                     PIN_ODR_HIGH(GPIOG_PIN2) |             \
1082
                                     PIN_ODR_HIGH(GPIOG_PIN3) |             \
1083
                                     PIN_ODR_HIGH(GPIOG_PIN4) |             \
1084
                                     PIN_ODR_HIGH(GPIOG_PIN5) |             \
1085
                                     PIN_ODR_HIGH(GPIOG_PIN6) |             \
1086
                                     PIN_ODR_HIGH(GPIOG_PIN7) |             \
1087
                                     PIN_ODR_HIGH(GPIOG_PIN8) |             \
1088
                                     PIN_ODR_HIGH(GPIOG_PIN9) |             \
1089
                                     PIN_ODR_HIGH(GPIOG_PIN10) |            \
1090
                                     PIN_ODR_HIGH(GPIOG_PIN11) |            \
1091
                                     PIN_ODR_HIGH(GPIOG_PIN12) |            \
1092
                                     PIN_ODR_HIGH(GPIOG_PIN13) |            \
1093
                                     PIN_ODR_HIGH(GPIOG_PIN14) |            \
1094
                                     PIN_ODR_HIGH(GPIOG_PIN15))
1095
#define VAL_GPIOG_AFRL              (PIN_AFIO_AF(GPIOG_PIN0, 0U) |          \
1096
                                     PIN_AFIO_AF(GPIOG_PIN1, 0U) |          \
1097
                                     PIN_AFIO_AF(GPIOG_PIN2, 0U) |          \
1098
                                     PIN_AFIO_AF(GPIOG_PIN3, 0U) |          \
1099
                                     PIN_AFIO_AF(GPIOG_PIN4, 0U) |          \
1100
                                     PIN_AFIO_AF(GPIOG_PIN5, 0U) |          \
1101
                                     PIN_AFIO_AF(GPIOG_PIN6, 0U) |          \
1102
                                     PIN_AFIO_AF(GPIOG_PIN7, 0U))
1103
#define VAL_GPIOG_AFRH              (PIN_AFIO_AF(GPIOG_PIN8, 0U) |          \
1104
                                     PIN_AFIO_AF(GPIOG_PIN9, 0U) |          \
1105
                                     PIN_AFIO_AF(GPIOG_PIN10, 0U) |         \
1106
                                     PIN_AFIO_AF(GPIOG_PIN11, 0U) |         \
1107
                                     PIN_AFIO_AF(GPIOG_PIN12, 0U) |         \
1108
                                     PIN_AFIO_AF(GPIOG_PIN13, 0U) |         \
1109
                                     PIN_AFIO_AF(GPIOG_PIN14, 0U) |         \
1110
                                     PIN_AFIO_AF(GPIOG_PIN15, 0U))
1111
1112
/*
1113
 * GPIOH setup:
1114
 *
1115
 * PH0  - OSC_IN                    (input floating).
1116
 * PH1  - OSC_OUT                   (input floating).
1117
 * PH2  - PIN2                      (input floating).
1118
 * PH3  - PIN3                      (input floating).
1119
 * PH4  - PIN4                      (input floating).
1120
 * PH5  - PIN5                      (input floating).
1121
 * PH6  - PIN6                      (input floating).
1122
 * PH7  - PIN7                      (input floating).
1123
 * PH8  - PIN8                      (input floating).
1124
 * PH9  - PIN9                      (input floating).
1125
 * PH10 - PIN10                     (input floating).
1126
 * PH11 - PIN11                     (input floating).
1127
 * PH12 - PIN12                     (input floating).
1128
 * PH13 - PIN13                     (input floating).
1129
 * PH14 - PIN14                     (input floating).
1130
 * PH15 - PIN15                     (input floating).
1131
 */
1132
#define VAL_GPIOH_MODER             (PIN_MODE_INPUT(GPIOH_OSC_IN) |         \
1133
                                     PIN_MODE_INPUT(GPIOH_OSC_OUT) |        \
1134
                                     PIN_MODE_INPUT(GPIOH_PIN2) |           \
1135
                                     PIN_MODE_INPUT(GPIOH_PIN3) |           \
1136
                                     PIN_MODE_INPUT(GPIOH_PIN4) |           \
1137
                                     PIN_MODE_INPUT(GPIOH_PIN5) |           \
1138
                                     PIN_MODE_INPUT(GPIOH_PIN6) |           \
1139
                                     PIN_MODE_INPUT(GPIOH_PIN7) |           \
1140
                                     PIN_MODE_INPUT(GPIOH_PIN8) |           \
1141
                                     PIN_MODE_INPUT(GPIOH_PIN9) |           \
1142
                                     PIN_MODE_INPUT(GPIOH_PIN10) |          \
1143
                                     PIN_MODE_INPUT(GPIOH_PIN11) |          \
1144
                                     PIN_MODE_INPUT(GPIOH_PIN12) |          \
1145
                                     PIN_MODE_INPUT(GPIOH_PIN13) |          \
1146
                                     PIN_MODE_INPUT(GPIOH_PIN14) |          \
1147
                                     PIN_MODE_INPUT(GPIOH_PIN15))
1148
#define VAL_GPIOH_OTYPER            (PIN_OTYPE_PUSHPULL(GPIOH_OSC_IN) |     \
1149
                                     PIN_OTYPE_PUSHPULL(GPIOH_OSC_OUT) |    \
1150
                                     PIN_OTYPE_PUSHPULL(GPIOH_PIN2) |       \
1151
                                     PIN_OTYPE_PUSHPULL(GPIOH_PIN3) |       \
1152
                                     PIN_OTYPE_PUSHPULL(GPIOH_PIN4) |       \
1153
                                     PIN_OTYPE_PUSHPULL(GPIOH_PIN5) |       \
1154
                                     PIN_OTYPE_PUSHPULL(GPIOH_PIN6) |       \
1155
                                     PIN_OTYPE_PUSHPULL(GPIOH_PIN7) |       \
1156
                                     PIN_OTYPE_PUSHPULL(GPIOH_PIN8) |       \
1157
                                     PIN_OTYPE_PUSHPULL(GPIOH_PIN9) |       \
1158
                                     PIN_OTYPE_PUSHPULL(GPIOH_PIN10) |      \
1159
                                     PIN_OTYPE_PUSHPULL(GPIOH_PIN11) |      \
1160
                                     PIN_OTYPE_PUSHPULL(GPIOH_PIN12) |      \
1161
                                     PIN_OTYPE_PUSHPULL(GPIOH_PIN13) |      \
1162
                                     PIN_OTYPE_PUSHPULL(GPIOH_PIN14) |      \
1163
                                     PIN_OTYPE_PUSHPULL(GPIOH_PIN15))
1164
#define VAL_GPIOH_OSPEEDR           (PIN_OSPEED_HIGH(GPIOH_OSC_IN) |        \
1165
                                     PIN_OSPEED_HIGH(GPIOH_OSC_OUT) |       \
1166
                                     PIN_OSPEED_HIGH(GPIOH_PIN2) |          \
1167
                                     PIN_OSPEED_HIGH(GPIOH_PIN3) |          \
1168
                                     PIN_OSPEED_HIGH(GPIOH_PIN4) |          \
1169
                                     PIN_OSPEED_HIGH(GPIOH_PIN5) |          \
1170
                                     PIN_OSPEED_HIGH(GPIOH_PIN6) |          \
1171
                                     PIN_OSPEED_HIGH(GPIOH_PIN7) |          \
1172
                                     PIN_OSPEED_HIGH(GPIOH_PIN8) |          \
1173
                                     PIN_OSPEED_HIGH(GPIOH_PIN9) |          \
1174
                                     PIN_OSPEED_HIGH(GPIOH_PIN10) |         \
1175
                                     PIN_OSPEED_HIGH(GPIOH_PIN11) |         \
1176
                                     PIN_OSPEED_HIGH(GPIOH_PIN12) |         \
1177
                                     PIN_OSPEED_HIGH(GPIOH_PIN13) |         \
1178
                                     PIN_OSPEED_HIGH(GPIOH_PIN14) |         \
1179
                                     PIN_OSPEED_HIGH(GPIOH_PIN15))
1180
#define VAL_GPIOH_PUPDR             (PIN_PUPDR_FLOATING(GPIOH_OSC_IN) |     \
1181
                                     PIN_PUPDR_FLOATING(GPIOH_OSC_OUT) |    \
1182
                                     PIN_PUPDR_FLOATING(GPIOH_PIN2) |       \
1183
                                     PIN_PUPDR_FLOATING(GPIOH_PIN3) |       \
1184
                                     PIN_PUPDR_FLOATING(GPIOH_PIN4) |       \
1185
                                     PIN_PUPDR_FLOATING(GPIOH_PIN5) |       \
1186
                                     PIN_PUPDR_FLOATING(GPIOH_PIN6) |       \
1187
                                     PIN_PUPDR_FLOATING(GPIOH_PIN7) |       \
1188
                                     PIN_PUPDR_FLOATING(GPIOH_PIN8) |       \
1189
                                     PIN_PUPDR_FLOATING(GPIOH_PIN9) |       \
1190
                                     PIN_PUPDR_FLOATING(GPIOH_PIN10) |      \
1191
                                     PIN_PUPDR_FLOATING(GPIOH_PIN11) |      \
1192
                                     PIN_PUPDR_FLOATING(GPIOH_PIN12) |      \
1193
                                     PIN_PUPDR_FLOATING(GPIOH_PIN13) |      \
1194
                                     PIN_PUPDR_FLOATING(GPIOH_PIN14) |      \
1195
                                     PIN_PUPDR_FLOATING(GPIOH_PIN15))
1196
#define VAL_GPIOH_ODR               (PIN_ODR_HIGH(GPIOH_OSC_IN) |           \
1197
                                     PIN_ODR_HIGH(GPIOH_OSC_OUT) |          \
1198
                                     PIN_ODR_HIGH(GPIOH_PIN2) |             \
1199
                                     PIN_ODR_HIGH(GPIOH_PIN3) |             \
1200
                                     PIN_ODR_HIGH(GPIOH_PIN4) |             \
1201
                                     PIN_ODR_HIGH(GPIOH_PIN5) |             \
1202
                                     PIN_ODR_HIGH(GPIOH_PIN6) |             \
1203
                                     PIN_ODR_HIGH(GPIOH_PIN7) |             \
1204
                                     PIN_ODR_HIGH(GPIOH_PIN8) |             \
1205
                                     PIN_ODR_HIGH(GPIOH_PIN9) |             \
1206
                                     PIN_ODR_HIGH(GPIOH_PIN10) |            \
1207
                                     PIN_ODR_HIGH(GPIOH_PIN11) |            \
1208
                                     PIN_ODR_HIGH(GPIOH_PIN12) |            \
1209
                                     PIN_ODR_HIGH(GPIOH_PIN13) |            \
1210
                                     PIN_ODR_HIGH(GPIOH_PIN14) |            \
1211
                                     PIN_ODR_HIGH(GPIOH_PIN15))
1212
#define VAL_GPIOH_AFRL              (PIN_AFIO_AF(GPIOH_OSC_IN, 0U) |        \
1213
                                     PIN_AFIO_AF(GPIOH_OSC_OUT, 0U) |       \
1214
                                     PIN_AFIO_AF(GPIOH_PIN2, 0U) |          \
1215
                                     PIN_AFIO_AF(GPIOH_PIN3, 0U) |          \
1216
                                     PIN_AFIO_AF(GPIOH_PIN4, 0U) |          \
1217
                                     PIN_AFIO_AF(GPIOH_PIN5, 0U) |          \
1218
                                     PIN_AFIO_AF(GPIOH_PIN6, 0U) |          \
1219
                                     PIN_AFIO_AF(GPIOH_PIN7, 0U))
1220
#define VAL_GPIOH_AFRH              (PIN_AFIO_AF(GPIOH_PIN8, 0U) |          \
1221
                                     PIN_AFIO_AF(GPIOH_PIN9, 0U) |          \
1222
                                     PIN_AFIO_AF(GPIOH_PIN10, 0U) |         \
1223
                                     PIN_AFIO_AF(GPIOH_PIN11, 0U) |         \
1224
                                     PIN_AFIO_AF(GPIOH_PIN12, 0U) |         \
1225
                                     PIN_AFIO_AF(GPIOH_PIN13, 0U) |         \
1226
                                     PIN_AFIO_AF(GPIOH_PIN14, 0U) |         \
1227
                                     PIN_AFIO_AF(GPIOH_PIN15, 0U))
1228
1229
/*
1230
 * GPIOI setup:
1231
 *
1232
 * PI0  - PIN0                      (input floating).
1233
 * PI1  - PIN1                      (input floating).
1234
 * PI2  - PIN2                      (input floating).
1235
 * PI3  - PIN3                      (input floating).
1236
 * PI4  - PIN4                      (input floating).
1237
 * PI5  - PIN5                      (input floating).
1238
 * PI6  - PIN6                      (input floating).
1239
 * PI7  - PIN7                      (input floating).
1240
 * PI8  - PIN8                      (input floating).
1241
 * PI9  - PIN9                      (input floating).
1242
 * PI10 - PIN10                     (input floating).
1243
 * PI11 - PIN11                     (input floating).
1244
 * PI12 - PIN12                     (input floating).
1245
 * PI13 - PIN13                     (input floating).
1246
 * PI14 - PIN14                     (input floating).
1247
 * PI15 - PIN15                     (input floating).
1248
 */
1249
#define VAL_GPIOI_MODER             (PIN_MODE_INPUT(GPIOI_PIN0) |           \
1250
                                     PIN_MODE_INPUT(GPIOI_PIN1) |           \
1251
                                     PIN_MODE_INPUT(GPIOI_PIN2) |           \
1252
                                     PIN_MODE_INPUT(GPIOI_PIN3) |           \
1253
                                     PIN_MODE_INPUT(GPIOI_PIN4) |           \
1254
                                     PIN_MODE_INPUT(GPIOI_PIN5) |           \
1255
                                     PIN_MODE_INPUT(GPIOI_PIN6) |           \
1256
                                     PIN_MODE_INPUT(GPIOI_PIN7) |           \
1257
                                     PIN_MODE_INPUT(GPIOI_PIN8) |           \
1258
                                     PIN_MODE_INPUT(GPIOI_PIN9) |           \
1259
                                     PIN_MODE_INPUT(GPIOI_PIN10) |          \
1260
                                     PIN_MODE_INPUT(GPIOI_PIN11) |          \
1261
                                     PIN_MODE_INPUT(GPIOI_PIN12) |          \
1262
                                     PIN_MODE_INPUT(GPIOI_PIN13) |          \
1263
                                     PIN_MODE_INPUT(GPIOI_PIN14) |          \
1264
                                     PIN_MODE_INPUT(GPIOI_PIN15))
1265
#define VAL_GPIOI_OTYPER            (PIN_OTYPE_PUSHPULL(GPIOI_PIN0) |       \
1266
                                     PIN_OTYPE_PUSHPULL(GPIOI_PIN1) |       \
1267
                                     PIN_OTYPE_PUSHPULL(GPIOI_PIN2) |       \
1268
                                     PIN_OTYPE_PUSHPULL(GPIOI_PIN3) |       \
1269
                                     PIN_OTYPE_PUSHPULL(GPIOI_PIN4) |       \
1270
                                     PIN_OTYPE_PUSHPULL(GPIOI_PIN5) |       \
1271
                                     PIN_OTYPE_PUSHPULL(GPIOI_PIN6) |       \
1272
                                     PIN_OTYPE_PUSHPULL(GPIOI_PIN7) |       \
1273
                                     PIN_OTYPE_PUSHPULL(GPIOI_PIN8) |       \
1274
                                     PIN_OTYPE_PUSHPULL(GPIOI_PIN9) |       \
1275
                                     PIN_OTYPE_PUSHPULL(GPIOI_PIN10) |      \
1276
                                     PIN_OTYPE_PUSHPULL(GPIOI_PIN11) |      \
1277
                                     PIN_OTYPE_PUSHPULL(GPIOI_PIN12) |      \
1278
                                     PIN_OTYPE_PUSHPULL(GPIOI_PIN13) |      \
1279
                                     PIN_OTYPE_PUSHPULL(GPIOI_PIN14) |      \
1280
                                     PIN_OTYPE_PUSHPULL(GPIOI_PIN15))
1281
#define VAL_GPIOI_OSPEEDR           (PIN_OSPEED_HIGH(GPIOI_PIN0) |          \
1282
                                     PIN_OSPEED_HIGH(GPIOI_PIN1) |          \
1283
                                     PIN_OSPEED_HIGH(GPIOI_PIN2) |          \
1284
                                     PIN_OSPEED_HIGH(GPIOI_PIN3) |          \
1285
                                     PIN_OSPEED_HIGH(GPIOI_PIN4) |          \
1286
                                     PIN_OSPEED_HIGH(GPIOI_PIN5) |          \
1287
                                     PIN_OSPEED_HIGH(GPIOI_PIN6) |          \
1288
                                     PIN_OSPEED_HIGH(GPIOI_PIN7) |          \
1289
                                     PIN_OSPEED_HIGH(GPIOI_PIN8) |          \
1290
                                     PIN_OSPEED_HIGH(GPIOI_PIN9) |          \
1291
                                     PIN_OSPEED_HIGH(GPIOI_PIN10) |         \
1292
                                     PIN_OSPEED_HIGH(GPIOI_PIN11) |         \
1293
                                     PIN_OSPEED_HIGH(GPIOI_PIN12) |         \
1294
                                     PIN_OSPEED_HIGH(GPIOI_PIN13) |         \
1295
                                     PIN_OSPEED_HIGH(GPIOI_PIN14) |         \
1296
                                     PIN_OSPEED_HIGH(GPIOI_PIN15))
1297
#define VAL_GPIOI_PUPDR             (PIN_PUPDR_FLOATING(GPIOI_PIN0) |       \
1298
                                     PIN_PUPDR_FLOATING(GPIOI_PIN1) |       \
1299
                                     PIN_PUPDR_FLOATING(GPIOI_PIN2) |       \
1300
                                     PIN_PUPDR_FLOATING(GPIOI_PIN3) |       \
1301
                                     PIN_PUPDR_FLOATING(GPIOI_PIN4) |       \
1302
                                     PIN_PUPDR_FLOATING(GPIOI_PIN5) |       \
1303
                                     PIN_PUPDR_FLOATING(GPIOI_PIN6) |       \
1304
                                     PIN_PUPDR_FLOATING(GPIOI_PIN7) |       \
1305
                                     PIN_PUPDR_FLOATING(GPIOI_PIN8) |       \
1306
                                     PIN_PUPDR_FLOATING(GPIOI_PIN9) |       \
1307
                                     PIN_PUPDR_FLOATING(GPIOI_PIN10) |      \
1308
                                     PIN_PUPDR_FLOATING(GPIOI_PIN11) |      \
1309
                                     PIN_PUPDR_FLOATING(GPIOI_PIN12) |      \
1310
                                     PIN_PUPDR_FLOATING(GPIOI_PIN13) |      \
1311
                                     PIN_PUPDR_FLOATING(GPIOI_PIN14) |      \
1312
                                     PIN_PUPDR_FLOATING(GPIOI_PIN15))
1313
#define VAL_GPIOI_ODR               (PIN_ODR_HIGH(GPIOI_PIN0) |             \
1314
                                     PIN_ODR_HIGH(GPIOI_PIN1) |             \
1315
                                     PIN_ODR_HIGH(GPIOI_PIN2) |             \
1316
                                     PIN_ODR_HIGH(GPIOI_PIN3) |             \
1317
                                     PIN_ODR_HIGH(GPIOI_PIN4) |             \
1318
                                     PIN_ODR_HIGH(GPIOI_PIN5) |             \
1319
                                     PIN_ODR_HIGH(GPIOI_PIN6) |             \
1320
                                     PIN_ODR_HIGH(GPIOI_PIN7) |             \
1321
                                     PIN_ODR_HIGH(GPIOI_PIN8) |             \
1322
                                     PIN_ODR_HIGH(GPIOI_PIN9) |             \
1323
                                     PIN_ODR_HIGH(GPIOI_PIN10) |            \
1324
                                     PIN_ODR_HIGH(GPIOI_PIN11) |            \
1325
                                     PIN_ODR_HIGH(GPIOI_PIN12) |            \
1326
                                     PIN_ODR_HIGH(GPIOI_PIN13) |            \
1327
                                     PIN_ODR_HIGH(GPIOI_PIN14) |            \
1328
                                     PIN_ODR_HIGH(GPIOI_PIN15))
1329
#define VAL_GPIOI_AFRL              (PIN_AFIO_AF(GPIOI_PIN0, 0U) |          \
1330
                                     PIN_AFIO_AF(GPIOI_PIN1, 0U) |          \
1331
                                     PIN_AFIO_AF(GPIOI_PIN2, 0U) |          \
1332
                                     PIN_AFIO_AF(GPIOI_PIN3, 0U) |          \
1333
                                     PIN_AFIO_AF(GPIOI_PIN4, 0U) |          \
1334
                                     PIN_AFIO_AF(GPIOI_PIN5, 0U) |          \
1335
                                     PIN_AFIO_AF(GPIOI_PIN6, 0U) |          \
1336
                                     PIN_AFIO_AF(GPIOI_PIN7, 0U))
1337
#define VAL_GPIOI_AFRH              (PIN_AFIO_AF(GPIOI_PIN8, 0U) |          \
1338
                                     PIN_AFIO_AF(GPIOI_PIN9, 0U) |          \
1339
                                     PIN_AFIO_AF(GPIOI_PIN10, 0U) |         \
1340
                                     PIN_AFIO_AF(GPIOI_PIN11, 0U) |         \
1341
                                     PIN_AFIO_AF(GPIOI_PIN12, 0U) |         \
1342
                                     PIN_AFIO_AF(GPIOI_PIN13, 0U) |         \
1343
                                     PIN_AFIO_AF(GPIOI_PIN14, 0U) |         \
1344
                                     PIN_AFIO_AF(GPIOI_PIN15, 0U))
1345
1346
/*===========================================================================*/
1347
/* External declarations.                                                    */
1348
/*===========================================================================*/
1349
1350
#if !defined(_FROM_ASM_)
1351
#ifdef __cplusplus
1352
extern "C" {
1353
#endif
1354
  void boardInit(void);
1355
#ifdef __cplusplus
1356
}
1357
#endif
1358
#endif /* _FROM_ASM_ */
1359
1360
#endif /* BOARD_H */