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