Paparazzi UAS  v5.15_devel-124-g3c411d6-dirty
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
board.h
Go to the documentation of this file.
1 /*
2  ChibiOS - Copyright (C) 2006..2016 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  * Setup for STMicroelectronics STM32F3-Discovery board.
27  */
28 
29 /*
30  * Board identifier.
31  */
32 #define BOARD_ST_STM32F3_DISCOVERY
33 #define BOARD_NAME "STMicroelectronics STM32F3-Discovery"
34 
35 /*
36  * Board oscillators-related settings.
37  * NOTE: LSE not fitted.
38  */
39 #if !defined(STM32_LSECLK)
40 #define STM32_LSECLK 0U
41 #endif
42 
43 #define STM32_LSEDRV (3U << 3U)
44 
45 #if !defined(STM32_HSECLK)
46 #define STM32_HSECLK 8000000U
47 #endif
48 
49 #define STM32_HSE_BYPASS
50 
51 /*
52  * MCU type as defined in the ST header.
53  */
54 #define STM32F303xC
55 
56 /*
57  * IO pins assignments.
58  */
59 #define GPIOA_BUTTON 0U
60 #define GPIOA_PIN1 1U
61 #define GPIOA_PIN2 2U
62 #define GPIOA_PIN3 3U
63 #define GPIOA_PIN4 4U
64 #define GPIOA_SPI1_SCK 5U
65 #define GPIOA_L3GD20_SCL 5U
66 #define GPIOA_SPI1_MISO 6U
67 #define GPIOA_L3GD20_SDO 6U
68 #define GPIOA_SPI1_MOSI 7U
69 #define GPIOA_L3GD20_SDI 7U
70 #define GPIOA_PIN8 8U
71 #define GPIOA_PIN9 9U
72 #define GPIOA_PIN10 10U
73 #define GPIOA_USB_DM 11U
74 #define GPIOA_USB_DP 12U
75 #define GPIOA_SWDIO 13U
76 #define GPIOA_SWCLK 14U
77 #define GPIOA_PIN15 15U
78 
79 #define GPIOB_PIN0 0U
80 #define GPIOB_PIN1 1U
81 #define GPIOB_PIN2 2U
82 #define GPIOB_SWO 3U
83 #define GPIOB_PIN4 4U
84 #define GPIOB_PIN5 5U
85 #define GPIOB_I2C1_SCL 6U
86 #define GPIOB_LSM303DLHC_SCL 6U
87 #define GPIOB_I2C1_SDA 7U
88 #define GPIOB_LSM303DLHC_SDA 7U
89 #define GPIOB_PIN8 8U
90 #define GPIOB_PIN9 9U
91 #define GPIOB_PIN10 10U
92 #define GPIOB_PIN11 11U
93 #define GPIOB_PIN12 12U
94 #define GPIOB_PIN13 13U
95 #define GPIOB_PIN14 14U
96 #define GPIOB_PIN15 15U
97 
98 #define GPIOC_PIN0 0U
99 #define GPIOC_PIN1 1U
100 #define GPIOC_PIN2 2U
101 #define GPIOC_PIN3 3U
102 #define GPIOC_PIN4 4U
103 #define GPIOC_PIN5 5U
104 #define GPIOC_PIN6 6U
105 #define GPIOC_PIN7 7U
106 #define GPIOC_PIN8 8U
107 #define GPIOC_PIN9 9U
108 #define GPIOC_PIN10 10U
109 #define GPIOC_PIN11 11U
110 #define GPIOC_PIN12 12U
111 #define GPIOC_PIN13 13U
112 #define GPIOC_OSC32_IN 14U
113 #define GPIOC_OSC32_OUT 15U
114 
115 #define GPIOD_PIN0 0U
116 #define GPIOD_PIN1 1U
117 #define GPIOD_PIN2 2U
118 #define GPIOD_PIN3 3U
119 #define GPIOD_PIN4 4U
120 #define GPIOD_PIN5 5U
121 #define GPIOD_PIN6 6U
122 #define GPIOD_PIN7 7U
123 #define GPIOD_PIN8 8U
124 #define GPIOD_PIN9 9U
125 #define GPIOD_PIN10 10U
126 #define GPIOD_PIN11 11U
127 #define GPIOD_PIN12 12U
128 #define GPIOD_PIN13 13U
129 #define GPIOD_PIN14 14U
130 #define GPIOD_PIN15 15U
131 
132 #define GPIOE_L3GD20_INT1 0U
133 #define GPIOE_L3GD20_INT2 1U
134 #define GPIOE_LSM303DLHC_DRDY 2U
135 #define GPIOE_SPI1_CS 3U
136 #define GPIOE_L3GD20_CS 3U
137 #define GPIOE_LSM303DLHC_INT1 4U
138 #define GPIOE_LSM303DLHC_INT2 5U
139 #define GPIOE_PIN6 6U
140 #define GPIOE_PIN7 7U
141 #define GPIOE_LED4_BLUE 8U
142 #define GPIOE_LED3_RED 9U
143 #define GPIOE_LED5_ORANGE 10U
144 #define GPIOE_LED7_GREEN 11U
145 #define GPIOE_LED9_BLUE 12U
146 #define GPIOE_LED10_RED 13U
147 #define GPIOE_LED8_ORANGE 14U
148 #define GPIOE_LED6_GREEN 15U
149 
150 #define GPIOF_OSC_IN 0U
151 #define GPIOF_OSC_OUT 1U
152 #define GPIOF_PIN2 2U
153 #define GPIOF_PIN3 3U
154 #define GPIOF_PIN4 4U
155 #define GPIOF_PIN5 5U
156 #define GPIOF_PIN6 6U
157 #define GPIOF_PIN7 7U
158 #define GPIOF_PIN8 8U
159 #define GPIOF_PIN9 9U
160 #define GPIOF_PIN10 10U
161 #define GPIOF_PIN11 11U
162 #define GPIOF_PIN12 12U
163 #define GPIOF_PIN13 13U
164 #define GPIOF_PIN14 14U
165 #define GPIOF_PIN15 15U
166 
167 #define GPIOG_PIN0 0U
168 #define GPIOG_PIN1 1U
169 #define GPIOG_PIN2 2U
170 #define GPIOG_PIN3 3U
171 #define GPIOG_PIN4 4U
172 #define GPIOG_PIN5 5U
173 #define GPIOG_PIN6 6U
174 #define GPIOG_PIN7 7U
175 #define GPIOG_PIN8 8U
176 #define GPIOG_PIN9 9U
177 #define GPIOG_PIN10 10U
178 #define GPIOG_PIN11 11U
179 #define GPIOG_PIN12 12U
180 #define GPIOG_PIN13 13U
181 #define GPIOG_PIN14 14U
182 #define GPIOG_PIN15 15U
183 
184 #define GPIOH_PIN0 0U
185 #define GPIOH_PIN1 1U
186 #define GPIOH_PIN2 2U
187 #define GPIOH_PIN3 3U
188 #define GPIOH_PIN4 4U
189 #define GPIOH_PIN5 5U
190 #define GPIOH_PIN6 6U
191 #define GPIOH_PIN7 7U
192 #define GPIOH_PIN8 8U
193 #define GPIOH_PIN9 9U
194 #define GPIOH_PIN10 10U
195 #define GPIOH_PIN11 11U
196 #define GPIOH_PIN12 12U
197 #define GPIOH_PIN13 13U
198 #define GPIOH_PIN14 14U
199 #define GPIOH_PIN15 15U
200 
201 /*
202  * IO lines assignments.
203  */
204 #define LINE_BUTTON PAL_LINE(GPIOA, 0U)
205 #define LINE_SPI1_SCK PAL_LINE(GPIOA, 5U)
206 #define LINE_L3GD20_SCL PAL_LINE(GPIOA, 5U)
207 #define LINE_SPI1_MISO PAL_LINE(GPIOA, 6U)
208 #define LINE_L3GD20_SDO PAL_LINE(GPIOA, 6U)
209 #define LINE_SPI1_MOSI PAL_LINE(GPIOA, 7U)
210 #define LINE_L3GD20_SDI PAL_LINE(GPIOA, 7U)
211 #define LINE_USB_DM PAL_LINE(GPIOA, 11U)
212 #define LINE_USB_DP PAL_LINE(GPIOA, 12U)
213 #define LINE_SWDIO PAL_LINE(GPIOA, 13U)
214 #define LINE_SWCLK PAL_LINE(GPIOA, 14U)
215 
216 #define LINE_SWO PAL_LINE(GPIOB, 3U)
217 #define LINE_I2C1_SCL PAL_LINE(GPIOB, 6U)
218 #define LINE_LSM303DLHC_SCL PAL_LINE(GPIOB, 6U)
219 #define LINE_I2C1_SDA PAL_LINE(GPIOB, 7U)
220 #define LINE_LSM303DLHC_SDA PAL_LINE(GPIOB, 7U)
221 
222 #define LINE_OSC32_IN PAL_LINE(GPIOC, 14U)
223 #define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U)
224 
225 
226 #define LINE_L3GD20_INT1 PAL_LINE(GPIOE, 0U)
227 #define LINE_L3GD20_INT2 PAL_LINE(GPIOE, 1U)
228 #define LINE_LSM303DLHC_DRDY PAL_LINE(GPIOE, 2U)
229 #define LINE_SPI1_CS PAL_LINE(GPIOE, 3U)
230 #define LINE_L3GD20_CS PAL_LINE(GPIOE, 3U)
231 #define LINE_LSM303DLHC_INT1 PAL_LINE(GPIOE, 4U)
232 #define LINE_LSM303DLHC_INT2 PAL_LINE(GPIOE, 5U)
233 #define LINE_LED4_BLUE PAL_LINE(GPIOE, 8U)
234 #define LINE_LED3_RED PAL_LINE(GPIOE, 9U)
235 #define LINE_LED5_ORANGE PAL_LINE(GPIOE, 10U)
236 #define LINE_LED7_GREEN PAL_LINE(GPIOE, 11U)
237 #define LINE_LED9_BLUE PAL_LINE(GPIOE, 12U)
238 #define LINE_LED10_RED PAL_LINE(GPIOE, 13U)
239 #define LINE_LED8_ORANGE PAL_LINE(GPIOE, 14U)
240 #define LINE_LED6_GREEN PAL_LINE(GPIOE, 15U)
241 
242 #define LINE_OSC_IN PAL_LINE(GPIOF, 0U)
243 #define LINE_OSC_OUT PAL_LINE(GPIOF, 1U)
244 
245 
246 
247 /*
248  * I/O ports initial setup, this configuration is established soon after reset
249  * in the initialization code.
250  * Please refer to the STM32 Reference Manual for details.
251  */
252 #define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
253 #define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
254 #define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
255 #define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
256 #define PIN_ODR_LOW(n) (0U << (n))
257 #define PIN_ODR_HIGH(n) (1U << (n))
258 #define PIN_OTYPE_PUSHPULL(n) (0U << (n))
259 #define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
260 #define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U))
261 #define PIN_OSPEED_LOW(n) (1U << ((n) * 2U))
262 #define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U))
263 #define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U))
264 #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
265 #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
266 #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
267 #define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
268 
269 /*
270  * GPIOA setup:
271  *
272  * PA0 - BUTTON (input floating).
273  * PA1 - PIN1 (input pullup).
274  * PA2 - PIN2 (input pullup).
275  * PA3 - PIN3 (input pullup).
276  * PA4 - PIN4 (input pullup).
277  * PA5 - SPI1_SCK L3GD20_SCL (alternate 5).
278  * PA6 - SPI1_MISO L3GD20_SDO (alternate 5).
279  * PA7 - SPI1_MOSI L3GD20_SDI (alternate 5).
280  * PA8 - PIN8 (input pullup).
281  * PA9 - PIN9 (input pullup).
282  * PA10 - PIN10 (input pullup).
283  * PA11 - USB_DM (alternate 14).
284  * PA12 - USB_DP (alternate 14).
285  * PA13 - SWDIO (alternate 0).
286  * PA14 - SWCLK (alternate 0).
287  * PA15 - PIN15 (input pullup).
288  */
289 #define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_BUTTON) | \
290  PIN_MODE_INPUT(GPIOA_PIN1) | \
291  PIN_MODE_INPUT(GPIOA_PIN2) | \
292  PIN_MODE_INPUT(GPIOA_PIN3) | \
293  PIN_MODE_INPUT(GPIOA_PIN4) | \
294  PIN_MODE_ALTERNATE(GPIOA_SPI1_SCK) | \
295  PIN_MODE_ALTERNATE(GPIOA_SPI1_MISO) | \
296  PIN_MODE_ALTERNATE(GPIOA_SPI1_MOSI) | \
297  PIN_MODE_INPUT(GPIOA_PIN8) | \
298  PIN_MODE_INPUT(GPIOA_PIN9) | \
299  PIN_MODE_INPUT(GPIOA_PIN10) | \
300  PIN_MODE_ALTERNATE(GPIOA_USB_DM) | \
301  PIN_MODE_ALTERNATE(GPIOA_USB_DP) | \
302  PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \
303  PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \
304  PIN_MODE_INPUT(GPIOA_PIN15))
305 #define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_BUTTON) | \
306  PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \
307  PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \
308  PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \
309  PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \
310  PIN_OTYPE_PUSHPULL(GPIOA_SPI1_SCK) | \
311  PIN_OTYPE_PUSHPULL(GPIOA_SPI1_MISO) | \
312  PIN_OTYPE_PUSHPULL(GPIOA_SPI1_MOSI) | \
313  PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \
314  PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \
315  PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \
316  PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | \
317  PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | \
318  PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \
319  PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \
320  PIN_OTYPE_PUSHPULL(GPIOA_PIN15))
321 #define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_BUTTON) | \
322  PIN_OSPEED_VERYLOW(GPIOA_PIN1) | \
323  PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \
324  PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \
325  PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \
326  PIN_OSPEED_HIGH(GPIOA_SPI1_SCK) | \
327  PIN_OSPEED_HIGH(GPIOA_SPI1_MISO) | \
328  PIN_OSPEED_HIGH(GPIOA_SPI1_MOSI) | \
329  PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \
330  PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \
331  PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \
332  PIN_OSPEED_HIGH(GPIOA_USB_DM) | \
333  PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \
334  PIN_OSPEED_HIGH(GPIOA_SWDIO) | \
335  PIN_OSPEED_HIGH(GPIOA_SWCLK) | \
336  PIN_OSPEED_VERYLOW(GPIOA_PIN15))
337 #define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON) | \
338  PIN_PUPDR_PULLUP(GPIOA_PIN1) | \
339  PIN_PUPDR_PULLUP(GPIOA_PIN2) | \
340  PIN_PUPDR_PULLUP(GPIOA_PIN3) | \
341  PIN_PUPDR_PULLUP(GPIOA_PIN4) | \
342  PIN_PUPDR_FLOATING(GPIOA_SPI1_SCK) | \
343  PIN_PUPDR_PULLUP(GPIOA_SPI1_MISO) | \
344  PIN_PUPDR_FLOATING(GPIOA_SPI1_MOSI) | \
345  PIN_PUPDR_PULLUP(GPIOA_PIN8) | \
346  PIN_PUPDR_PULLUP(GPIOA_PIN9) | \
347  PIN_PUPDR_PULLUP(GPIOA_PIN10) | \
348  PIN_PUPDR_FLOATING(GPIOA_USB_DM) | \
349  PIN_PUPDR_FLOATING(GPIOA_USB_DP) | \
350  PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \
351  PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \
352  PIN_PUPDR_PULLUP(GPIOA_PIN15))
353 #define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_BUTTON) | \
354  PIN_ODR_HIGH(GPIOA_PIN1) | \
355  PIN_ODR_HIGH(GPIOA_PIN2) | \
356  PIN_ODR_HIGH(GPIOA_PIN3) | \
357  PIN_ODR_HIGH(GPIOA_PIN4) | \
358  PIN_ODR_HIGH(GPIOA_SPI1_SCK) | \
359  PIN_ODR_HIGH(GPIOA_SPI1_MISO) | \
360  PIN_ODR_HIGH(GPIOA_SPI1_MOSI) | \
361  PIN_ODR_HIGH(GPIOA_PIN8) | \
362  PIN_ODR_HIGH(GPIOA_PIN9) | \
363  PIN_ODR_HIGH(GPIOA_PIN10) | \
364  PIN_ODR_HIGH(GPIOA_USB_DM) | \
365  PIN_ODR_HIGH(GPIOA_USB_DP) | \
366  PIN_ODR_HIGH(GPIOA_SWDIO) | \
367  PIN_ODR_HIGH(GPIOA_SWCLK) | \
368  PIN_ODR_HIGH(GPIOA_PIN15))
369 #define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_BUTTON, 0U) | \
370  PIN_AFIO_AF(GPIOA_PIN1, 0U) | \
371  PIN_AFIO_AF(GPIOA_PIN2, 0U) | \
372  PIN_AFIO_AF(GPIOA_PIN3, 0U) | \
373  PIN_AFIO_AF(GPIOA_PIN4, 0U) | \
374  PIN_AFIO_AF(GPIOA_SPI1_SCK, 5U) | \
375  PIN_AFIO_AF(GPIOA_SPI1_MISO, 5U) | \
376  PIN_AFIO_AF(GPIOA_SPI1_MOSI, 5U))
377 #define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0U) | \
378  PIN_AFIO_AF(GPIOA_PIN9, 0U) | \
379  PIN_AFIO_AF(GPIOA_PIN10, 0U) | \
380  PIN_AFIO_AF(GPIOA_USB_DM, 14U) | \
381  PIN_AFIO_AF(GPIOA_USB_DP, 14U) | \
382  PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \
383  PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \
384  PIN_AFIO_AF(GPIOA_PIN15, 0U))
385 
386 /*
387  * GPIOB setup:
388  *
389  * PB0 - PIN0 (input pullup).
390  * PB1 - PIN1 (input pullup).
391  * PB2 - PIN2 (input pullup).
392  * PB3 - SWO (alternate 0).
393  * PB4 - PIN4 (input pullup).
394  * PB5 - PIN5 (input pullup).
395  * PB6 - I2C1_SCL LSM303DLHC_SCL (alternate 4).
396  * PB7 - I2C1_SDA LSM303DLHC_SDA (alternate 4).
397  * PB8 - PIN8 (input pullup).
398  * PB9 - PIN9 (input pullup).
399  * PB10 - PIN10 (input pullup).
400  * PB11 - PIN11 (input pullup).
401  * PB12 - PIN12 (input pullup).
402  * PB13 - PIN13 (input pullup).
403  * PB14 - PIN14 (input pullup).
404  * PB15 - PIN15 (input pullup).
405  */
406 #define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \
407  PIN_MODE_INPUT(GPIOB_PIN1) | \
408  PIN_MODE_INPUT(GPIOB_PIN2) | \
409  PIN_MODE_ALTERNATE(GPIOB_SWO) | \
410  PIN_MODE_INPUT(GPIOB_PIN4) | \
411  PIN_MODE_INPUT(GPIOB_PIN5) | \
412  PIN_MODE_ALTERNATE(GPIOB_I2C1_SCL) | \
413  PIN_MODE_ALTERNATE(GPIOB_I2C1_SDA) | \
414  PIN_MODE_INPUT(GPIOB_PIN8) | \
415  PIN_MODE_INPUT(GPIOB_PIN9) | \
416  PIN_MODE_INPUT(GPIOB_PIN10) | \
417  PIN_MODE_INPUT(GPIOB_PIN11) | \
418  PIN_MODE_INPUT(GPIOB_PIN12) | \
419  PIN_MODE_INPUT(GPIOB_PIN13) | \
420  PIN_MODE_INPUT(GPIOB_PIN14) | \
421  PIN_MODE_INPUT(GPIOB_PIN15))
422 #define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \
423  PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \
424  PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \
425  PIN_OTYPE_PUSHPULL(GPIOB_SWO) | \
426  PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \
427  PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \
428  PIN_OTYPE_OPENDRAIN(GPIOB_I2C1_SCL) | \
429  PIN_OTYPE_OPENDRAIN(GPIOB_I2C1_SDA) | \
430  PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \
431  PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \
432  PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \
433  PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \
434  PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \
435  PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \
436  PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \
437  PIN_OTYPE_PUSHPULL(GPIOB_PIN15))
438 #define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \
439  PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \
440  PIN_OSPEED_VERYLOW(GPIOB_PIN2) | \
441  PIN_OSPEED_HIGH(GPIOB_SWO) | \
442  PIN_OSPEED_VERYLOW(GPIOB_PIN4) | \
443  PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \
444  PIN_OSPEED_HIGH(GPIOB_I2C1_SCL) | \
445  PIN_OSPEED_HIGH(GPIOB_I2C1_SDA) | \
446  PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \
447  PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \
448  PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \
449  PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \
450  PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \
451  PIN_OSPEED_VERYLOW(GPIOB_PIN13) | \
452  PIN_OSPEED_VERYLOW(GPIOB_PIN14) | \
453  PIN_OSPEED_VERYLOW(GPIOB_PIN15))
454 #define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \
455  PIN_PUPDR_PULLUP(GPIOB_PIN1) | \
456  PIN_PUPDR_PULLUP(GPIOB_PIN2) | \
457  PIN_PUPDR_FLOATING(GPIOB_SWO) | \
458  PIN_PUPDR_PULLUP(GPIOB_PIN4) | \
459  PIN_PUPDR_PULLUP(GPIOB_PIN5) | \
460  PIN_PUPDR_FLOATING(GPIOB_I2C1_SCL) | \
461  PIN_PUPDR_FLOATING(GPIOB_I2C1_SDA) | \
462  PIN_PUPDR_PULLUP(GPIOB_PIN8) | \
463  PIN_PUPDR_PULLUP(GPIOB_PIN9) | \
464  PIN_PUPDR_PULLUP(GPIOB_PIN10) | \
465  PIN_PUPDR_PULLUP(GPIOB_PIN11) | \
466  PIN_PUPDR_PULLUP(GPIOB_PIN12) | \
467  PIN_PUPDR_PULLUP(GPIOB_PIN13) | \
468  PIN_PUPDR_PULLUP(GPIOB_PIN14) | \
469  PIN_PUPDR_PULLUP(GPIOB_PIN15))
470 #define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \
471  PIN_ODR_HIGH(GPIOB_PIN1) | \
472  PIN_ODR_HIGH(GPIOB_PIN2) | \
473  PIN_ODR_HIGH(GPIOB_SWO) | \
474  PIN_ODR_HIGH(GPIOB_PIN4) | \
475  PIN_ODR_HIGH(GPIOB_PIN5) | \
476  PIN_ODR_HIGH(GPIOB_I2C1_SCL) | \
477  PIN_ODR_HIGH(GPIOB_I2C1_SDA) | \
478  PIN_ODR_HIGH(GPIOB_PIN8) | \
479  PIN_ODR_HIGH(GPIOB_PIN9) | \
480  PIN_ODR_HIGH(GPIOB_PIN10) | \
481  PIN_ODR_HIGH(GPIOB_PIN11) | \
482  PIN_ODR_HIGH(GPIOB_PIN12) | \
483  PIN_ODR_HIGH(GPIOB_PIN13) | \
484  PIN_ODR_HIGH(GPIOB_PIN14) | \
485  PIN_ODR_HIGH(GPIOB_PIN15))
486 #define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0U) | \
487  PIN_AFIO_AF(GPIOB_PIN1, 0U) | \
488  PIN_AFIO_AF(GPIOB_PIN2, 0U) | \
489  PIN_AFIO_AF(GPIOB_SWO, 0U) | \
490  PIN_AFIO_AF(GPIOB_PIN4, 0U) | \
491  PIN_AFIO_AF(GPIOB_PIN5, 0U) | \
492  PIN_AFIO_AF(GPIOB_I2C1_SCL, 4U) | \
493  PIN_AFIO_AF(GPIOB_I2C1_SDA, 4U))
494 #define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \
495  PIN_AFIO_AF(GPIOB_PIN9, 0U) | \
496  PIN_AFIO_AF(GPIOB_PIN10, 0U) | \
497  PIN_AFIO_AF(GPIOB_PIN11, 0U) | \
498  PIN_AFIO_AF(GPIOB_PIN12, 0U) | \
499  PIN_AFIO_AF(GPIOB_PIN13, 0U) | \
500  PIN_AFIO_AF(GPIOB_PIN14, 0U) | \
501  PIN_AFIO_AF(GPIOB_PIN15, 0U))
502 
503 /*
504  * GPIOC setup:
505  *
506  * PC0 - PIN0 (input pullup).
507  * PC1 - PIN1 (input pullup).
508  * PC2 - PIN2 (input pullup).
509  * PC3 - PIN3 (input pullup).
510  * PC4 - PIN4 (input pullup).
511  * PC5 - PIN5 (input pullup).
512  * PC6 - PIN6 (input pullup).
513  * PC7 - PIN7 (input pullup).
514  * PC8 - PIN8 (input pullup).
515  * PC9 - PIN9 (input pullup).
516  * PC10 - PIN10 (input pullup).
517  * PC11 - PIN11 (input pullup).
518  * PC12 - PIN12 (input pullup).
519  * PC13 - PIN13 (input pullup).
520  * PC14 - OSC32_IN (input floating).
521  * PC15 - OSC32_OUT (input floating).
522  */
523 #define VAL_GPIOC_MODER (PIN_MODE_INPUT(GPIOC_PIN0) | \
524  PIN_MODE_INPUT(GPIOC_PIN1) | \
525  PIN_MODE_INPUT(GPIOC_PIN2) | \
526  PIN_MODE_INPUT(GPIOC_PIN3) | \
527  PIN_MODE_INPUT(GPIOC_PIN4) | \
528  PIN_MODE_INPUT(GPIOC_PIN5) | \
529  PIN_MODE_INPUT(GPIOC_PIN6) | \
530  PIN_MODE_INPUT(GPIOC_PIN7) | \
531  PIN_MODE_INPUT(GPIOC_PIN8) | \
532  PIN_MODE_INPUT(GPIOC_PIN9) | \
533  PIN_MODE_INPUT(GPIOC_PIN10) | \
534  PIN_MODE_INPUT(GPIOC_PIN11) | \
535  PIN_MODE_INPUT(GPIOC_PIN12) | \
536  PIN_MODE_INPUT(GPIOC_PIN13) | \
537  PIN_MODE_INPUT(GPIOC_OSC32_IN) | \
538  PIN_MODE_INPUT(GPIOC_OSC32_OUT))
539 #define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_PIN0) | \
540  PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \
541  PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \
542  PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \
543  PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \
544  PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \
545  PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | \
546  PIN_OTYPE_PUSHPULL(GPIOC_PIN7) | \
547  PIN_OTYPE_PUSHPULL(GPIOC_PIN8) | \
548  PIN_OTYPE_PUSHPULL(GPIOC_PIN9) | \
549  PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \
550  PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \
551  PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \
552  PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \
553  PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \
554  PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT))
555 #define VAL_GPIOC_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOC_PIN0) | \
556  PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \
557  PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \
558  PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \
559  PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \
560  PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \
561  PIN_OSPEED_VERYLOW(GPIOC_PIN6) | \
562  PIN_OSPEED_VERYLOW(GPIOC_PIN7) | \
563  PIN_OSPEED_VERYLOW(GPIOC_PIN8) | \
564  PIN_OSPEED_VERYLOW(GPIOC_PIN9) | \
565  PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \
566  PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \
567  PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \
568  PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \
569  PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \
570  PIN_OSPEED_HIGH(GPIOC_OSC32_OUT))
571 #define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \
572  PIN_PUPDR_PULLUP(GPIOC_PIN1) | \
573  PIN_PUPDR_PULLUP(GPIOC_PIN2) | \
574  PIN_PUPDR_PULLUP(GPIOC_PIN3) | \
575  PIN_PUPDR_PULLUP(GPIOC_PIN4) | \
576  PIN_PUPDR_PULLUP(GPIOC_PIN5) | \
577  PIN_PUPDR_PULLUP(GPIOC_PIN6) | \
578  PIN_PUPDR_PULLUP(GPIOC_PIN7) | \
579  PIN_PUPDR_PULLUP(GPIOC_PIN8) | \
580  PIN_PUPDR_PULLUP(GPIOC_PIN9) | \
581  PIN_PUPDR_PULLUP(GPIOC_PIN10) | \
582  PIN_PUPDR_PULLUP(GPIOC_PIN11) | \
583  PIN_PUPDR_PULLUP(GPIOC_PIN12) | \
584  PIN_PUPDR_PULLUP(GPIOC_PIN13) | \
585  PIN_PUPDR_FLOATING(GPIOC_OSC32_IN) | \
586  PIN_PUPDR_FLOATING(GPIOC_OSC32_OUT))
587 #define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_PIN0) | \
588  PIN_ODR_HIGH(GPIOC_PIN1) | \
589  PIN_ODR_HIGH(GPIOC_PIN2) | \
590  PIN_ODR_HIGH(GPIOC_PIN3) | \
591  PIN_ODR_HIGH(GPIOC_PIN4) | \
592  PIN_ODR_HIGH(GPIOC_PIN5) | \
593  PIN_ODR_HIGH(GPIOC_PIN6) | \
594  PIN_ODR_HIGH(GPIOC_PIN7) | \
595  PIN_ODR_HIGH(GPIOC_PIN8) | \
596  PIN_ODR_HIGH(GPIOC_PIN9) | \
597  PIN_ODR_HIGH(GPIOC_PIN10) | \
598  PIN_ODR_HIGH(GPIOC_PIN11) | \
599  PIN_ODR_HIGH(GPIOC_PIN12) | \
600  PIN_ODR_HIGH(GPIOC_PIN13) | \
601  PIN_ODR_HIGH(GPIOC_OSC32_IN) | \
602  PIN_ODR_HIGH(GPIOC_OSC32_OUT))
603 #define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_PIN0, 0U) | \
604  PIN_AFIO_AF(GPIOC_PIN1, 0U) | \
605  PIN_AFIO_AF(GPIOC_PIN2, 0U) | \
606  PIN_AFIO_AF(GPIOC_PIN3, 0U) | \
607  PIN_AFIO_AF(GPIOC_PIN4, 0U) | \
608  PIN_AFIO_AF(GPIOC_PIN5, 0U) | \
609  PIN_AFIO_AF(GPIOC_PIN6, 0U) | \
610  PIN_AFIO_AF(GPIOC_PIN7, 0U))
611 #define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_PIN8, 0U) | \
612  PIN_AFIO_AF(GPIOC_PIN9, 0U) | \
613  PIN_AFIO_AF(GPIOC_PIN10, 0U) | \
614  PIN_AFIO_AF(GPIOC_PIN11, 0U) | \
615  PIN_AFIO_AF(GPIOC_PIN12, 0U) | \
616  PIN_AFIO_AF(GPIOC_PIN13, 0U) | \
617  PIN_AFIO_AF(GPIOC_OSC32_IN, 0U) | \
618  PIN_AFIO_AF(GPIOC_OSC32_OUT, 0U))
619 
620 /*
621  * GPIOD setup:
622  *
623  * PD0 - PIN0 (input pullup).
624  * PD1 - PIN1 (input pullup).
625  * PD2 - PIN2 (input pullup).
626  * PD3 - PIN3 (input pullup).
627  * PD4 - PIN4 (input pullup).
628  * PD5 - PIN5 (input pullup).
629  * PD6 - PIN6 (input pullup).
630  * PD7 - PIN7 (input pullup).
631  * PD8 - PIN8 (input pullup).
632  * PD9 - PIN9 (input pullup).
633  * PD10 - PIN10 (input pullup).
634  * PD11 - PIN11 (input pullup).
635  * PD12 - PIN12 (input pullup).
636  * PD13 - PIN13 (input pullup).
637  * PD14 - PIN14 (input pullup).
638  * PD15 - PIN15 (input pullup).
639  */
640 #define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \
641  PIN_MODE_INPUT(GPIOD_PIN1) | \
642  PIN_MODE_INPUT(GPIOD_PIN2) | \
643  PIN_MODE_INPUT(GPIOD_PIN3) | \
644  PIN_MODE_INPUT(GPIOD_PIN4) | \
645  PIN_MODE_INPUT(GPIOD_PIN5) | \
646  PIN_MODE_INPUT(GPIOD_PIN6) | \
647  PIN_MODE_INPUT(GPIOD_PIN7) | \
648  PIN_MODE_INPUT(GPIOD_PIN8) | \
649  PIN_MODE_INPUT(GPIOD_PIN9) | \
650  PIN_MODE_INPUT(GPIOD_PIN10) | \
651  PIN_MODE_INPUT(GPIOD_PIN11) | \
652  PIN_MODE_INPUT(GPIOD_PIN12) | \
653  PIN_MODE_INPUT(GPIOD_PIN13) | \
654  PIN_MODE_INPUT(GPIOD_PIN14) | \
655  PIN_MODE_INPUT(GPIOD_PIN15))
656 #define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \
657  PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \
658  PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \
659  PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \
660  PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \
661  PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \
662  PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \
663  PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \
664  PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \
665  PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \
666  PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \
667  PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \
668  PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \
669  PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \
670  PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \
671  PIN_OTYPE_PUSHPULL(GPIOD_PIN15))
672 #define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \
673  PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \
674  PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \
675  PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \
676  PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \
677  PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \
678  PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \
679  PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \
680  PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \
681  PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \
682  PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \
683  PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \
684  PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \
685  PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \
686  PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \
687  PIN_OSPEED_VERYLOW(GPIOD_PIN15))
688 #define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \
689  PIN_PUPDR_PULLUP(GPIOD_PIN1) | \
690  PIN_PUPDR_PULLUP(GPIOD_PIN2) | \
691  PIN_PUPDR_PULLUP(GPIOD_PIN3) | \
692  PIN_PUPDR_PULLUP(GPIOD_PIN4) | \
693  PIN_PUPDR_PULLUP(GPIOD_PIN5) | \
694  PIN_PUPDR_PULLUP(GPIOD_PIN6) | \
695  PIN_PUPDR_PULLUP(GPIOD_PIN7) | \
696  PIN_PUPDR_PULLUP(GPIOD_PIN8) | \
697  PIN_PUPDR_PULLUP(GPIOD_PIN9) | \
698  PIN_PUPDR_PULLUP(GPIOD_PIN10) | \
699  PIN_PUPDR_PULLUP(GPIOD_PIN11) | \
700  PIN_PUPDR_PULLUP(GPIOD_PIN12) | \
701  PIN_PUPDR_PULLUP(GPIOD_PIN13) | \
702  PIN_PUPDR_PULLUP(GPIOD_PIN14) | \
703  PIN_PUPDR_PULLUP(GPIOD_PIN15))
704 #define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \
705  PIN_ODR_HIGH(GPIOD_PIN1) | \
706  PIN_ODR_HIGH(GPIOD_PIN2) | \
707  PIN_ODR_HIGH(GPIOD_PIN3) | \
708  PIN_ODR_HIGH(GPIOD_PIN4) | \
709  PIN_ODR_HIGH(GPIOD_PIN5) | \
710  PIN_ODR_HIGH(GPIOD_PIN6) | \
711  PIN_ODR_HIGH(GPIOD_PIN7) | \
712  PIN_ODR_HIGH(GPIOD_PIN8) | \
713  PIN_ODR_HIGH(GPIOD_PIN9) | \
714  PIN_ODR_HIGH(GPIOD_PIN10) | \
715  PIN_ODR_HIGH(GPIOD_PIN11) | \
716  PIN_ODR_HIGH(GPIOD_PIN12) | \
717  PIN_ODR_HIGH(GPIOD_PIN13) | \
718  PIN_ODR_HIGH(GPIOD_PIN14) | \
719  PIN_ODR_HIGH(GPIOD_PIN15))
720 #define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \
721  PIN_AFIO_AF(GPIOD_PIN1, 0U) | \
722  PIN_AFIO_AF(GPIOD_PIN2, 0U) | \
723  PIN_AFIO_AF(GPIOD_PIN3, 0U) | \
724  PIN_AFIO_AF(GPIOD_PIN4, 0U) | \
725  PIN_AFIO_AF(GPIOD_PIN5, 0U) | \
726  PIN_AFIO_AF(GPIOD_PIN6, 0U) | \
727  PIN_AFIO_AF(GPIOD_PIN7, 0U))
728 #define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \
729  PIN_AFIO_AF(GPIOD_PIN9, 0U) | \
730  PIN_AFIO_AF(GPIOD_PIN10, 0U) | \
731  PIN_AFIO_AF(GPIOD_PIN11, 0U) | \
732  PIN_AFIO_AF(GPIOD_PIN12, 0U) | \
733  PIN_AFIO_AF(GPIOD_PIN13, 0U) | \
734  PIN_AFIO_AF(GPIOD_PIN14, 0U) | \
735  PIN_AFIO_AF(GPIOD_PIN15, 0U))
736 
737 /*
738  * GPIOE setup:
739  *
740  * PE0 - L3GD20_INT1 (input pullup).
741  * PE1 - L3GD20_INT2 (input pullup).
742  * PE2 - LSM303DLHC_DRDY (input pullup).
743  * PE3 - SPI1_CS L3GD20_CS (output pushpull maximum).
744  * PE4 - LSM303DLHC_INT1 (input pullup).
745  * PE5 - LSM303DLHC_INT2 (input pullup).
746  * PE6 - PIN6 (input pullup).
747  * PE7 - PIN7 (input pullup).
748  * PE8 - LED4_BLUE (output pushpull maximum).
749  * PE9 - LED3_RED (output pushpull maximum).
750  * PE10 - LED5_ORANGE (output pushpull maximum).
751  * PE11 - LED7_GREEN (output pushpull maximum).
752  * PE12 - LED9_BLUE (output pushpull maximum).
753  * PE13 - LED10_RED (output pushpull maximum).
754  * PE14 - LED8_ORANGE (output pushpull maximum).
755  * PE15 - LED6_GREEN (output pushpull maximum).
756  */
757 #define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_L3GD20_INT1) | \
758  PIN_MODE_INPUT(GPIOE_L3GD20_INT2) | \
759  PIN_MODE_INPUT(GPIOE_LSM303DLHC_DRDY) |\
760  PIN_MODE_OUTPUT(GPIOE_SPI1_CS) | \
761  PIN_MODE_INPUT(GPIOE_LSM303DLHC_INT1) |\
762  PIN_MODE_INPUT(GPIOE_LSM303DLHC_INT2) |\
763  PIN_MODE_INPUT(GPIOE_PIN6) | \
764  PIN_MODE_INPUT(GPIOE_PIN7) | \
765  PIN_MODE_OUTPUT(GPIOE_LED4_BLUE) | \
766  PIN_MODE_OUTPUT(GPIOE_LED3_RED) | \
767  PIN_MODE_OUTPUT(GPIOE_LED5_ORANGE) | \
768  PIN_MODE_OUTPUT(GPIOE_LED7_GREEN) | \
769  PIN_MODE_OUTPUT(GPIOE_LED9_BLUE) | \
770  PIN_MODE_OUTPUT(GPIOE_LED10_RED) | \
771  PIN_MODE_OUTPUT(GPIOE_LED8_ORANGE) | \
772  PIN_MODE_OUTPUT(GPIOE_LED6_GREEN))
773 #define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_L3GD20_INT1) |\
774  PIN_OTYPE_PUSHPULL(GPIOE_L3GD20_INT2) |\
775  PIN_OTYPE_PUSHPULL(GPIOE_LSM303DLHC_DRDY) |\
776  PIN_OTYPE_PUSHPULL(GPIOE_SPI1_CS) | \
777  PIN_OTYPE_PUSHPULL(GPIOE_LSM303DLHC_INT1) |\
778  PIN_OTYPE_PUSHPULL(GPIOE_LSM303DLHC_INT2) |\
779  PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \
780  PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \
781  PIN_OTYPE_PUSHPULL(GPIOE_LED4_BLUE) | \
782  PIN_OTYPE_PUSHPULL(GPIOE_LED3_RED) | \
783  PIN_OTYPE_PUSHPULL(GPIOE_LED5_ORANGE) |\
784  PIN_OTYPE_PUSHPULL(GPIOE_LED7_GREEN) | \
785  PIN_OTYPE_PUSHPULL(GPIOE_LED9_BLUE) | \
786  PIN_OTYPE_PUSHPULL(GPIOE_LED10_RED) | \
787  PIN_OTYPE_PUSHPULL(GPIOE_LED8_ORANGE) |\
788  PIN_OTYPE_PUSHPULL(GPIOE_LED6_GREEN))
789 #define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_L3GD20_INT1) |\
790  PIN_OSPEED_VERYLOW(GPIOE_L3GD20_INT2) |\
791  PIN_OSPEED_VERYLOW(GPIOE_LSM303DLHC_DRDY) |\
792  PIN_OSPEED_HIGH(GPIOE_SPI1_CS) | \
793  PIN_OSPEED_VERYLOW(GPIOE_LSM303DLHC_INT1) |\
794  PIN_OSPEED_VERYLOW(GPIOE_LSM303DLHC_INT2) |\
795  PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \
796  PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \
797  PIN_OSPEED_HIGH(GPIOE_LED4_BLUE) | \
798  PIN_OSPEED_HIGH(GPIOE_LED3_RED) | \
799  PIN_OSPEED_HIGH(GPIOE_LED5_ORANGE) | \
800  PIN_OSPEED_HIGH(GPIOE_LED7_GREEN) | \
801  PIN_OSPEED_HIGH(GPIOE_LED9_BLUE) | \
802  PIN_OSPEED_HIGH(GPIOE_LED10_RED) | \
803  PIN_OSPEED_HIGH(GPIOE_LED8_ORANGE) | \
804  PIN_OSPEED_HIGH(GPIOE_LED6_GREEN))
805 #define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_L3GD20_INT1) | \
806  PIN_PUPDR_PULLUP(GPIOE_L3GD20_INT2) | \
807  PIN_PUPDR_PULLUP(GPIOE_LSM303DLHC_DRDY) |\
808  PIN_PUPDR_FLOATING(GPIOE_SPI1_CS) | \
809  PIN_PUPDR_PULLUP(GPIOE_LSM303DLHC_INT1) |\
810  PIN_PUPDR_PULLUP(GPIOE_LSM303DLHC_INT2) |\
811  PIN_PUPDR_PULLUP(GPIOE_PIN6) | \
812  PIN_PUPDR_PULLUP(GPIOE_PIN7) | \
813  PIN_PUPDR_PULLUP(GPIOE_LED4_BLUE) | \
814  PIN_PUPDR_PULLUP(GPIOE_LED3_RED) | \
815  PIN_PUPDR_PULLUP(GPIOE_LED5_ORANGE) | \
816  PIN_PUPDR_FLOATING(GPIOE_LED7_GREEN) | \
817  PIN_PUPDR_PULLUP(GPIOE_LED9_BLUE) | \
818  PIN_PUPDR_FLOATING(GPIOE_LED10_RED) | \
819  PIN_PUPDR_FLOATING(GPIOE_LED8_ORANGE) |\
820  PIN_PUPDR_FLOATING(GPIOE_LED6_GREEN))
821 #define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_L3GD20_INT1) | \
822  PIN_ODR_HIGH(GPIOE_L3GD20_INT2) | \
823  PIN_ODR_HIGH(GPIOE_LSM303DLHC_DRDY) | \
824  PIN_ODR_HIGH(GPIOE_SPI1_CS) | \
825  PIN_ODR_HIGH(GPIOE_LSM303DLHC_INT1) | \
826  PIN_ODR_HIGH(GPIOE_LSM303DLHC_INT2) | \
827  PIN_ODR_HIGH(GPIOE_PIN6) | \
828  PIN_ODR_HIGH(GPIOE_PIN7) | \
829  PIN_ODR_LOW(GPIOE_LED4_BLUE) | \
830  PIN_ODR_LOW(GPIOE_LED3_RED) | \
831  PIN_ODR_LOW(GPIOE_LED5_ORANGE) | \
832  PIN_ODR_LOW(GPIOE_LED7_GREEN) | \
833  PIN_ODR_LOW(GPIOE_LED9_BLUE) | \
834  PIN_ODR_LOW(GPIOE_LED10_RED) | \
835  PIN_ODR_LOW(GPIOE_LED8_ORANGE) | \
836  PIN_ODR_LOW(GPIOE_LED6_GREEN))
837 #define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_L3GD20_INT1, 0U) | \
838  PIN_AFIO_AF(GPIOE_L3GD20_INT2, 0U) | \
839  PIN_AFIO_AF(GPIOE_LSM303DLHC_DRDY, 0U) |\
840  PIN_AFIO_AF(GPIOE_SPI1_CS, 0U) | \
841  PIN_AFIO_AF(GPIOE_LSM303DLHC_INT1, 0U) |\
842  PIN_AFIO_AF(GPIOE_LSM303DLHC_INT2, 0U) |\
843  PIN_AFIO_AF(GPIOE_PIN6, 0U) | \
844  PIN_AFIO_AF(GPIOE_PIN7, 0U))
845 #define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_LED4_BLUE, 0U) | \
846  PIN_AFIO_AF(GPIOE_LED3_RED, 0U) | \
847  PIN_AFIO_AF(GPIOE_LED5_ORANGE, 0U) | \
848  PIN_AFIO_AF(GPIOE_LED7_GREEN, 0U) | \
849  PIN_AFIO_AF(GPIOE_LED9_BLUE, 0U) | \
850  PIN_AFIO_AF(GPIOE_LED10_RED, 0U) | \
851  PIN_AFIO_AF(GPIOE_LED8_ORANGE, 0U) | \
852  PIN_AFIO_AF(GPIOE_LED6_GREEN, 0U))
853 
854 /*
855  * GPIOF setup:
856  *
857  * PF0 - OSC_IN (input floating).
858  * PF1 - OSC_OUT (input floating).
859  * PF2 - PIN2 (input pullup).
860  * PF3 - PIN3 (input pullup).
861  * PF4 - PIN4 (input pullup).
862  * PF5 - PIN5 (input pullup).
863  * PF6 - PIN6 (input pullup).
864  * PF7 - PIN7 (input pullup).
865  * PF8 - PIN8 (input pullup).
866  * PF9 - PIN9 (input pullup).
867  * PF10 - PIN10 (input pullup).
868  * PF11 - PIN11 (input pullup).
869  * PF12 - PIN12 (input pullup).
870  * PF13 - PIN13 (input pullup).
871  * PF14 - PIN14 (input pullup).
872  * PF15 - PIN15 (input pullup).
873  */
874 #define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_OSC_IN) | \
875  PIN_MODE_INPUT(GPIOF_OSC_OUT) | \
876  PIN_MODE_INPUT(GPIOF_PIN2) | \
877  PIN_MODE_INPUT(GPIOF_PIN3) | \
878  PIN_MODE_INPUT(GPIOF_PIN4) | \
879  PIN_MODE_INPUT(GPIOF_PIN5) | \
880  PIN_MODE_INPUT(GPIOF_PIN6) | \
881  PIN_MODE_INPUT(GPIOF_PIN7) | \
882  PIN_MODE_INPUT(GPIOF_PIN8) | \
883  PIN_MODE_INPUT(GPIOF_PIN9) | \
884  PIN_MODE_INPUT(GPIOF_PIN10) | \
885  PIN_MODE_INPUT(GPIOF_PIN11) | \
886  PIN_MODE_INPUT(GPIOF_PIN12) | \
887  PIN_MODE_INPUT(GPIOF_PIN13) | \
888  PIN_MODE_INPUT(GPIOF_PIN14) | \
889  PIN_MODE_INPUT(GPIOF_PIN15))
890 #define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_OSC_IN) | \
891  PIN_OTYPE_PUSHPULL(GPIOF_OSC_OUT) | \
892  PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \
893  PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \
894  PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \
895  PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \
896  PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \
897  PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \
898  PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \
899  PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \
900  PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \
901  PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \
902  PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \
903  PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \
904  PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \
905  PIN_OTYPE_PUSHPULL(GPIOF_PIN15))
906 #define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_OSC_IN) | \
907  PIN_OSPEED_HIGH(GPIOF_OSC_OUT) | \
908  PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \
909  PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \
910  PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \
911  PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \
912  PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \
913  PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \
914  PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \
915  PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \
916  PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \
917  PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \
918  PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \
919  PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \
920  PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \
921  PIN_OSPEED_VERYLOW(GPIOF_PIN15))
922 #define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_OSC_IN) | \
923  PIN_PUPDR_FLOATING(GPIOF_OSC_OUT) | \
924  PIN_PUPDR_PULLUP(GPIOF_PIN2) | \
925  PIN_PUPDR_PULLUP(GPIOF_PIN3) | \
926  PIN_PUPDR_PULLUP(GPIOF_PIN4) | \
927  PIN_PUPDR_PULLUP(GPIOF_PIN5) | \
928  PIN_PUPDR_PULLUP(GPIOF_PIN6) | \
929  PIN_PUPDR_PULLUP(GPIOF_PIN7) | \
930  PIN_PUPDR_PULLUP(GPIOF_PIN8) | \
931  PIN_PUPDR_PULLUP(GPIOF_PIN9) | \
932  PIN_PUPDR_PULLUP(GPIOF_PIN10) | \
933  PIN_PUPDR_PULLUP(GPIOF_PIN11) | \
934  PIN_PUPDR_PULLUP(GPIOF_PIN12) | \
935  PIN_PUPDR_PULLUP(GPIOF_PIN13) | \
936  PIN_PUPDR_PULLUP(GPIOF_PIN14) | \
937  PIN_PUPDR_PULLUP(GPIOF_PIN15))
938 #define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_OSC_IN) | \
939  PIN_ODR_HIGH(GPIOF_OSC_OUT) | \
940  PIN_ODR_HIGH(GPIOF_PIN2) | \
941  PIN_ODR_HIGH(GPIOF_PIN3) | \
942  PIN_ODR_HIGH(GPIOF_PIN4) | \
943  PIN_ODR_HIGH(GPIOF_PIN5) | \
944  PIN_ODR_HIGH(GPIOF_PIN6) | \
945  PIN_ODR_HIGH(GPIOF_PIN7) | \
946  PIN_ODR_HIGH(GPIOF_PIN8) | \
947  PIN_ODR_HIGH(GPIOF_PIN9) | \
948  PIN_ODR_HIGH(GPIOF_PIN10) | \
949  PIN_ODR_HIGH(GPIOF_PIN11) | \
950  PIN_ODR_HIGH(GPIOF_PIN12) | \
951  PIN_ODR_HIGH(GPIOF_PIN13) | \
952  PIN_ODR_HIGH(GPIOF_PIN14) | \
953  PIN_ODR_HIGH(GPIOF_PIN15))
954 #define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_OSC_IN, 0U) | \
955  PIN_AFIO_AF(GPIOF_OSC_OUT, 0U) | \
956  PIN_AFIO_AF(GPIOF_PIN2, 0U) | \
957  PIN_AFIO_AF(GPIOF_PIN3, 0U) | \
958  PIN_AFIO_AF(GPIOF_PIN4, 0U) | \
959  PIN_AFIO_AF(GPIOF_PIN5, 0U) | \
960  PIN_AFIO_AF(GPIOF_PIN6, 0U) | \
961  PIN_AFIO_AF(GPIOF_PIN7, 0U))
962 #define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \
963  PIN_AFIO_AF(GPIOF_PIN9, 0U) | \
964  PIN_AFIO_AF(GPIOF_PIN10, 0U) | \
965  PIN_AFIO_AF(GPIOF_PIN11, 0U) | \
966  PIN_AFIO_AF(GPIOF_PIN12, 0U) | \
967  PIN_AFIO_AF(GPIOF_PIN13, 0U) | \
968  PIN_AFIO_AF(GPIOF_PIN14, 0U) | \
969  PIN_AFIO_AF(GPIOF_PIN15, 0U))
970 
971 /*
972  * GPIOG setup:
973  *
974  * PG0 - PIN0 (input pullup).
975  * PG1 - PIN1 (input pullup).
976  * PG2 - PIN2 (input pullup).
977  * PG3 - PIN3 (input pullup).
978  * PG4 - PIN4 (input pullup).
979  * PG5 - PIN5 (input pullup).
980  * PG6 - PIN6 (input pullup).
981  * PG7 - PIN7 (input pullup).
982  * PG8 - PIN8 (input pullup).
983  * PG9 - PIN9 (input pullup).
984  * PG10 - PIN10 (input pullup).
985  * PG11 - PIN11 (input pullup).
986  * PG12 - PIN12 (input pullup).
987  * PG13 - PIN13 (input pullup).
988  * PG14 - PIN14 (input pullup).
989  * PG15 - PIN15 (input pullup).
990  */
991 #define VAL_GPIOG_MODER (PIN_MODE_INPUT(GPIOG_PIN0) | \
992  PIN_MODE_INPUT(GPIOG_PIN1) | \
993  PIN_MODE_INPUT(GPIOG_PIN2) | \
994  PIN_MODE_INPUT(GPIOG_PIN3) | \
995  PIN_MODE_INPUT(GPIOG_PIN4) | \
996  PIN_MODE_INPUT(GPIOG_PIN5) | \
997  PIN_MODE_INPUT(GPIOG_PIN6) | \
998  PIN_MODE_INPUT(GPIOG_PIN7) | \
999  PIN_MODE_INPUT(GPIOG_PIN8) | \
1000  PIN_MODE_INPUT(GPIOG_PIN9) | \
1001  PIN_MODE_INPUT(GPIOG_PIN10) | \
1002  PIN_MODE_INPUT(GPIOG_PIN11) | \
1003  PIN_MODE_INPUT(GPIOG_PIN12) | \
1004  PIN_MODE_INPUT(GPIOG_PIN13) | \
1005  PIN_MODE_INPUT(GPIOG_PIN14) | \
1006  PIN_MODE_INPUT(GPIOG_PIN15))
1007 #define VAL_GPIOG_OTYPER (PIN_OTYPE_PUSHPULL(GPIOG_PIN0) | \
1008  PIN_OTYPE_PUSHPULL(GPIOG_PIN1) | \
1009  PIN_OTYPE_PUSHPULL(GPIOG_PIN2) | \
1010  PIN_OTYPE_PUSHPULL(GPIOG_PIN3) | \
1011  PIN_OTYPE_PUSHPULL(GPIOG_PIN4) | \
1012  PIN_OTYPE_PUSHPULL(GPIOG_PIN5) | \
1013  PIN_OTYPE_PUSHPULL(GPIOG_PIN6) | \
1014  PIN_OTYPE_PUSHPULL(GPIOG_PIN7) | \
1015  PIN_OTYPE_PUSHPULL(GPIOG_PIN8) | \
1016  PIN_OTYPE_PUSHPULL(GPIOG_PIN9) | \
1017  PIN_OTYPE_PUSHPULL(GPIOG_PIN10) | \
1018  PIN_OTYPE_PUSHPULL(GPIOG_PIN11) | \
1019  PIN_OTYPE_PUSHPULL(GPIOG_PIN12) | \
1020  PIN_OTYPE_PUSHPULL(GPIOG_PIN13) | \
1021  PIN_OTYPE_PUSHPULL(GPIOG_PIN14) | \
1022  PIN_OTYPE_PUSHPULL(GPIOG_PIN15))
1023 #define VAL_GPIOG_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOG_PIN0) | \
1024  PIN_OSPEED_VERYLOW(GPIOG_PIN1) | \
1025  PIN_OSPEED_VERYLOW(GPIOG_PIN2) | \
1026  PIN_OSPEED_VERYLOW(GPIOG_PIN3) | \
1027  PIN_OSPEED_VERYLOW(GPIOG_PIN4) | \
1028  PIN_OSPEED_VERYLOW(GPIOG_PIN5) | \
1029  PIN_OSPEED_VERYLOW(GPIOG_PIN6) | \
1030  PIN_OSPEED_VERYLOW(GPIOG_PIN7) | \
1031  PIN_OSPEED_VERYLOW(GPIOG_PIN8) | \
1032  PIN_OSPEED_VERYLOW(GPIOG_PIN9) | \
1033  PIN_OSPEED_VERYLOW(GPIOG_PIN10) | \
1034  PIN_OSPEED_VERYLOW(GPIOG_PIN11) | \
1035  PIN_OSPEED_VERYLOW(GPIOG_PIN12) | \
1036  PIN_OSPEED_VERYLOW(GPIOG_PIN13) | \
1037  PIN_OSPEED_VERYLOW(GPIOG_PIN14) | \
1038  PIN_OSPEED_VERYLOW(GPIOG_PIN15))
1039 #define VAL_GPIOG_PUPDR (PIN_PUPDR_PULLUP(GPIOG_PIN0) | \
1040  PIN_PUPDR_PULLUP(GPIOG_PIN1) | \
1041  PIN_PUPDR_PULLUP(GPIOG_PIN2) | \
1042  PIN_PUPDR_PULLUP(GPIOG_PIN3) | \
1043  PIN_PUPDR_PULLUP(GPIOG_PIN4) | \
1044  PIN_PUPDR_PULLUP(GPIOG_PIN5) | \
1045  PIN_PUPDR_PULLUP(GPIOG_PIN6) | \
1046  PIN_PUPDR_PULLUP(GPIOG_PIN7) | \
1047  PIN_PUPDR_PULLUP(GPIOG_PIN8) | \
1048  PIN_PUPDR_PULLUP(GPIOG_PIN9) | \
1049  PIN_PUPDR_PULLUP(GPIOG_PIN10) | \
1050  PIN_PUPDR_PULLUP(GPIOG_PIN11) | \
1051  PIN_PUPDR_PULLUP(GPIOG_PIN12) | \
1052  PIN_PUPDR_PULLUP(GPIOG_PIN13) | \
1053  PIN_PUPDR_PULLUP(GPIOG_PIN14) | \
1054  PIN_PUPDR_PULLUP(GPIOG_PIN15))
1055 #define VAL_GPIOG_ODR (PIN_ODR_HIGH(GPIOG_PIN0) | \
1056  PIN_ODR_HIGH(GPIOG_PIN1) | \
1057  PIN_ODR_HIGH(GPIOG_PIN2) | \
1058  PIN_ODR_HIGH(GPIOG_PIN3) | \
1059  PIN_ODR_HIGH(GPIOG_PIN4) | \
1060  PIN_ODR_HIGH(GPIOG_PIN5) | \
1061  PIN_ODR_HIGH(GPIOG_PIN6) | \
1062  PIN_ODR_HIGH(GPIOG_PIN7) | \
1063  PIN_ODR_HIGH(GPIOG_PIN8) | \
1064  PIN_ODR_HIGH(GPIOG_PIN9) | \
1065  PIN_ODR_HIGH(GPIOG_PIN10) | \
1066  PIN_ODR_HIGH(GPIOG_PIN11) | \
1067  PIN_ODR_HIGH(GPIOG_PIN12) | \
1068  PIN_ODR_HIGH(GPIOG_PIN13) | \
1069  PIN_ODR_HIGH(GPIOG_PIN14) | \
1070  PIN_ODR_HIGH(GPIOG_PIN15))
1071 #define VAL_GPIOG_AFRL (PIN_AFIO_AF(GPIOG_PIN0, 0U) | \
1072  PIN_AFIO_AF(GPIOG_PIN1, 0U) | \
1073  PIN_AFIO_AF(GPIOG_PIN2, 0U) | \
1074  PIN_AFIO_AF(GPIOG_PIN3, 0U) | \
1075  PIN_AFIO_AF(GPIOG_PIN4, 0U) | \
1076  PIN_AFIO_AF(GPIOG_PIN5, 0U) | \
1077  PIN_AFIO_AF(GPIOG_PIN6, 0U) | \
1078  PIN_AFIO_AF(GPIOG_PIN7, 0U))
1079 #define VAL_GPIOG_AFRH (PIN_AFIO_AF(GPIOG_PIN8, 0U) | \
1080  PIN_AFIO_AF(GPIOG_PIN9, 0U) | \
1081  PIN_AFIO_AF(GPIOG_PIN10, 0U) | \
1082  PIN_AFIO_AF(GPIOG_PIN11, 0U) | \
1083  PIN_AFIO_AF(GPIOG_PIN12, 0U) | \
1084  PIN_AFIO_AF(GPIOG_PIN13, 0U) | \
1085  PIN_AFIO_AF(GPIOG_PIN14, 0U) | \
1086  PIN_AFIO_AF(GPIOG_PIN15, 0U))
1087 
1088 /*
1089  * GPIOH setup:
1090  *
1091  * PH0 - PIN0 (input pullup).
1092  * PH1 - PIN1 (input pullup).
1093  * PH2 - PIN2 (input pullup).
1094  * PH3 - PIN3 (input pullup).
1095  * PH4 - PIN4 (input pullup).
1096  * PH5 - PIN5 (input pullup).
1097  * PH6 - PIN6 (input pullup).
1098  * PH7 - PIN7 (input pullup).
1099  * PH8 - PIN8 (input pullup).
1100  * PH9 - PIN9 (input pullup).
1101  * PH10 - PIN10 (input pullup).
1102  * PH11 - PIN11 (input pullup).
1103  * PH12 - PIN12 (input pullup).
1104  * PH13 - PIN13 (input pullup).
1105  * PH14 - PIN14 (input pullup).
1106  * PH15 - PIN15 (input pullup).
1107  */
1108 #define VAL_GPIOH_MODER (PIN_MODE_INPUT(GPIOH_PIN0) | \
1109  PIN_MODE_INPUT(GPIOH_PIN1) | \
1110  PIN_MODE_INPUT(GPIOH_PIN2) | \
1111  PIN_MODE_INPUT(GPIOH_PIN3) | \
1112  PIN_MODE_INPUT(GPIOH_PIN4) | \
1113  PIN_MODE_INPUT(GPIOH_PIN5) | \
1114  PIN_MODE_INPUT(GPIOH_PIN6) | \
1115  PIN_MODE_INPUT(GPIOH_PIN7) | \
1116  PIN_MODE_INPUT(GPIOH_PIN8) | \
1117  PIN_MODE_INPUT(GPIOH_PIN9) | \
1118  PIN_MODE_INPUT(GPIOH_PIN10) | \
1119  PIN_MODE_INPUT(GPIOH_PIN11) | \
1120  PIN_MODE_INPUT(GPIOH_PIN12) | \
1121  PIN_MODE_INPUT(GPIOH_PIN13) | \
1122  PIN_MODE_INPUT(GPIOH_PIN14) | \
1123  PIN_MODE_INPUT(GPIOH_PIN15))
1124 #define VAL_GPIOH_OTYPER (PIN_OTYPE_PUSHPULL(GPIOH_PIN0) | \
1125  PIN_OTYPE_PUSHPULL(GPIOH_PIN1) | \
1126  PIN_OTYPE_PUSHPULL(GPIOH_PIN2) | \
1127  PIN_OTYPE_PUSHPULL(GPIOH_PIN3) | \
1128  PIN_OTYPE_PUSHPULL(GPIOH_PIN4) | \
1129  PIN_OTYPE_PUSHPULL(GPIOH_PIN5) | \
1130  PIN_OTYPE_PUSHPULL(GPIOH_PIN6) | \
1131  PIN_OTYPE_PUSHPULL(GPIOH_PIN7) | \
1132  PIN_OTYPE_PUSHPULL(GPIOH_PIN8) | \
1133  PIN_OTYPE_PUSHPULL(GPIOH_PIN9) | \
1134  PIN_OTYPE_PUSHPULL(GPIOH_PIN10) | \
1135  PIN_OTYPE_PUSHPULL(GPIOH_PIN11) | \
1136  PIN_OTYPE_PUSHPULL(GPIOH_PIN12) | \
1137  PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \
1138  PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \
1139  PIN_OTYPE_PUSHPULL(GPIOH_PIN15))
1140 #define VAL_GPIOH_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOH_PIN0) | \
1141  PIN_OSPEED_VERYLOW(GPIOH_PIN1) | \
1142  PIN_OSPEED_VERYLOW(GPIOH_PIN2) | \
1143  PIN_OSPEED_VERYLOW(GPIOH_PIN3) | \
1144  PIN_OSPEED_VERYLOW(GPIOH_PIN4) | \
1145  PIN_OSPEED_VERYLOW(GPIOH_PIN5) | \
1146  PIN_OSPEED_VERYLOW(GPIOH_PIN6) | \
1147  PIN_OSPEED_VERYLOW(GPIOH_PIN7) | \
1148  PIN_OSPEED_VERYLOW(GPIOH_PIN8) | \
1149  PIN_OSPEED_VERYLOW(GPIOH_PIN9) | \
1150  PIN_OSPEED_VERYLOW(GPIOH_PIN10) | \
1151  PIN_OSPEED_VERYLOW(GPIOH_PIN11) | \
1152  PIN_OSPEED_VERYLOW(GPIOH_PIN12) | \
1153  PIN_OSPEED_VERYLOW(GPIOH_PIN13) | \
1154  PIN_OSPEED_VERYLOW(GPIOH_PIN14) | \
1155  PIN_OSPEED_VERYLOW(GPIOH_PIN15))
1156 #define VAL_GPIOH_PUPDR (PIN_PUPDR_PULLUP(GPIOH_PIN0) | \
1157  PIN_PUPDR_PULLUP(GPIOH_PIN1) | \
1158  PIN_PUPDR_PULLUP(GPIOH_PIN2) | \
1159  PIN_PUPDR_PULLUP(GPIOH_PIN3) | \
1160  PIN_PUPDR_PULLUP(GPIOH_PIN4) | \
1161  PIN_PUPDR_PULLUP(GPIOH_PIN5) | \
1162  PIN_PUPDR_PULLUP(GPIOH_PIN6) | \
1163  PIN_PUPDR_PULLUP(GPIOH_PIN7) | \
1164  PIN_PUPDR_PULLUP(GPIOH_PIN8) | \
1165  PIN_PUPDR_PULLUP(GPIOH_PIN9) | \
1166  PIN_PUPDR_PULLUP(GPIOH_PIN10) | \
1167  PIN_PUPDR_PULLUP(GPIOH_PIN11) | \
1168  PIN_PUPDR_PULLUP(GPIOH_PIN12) | \
1169  PIN_PUPDR_PULLUP(GPIOH_PIN13) | \
1170  PIN_PUPDR_PULLUP(GPIOH_PIN14) | \
1171  PIN_PUPDR_PULLUP(GPIOH_PIN15))
1172 #define VAL_GPIOH_ODR (PIN_ODR_HIGH(GPIOH_PIN0) | \
1173  PIN_ODR_HIGH(GPIOH_PIN1) | \
1174  PIN_ODR_HIGH(GPIOH_PIN2) | \
1175  PIN_ODR_HIGH(GPIOH_PIN3) | \
1176  PIN_ODR_HIGH(GPIOH_PIN4) | \
1177  PIN_ODR_HIGH(GPIOH_PIN5) | \
1178  PIN_ODR_HIGH(GPIOH_PIN6) | \
1179  PIN_ODR_HIGH(GPIOH_PIN7) | \
1180  PIN_ODR_HIGH(GPIOH_PIN8) | \
1181  PIN_ODR_HIGH(GPIOH_PIN9) | \
1182  PIN_ODR_HIGH(GPIOH_PIN10) | \
1183  PIN_ODR_HIGH(GPIOH_PIN11) | \
1184  PIN_ODR_HIGH(GPIOH_PIN12) | \
1185  PIN_ODR_HIGH(GPIOH_PIN13) | \
1186  PIN_ODR_HIGH(GPIOH_PIN14) | \
1187  PIN_ODR_HIGH(GPIOH_PIN15))
1188 #define VAL_GPIOH_AFRL (PIN_AFIO_AF(GPIOH_PIN0, 0U) | \
1189  PIN_AFIO_AF(GPIOH_PIN1, 0U) | \
1190  PIN_AFIO_AF(GPIOH_PIN2, 0U) | \
1191  PIN_AFIO_AF(GPIOH_PIN3, 0U) | \
1192  PIN_AFIO_AF(GPIOH_PIN4, 0U) | \
1193  PIN_AFIO_AF(GPIOH_PIN5, 0U) | \
1194  PIN_AFIO_AF(GPIOH_PIN6, 0U) | \
1195  PIN_AFIO_AF(GPIOH_PIN7, 0U))
1196 #define VAL_GPIOH_AFRH (PIN_AFIO_AF(GPIOH_PIN8, 0U) | \
1197  PIN_AFIO_AF(GPIOH_PIN9, 0U) | \
1198  PIN_AFIO_AF(GPIOH_PIN10, 0U) | \
1199  PIN_AFIO_AF(GPIOH_PIN11, 0U) | \
1200  PIN_AFIO_AF(GPIOH_PIN12, 0U) | \
1201  PIN_AFIO_AF(GPIOH_PIN13, 0U) | \
1202  PIN_AFIO_AF(GPIOH_PIN14, 0U) | \
1203  PIN_AFIO_AF(GPIOH_PIN15, 0U))
1204 
1205 //*****************************************************************************
1206 
1207 /*
1208  * AHB_CLK
1209  */
1210 #define AHB_CLK STM32_HCLK
1211 
1212 /*
1213  * LEDs
1214  */
1215 /* red */
1216 #ifndef USE_LED_1
1217 #define USE_LED_1 1
1218 #endif
1219 #define LED_1_GPIO GPIOE
1220 #define LED_1_GPIO_PIN GPIO9
1221 #define LED_1_GPIO_ON gpio_clear
1222 #define LED_1_GPIO_OFF gpio_set
1223 
1224 /* blue */
1225 #ifndef USE_LED_2
1226 #define USE_LED_2 1
1227 #endif
1228 #define LED_2_GPIO GPIOE
1229 #define LED_2_GPIO_PIN GPIO8
1230 #define LED_2_GPIO_ON gpio_clear
1231 #define LED_2_GPIO_OFF gpio_set
1232 
1233 /*orange */
1234 #ifndef USE_LED_3
1235 #define USE_LED_3 1
1236 #endif
1237 #define LED_3_GPIO GPIOE
1238 #define LED_3_GPIO_PIN GPIO10
1239 #define LED_3_GPIO_ON gpio_clear
1240 #define LED_3_GPIO_OFF gpio_set
1241 
1242 /* green */
1243 #ifndef USE_LED_4
1244 #define USE_LED_4 1
1245 #endif
1246 #define LED_4_GPIO GPIOE
1247 #define LED_4_GPIO_PIN GPIO11
1248 #define LED_4_GPIO_ON gpio_clear
1249 #define LED_4_GPIO_OFF gpio_set
1250 
1251 /* blue*/
1252 #ifndef USE_LED_5
1253 #define USE_LED_5 0
1254 #endif
1255 #define LED_5_GPIO GPIOE
1256 #define LED_5_GPIO_PIN GPIO12
1257 #define LED_5_GPIO_ON gpio_set
1258 #define LED_5_GPIO_OFF gpio_clear
1259 
1260 /* red*/
1261 #ifndef USE_LED_6
1262 #define USE_LED_6 0
1263 #endif
1264 #define LED_6_GPIO GPIOE
1265 #define LED_6_GPIO_PIN GPIO13
1266 #define LED_6_GPIO_ON gpio_set
1267 #define LED_6_GPIO_OFF gpio_clear
1268 
1269 /* orange*/
1270 #ifndef USE_LED_7
1271 #define USE_LED_7 0
1272 #endif
1273 #define LED_7_GPIO GPIOE
1274 #define LED_7_GPIO_PIN GPIO13
1275 #define LED_7_GPIO_ON gpio_set
1276 #define LED_7_GPIO_OFF gpio_clear
1277 
1278 /* green*/
1279 #ifndef USE_LED_8
1280 #define USE_LED_8 0
1281 #endif
1282 #define LED_8_GPIO GPIOE
1283 #define LED_8_GPIO_PIN GPIO15
1284 #define LED_8_GPIO_ON gpio_set
1285 #define LED_8_GPIO_OFF gpio_clear
1286 
1287 
1288 /* Pint to set Uart2 RX polarity, on PB13, output high inverts, low doesn't */
1289 #define RC_POLARITY_GPIO_PORT GPIOB
1290 #define RC_POLARITY_GPIO_PIN GPIO13
1291 
1292 /*
1293  * ADCs
1294  */
1295 // AUX 1
1296 #if USE_ADC_1
1297 #define AD1_1_CHANNEL ADC_CHANNEL_IN9
1298 #define ADC_1 AD1_1
1299 #define ADC_1_GPIO_PORT GPIOB
1300 #define ADC_1_GPIO_PIN GPIO1
1301 #endif
1302 
1303 // AUX 2
1304 #if USE_ADC_2
1305 #define AD1_2_CHANNEL ADC_CHANNEL_IN15
1306 #define ADC_2 AD1_2
1307 #define ADC_2_GPIO_PORT GPIOC
1308 #define ADC_2_GPIO_PIN GPIO5
1309 #endif
1310 
1311 // AUX 3
1312 #if USE_ADC_3
1313 #define AD1_3_CHANNEL ADC_CHANNEL_IN14
1314 #define ADC_3 AD1_3
1315 #define ADC_3_GPIO_PORT GPIOC
1316 #define ADC_3_GPIO_PIN GPIO4
1317 #endif
1318 
1319 // Internal ADC for battery enabled by default
1320 #ifndef USE_ADC_4
1321 #define USE_ADC_4 1
1322 #endif
1323 #if USE_ADC_4
1324 #define AD1_4_CHANNEL ADC_CHANNEL_IN4
1325 #define ADC_4 AD1_4
1326 #define ADC_4_GPIO_PORT GPIOA
1327 #define ADC_4_GPIO_PIN GPIO4
1328 #endif
1329 
1330 /* allow to define ADC_CHANNEL_VSUPPLY in the airframe file*/
1331 #ifndef ADC_CHANNEL_VSUPPLY
1332 #define ADC_CHANNEL_VSUPPLY ADC_4
1333 #endif
1334 
1335 #define DefaultVoltageOfAdc(adc) (0.006185*adc)
1336 
1337 /*
1338  * PWM defines
1339  */
1340 #ifndef USE_PWM0
1341 #define USE_PWM0 1
1342 #endif
1343 #if USE_PWM0
1344 #define PWM_SERVO_0 0
1345 #define PWM_SERVO_0_GPIO GPIOB
1346 #define PWM_SERVO_0_PIN GPIO0
1347 #define PWM_SERVO_0_AF GPIO_AF2
1348 #define PWM_SERVO_0_DRIVER PWMD3
1349 #define PWM_SERVO_0_CHANNEL 2
1350 #define PWM_SERVO_0_ACTIVE PWM_OUTPUT_ACTIVE_HIGH
1351 #else
1352 #define PWM_SERVO_0_ACTIVE PWM_OUTPUT_DISABLED
1353 #endif
1354 
1355 #ifndef USE_PWM1
1356 #define USE_PWM1 1
1357 #endif
1358 #if USE_PWM1
1359 #define PWM_SERVO_1 1
1360 #define PWM_SERVO_1_GPIO GPIOA
1361 #define PWM_SERVO_1_PIN GPIO2
1362 #define PWM_SERVO_1_AF GPIO_AF1
1363 #define PWM_SERVO_1_DRIVER PWMD2
1364 #define PWM_SERVO_1_CHANNEL 2
1365 #define PWM_SERVO_1_ACTIVE PWM_OUTPUT_ACTIVE_HIGH
1366 #else
1367 #define PWM_SERVO_1_ACTIVE PWM_OUTPUT_DISABLED
1368 #endif
1369 
1370 #ifndef USE_PWM2
1371 #define USE_PWM2 1
1372 #endif
1373 #if USE_PWM2
1374 #define PWM_SERVO_2 2
1375 #define PWM_SERVO_2_GPIO GPIOB
1376 #define PWM_SERVO_2_PIN GPIO5
1377 #define PWM_SERVO_2_AF GPIO_AF2
1378 #define PWM_SERVO_2_DRIVER PWMD3
1379 #define PWM_SERVO_2_CHANNEL 1
1380 #define PWM_SERVO_2_ACTIVE PWM_OUTPUT_ACTIVE_HIGH
1381 #else
1382 #define PWM_SERVO_2_ACTIVE PWM_OUTPUT_DISABLED
1383 #endif
1384 
1385 #ifndef USE_PWM3
1386 #define USE_PWM3 1
1387 #endif
1388 #if USE_PWM3
1389 #define PWM_SERVO_3 3
1390 #define PWM_SERVO_3_GPIO GPIOB
1391 #define PWM_SERVO_3_PIN GPIO4
1392 #define PWM_SERVO_3_AF GPIO_AF2
1393 #define PWM_SERVO_3_DRIVER PWMD3
1394 #define PWM_SERVO_3_CHANNEL 0
1395 #define PWM_SERVO_3_ACTIVE PWM_OUTPUT_ACTIVE_HIGH
1396 #else
1397 #define PWM_SERVO_3_ACTIVE PWM_OUTPUT_DISABLED
1398 #endif
1399 
1400 #ifndef USE_PWM4
1401 #define USE_PWM4 1
1402 #endif
1403 #if USE_PWM4
1404 #define PWM_SERVO_4 4
1405 #define PWM_SERVO_4_GPIO GPIOB
1406 #define PWM_SERVO_4_PIN GPIO3
1407 #define PWM_SERVO_4_AF GPIO_AF1
1408 #define PWM_SERVO_4_DRIVER PWMD2
1409 #define PWM_SERVO_4_CHANNEL 1
1410 #define PWM_SERVO_4_ACTIVE PWM_OUTPUT_ACTIVE_HIGH
1411 #else
1412 #define PWM_SERVO_4_ACTIVE PWM_OUTPUT_DISABLED
1413 #endif
1414 
1415 #ifndef USE_PWM5
1416 #define USE_PWM5 1
1417 #endif
1418 #if USE_PWM5
1419 #define PWM_SERVO_5 5
1420 #define PWM_SERVO_5_GPIO GPIOA
1421 #define PWM_SERVO_5_PIN GPIO15
1422 #define PWM_SERVO_5_AF GPIO_AF1
1423 #define PWM_SERVO_5_DRIVER PWMD2
1424 #define PWM_SERVO_5_CHANNEL 0
1425 #define PWM_SERVO_5_ACTIVE PWM_OUTPUT_ACTIVE_HIGH
1426 #else
1427 #define PWM_SERVO_5_ACTIVE PWM_OUTPUT_DISABLED
1428 #endif
1429 
1430 #if USE_PWM6
1431 #define PWM_SERVO_6 6
1432 #define PWM_SERVO_6_GPIO GPIOB
1433 #define PWM_SERVO_6_PIN GPIO1
1434 #define PWM_SERVO_6_AF GPIO_AF2
1435 #define PWM_SERVO_6_DRIVER PWMD3
1436 #define PWM_SERVO_6_CHANNEL 3
1437 #define PWM_SERVO_6_ACTIVE PWM_OUTPUT_ACTIVE_HIGH
1438 #else
1439 #define PWM_SERVO_6_ACTIVE PWM_OUTPUT_DISABLED
1440 #endif
1441 
1442 
1443 #ifdef STM32_PWM_USE_TIM2
1444 #define PWM_CONF_TIM2 STM32_PWM_USE_TIM2
1445 #else
1446 #define PWM_CONF_TIM2 1
1447 #endif
1448 #define PWM_CONF2_DEF { \
1449  PWM_FREQUENCY, \
1450  PWM_FREQUENCY/TIM2_SERVO_HZ, \
1451  NULL, \
1452  { \
1453  { PWM_SERVO_5_ACTIVE, NULL }, \
1454  { PWM_SERVO_4_ACTIVE, NULL }, \
1455  { PWM_SERVO_1_ACTIVE, NULL }, \
1456  { PWM_OUTPUT_DISABLED, NULL }, \
1457  }, \
1458  0, \
1459  0 \
1460  }
1461 
1462 #ifdef STM32_PWM_USE_TIM3
1463 #define PWM_CONF_TIM3 STM32_PWM_USE_TIM3
1464 #else
1465 #define PWM_CONF_TIM3 1
1466 #endif
1467 #define PWM_CONF3_DEF { \
1468  PWM_FREQUENCY, \
1469  PWM_FREQUENCY/TIM3_SERVO_HZ, \
1470  NULL, \
1471  { \
1472  { PWM_SERVO_3_ACTIVE, NULL }, \
1473  { PWM_SERVO_2_ACTIVE, NULL }, \
1474  { PWM_SERVO_0_ACTIVE, NULL }, \
1475  { PWM_SERVO_6_ACTIVE, NULL }, \
1476  }, \
1477  0, \
1478  0 \
1479  }
1480 
1484 #define RC_PPM_TICKS_PER_USEC 2
1485 #define PPM_TIMER_FREQUENCY 2000000
1486 #define PPM_CHANNEL ICU_CHANNEL_1
1487 #define PPM_TIMER ICUD1
1488 
1489 /*
1490  * PWM input
1491  */
1492 // PWM_INPUT 1 on PA8 (also PPM IN)
1493 #define PWM_INPUT1_ICU ICUD1
1494 #define PWM_INPUT1_CHANNEL ICU_CHANNEL_1
1495 // PPM in (aka PA8) is used: not compatible with PPM RC receiver
1496 #define PWM_INPUT1_GPIO_PORT GPIOA
1497 #define PWM_INPUT1_GPIO_PIN GPIO8
1498 #define PWM_INPUT1_GPIO_AF GPIO_AF1
1499 
1500 // PWM_INPUT 2 on PA3 (also SERVO 1)
1501 #if (USE_PWM1 && USE_PWM_INPUT2)
1502 #error "PW1 and PWM_INPUT2 are not compatible"
1503 #endif
1504 #define PWM_INPUT2_ICU ICUD9
1505 #define PWM_INPUT2_CHANNEL ICU_CHANNEL_1
1506 #define PWM_INPUT2_GPIO_PORT GPIOA
1507 #define PWM_INPUT2_GPIO_PIN GPIO2
1508 #define PWM_INPUT2_GPIO_AF GPIO_AF3
1509 
1513 #ifndef I2C1_CLOCK_SPEED
1514 #define I2C1_CLOCK_SPEED 400000
1515 #endif
1516 #if I2C1_CLOCK_SPEED == 400000
1517 #define I2C1_DUTY_CYCLE FAST_DUTY_CYCLE_2
1518 #elif I2C1_CLOCK_SPEED == 100000
1519 #define I2C1_DUTY_CYCLE STD_DUTY_CYCLE
1520 #else
1521 #error Invalid I2C1 clock speed
1522 #endif
1523 #define I2C1_CFG_DEF { \
1524  OPMODE_I2C, \
1525  I2C1_CLOCK_SPEED, \
1526  I2C1_DUTY_CYCLE, \
1527  }
1528 
1529 #ifndef I2C2_CLOCK_SPEED
1530 #define I2C2_CLOCK_SPEED 400000
1531 #endif
1532 #if I2C2_CLOCK_SPEED == 400000
1533 #define I2C2_DUTY_CYCLE FAST_DUTY_CYCLE_2
1534 #elif I2C2_CLOCK_SPEED == 100000
1535 #define I2C2_DUTY_CYCLE STD_DUTY_CYCLE
1536 #else
1537 #error Invalid I2C2 clock speed
1538 #endif
1539 #define I2C2_CFG_DEF { \
1540  OPMODE_I2C, \
1541  I2C2_CLOCK_SPEED, \
1542  I2C2_DUTY_CYCLE, \
1543  }
1544 
1548 #define SPI1_GPIO_AF GPIO_AF5
1549 #define SPI1_GPIO_PORT_MISO GPIOA
1550 #define SPI1_GPIO_MISO GPIO6
1551 #define SPI1_GPIO_PORT_MOSI GPIOA
1552 #define SPI1_GPIO_MOSI GPIO7
1553 #define SPI1_GPIO_PORT_SCK GPIOA
1554 #define SPI1_GPIO_SCK GPIO5
1555 
1556 // SLAVE0 on SPI connector
1557 #define SPI_SELECT_SLAVE0_PORT GPIOB
1558 #define SPI_SELECT_SLAVE0_PIN GPIO9
1559 // SLAVE1 on AUX1
1560 #define SPI_SELECT_SLAVE1_PORT GPIOB
1561 #define SPI_SELECT_SLAVE1_PIN GPIO1
1562 // SLAVE2 on AUX2
1563 #define SPI_SELECT_SLAVE2_PORT GPIOC
1564 #define SPI_SELECT_SLAVE2_PIN GPIO5
1565 // SLAVE3 on AUX3
1566 #define SPI_SELECT_SLAVE3_PORT GPIOC
1567 #define SPI_SELECT_SLAVE3_PIN GPIO4
1568 // SLAVE4 on AUX4
1569 #define SPI_SELECT_SLAVE4_PORT GPIOB
1570 #define SPI_SELECT_SLAVE4_PIN GPIO15
1571 
1578 // #ifndef USE_BARO_BOARD
1579 // #define USE_BARO_BOARD 1
1580 // #endif
1581 
1582 /*
1583  * Actuators for fixedwing
1584  */
1585 /* Default actuators driver */
1586 #define DEFAULT_ACTUATORS "subsystems/actuators/actuators_pwm.h"
1587 #define ActuatorDefaultSet(_x,_y) ActuatorPwmSet(_x,_y)
1588 #define ActuatorsDefaultInit() ActuatorsPwmInit()
1589 #define ActuatorsDefaultCommit() ActuatorsPwmCommit()
1590 
1591 
1595 #define SDIO_D0_PORT GPIOC
1596 #define SDIO_D0_PIN GPIOC_SDIO_D0
1597 #define SDIO_D1_PORT GPIOC
1598 #define SDIO_D1_PIN GPIOC_SDIO_D1
1599 #define SDIO_D2_PORT GPIOC
1600 #define SDIO_D2_PIN GPIOC_SDIO_D2
1601 #define SDIO_D3_PORT GPIOC
1602 #define SDIO_D3_PIN GPIOC_SDIO_D3
1603 #define SDIO_CK_PORT GPIOC
1604 #define SDIO_CK_PIN GPIOC_SDIO_CK
1605 #define SDIO_CMD_PORT GPIOD
1606 #define SDIO_CMD_PIN GPIOD_SDIO_CMD
1607 #define SDIO_AF 12
1608 // bat monitoring for file closing
1609 #define SDLOG_BAT_ADC ADCD1
1610 #define SDLOG_BAT_CHAN AD1_4_CHANNEL
1611 // usb led status
1612 #define SDLOG_USB_LED 4
1613 #define SDLOG_USB_VBUS_PORT GPIOA
1614 #define SDLOG_USB_VBUS_PIN GPIO9
1615 
1616 
1617 //*****************************************************************************
1618 #if !defined(_FROM_ASM_)
1619 #ifdef __cplusplus
1620 extern "C" {
1621 #endif
1622 void boardInit(void);
1623 #ifdef __cplusplus
1624 }
1625 #endif
1626 #endif /* _FROM_ASM_ */
1627 
1628 #endif /* BOARD_H */
void boardInit(void)
Board-specific initialization code.
Definition: board.c:261