aboutsummaryrefslogtreecommitdiff
path: root/lib/chibios/os/hal/boards/ST_STM32F3_DISCOVERY/board.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chibios/os/hal/boards/ST_STM32F3_DISCOVERY/board.h')
-rw-r--r--lib/chibios/os/hal/boards/ST_STM32F3_DISCOVERY/board.h1234
1 files changed, 1234 insertions, 0 deletions
diff --git a/lib/chibios/os/hal/boards/ST_STM32F3_DISCOVERY/board.h b/lib/chibios/os/hal/boards/ST_STM32F3_DISCOVERY/board.h
new file mode 100644
index 000000000..042f20d7b
--- /dev/null
+++ b/lib/chibios/os/hal/boards/ST_STM32F3_DISCOVERY/board.h
@@ -0,0 +1,1234 @@
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 STM32F3-Discovery board.
31 */
32
33/*
34 * Board identifier.
35 */
36#define BOARD_ST_STM32F3_DISCOVERY
37#define BOARD_NAME "STMicroelectronics STM32F3-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#define STM32_LSEDRV (3U << 3U)
48
49#if !defined(STM32_HSECLK)
50#define STM32_HSECLK 8000000U
51#endif
52
53#define STM32_HSE_BYPASS
54
55/*
56 * MCU type as defined in the ST header.
57 */
58#define STM32F303xC
59
60/*
61 * IO pins assignments.
62 */
63#define GPIOA_BUTTON 0U
64#define GPIOA_PIN1 1U
65#define GPIOA_PIN2 2U
66#define GPIOA_PIN3 3U
67#define GPIOA_PIN4 4U
68#define GPIOA_SPI1_SCK 5U
69#define GPIOA_L3GD20_SCL 5U
70#define GPIOA_SPI1_MISO 6U
71#define GPIOA_L3GD20_SDO 6U
72#define GPIOA_SPI1_MOSI 7U
73#define GPIOA_L3GD20_SDI 7U
74#define GPIOA_PIN8 8U
75#define GPIOA_PIN9 9U
76#define GPIOA_PIN10 10U
77#define GPIOA_USB_DM 11U
78#define GPIOA_USB_DP 12U
79#define GPIOA_SWDIO 13U
80#define GPIOA_SWCLK 14U
81#define GPIOA_PIN15 15U
82
83#define GPIOB_PIN0 0U
84#define GPIOB_PIN1 1U
85#define GPIOB_PIN2 2U
86#define GPIOB_SWO 3U
87#define GPIOB_PIN4 4U
88#define GPIOB_PIN5 5U
89#define GPIOB_I2C1_SCL 6U
90#define GPIOB_LSM303DLHC_SCL 6U
91#define GPIOB_I2C1_SDA 7U
92#define GPIOB_LSM303DLHC_SDA 7U
93#define GPIOB_PIN8 8U
94#define GPIOB_PIN9 9U
95#define GPIOB_PIN10 10U
96#define GPIOB_PIN11 11U
97#define GPIOB_PIN12 12U
98#define GPIOB_PIN13 13U
99#define GPIOB_PIN14 14U
100#define GPIOB_PIN15 15U
101
102#define GPIOC_PIN0 0U
103#define GPIOC_PIN1 1U
104#define GPIOC_PIN2 2U
105#define GPIOC_PIN3 3U
106#define GPIOC_VCP_RX 4U
107#define GPIOC_VCP_TX 5U
108#define GPIOC_PIN6 6U
109#define GPIOC_PIN7 7U
110#define GPIOC_PIN8 8U
111#define GPIOC_PIN9 9U
112#define GPIOC_PIN10 10U
113#define GPIOC_PIN11 11U
114#define GPIOC_PIN12 12U
115#define GPIOC_PIN13 13U
116#define GPIOC_OSC32_IN 14U
117#define GPIOC_OSC32_OUT 15U
118
119#define GPIOD_PIN0 0U
120#define GPIOD_PIN1 1U
121#define GPIOD_PIN2 2U
122#define GPIOD_PIN3 3U
123#define GPIOD_PIN4 4U
124#define GPIOD_PIN5 5U
125#define GPIOD_PIN6 6U
126#define GPIOD_PIN7 7U
127#define GPIOD_PIN8 8U
128#define GPIOD_PIN9 9U
129#define GPIOD_PIN10 10U
130#define GPIOD_PIN11 11U
131#define GPIOD_PIN12 12U
132#define GPIOD_PIN13 13U
133#define GPIOD_PIN14 14U
134#define GPIOD_PIN15 15U
135
136#define GPIOE_L3GD20_INT1 0U
137#define GPIOE_L3GD20_INT2 1U
138#define GPIOE_LSM303DLHC_DRDY 2U
139#define GPIOE_SPI1_CS 3U
140#define GPIOE_L3GD20_CS 3U
141#define GPIOE_LSM303DLHC_INT1 4U
142#define GPIOE_LSM303DLHC_INT2 5U
143#define GPIOE_PIN6 6U
144#define GPIOE_PIN7 7U
145#define GPIOE_LED4_BLUE 8U
146#define GPIOE_LED3_RED 9U
147#define GPIOE_LED5_ORANGE 10U
148#define GPIOE_LED7_GREEN 11U
149#define GPIOE_LED9_BLUE 12U
150#define GPIOE_LED10_RED 13U
151#define GPIOE_LED8_ORANGE 14U
152#define GPIOE_LED6_GREEN 15U
153
154#define GPIOF_OSC_IN 0U
155#define GPIOF_OSC_OUT 1U
156#define GPIOF_PIN2 2U
157#define GPIOF_PIN3 3U
158#define GPIOF_PIN4 4U
159#define GPIOF_PIN5 5U
160#define GPIOF_PIN6 6U
161#define GPIOF_PIN7 7U
162#define GPIOF_PIN8 8U
163#define GPIOF_PIN9 9U
164#define GPIOF_PIN10 10U
165#define GPIOF_PIN11 11U
166#define GPIOF_PIN12 12U
167#define GPIOF_PIN13 13U
168#define GPIOF_PIN14 14U
169#define GPIOF_PIN15 15U
170
171#define GPIOG_PIN0 0U
172#define GPIOG_PIN1 1U
173#define GPIOG_PIN2 2U
174#define GPIOG_PIN3 3U
175#define GPIOG_PIN4 4U
176#define GPIOG_PIN5 5U
177#define GPIOG_PIN6 6U
178#define GPIOG_PIN7 7U
179#define GPIOG_PIN8 8U
180#define GPIOG_PIN9 9U
181#define GPIOG_PIN10 10U
182#define GPIOG_PIN11 11U
183#define GPIOG_PIN12 12U
184#define GPIOG_PIN13 13U
185#define GPIOG_PIN14 14U
186#define GPIOG_PIN15 15U
187
188#define GPIOH_PIN0 0U
189#define GPIOH_PIN1 1U
190#define GPIOH_PIN2 2U
191#define GPIOH_PIN3 3U
192#define GPIOH_PIN4 4U
193#define GPIOH_PIN5 5U
194#define GPIOH_PIN6 6U
195#define GPIOH_PIN7 7U
196#define GPIOH_PIN8 8U
197#define GPIOH_PIN9 9U
198#define GPIOH_PIN10 10U
199#define GPIOH_PIN11 11U
200#define GPIOH_PIN12 12U
201#define GPIOH_PIN13 13U
202#define GPIOH_PIN14 14U
203#define GPIOH_PIN15 15U
204
205/*
206 * IO lines assignments.
207 */
208#define LINE_BUTTON PAL_LINE(GPIOA, 0U)
209#define LINE_SPI1_SCK PAL_LINE(GPIOA, 5U)
210#define LINE_L3GD20_SCL PAL_LINE(GPIOA, 5U)
211#define LINE_SPI1_MISO PAL_LINE(GPIOA, 6U)
212#define LINE_L3GD20_SDO PAL_LINE(GPIOA, 6U)
213#define LINE_SPI1_MOSI PAL_LINE(GPIOA, 7U)
214#define LINE_L3GD20_SDI PAL_LINE(GPIOA, 7U)
215#define LINE_USB_DM PAL_LINE(GPIOA, 11U)
216#define LINE_USB_DP PAL_LINE(GPIOA, 12U)
217#define LINE_SWDIO PAL_LINE(GPIOA, 13U)
218#define LINE_SWCLK PAL_LINE(GPIOA, 14U)
219#define LINE_SWO PAL_LINE(GPIOB, 3U)
220#define LINE_I2C1_SCL PAL_LINE(GPIOB, 6U)
221#define LINE_LSM303DLHC_SCL PAL_LINE(GPIOB, 6U)
222#define LINE_I2C1_SDA PAL_LINE(GPIOB, 7U)
223#define LINE_LSM303DLHC_SDA PAL_LINE(GPIOB, 7U)
224#define LINE_VCP_RX PAL_LINE(GPIOC, 4U)
225#define LINE_VCP_TX PAL_LINE(GPIOC, 5U)
226#define LINE_OSC32_IN PAL_LINE(GPIOC, 14U)
227#define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U)
228#define LINE_L3GD20_INT1 PAL_LINE(GPIOE, 0U)
229#define LINE_L3GD20_INT2 PAL_LINE(GPIOE, 1U)
230#define LINE_LSM303DLHC_DRDY PAL_LINE(GPIOE, 2U)
231#define LINE_SPI1_CS PAL_LINE(GPIOE, 3U)
232#define LINE_L3GD20_CS PAL_LINE(GPIOE, 3U)
233#define LINE_LSM303DLHC_INT1 PAL_LINE(GPIOE, 4U)
234#define LINE_LSM303DLHC_INT2 PAL_LINE(GPIOE, 5U)
235#define LINE_LED4_BLUE PAL_LINE(GPIOE, 8U)
236#define LINE_LED3_RED PAL_LINE(GPIOE, 9U)
237#define LINE_LED5_ORANGE PAL_LINE(GPIOE, 10U)
238#define LINE_LED7_GREEN PAL_LINE(GPIOE, 11U)
239#define LINE_LED9_BLUE PAL_LINE(GPIOE, 12U)
240#define LINE_LED10_RED PAL_LINE(GPIOE, 13U)
241#define LINE_LED8_ORANGE PAL_LINE(GPIOE, 14U)
242#define LINE_LED6_GREEN PAL_LINE(GPIOE, 15U)
243#define LINE_OSC_IN PAL_LINE(GPIOF, 0U)
244#define LINE_OSC_OUT PAL_LINE(GPIOF, 1U)
245
246/*===========================================================================*/
247/* Driver pre-compile time settings. */
248/*===========================================================================*/
249
250/*===========================================================================*/
251/* Derived constants and error checks. */
252/*===========================================================================*/
253
254/*===========================================================================*/
255/* Driver data structures and types. */
256/*===========================================================================*/
257
258/*===========================================================================*/
259/* Driver macros. */
260/*===========================================================================*/
261
262/*
263 * I/O ports initial setup, this configuration is established soon after reset
264 * in the initialization code.
265 * Please refer to the STM32 Reference Manual for details.
266 */
267#define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
268#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
269#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
270#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
271#define PIN_ODR_LOW(n) (0U << (n))
272#define PIN_ODR_HIGH(n) (1U << (n))
273#define PIN_OTYPE_PUSHPULL(n) (0U << (n))
274#define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
275#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U))
276#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U))
277#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U))
278#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U))
279#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
280#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
281#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
282#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
283
284/*
285 * GPIOA setup:
286 *
287 * PA0 - BUTTON (input floating).
288 * PA1 - PIN1 (input pullup).
289 * PA2 - PIN2 (input pullup).
290 * PA3 - PIN3 (input pullup).
291 * PA4 - PIN4 (input pullup).
292 * PA5 - SPI1_SCK L3GD20_SCL (alternate 5).
293 * PA6 - SPI1_MISO L3GD20_SDO (alternate 5).
294 * PA7 - SPI1_MOSI L3GD20_SDI (alternate 5).
295 * PA8 - PIN8 (input pullup).
296 * PA9 - PIN9 (input pullup).
297 * PA10 - PIN10 (input pullup).
298 * PA11 - USB_DM (alternate 14).
299 * PA12 - USB_DP (alternate 14).
300 * PA13 - SWDIO (alternate 0).
301 * PA14 - SWCLK (alternate 0).
302 * PA15 - PIN15 (input pullup).
303 */
304#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_BUTTON) | \
305 PIN_MODE_INPUT(GPIOA_PIN1) | \
306 PIN_MODE_INPUT(GPIOA_PIN2) | \
307 PIN_MODE_INPUT(GPIOA_PIN3) | \
308 PIN_MODE_INPUT(GPIOA_PIN4) | \
309 PIN_MODE_ALTERNATE(GPIOA_SPI1_SCK) | \
310 PIN_MODE_ALTERNATE(GPIOA_SPI1_MISO) | \
311 PIN_MODE_ALTERNATE(GPIOA_SPI1_MOSI) | \
312 PIN_MODE_INPUT(GPIOA_PIN8) | \
313 PIN_MODE_INPUT(GPIOA_PIN9) | \
314 PIN_MODE_INPUT(GPIOA_PIN10) | \
315 PIN_MODE_ALTERNATE(GPIOA_USB_DM) | \
316 PIN_MODE_ALTERNATE(GPIOA_USB_DP) | \
317 PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \
318 PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \
319 PIN_MODE_INPUT(GPIOA_PIN15))
320#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_BUTTON) | \
321 PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \
322 PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \
323 PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \
324 PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \
325 PIN_OTYPE_PUSHPULL(GPIOA_SPI1_SCK) | \
326 PIN_OTYPE_PUSHPULL(GPIOA_SPI1_MISO) | \
327 PIN_OTYPE_PUSHPULL(GPIOA_SPI1_MOSI) | \
328 PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \
329 PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \
330 PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \
331 PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | \
332 PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | \
333 PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \
334 PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \
335 PIN_OTYPE_PUSHPULL(GPIOA_PIN15))
336#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_BUTTON) | \
337 PIN_OSPEED_VERYLOW(GPIOA_PIN1) | \
338 PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \
339 PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \
340 PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \
341 PIN_OSPEED_HIGH(GPIOA_SPI1_SCK) | \
342 PIN_OSPEED_HIGH(GPIOA_SPI1_MISO) | \
343 PIN_OSPEED_HIGH(GPIOA_SPI1_MOSI) | \
344 PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \
345 PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \
346 PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \
347 PIN_OSPEED_HIGH(GPIOA_USB_DM) | \
348 PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \
349 PIN_OSPEED_HIGH(GPIOA_SWDIO) | \
350 PIN_OSPEED_HIGH(GPIOA_SWCLK) | \
351 PIN_OSPEED_VERYLOW(GPIOA_PIN15))
352#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON) | \
353 PIN_PUPDR_PULLUP(GPIOA_PIN1) | \
354 PIN_PUPDR_PULLUP(GPIOA_PIN2) | \
355 PIN_PUPDR_PULLUP(GPIOA_PIN3) | \
356 PIN_PUPDR_PULLUP(GPIOA_PIN4) | \
357 PIN_PUPDR_FLOATING(GPIOA_SPI1_SCK) | \
358 PIN_PUPDR_PULLUP(GPIOA_SPI1_MISO) | \
359 PIN_PUPDR_FLOATING(GPIOA_SPI1_MOSI) | \
360 PIN_PUPDR_PULLUP(GPIOA_PIN8) | \
361 PIN_PUPDR_PULLUP(GPIOA_PIN9) | \
362 PIN_PUPDR_PULLUP(GPIOA_PIN10) | \
363 PIN_PUPDR_FLOATING(GPIOA_USB_DM) | \
364 PIN_PUPDR_FLOATING(GPIOA_USB_DP) | \
365 PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \
366 PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \
367 PIN_PUPDR_PULLUP(GPIOA_PIN15))
368#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_BUTTON) | \
369 PIN_ODR_HIGH(GPIOA_PIN1) | \
370 PIN_ODR_HIGH(GPIOA_PIN2) | \
371 PIN_ODR_HIGH(GPIOA_PIN3) | \
372 PIN_ODR_HIGH(GPIOA_PIN4) | \
373 PIN_ODR_HIGH(GPIOA_SPI1_SCK) | \
374 PIN_ODR_HIGH(GPIOA_SPI1_MISO) | \
375 PIN_ODR_HIGH(GPIOA_SPI1_MOSI) | \
376 PIN_ODR_HIGH(GPIOA_PIN8) | \
377 PIN_ODR_HIGH(GPIOA_PIN9) | \
378 PIN_ODR_HIGH(GPIOA_PIN10) | \
379 PIN_ODR_HIGH(GPIOA_USB_DM) | \
380 PIN_ODR_HIGH(GPIOA_USB_DP) | \
381 PIN_ODR_HIGH(GPIOA_SWDIO) | \
382 PIN_ODR_HIGH(GPIOA_SWCLK) | \
383 PIN_ODR_HIGH(GPIOA_PIN15))
384#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_BUTTON, 0U) | \
385 PIN_AFIO_AF(GPIOA_PIN1, 0U) | \
386 PIN_AFIO_AF(GPIOA_PIN2, 0U) | \
387 PIN_AFIO_AF(GPIOA_PIN3, 0U) | \
388 PIN_AFIO_AF(GPIOA_PIN4, 0U) | \
389 PIN_AFIO_AF(GPIOA_SPI1_SCK, 5U) | \
390 PIN_AFIO_AF(GPIOA_SPI1_MISO, 5U) | \
391 PIN_AFIO_AF(GPIOA_SPI1_MOSI, 5U))
392#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0U) | \
393 PIN_AFIO_AF(GPIOA_PIN9, 0U) | \
394 PIN_AFIO_AF(GPIOA_PIN10, 0U) | \
395 PIN_AFIO_AF(GPIOA_USB_DM, 14U) | \
396 PIN_AFIO_AF(GPIOA_USB_DP, 14U) | \
397 PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \
398 PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \
399 PIN_AFIO_AF(GPIOA_PIN15, 0U))
400
401/*
402 * GPIOB setup:
403 *
404 * PB0 - PIN0 (input pullup).
405 * PB1 - PIN1 (input pullup).
406 * PB2 - PIN2 (input pullup).
407 * PB3 - SWO (alternate 0).
408 * PB4 - PIN4 (input pullup).
409 * PB5 - PIN5 (input pullup).
410 * PB6 - I2C1_SCL LSM303DLHC_SCL (alternate 4).
411 * PB7 - I2C1_SDA LSM303DLHC_SDA (alternate 4).
412 * PB8 - PIN8 (input pullup).
413 * PB9 - PIN9 (input pullup).
414 * PB10 - PIN10 (input pullup).
415 * PB11 - PIN11 (input pullup).
416 * PB12 - PIN12 (input pullup).
417 * PB13 - PIN13 (input pullup).
418 * PB14 - PIN14 (input pullup).
419 * PB15 - PIN15 (input pullup).
420 */
421#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \
422 PIN_MODE_INPUT(GPIOB_PIN1) | \
423 PIN_MODE_INPUT(GPIOB_PIN2) | \
424 PIN_MODE_ALTERNATE(GPIOB_SWO) | \
425 PIN_MODE_INPUT(GPIOB_PIN4) | \
426 PIN_MODE_INPUT(GPIOB_PIN5) | \
427 PIN_MODE_ALTERNATE(GPIOB_I2C1_SCL) | \
428 PIN_MODE_ALTERNATE(GPIOB_I2C1_SDA) | \
429 PIN_MODE_INPUT(GPIOB_PIN8) | \
430 PIN_MODE_INPUT(GPIOB_PIN9) | \
431 PIN_MODE_INPUT(GPIOB_PIN10) | \
432 PIN_MODE_INPUT(GPIOB_PIN11) | \
433 PIN_MODE_INPUT(GPIOB_PIN12) | \
434 PIN_MODE_INPUT(GPIOB_PIN13) | \
435 PIN_MODE_INPUT(GPIOB_PIN14) | \
436 PIN_MODE_INPUT(GPIOB_PIN15))
437#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \
438 PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \
439 PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \
440 PIN_OTYPE_PUSHPULL(GPIOB_SWO) | \
441 PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \
442 PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \
443 PIN_OTYPE_OPENDRAIN(GPIOB_I2C1_SCL) | \
444 PIN_OTYPE_OPENDRAIN(GPIOB_I2C1_SDA) | \
445 PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \
446 PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \
447 PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \
448 PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \
449 PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \
450 PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \
451 PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \
452 PIN_OTYPE_PUSHPULL(GPIOB_PIN15))
453#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \
454 PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \
455 PIN_OSPEED_VERYLOW(GPIOB_PIN2) | \
456 PIN_OSPEED_HIGH(GPIOB_SWO) | \
457 PIN_OSPEED_VERYLOW(GPIOB_PIN4) | \
458 PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \
459 PIN_OSPEED_HIGH(GPIOB_I2C1_SCL) | \
460 PIN_OSPEED_HIGH(GPIOB_I2C1_SDA) | \
461 PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \
462 PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \
463 PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \
464 PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \
465 PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \
466 PIN_OSPEED_VERYLOW(GPIOB_PIN13) | \
467 PIN_OSPEED_VERYLOW(GPIOB_PIN14) | \
468 PIN_OSPEED_VERYLOW(GPIOB_PIN15))
469#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \
470 PIN_PUPDR_PULLUP(GPIOB_PIN1) | \
471 PIN_PUPDR_PULLUP(GPIOB_PIN2) | \
472 PIN_PUPDR_FLOATING(GPIOB_SWO) | \
473 PIN_PUPDR_PULLUP(GPIOB_PIN4) | \
474 PIN_PUPDR_PULLUP(GPIOB_PIN5) | \
475 PIN_PUPDR_FLOATING(GPIOB_I2C1_SCL) | \
476 PIN_PUPDR_FLOATING(GPIOB_I2C1_SDA) | \
477 PIN_PUPDR_PULLUP(GPIOB_PIN8) | \
478 PIN_PUPDR_PULLUP(GPIOB_PIN9) | \
479 PIN_PUPDR_PULLUP(GPIOB_PIN10) | \
480 PIN_PUPDR_PULLUP(GPIOB_PIN11) | \
481 PIN_PUPDR_PULLUP(GPIOB_PIN12) | \
482 PIN_PUPDR_PULLUP(GPIOB_PIN13) | \
483 PIN_PUPDR_PULLUP(GPIOB_PIN14) | \
484 PIN_PUPDR_PULLUP(GPIOB_PIN15))
485#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \
486 PIN_ODR_HIGH(GPIOB_PIN1) | \
487 PIN_ODR_HIGH(GPIOB_PIN2) | \
488 PIN_ODR_HIGH(GPIOB_SWO) | \
489 PIN_ODR_HIGH(GPIOB_PIN4) | \
490 PIN_ODR_HIGH(GPIOB_PIN5) | \
491 PIN_ODR_HIGH(GPIOB_I2C1_SCL) | \
492 PIN_ODR_HIGH(GPIOB_I2C1_SDA) | \
493 PIN_ODR_HIGH(GPIOB_PIN8) | \
494 PIN_ODR_HIGH(GPIOB_PIN9) | \
495 PIN_ODR_HIGH(GPIOB_PIN10) | \
496 PIN_ODR_HIGH(GPIOB_PIN11) | \
497 PIN_ODR_HIGH(GPIOB_PIN12) | \
498 PIN_ODR_HIGH(GPIOB_PIN13) | \
499 PIN_ODR_HIGH(GPIOB_PIN14) | \
500 PIN_ODR_HIGH(GPIOB_PIN15))
501#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0U) | \
502 PIN_AFIO_AF(GPIOB_PIN1, 0U) | \
503 PIN_AFIO_AF(GPIOB_PIN2, 0U) | \
504 PIN_AFIO_AF(GPIOB_SWO, 0U) | \
505 PIN_AFIO_AF(GPIOB_PIN4, 0U) | \
506 PIN_AFIO_AF(GPIOB_PIN5, 0U) | \
507 PIN_AFIO_AF(GPIOB_I2C1_SCL, 4U) | \
508 PIN_AFIO_AF(GPIOB_I2C1_SDA, 4U))
509#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \
510 PIN_AFIO_AF(GPIOB_PIN9, 0U) | \
511 PIN_AFIO_AF(GPIOB_PIN10, 0U) | \
512 PIN_AFIO_AF(GPIOB_PIN11, 0U) | \
513 PIN_AFIO_AF(GPIOB_PIN12, 0U) | \
514 PIN_AFIO_AF(GPIOB_PIN13, 0U) | \
515 PIN_AFIO_AF(GPIOB_PIN14, 0U) | \
516 PIN_AFIO_AF(GPIOB_PIN15, 0U))
517
518/*
519 * GPIOC setup:
520 *
521 * PC0 - PIN0 (input pullup).
522 * PC1 - PIN1 (input pullup).
523 * PC2 - PIN2 (input pullup).
524 * PC3 - PIN3 (input pullup).
525 * PC4 - VCP_RX (alternate 7).
526 * PC5 - VCP_TX (alternate 7).
527 * PC6 - PIN6 (input pullup).
528 * PC7 - PIN7 (input pullup).
529 * PC8 - PIN8 (input pullup).
530 * PC9 - PIN9 (input pullup).
531 * PC10 - PIN10 (input pullup).
532 * PC11 - PIN11 (input pullup).
533 * PC12 - PIN12 (input pullup).
534 * PC13 - PIN13 (input pullup).
535 * PC14 - OSC32_IN (input floating).
536 * PC15 - OSC32_OUT (input floating).
537 */
538#define VAL_GPIOC_MODER (PIN_MODE_INPUT(GPIOC_PIN0) | \
539 PIN_MODE_INPUT(GPIOC_PIN1) | \
540 PIN_MODE_INPUT(GPIOC_PIN2) | \
541 PIN_MODE_INPUT(GPIOC_PIN3) | \
542 PIN_MODE_ALTERNATE(GPIOC_VCP_RX) | \
543 PIN_MODE_ALTERNATE(GPIOC_VCP_TX) | \
544 PIN_MODE_INPUT(GPIOC_PIN6) | \
545 PIN_MODE_INPUT(GPIOC_PIN7) | \
546 PIN_MODE_INPUT(GPIOC_PIN8) | \
547 PIN_MODE_INPUT(GPIOC_PIN9) | \
548 PIN_MODE_INPUT(GPIOC_PIN10) | \
549 PIN_MODE_INPUT(GPIOC_PIN11) | \
550 PIN_MODE_INPUT(GPIOC_PIN12) | \
551 PIN_MODE_INPUT(GPIOC_PIN13) | \
552 PIN_MODE_INPUT(GPIOC_OSC32_IN) | \
553 PIN_MODE_INPUT(GPIOC_OSC32_OUT))
554#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_PIN0) | \
555 PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \
556 PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \
557 PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \
558 PIN_OTYPE_PUSHPULL(GPIOC_VCP_RX) | \
559 PIN_OTYPE_PUSHPULL(GPIOC_VCP_TX) | \
560 PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | \
561 PIN_OTYPE_PUSHPULL(GPIOC_PIN7) | \
562 PIN_OTYPE_PUSHPULL(GPIOC_PIN8) | \
563 PIN_OTYPE_PUSHPULL(GPIOC_PIN9) | \
564 PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \
565 PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \
566 PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \
567 PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \
568 PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \
569 PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT))
570#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOC_PIN0) | \
571 PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \
572 PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \
573 PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \
574 PIN_OSPEED_VERYLOW(GPIOC_VCP_RX) | \
575 PIN_OSPEED_VERYLOW(GPIOC_VCP_TX) | \
576 PIN_OSPEED_VERYLOW(GPIOC_PIN6) | \
577 PIN_OSPEED_VERYLOW(GPIOC_PIN7) | \
578 PIN_OSPEED_VERYLOW(GPIOC_PIN8) | \
579 PIN_OSPEED_VERYLOW(GPIOC_PIN9) | \
580 PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \
581 PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \
582 PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \
583 PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \
584 PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \
585 PIN_OSPEED_HIGH(GPIOC_OSC32_OUT))
586#define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \
587 PIN_PUPDR_PULLUP(GPIOC_PIN1) | \
588 PIN_PUPDR_PULLUP(GPIOC_PIN2) | \
589 PIN_PUPDR_PULLUP(GPIOC_PIN3) | \
590 PIN_PUPDR_PULLUP(GPIOC_VCP_RX) | \
591 PIN_PUPDR_PULLUP(GPIOC_VCP_TX) | \
592 PIN_PUPDR_PULLUP(GPIOC_PIN6) | \
593 PIN_PUPDR_PULLUP(GPIOC_PIN7) | \
594 PIN_PUPDR_PULLUP(GPIOC_PIN8) | \
595 PIN_PUPDR_PULLUP(GPIOC_PIN9) | \
596 PIN_PUPDR_PULLUP(GPIOC_PIN10) | \
597 PIN_PUPDR_PULLUP(GPIOC_PIN11) | \
598 PIN_PUPDR_PULLUP(GPIOC_PIN12) | \
599 PIN_PUPDR_PULLUP(GPIOC_PIN13) | \
600 PIN_PUPDR_FLOATING(GPIOC_OSC32_IN) | \
601 PIN_PUPDR_FLOATING(GPIOC_OSC32_OUT))
602#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_PIN0) | \
603 PIN_ODR_HIGH(GPIOC_PIN1) | \
604 PIN_ODR_HIGH(GPIOC_PIN2) | \
605 PIN_ODR_HIGH(GPIOC_PIN3) | \
606 PIN_ODR_HIGH(GPIOC_VCP_RX) | \
607 PIN_ODR_HIGH(GPIOC_VCP_TX) | \
608 PIN_ODR_HIGH(GPIOC_PIN6) | \
609 PIN_ODR_HIGH(GPIOC_PIN7) | \
610 PIN_ODR_HIGH(GPIOC_PIN8) | \
611 PIN_ODR_HIGH(GPIOC_PIN9) | \
612 PIN_ODR_HIGH(GPIOC_PIN10) | \
613 PIN_ODR_HIGH(GPIOC_PIN11) | \
614 PIN_ODR_HIGH(GPIOC_PIN12) | \
615 PIN_ODR_HIGH(GPIOC_PIN13) | \
616 PIN_ODR_HIGH(GPIOC_OSC32_IN) | \
617 PIN_ODR_HIGH(GPIOC_OSC32_OUT))
618#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_PIN0, 0U) | \
619 PIN_AFIO_AF(GPIOC_PIN1, 0U) | \
620 PIN_AFIO_AF(GPIOC_PIN2, 0U) | \
621 PIN_AFIO_AF(GPIOC_PIN3, 0U) | \
622 PIN_AFIO_AF(GPIOC_VCP_RX, 7U) | \
623 PIN_AFIO_AF(GPIOC_VCP_TX, 7U) | \
624 PIN_AFIO_AF(GPIOC_PIN6, 0U) | \
625 PIN_AFIO_AF(GPIOC_PIN7, 0U))
626#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_PIN8, 0U) | \
627 PIN_AFIO_AF(GPIOC_PIN9, 0U) | \
628 PIN_AFIO_AF(GPIOC_PIN10, 0U) | \
629 PIN_AFIO_AF(GPIOC_PIN11, 0U) | \
630 PIN_AFIO_AF(GPIOC_PIN12, 0U) | \
631 PIN_AFIO_AF(GPIOC_PIN13, 0U) | \
632 PIN_AFIO_AF(GPIOC_OSC32_IN, 0U) | \
633 PIN_AFIO_AF(GPIOC_OSC32_OUT, 0U))
634
635/*
636 * GPIOD setup:
637 *
638 * PD0 - PIN0 (input pullup).
639 * PD1 - PIN1 (input pullup).
640 * PD2 - PIN2 (input pullup).
641 * PD3 - PIN3 (input pullup).
642 * PD4 - PIN4 (input pullup).
643 * PD5 - PIN5 (input pullup).
644 * PD6 - PIN6 (input pullup).
645 * PD7 - PIN7 (input pullup).
646 * PD8 - PIN8 (input pullup).
647 * PD9 - PIN9 (input pullup).
648 * PD10 - PIN10 (input pullup).
649 * PD11 - PIN11 (input pullup).
650 * PD12 - PIN12 (input pullup).
651 * PD13 - PIN13 (input pullup).
652 * PD14 - PIN14 (input pullup).
653 * PD15 - PIN15 (input pullup).
654 */
655#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \
656 PIN_MODE_INPUT(GPIOD_PIN1) | \
657 PIN_MODE_INPUT(GPIOD_PIN2) | \
658 PIN_MODE_INPUT(GPIOD_PIN3) | \
659 PIN_MODE_INPUT(GPIOD_PIN4) | \
660 PIN_MODE_INPUT(GPIOD_PIN5) | \
661 PIN_MODE_INPUT(GPIOD_PIN6) | \
662 PIN_MODE_INPUT(GPIOD_PIN7) | \
663 PIN_MODE_INPUT(GPIOD_PIN8) | \
664 PIN_MODE_INPUT(GPIOD_PIN9) | \
665 PIN_MODE_INPUT(GPIOD_PIN10) | \
666 PIN_MODE_INPUT(GPIOD_PIN11) | \
667 PIN_MODE_INPUT(GPIOD_PIN12) | \
668 PIN_MODE_INPUT(GPIOD_PIN13) | \
669 PIN_MODE_INPUT(GPIOD_PIN14) | \
670 PIN_MODE_INPUT(GPIOD_PIN15))
671#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \
672 PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \
673 PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \
674 PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \
675 PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \
676 PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \
677 PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \
678 PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \
679 PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \
680 PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \
681 PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \
682 PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \
683 PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \
684 PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \
685 PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \
686 PIN_OTYPE_PUSHPULL(GPIOD_PIN15))
687#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \
688 PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \
689 PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \
690 PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \
691 PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \
692 PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \
693 PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \
694 PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \
695 PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \
696 PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \
697 PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \
698 PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \
699 PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \
700 PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \
701 PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \
702 PIN_OSPEED_VERYLOW(GPIOD_PIN15))
703#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \
704 PIN_PUPDR_PULLUP(GPIOD_PIN1) | \
705 PIN_PUPDR_PULLUP(GPIOD_PIN2) | \
706 PIN_PUPDR_PULLUP(GPIOD_PIN3) | \
707 PIN_PUPDR_PULLUP(GPIOD_PIN4) | \
708 PIN_PUPDR_PULLUP(GPIOD_PIN5) | \
709 PIN_PUPDR_PULLUP(GPIOD_PIN6) | \
710 PIN_PUPDR_PULLUP(GPIOD_PIN7) | \
711 PIN_PUPDR_PULLUP(GPIOD_PIN8) | \
712 PIN_PUPDR_PULLUP(GPIOD_PIN9) | \
713 PIN_PUPDR_PULLUP(GPIOD_PIN10) | \
714 PIN_PUPDR_PULLUP(GPIOD_PIN11) | \
715 PIN_PUPDR_PULLUP(GPIOD_PIN12) | \
716 PIN_PUPDR_PULLUP(GPIOD_PIN13) | \
717 PIN_PUPDR_PULLUP(GPIOD_PIN14) | \
718 PIN_PUPDR_PULLUP(GPIOD_PIN15))
719#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \
720 PIN_ODR_HIGH(GPIOD_PIN1) | \
721 PIN_ODR_HIGH(GPIOD_PIN2) | \
722 PIN_ODR_HIGH(GPIOD_PIN3) | \
723 PIN_ODR_HIGH(GPIOD_PIN4) | \
724 PIN_ODR_HIGH(GPIOD_PIN5) | \
725 PIN_ODR_HIGH(GPIOD_PIN6) | \
726 PIN_ODR_HIGH(GPIOD_PIN7) | \
727 PIN_ODR_HIGH(GPIOD_PIN8) | \
728 PIN_ODR_HIGH(GPIOD_PIN9) | \
729 PIN_ODR_HIGH(GPIOD_PIN10) | \
730 PIN_ODR_HIGH(GPIOD_PIN11) | \
731 PIN_ODR_HIGH(GPIOD_PIN12) | \
732 PIN_ODR_HIGH(GPIOD_PIN13) | \
733 PIN_ODR_HIGH(GPIOD_PIN14) | \
734 PIN_ODR_HIGH(GPIOD_PIN15))
735#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \
736 PIN_AFIO_AF(GPIOD_PIN1, 0U) | \
737 PIN_AFIO_AF(GPIOD_PIN2, 0U) | \
738 PIN_AFIO_AF(GPIOD_PIN3, 0U) | \
739 PIN_AFIO_AF(GPIOD_PIN4, 0U) | \
740 PIN_AFIO_AF(GPIOD_PIN5, 0U) | \
741 PIN_AFIO_AF(GPIOD_PIN6, 0U) | \
742 PIN_AFIO_AF(GPIOD_PIN7, 0U))
743#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \
744 PIN_AFIO_AF(GPIOD_PIN9, 0U) | \
745 PIN_AFIO_AF(GPIOD_PIN10, 0U) | \
746 PIN_AFIO_AF(GPIOD_PIN11, 0U) | \
747 PIN_AFIO_AF(GPIOD_PIN12, 0U) | \
748 PIN_AFIO_AF(GPIOD_PIN13, 0U) | \
749 PIN_AFIO_AF(GPIOD_PIN14, 0U) | \
750 PIN_AFIO_AF(GPIOD_PIN15, 0U))
751
752/*
753 * GPIOE setup:
754 *
755 * PE0 - L3GD20_INT1 (input pullup).
756 * PE1 - L3GD20_INT2 (input pullup).
757 * PE2 - LSM303DLHC_DRDY (input pullup).
758 * PE3 - SPI1_CS L3GD20_CS (output pushpull maximum).
759 * PE4 - LSM303DLHC_INT1 (input pullup).
760 * PE5 - LSM303DLHC_INT2 (input pullup).
761 * PE6 - PIN6 (input pullup).
762 * PE7 - PIN7 (input pullup).
763 * PE8 - LED4_BLUE (output pushpull maximum).
764 * PE9 - LED3_RED (output pushpull maximum).
765 * PE10 - LED5_ORANGE (output pushpull maximum).
766 * PE11 - LED7_GREEN (output pushpull maximum).
767 * PE12 - LED9_BLUE (output pushpull maximum).
768 * PE13 - LED10_RED (output pushpull maximum).
769 * PE14 - LED8_ORANGE (output pushpull maximum).
770 * PE15 - LED6_GREEN (output pushpull maximum).
771 */
772#define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_L3GD20_INT1) | \
773 PIN_MODE_INPUT(GPIOE_L3GD20_INT2) | \
774 PIN_MODE_INPUT(GPIOE_LSM303DLHC_DRDY) |\
775 PIN_MODE_OUTPUT(GPIOE_SPI1_CS) | \
776 PIN_MODE_INPUT(GPIOE_LSM303DLHC_INT1) |\
777 PIN_MODE_INPUT(GPIOE_LSM303DLHC_INT2) |\
778 PIN_MODE_INPUT(GPIOE_PIN6) | \
779 PIN_MODE_INPUT(GPIOE_PIN7) | \
780 PIN_MODE_OUTPUT(GPIOE_LED4_BLUE) | \
781 PIN_MODE_OUTPUT(GPIOE_LED3_RED) | \
782 PIN_MODE_OUTPUT(GPIOE_LED5_ORANGE) | \
783 PIN_MODE_OUTPUT(GPIOE_LED7_GREEN) | \
784 PIN_MODE_OUTPUT(GPIOE_LED9_BLUE) | \
785 PIN_MODE_OUTPUT(GPIOE_LED10_RED) | \
786 PIN_MODE_OUTPUT(GPIOE_LED8_ORANGE) | \
787 PIN_MODE_OUTPUT(GPIOE_LED6_GREEN))
788#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_L3GD20_INT1) |\
789 PIN_OTYPE_PUSHPULL(GPIOE_L3GD20_INT2) |\
790 PIN_OTYPE_PUSHPULL(GPIOE_LSM303DLHC_DRDY) |\
791 PIN_OTYPE_PUSHPULL(GPIOE_SPI1_CS) | \
792 PIN_OTYPE_PUSHPULL(GPIOE_LSM303DLHC_INT1) |\
793 PIN_OTYPE_PUSHPULL(GPIOE_LSM303DLHC_INT2) |\
794 PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \
795 PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \
796 PIN_OTYPE_PUSHPULL(GPIOE_LED4_BLUE) | \
797 PIN_OTYPE_PUSHPULL(GPIOE_LED3_RED) | \
798 PIN_OTYPE_PUSHPULL(GPIOE_LED5_ORANGE) |\
799 PIN_OTYPE_PUSHPULL(GPIOE_LED7_GREEN) | \
800 PIN_OTYPE_PUSHPULL(GPIOE_LED9_BLUE) | \
801 PIN_OTYPE_PUSHPULL(GPIOE_LED10_RED) | \
802 PIN_OTYPE_PUSHPULL(GPIOE_LED8_ORANGE) |\
803 PIN_OTYPE_PUSHPULL(GPIOE_LED6_GREEN))
804#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_L3GD20_INT1) |\
805 PIN_OSPEED_VERYLOW(GPIOE_L3GD20_INT2) |\
806 PIN_OSPEED_VERYLOW(GPIOE_LSM303DLHC_DRDY) |\
807 PIN_OSPEED_HIGH(GPIOE_SPI1_CS) | \
808 PIN_OSPEED_VERYLOW(GPIOE_LSM303DLHC_INT1) |\
809 PIN_OSPEED_VERYLOW(GPIOE_LSM303DLHC_INT2) |\
810 PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \
811 PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \
812 PIN_OSPEED_HIGH(GPIOE_LED4_BLUE) | \
813 PIN_OSPEED_HIGH(GPIOE_LED3_RED) | \
814 PIN_OSPEED_HIGH(GPIOE_LED5_ORANGE) | \
815 PIN_OSPEED_HIGH(GPIOE_LED7_GREEN) | \
816 PIN_OSPEED_HIGH(GPIOE_LED9_BLUE) | \
817 PIN_OSPEED_HIGH(GPIOE_LED10_RED) | \
818 PIN_OSPEED_HIGH(GPIOE_LED8_ORANGE) | \
819 PIN_OSPEED_HIGH(GPIOE_LED6_GREEN))
820#define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_L3GD20_INT1) | \
821 PIN_PUPDR_PULLUP(GPIOE_L3GD20_INT2) | \
822 PIN_PUPDR_PULLUP(GPIOE_LSM303DLHC_DRDY) |\
823 PIN_PUPDR_FLOATING(GPIOE_SPI1_CS) | \
824 PIN_PUPDR_PULLUP(GPIOE_LSM303DLHC_INT1) |\
825 PIN_PUPDR_PULLUP(GPIOE_LSM303DLHC_INT2) |\
826 PIN_PUPDR_PULLUP(GPIOE_PIN6) | \
827 PIN_PUPDR_PULLUP(GPIOE_PIN7) | \
828 PIN_PUPDR_PULLUP(GPIOE_LED4_BLUE) | \
829 PIN_PUPDR_PULLUP(GPIOE_LED3_RED) | \
830 PIN_PUPDR_PULLUP(GPIOE_LED5_ORANGE) | \
831 PIN_PUPDR_FLOATING(GPIOE_LED7_GREEN) | \
832 PIN_PUPDR_PULLUP(GPIOE_LED9_BLUE) | \
833 PIN_PUPDR_FLOATING(GPIOE_LED10_RED) | \
834 PIN_PUPDR_FLOATING(GPIOE_LED8_ORANGE) |\
835 PIN_PUPDR_FLOATING(GPIOE_LED6_GREEN))
836#define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_L3GD20_INT1) | \
837 PIN_ODR_HIGH(GPIOE_L3GD20_INT2) | \
838 PIN_ODR_HIGH(GPIOE_LSM303DLHC_DRDY) | \
839 PIN_ODR_HIGH(GPIOE_SPI1_CS) | \
840 PIN_ODR_HIGH(GPIOE_LSM303DLHC_INT1) | \
841 PIN_ODR_HIGH(GPIOE_LSM303DLHC_INT2) | \
842 PIN_ODR_HIGH(GPIOE_PIN6) | \
843 PIN_ODR_HIGH(GPIOE_PIN7) | \
844 PIN_ODR_LOW(GPIOE_LED4_BLUE) | \
845 PIN_ODR_LOW(GPIOE_LED3_RED) | \
846 PIN_ODR_LOW(GPIOE_LED5_ORANGE) | \
847 PIN_ODR_LOW(GPIOE_LED7_GREEN) | \
848 PIN_ODR_LOW(GPIOE_LED9_BLUE) | \
849 PIN_ODR_LOW(GPIOE_LED10_RED) | \
850 PIN_ODR_LOW(GPIOE_LED8_ORANGE) | \
851 PIN_ODR_LOW(GPIOE_LED6_GREEN))
852#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_L3GD20_INT1, 0U) | \
853 PIN_AFIO_AF(GPIOE_L3GD20_INT2, 0U) | \
854 PIN_AFIO_AF(GPIOE_LSM303DLHC_DRDY, 0U) |\
855 PIN_AFIO_AF(GPIOE_SPI1_CS, 0U) | \
856 PIN_AFIO_AF(GPIOE_LSM303DLHC_INT1, 0U) |\
857 PIN_AFIO_AF(GPIOE_LSM303DLHC_INT2, 0U) |\
858 PIN_AFIO_AF(GPIOE_PIN6, 0U) | \
859 PIN_AFIO_AF(GPIOE_PIN7, 0U))
860#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_LED4_BLUE, 0U) | \
861 PIN_AFIO_AF(GPIOE_LED3_RED, 0U) | \
862 PIN_AFIO_AF(GPIOE_LED5_ORANGE, 0U) | \
863 PIN_AFIO_AF(GPIOE_LED7_GREEN, 0U) | \
864 PIN_AFIO_AF(GPIOE_LED9_BLUE, 0U) | \
865 PIN_AFIO_AF(GPIOE_LED10_RED, 0U) | \
866 PIN_AFIO_AF(GPIOE_LED8_ORANGE, 0U) | \
867 PIN_AFIO_AF(GPIOE_LED6_GREEN, 0U))
868
869/*
870 * GPIOF setup:
871 *
872 * PF0 - OSC_IN (input floating).
873 * PF1 - OSC_OUT (input floating).
874 * PF2 - PIN2 (input pullup).
875 * PF3 - PIN3 (input pullup).
876 * PF4 - PIN4 (input pullup).
877 * PF5 - PIN5 (input pullup).
878 * PF6 - PIN6 (input pullup).
879 * PF7 - PIN7 (input pullup).
880 * PF8 - PIN8 (input pullup).
881 * PF9 - PIN9 (input pullup).
882 * PF10 - PIN10 (input pullup).
883 * PF11 - PIN11 (input pullup).
884 * PF12 - PIN12 (input pullup).
885 * PF13 - PIN13 (input pullup).
886 * PF14 - PIN14 (input pullup).
887 * PF15 - PIN15 (input pullup).
888 */
889#define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_OSC_IN) | \
890 PIN_MODE_INPUT(GPIOF_OSC_OUT) | \
891 PIN_MODE_INPUT(GPIOF_PIN2) | \
892 PIN_MODE_INPUT(GPIOF_PIN3) | \
893 PIN_MODE_INPUT(GPIOF_PIN4) | \
894 PIN_MODE_INPUT(GPIOF_PIN5) | \
895 PIN_MODE_INPUT(GPIOF_PIN6) | \
896 PIN_MODE_INPUT(GPIOF_PIN7) | \
897 PIN_MODE_INPUT(GPIOF_PIN8) | \
898 PIN_MODE_INPUT(GPIOF_PIN9) | \
899 PIN_MODE_INPUT(GPIOF_PIN10) | \
900 PIN_MODE_INPUT(GPIOF_PIN11) | \
901 PIN_MODE_INPUT(GPIOF_PIN12) | \
902 PIN_MODE_INPUT(GPIOF_PIN13) | \
903 PIN_MODE_INPUT(GPIOF_PIN14) | \
904 PIN_MODE_INPUT(GPIOF_PIN15))
905#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_OSC_IN) | \
906 PIN_OTYPE_PUSHPULL(GPIOF_OSC_OUT) | \
907 PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \
908 PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \
909 PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \
910 PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \
911 PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \
912 PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \
913 PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \
914 PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \
915 PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \
916 PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \
917 PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \
918 PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \
919 PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \
920 PIN_OTYPE_PUSHPULL(GPIOF_PIN15))
921#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_OSC_IN) | \
922 PIN_OSPEED_HIGH(GPIOF_OSC_OUT) | \
923 PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \
924 PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \
925 PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \
926 PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \
927 PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \
928 PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \
929 PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \
930 PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \
931 PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \
932 PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \
933 PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \
934 PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \
935 PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \
936 PIN_OSPEED_VERYLOW(GPIOF_PIN15))
937#define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_OSC_IN) | \
938 PIN_PUPDR_FLOATING(GPIOF_OSC_OUT) | \
939 PIN_PUPDR_PULLUP(GPIOF_PIN2) | \
940 PIN_PUPDR_PULLUP(GPIOF_PIN3) | \
941 PIN_PUPDR_PULLUP(GPIOF_PIN4) | \
942 PIN_PUPDR_PULLUP(GPIOF_PIN5) | \
943 PIN_PUPDR_PULLUP(GPIOF_PIN6) | \
944 PIN_PUPDR_PULLUP(GPIOF_PIN7) | \
945 PIN_PUPDR_PULLUP(GPIOF_PIN8) | \
946 PIN_PUPDR_PULLUP(GPIOF_PIN9) | \
947 PIN_PUPDR_PULLUP(GPIOF_PIN10) | \
948 PIN_PUPDR_PULLUP(GPIOF_PIN11) | \
949 PIN_PUPDR_PULLUP(GPIOF_PIN12) | \
950 PIN_PUPDR_PULLUP(GPIOF_PIN13) | \
951 PIN_PUPDR_PULLUP(GPIOF_PIN14) | \
952 PIN_PUPDR_PULLUP(GPIOF_PIN15))
953#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_OSC_IN) | \
954 PIN_ODR_HIGH(GPIOF_OSC_OUT) | \
955 PIN_ODR_HIGH(GPIOF_PIN2) | \
956 PIN_ODR_HIGH(GPIOF_PIN3) | \
957 PIN_ODR_HIGH(GPIOF_PIN4) | \
958 PIN_ODR_HIGH(GPIOF_PIN5) | \
959 PIN_ODR_HIGH(GPIOF_PIN6) | \
960 PIN_ODR_HIGH(GPIOF_PIN7) | \
961 PIN_ODR_HIGH(GPIOF_PIN8) | \
962 PIN_ODR_HIGH(GPIOF_PIN9) | \
963 PIN_ODR_HIGH(GPIOF_PIN10) | \
964 PIN_ODR_HIGH(GPIOF_PIN11) | \
965 PIN_ODR_HIGH(GPIOF_PIN12) | \
966 PIN_ODR_HIGH(GPIOF_PIN13) | \
967 PIN_ODR_HIGH(GPIOF_PIN14) | \
968 PIN_ODR_HIGH(GPIOF_PIN15))
969#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_OSC_IN, 0U) | \
970 PIN_AFIO_AF(GPIOF_OSC_OUT, 0U) | \
971 PIN_AFIO_AF(GPIOF_PIN2, 0U) | \
972 PIN_AFIO_AF(GPIOF_PIN3, 0U) | \
973 PIN_AFIO_AF(GPIOF_PIN4, 0U) | \
974 PIN_AFIO_AF(GPIOF_PIN5, 0U) | \
975 PIN_AFIO_AF(GPIOF_PIN6, 0U) | \
976 PIN_AFIO_AF(GPIOF_PIN7, 0U))
977#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \
978 PIN_AFIO_AF(GPIOF_PIN9, 0U) | \
979 PIN_AFIO_AF(GPIOF_PIN10, 0U) | \
980 PIN_AFIO_AF(GPIOF_PIN11, 0U) | \
981 PIN_AFIO_AF(GPIOF_PIN12, 0U) | \
982 PIN_AFIO_AF(GPIOF_PIN13, 0U) | \
983 PIN_AFIO_AF(GPIOF_PIN14, 0U) | \
984 PIN_AFIO_AF(GPIOF_PIN15, 0U))
985
986/*
987 * GPIOG setup:
988 *
989 * PG0 - PIN0 (input pullup).
990 * PG1 - PIN1 (input pullup).
991 * PG2 - PIN2 (input pullup).
992 * PG3 - PIN3 (input pullup).
993 * PG4 - PIN4 (input pullup).
994 * PG5 - PIN5 (input pullup).
995 * PG6 - PIN6 (input pullup).
996 * PG7 - PIN7 (input pullup).
997 * PG8 - PIN8 (input pullup).
998 * PG9 - PIN9 (input pullup).
999 * PG10 - PIN10 (input pullup).
1000 * PG11 - PIN11 (input pullup).
1001 * PG12 - PIN12 (input pullup).
1002 * PG13 - PIN13 (input pullup).
1003 * PG14 - PIN14 (input pullup).
1004 * PG15 - PIN15 (input pullup).
1005 */
1006#define VAL_GPIOG_MODER (PIN_MODE_INPUT(GPIOG_PIN0) | \
1007 PIN_MODE_INPUT(GPIOG_PIN1) | \
1008 PIN_MODE_INPUT(GPIOG_PIN2) | \
1009 PIN_MODE_INPUT(GPIOG_PIN3) | \
1010 PIN_MODE_INPUT(GPIOG_PIN4) | \
1011 PIN_MODE_INPUT(GPIOG_PIN5) | \
1012 PIN_MODE_INPUT(GPIOG_PIN6) | \
1013 PIN_MODE_INPUT(GPIOG_PIN7) | \
1014 PIN_MODE_INPUT(GPIOG_PIN8) | \
1015 PIN_MODE_INPUT(GPIOG_PIN9) | \
1016 PIN_MODE_INPUT(GPIOG_PIN10) | \
1017 PIN_MODE_INPUT(GPIOG_PIN11) | \
1018 PIN_MODE_INPUT(GPIOG_PIN12) | \
1019 PIN_MODE_INPUT(GPIOG_PIN13) | \
1020 PIN_MODE_INPUT(GPIOG_PIN14) | \
1021 PIN_MODE_INPUT(GPIOG_PIN15))
1022#define VAL_GPIOG_OTYPER (PIN_OTYPE_PUSHPULL(GPIOG_PIN0) | \
1023 PIN_OTYPE_PUSHPULL(GPIOG_PIN1) | \
1024 PIN_OTYPE_PUSHPULL(GPIOG_PIN2) | \
1025 PIN_OTYPE_PUSHPULL(GPIOG_PIN3) | \
1026 PIN_OTYPE_PUSHPULL(GPIOG_PIN4) | \
1027 PIN_OTYPE_PUSHPULL(GPIOG_PIN5) | \
1028 PIN_OTYPE_PUSHPULL(GPIOG_PIN6) | \
1029 PIN_OTYPE_PUSHPULL(GPIOG_PIN7) | \
1030 PIN_OTYPE_PUSHPULL(GPIOG_PIN8) | \
1031 PIN_OTYPE_PUSHPULL(GPIOG_PIN9) | \
1032 PIN_OTYPE_PUSHPULL(GPIOG_PIN10) | \
1033 PIN_OTYPE_PUSHPULL(GPIOG_PIN11) | \
1034 PIN_OTYPE_PUSHPULL(GPIOG_PIN12) | \
1035 PIN_OTYPE_PUSHPULL(GPIOG_PIN13) | \
1036 PIN_OTYPE_PUSHPULL(GPIOG_PIN14) | \
1037 PIN_OTYPE_PUSHPULL(GPIOG_PIN15))
1038#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOG_PIN0) | \
1039 PIN_OSPEED_VERYLOW(GPIOG_PIN1) | \
1040 PIN_OSPEED_VERYLOW(GPIOG_PIN2) | \
1041 PIN_OSPEED_VERYLOW(GPIOG_PIN3) | \
1042 PIN_OSPEED_VERYLOW(GPIOG_PIN4) | \
1043 PIN_OSPEED_VERYLOW(GPIOG_PIN5) | \
1044 PIN_OSPEED_VERYLOW(GPIOG_PIN6) | \
1045 PIN_OSPEED_VERYLOW(GPIOG_PIN7) | \
1046 PIN_OSPEED_VERYLOW(GPIOG_PIN8) | \
1047 PIN_OSPEED_VERYLOW(GPIOG_PIN9) | \
1048 PIN_OSPEED_VERYLOW(GPIOG_PIN10) | \
1049 PIN_OSPEED_VERYLOW(GPIOG_PIN11) | \
1050 PIN_OSPEED_VERYLOW(GPIOG_PIN12) | \
1051 PIN_OSPEED_VERYLOW(GPIOG_PIN13) | \
1052 PIN_OSPEED_VERYLOW(GPIOG_PIN14) | \
1053 PIN_OSPEED_VERYLOW(GPIOG_PIN15))
1054#define VAL_GPIOG_PUPDR (PIN_PUPDR_PULLUP(GPIOG_PIN0) | \
1055 PIN_PUPDR_PULLUP(GPIOG_PIN1) | \
1056 PIN_PUPDR_PULLUP(GPIOG_PIN2) | \
1057 PIN_PUPDR_PULLUP(GPIOG_PIN3) | \
1058 PIN_PUPDR_PULLUP(GPIOG_PIN4) | \
1059 PIN_PUPDR_PULLUP(GPIOG_PIN5) | \
1060 PIN_PUPDR_PULLUP(GPIOG_PIN6) | \
1061 PIN_PUPDR_PULLUP(GPIOG_PIN7) | \
1062 PIN_PUPDR_PULLUP(GPIOG_PIN8) | \
1063 PIN_PUPDR_PULLUP(GPIOG_PIN9) | \
1064 PIN_PUPDR_PULLUP(GPIOG_PIN10) | \
1065 PIN_PUPDR_PULLUP(GPIOG_PIN11) | \
1066 PIN_PUPDR_PULLUP(GPIOG_PIN12) | \
1067 PIN_PUPDR_PULLUP(GPIOG_PIN13) | \
1068 PIN_PUPDR_PULLUP(GPIOG_PIN14) | \
1069 PIN_PUPDR_PULLUP(GPIOG_PIN15))
1070#define VAL_GPIOG_ODR (PIN_ODR_HIGH(GPIOG_PIN0) | \
1071 PIN_ODR_HIGH(GPIOG_PIN1) | \
1072 PIN_ODR_HIGH(GPIOG_PIN2) | \
1073 PIN_ODR_HIGH(GPIOG_PIN3) | \
1074 PIN_ODR_HIGH(GPIOG_PIN4) | \
1075 PIN_ODR_HIGH(GPIOG_PIN5) | \
1076 PIN_ODR_HIGH(GPIOG_PIN6) | \
1077 PIN_ODR_HIGH(GPIOG_PIN7) | \
1078 PIN_ODR_HIGH(GPIOG_PIN8) | \
1079 PIN_ODR_HIGH(GPIOG_PIN9) | \
1080 PIN_ODR_HIGH(GPIOG_PIN10) | \
1081 PIN_ODR_HIGH(GPIOG_PIN11) | \
1082 PIN_ODR_HIGH(GPIOG_PIN12) | \
1083 PIN_ODR_HIGH(GPIOG_PIN13) | \
1084 PIN_ODR_HIGH(GPIOG_PIN14) | \
1085 PIN_ODR_HIGH(GPIOG_PIN15))
1086#define VAL_GPIOG_AFRL (PIN_AFIO_AF(GPIOG_PIN0, 0U) | \
1087 PIN_AFIO_AF(GPIOG_PIN1, 0U) | \
1088 PIN_AFIO_AF(GPIOG_PIN2, 0U) | \
1089 PIN_AFIO_AF(GPIOG_PIN3, 0U) | \
1090 PIN_AFIO_AF(GPIOG_PIN4, 0U) | \
1091 PIN_AFIO_AF(GPIOG_PIN5, 0U) | \
1092 PIN_AFIO_AF(GPIOG_PIN6, 0U) | \
1093 PIN_AFIO_AF(GPIOG_PIN7, 0U))
1094#define VAL_GPIOG_AFRH (PIN_AFIO_AF(GPIOG_PIN8, 0U) | \
1095 PIN_AFIO_AF(GPIOG_PIN9, 0U) | \
1096 PIN_AFIO_AF(GPIOG_PIN10, 0U) | \
1097 PIN_AFIO_AF(GPIOG_PIN11, 0U) | \
1098 PIN_AFIO_AF(GPIOG_PIN12, 0U) | \
1099 PIN_AFIO_AF(GPIOG_PIN13, 0U) | \
1100 PIN_AFIO_AF(GPIOG_PIN14, 0U) | \
1101 PIN_AFIO_AF(GPIOG_PIN15, 0U))
1102
1103/*
1104 * GPIOH setup:
1105 *
1106 * PH0 - PIN0 (input pullup).
1107 * PH1 - PIN1 (input pullup).
1108 * PH2 - PIN2 (input pullup).
1109 * PH3 - PIN3 (input pullup).
1110 * PH4 - PIN4 (input pullup).
1111 * PH5 - PIN5 (input pullup).
1112 * PH6 - PIN6 (input pullup).
1113 * PH7 - PIN7 (input pullup).
1114 * PH8 - PIN8 (input pullup).
1115 * PH9 - PIN9 (input pullup).
1116 * PH10 - PIN10 (input pullup).
1117 * PH11 - PIN11 (input pullup).
1118 * PH12 - PIN12 (input pullup).
1119 * PH13 - PIN13 (input pullup).
1120 * PH14 - PIN14 (input pullup).
1121 * PH15 - PIN15 (input pullup).
1122 */
1123#define VAL_GPIOH_MODER (PIN_MODE_INPUT(GPIOH_PIN0) | \
1124 PIN_MODE_INPUT(GPIOH_PIN1) | \
1125 PIN_MODE_INPUT(GPIOH_PIN2) | \
1126 PIN_MODE_INPUT(GPIOH_PIN3) | \
1127 PIN_MODE_INPUT(GPIOH_PIN4) | \
1128 PIN_MODE_INPUT(GPIOH_PIN5) | \
1129 PIN_MODE_INPUT(GPIOH_PIN6) | \
1130 PIN_MODE_INPUT(GPIOH_PIN7) | \
1131 PIN_MODE_INPUT(GPIOH_PIN8) | \
1132 PIN_MODE_INPUT(GPIOH_PIN9) | \
1133 PIN_MODE_INPUT(GPIOH_PIN10) | \
1134 PIN_MODE_INPUT(GPIOH_PIN11) | \
1135 PIN_MODE_INPUT(GPIOH_PIN12) | \
1136 PIN_MODE_INPUT(GPIOH_PIN13) | \
1137 PIN_MODE_INPUT(GPIOH_PIN14) | \
1138 PIN_MODE_INPUT(GPIOH_PIN15))
1139#define VAL_GPIOH_OTYPER (PIN_OTYPE_PUSHPULL(GPIOH_PIN0) | \
1140 PIN_OTYPE_PUSHPULL(GPIOH_PIN1) | \
1141 PIN_OTYPE_PUSHPULL(GPIOH_PIN2) | \
1142 PIN_OTYPE_PUSHPULL(GPIOH_PIN3) | \
1143 PIN_OTYPE_PUSHPULL(GPIOH_PIN4) | \
1144 PIN_OTYPE_PUSHPULL(GPIOH_PIN5) | \
1145 PIN_OTYPE_PUSHPULL(GPIOH_PIN6) | \
1146 PIN_OTYPE_PUSHPULL(GPIOH_PIN7) | \
1147 PIN_OTYPE_PUSHPULL(GPIOH_PIN8) | \
1148 PIN_OTYPE_PUSHPULL(GPIOH_PIN9) | \
1149 PIN_OTYPE_PUSHPULL(GPIOH_PIN10) | \
1150 PIN_OTYPE_PUSHPULL(GPIOH_PIN11) | \
1151 PIN_OTYPE_PUSHPULL(GPIOH_PIN12) | \
1152 PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \
1153 PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \
1154 PIN_OTYPE_PUSHPULL(GPIOH_PIN15))
1155#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOH_PIN0) | \
1156 PIN_OSPEED_VERYLOW(GPIOH_PIN1) | \
1157 PIN_OSPEED_VERYLOW(GPIOH_PIN2) | \
1158 PIN_OSPEED_VERYLOW(GPIOH_PIN3) | \
1159 PIN_OSPEED_VERYLOW(GPIOH_PIN4) | \
1160 PIN_OSPEED_VERYLOW(GPIOH_PIN5) | \
1161 PIN_OSPEED_VERYLOW(GPIOH_PIN6) | \
1162 PIN_OSPEED_VERYLOW(GPIOH_PIN7) | \
1163 PIN_OSPEED_VERYLOW(GPIOH_PIN8) | \
1164 PIN_OSPEED_VERYLOW(GPIOH_PIN9) | \
1165 PIN_OSPEED_VERYLOW(GPIOH_PIN10) | \
1166 PIN_OSPEED_VERYLOW(GPIOH_PIN11) | \
1167 PIN_OSPEED_VERYLOW(GPIOH_PIN12) | \
1168 PIN_OSPEED_VERYLOW(GPIOH_PIN13) | \
1169 PIN_OSPEED_VERYLOW(GPIOH_PIN14) | \
1170 PIN_OSPEED_VERYLOW(GPIOH_PIN15))
1171#define VAL_GPIOH_PUPDR (PIN_PUPDR_PULLUP(GPIOH_PIN0) | \
1172 PIN_PUPDR_PULLUP(GPIOH_PIN1) | \
1173 PIN_PUPDR_PULLUP(GPIOH_PIN2) | \
1174 PIN_PUPDR_PULLUP(GPIOH_PIN3) | \
1175 PIN_PUPDR_PULLUP(GPIOH_PIN4) | \
1176 PIN_PUPDR_PULLUP(GPIOH_PIN5) | \
1177 PIN_PUPDR_PULLUP(GPIOH_PIN6) | \
1178 PIN_PUPDR_PULLUP(GPIOH_PIN7) | \
1179 PIN_PUPDR_PULLUP(GPIOH_PIN8) | \
1180 PIN_PUPDR_PULLUP(GPIOH_PIN9) | \
1181 PIN_PUPDR_PULLUP(GPIOH_PIN10) | \
1182 PIN_PUPDR_PULLUP(GPIOH_PIN11) | \
1183 PIN_PUPDR_PULLUP(GPIOH_PIN12) | \
1184 PIN_PUPDR_PULLUP(GPIOH_PIN13) | \
1185 PIN_PUPDR_PULLUP(GPIOH_PIN14) | \
1186 PIN_PUPDR_PULLUP(GPIOH_PIN15))
1187#define VAL_GPIOH_ODR (PIN_ODR_HIGH(GPIOH_PIN0) | \
1188 PIN_ODR_HIGH(GPIOH_PIN1) | \
1189 PIN_ODR_HIGH(GPIOH_PIN2) | \
1190 PIN_ODR_HIGH(GPIOH_PIN3) | \
1191 PIN_ODR_HIGH(GPIOH_PIN4) | \
1192 PIN_ODR_HIGH(GPIOH_PIN5) | \
1193 PIN_ODR_HIGH(GPIOH_PIN6) | \
1194 PIN_ODR_HIGH(GPIOH_PIN7) | \
1195 PIN_ODR_HIGH(GPIOH_PIN8) | \
1196 PIN_ODR_HIGH(GPIOH_PIN9) | \
1197 PIN_ODR_HIGH(GPIOH_PIN10) | \
1198 PIN_ODR_HIGH(GPIOH_PIN11) | \
1199 PIN_ODR_HIGH(GPIOH_PIN12) | \
1200 PIN_ODR_HIGH(GPIOH_PIN13) | \
1201 PIN_ODR_HIGH(GPIOH_PIN14) | \
1202 PIN_ODR_HIGH(GPIOH_PIN15))
1203#define VAL_GPIOH_AFRL (PIN_AFIO_AF(GPIOH_PIN0, 0U) | \
1204 PIN_AFIO_AF(GPIOH_PIN1, 0U) | \
1205 PIN_AFIO_AF(GPIOH_PIN2, 0U) | \
1206 PIN_AFIO_AF(GPIOH_PIN3, 0U) | \
1207 PIN_AFIO_AF(GPIOH_PIN4, 0U) | \
1208 PIN_AFIO_AF(GPIOH_PIN5, 0U) | \
1209 PIN_AFIO_AF(GPIOH_PIN6, 0U) | \
1210 PIN_AFIO_AF(GPIOH_PIN7, 0U))
1211#define VAL_GPIOH_AFRH (PIN_AFIO_AF(GPIOH_PIN8, 0U) | \
1212 PIN_AFIO_AF(GPIOH_PIN9, 0U) | \
1213 PIN_AFIO_AF(GPIOH_PIN10, 0U) | \
1214 PIN_AFIO_AF(GPIOH_PIN11, 0U) | \
1215 PIN_AFIO_AF(GPIOH_PIN12, 0U) | \
1216 PIN_AFIO_AF(GPIOH_PIN13, 0U) | \
1217 PIN_AFIO_AF(GPIOH_PIN14, 0U) | \
1218 PIN_AFIO_AF(GPIOH_PIN15, 0U))
1219
1220/*===========================================================================*/
1221/* External declarations. */
1222/*===========================================================================*/
1223
1224#if !defined(_FROM_ASM_)
1225#ifdef __cplusplus
1226extern "C" {
1227#endif
1228 void boardInit(void);
1229#ifdef __cplusplus
1230}
1231#endif
1232#endif /* _FROM_ASM_ */
1233
1234#endif /* BOARD_H */