Paparazzi UAS  v5.17_devel-24-g2ae834f
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..2015 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 #pragma once
18 
19 /*
20  * Board identifier.
21  */
22 #define BOARD_PX4FMU
23 #define BOARD_NAME "Pixhawk PX4 FMU v5.0"
24 
25 /*
26  * Board oscillators-related settings.
27  */
28 #if !defined(STM32_LSECLK)
29 #define STM32_LSECLK 32768U
30 #endif
31 
32 #define STM32_LSEDRV (3U << 3U)
33 
34 #if !defined(STM32_HSECLK)
35 #define STM32_HSECLK 16000000U
36 #endif
37 
38 /*
39  * Board voltages.
40  * Required for performance limits calculation.
41  */
42 #define STM32_VDD 330U
43 
44 /*
45  * MCU type as defined in the ST header.
46  */
47 #define STM32F767xx
48 
49 /*
50  * IO pins assignments.
51  */
52 #define PA00_ADC1 0U
53 #define PA01_ADC2 1U
54 #define PA02_ADC3 2U
55 #define PA03_ADC4 3U
56 #define PA04_ADC1_SPARE2 4U
57 #define PA05_FMU_CAP1 5U
58 #define PA06_SPI1_MISO 6U
59 #define PA07_HEATER 7U
60 #define PA08_CAN3_RX 8U
61 #define PA09_USB_VBUS 9U
62 #define PA10_SERVO2 10U
63 #define PA11_USB_DM 11U
64 #define PA12_USB_DP 12U
65 #define PA13_SWDIO 13U
66 #define PA14_SWCLK 14U
67 #define PA15_CAN3_TX 15U
68 
69 #define PB00_RSSI_IN 0U
70 #define PB01_LED1 1U
71 #define PB02 2U
72 #define PB03_FMU_CAP2 3U
73 #define PB04_DRDY1_ICM20689 4U
74 #define PB05_SPI6_MOSI 5U
75 #define PB06_USART1_TX 6U
76 #define PB07_USART1_RX 7U
77 #define PB08_I2C1_SCL 8U
78 #define PB09_I2C1_SDA 9U
79 #define PB10_SPI5_RESET 10U
80 #define PB11_FMU_CAP3 11U
81 #define PB12_CAN2_RX 12U
82 #define PB13_CAN2_TX 13U
83 #define PB14_DRDY2_BMI055_GYRO 14U
84 #define PB15_DRDY2_BMI055_ACC 15U
85 
86 #define PC00_SCALED_V5 0U
87 #define PC01_SCALED_3V3_SENSORS 1U
88 #define PC02_HW_VER_SENSE 2U
89 #define PC03_HW_REV_SENSE 3U
90 #define PC04_ADC1_SPARE1 4U
91 #define PC05_DRDY4_ICM20602 5U
92 #define PC06_LED2 6U
93 #define PC07_LED3 7U
94 #define PC08_SDIO_D0 8U
95 #define PC09_SDIO_D1 9U
96 #define PC10_SDIO_D2 10U
97 #define PC11_SDIO_D3 11U
98 #define PC12_SDIO_CK 12U
99 #define PC13_DRDY5_BMI055_GYRO 13U
100 #define PC14_OSC32_IN 14U
101 #define PC15_OSC32_OUT 15U
102 
103 #define PD00_UART4_RX 0U
104 #define PD01_UART4_TX 1U
105 #define PD02_SDIO_CMD 2U
106 #define PD03_UART2_CTS 3U
107 #define PD04_UART2_RTS 4U
108 #define PD05_UART2_TX 5U
109 #define PD06_UART2_RX 6U
110 #define PD07_SPI1_MOSI 7U
111 #define PD08_UART3_TX 8U
112 #define PD09_UART3_RX 9U
113 #define PD10_DRDY6_BMI055_ACC 10U
114 #define PD11_UART3_CTS 11U
115 #define PD12_UART3_RTS 12U
116 #define PD13_SERVO5 13U
117 #define PD14_SERVO6 14U
118 #define PD15_DRDY7_EXTERNAL1 15U
119 
120 #define PE00_UART8_RX 0U
121 #define PE01_UART8_TX 1U
122 #define PE02_SPI4_SCK 2U
123 #define PE03_V3V3_SENSORS_EN 3U
124 #define PE04_V3V3_SPEKTRUM_EN 4U
125 #define PE05_BUZZER 5U
126 #define PE06_SPI4_MOSI 6U
127 #define PE07_DRDY8 7U
128 #define PE08_UART7_TX 8U
129 #define PE09_SERVO4 9U
130 #define PE10_SAFETY_SWITCH_IN 10U
131 #define PE11_SERVO3 11U
132 #define PE12_LED4 12U
133 #define PE13_SPI4_MISO 13U
134 #define PE14_SERVO1 14U
135 #define PE15_V5V_PERIPH_OC 15U
136 
137 #define PF00_I2C2_SDA 0U
138 #define PF01_I2C2_SCL 1U
139 #define PF02_SPI_SLAVE0 2U
140 #define PF03_SPI_SLAVE1 3U
141 #define PF04_SPI_SLAVE2 4U
142 #define PF05_SPI_SLAVE3 5U
143 #define PF06_UART7_RX 6U
144 #define PF07_SPI5_SCK 7U
145 #define PF08_SPI5_MISO 8U
146 #define PF09_SPI5_MOSI 9U
147 #define PF10_SPI_SLAVE4 10U
148 #define PF11_SPI_SLAVE5 11U
149 #define PF12_V5V_HIPOWER_EN 12U
150 #define PF13_V5V_HIPOWER_OC 13U
151 #define PF14_I2C4_SCL 14U
152 #define PF15_I2C4_SDA 15U
153 
154 #define PG00_HW_VER_DRIVE 0U
155 #define PG01_POWER_IN_A 1U
156 #define PG02_POWER_IN_B 2U
157 #define PG03_POWER_IN_C 3U
158 #define PG04_V5V_PERIPH_EN 4U
159 #define PG05_V5V_RC_EN 5U
160 #define PG06_V5V_WIFI_EN 6U
161 #define PG07_V3V3_SD_CARD_EN 7U
162 #define PG08_USART6_RTS 8U
163 #define PG09_USART6_RX 9U
164 #define PG10_SPI_SLAVE6 10U
165 #define PG11_SPI1_SCK 11U
166 #define PG12_SPI6_MISO 12U
167 #define PG13_SPI6_SCK 13U
168 #define PG14_USART6_TX 14U
169 #define PG15_USART6_CTS 15U
170 
171 #define PH00_OSC_IN 0U
172 #define PH01_OSC_OUT 1U
173 #define PH02_CAN1_SILENT_S0 2U
174 #define PH03_CAN2_SILENT_S1 3U
175 #define PH04_CAN3_SILENT_S2 4U
176 #define PH05_SPI_SLAVE7 5U
177 #define PH06_SERVO7 6U
178 #define PH07_I2C3_SCL 7U
179 #define PH08_I2C3_SDA 8U
180 #define PH09_SERVO8 9U
181 #define PH10_LED5 10U
182 #define PH11_LED6 11U
183 #define PH12_LED7 12U
184 #define PH13_CAN1_TX 13U
185 #define PH14_HW_REV_DRIVE 14U
186 #define PH15_SPI5_SYNC 15U
187 
188 #define PI00_ARMED 0U
189 #define PI01_SPI2_SCK 1U
190 #define PI02_SPI2_MISO 2U
191 #define PI03_SPI2_MOSI 3U
192 #define PI04_SPI_SLAVE8 4U
193 #define PI05_RC_INPUT 5U
194 #define PI06_SPI_SLAVE9 6U
195 #define PI07_SPI_SLAVE10 7U
196 #define PI08_SPI_SLAVE11 8U
197 #define PI09_CAN1_RX 9U
198 #define PI10_SPI_SLAVE12 10U
199 #define PI11_SPI_SLAVE13 11U
200 #define PI12 12U
201 #define PI13 13U
202 #define PI14 14U
203 #define PI15 15U
204 
205 #define PJ00 0U
206 #define PJ01 1U
207 #define PJ02 2U
208 #define PJ03 3U
209 #define PJ04 4U
210 #define PJ05 5U
211 #define PJ06 6U
212 #define PJ07 7U
213 #define PJ08 8U
214 #define PJ09 9U
215 #define PJ10 10U
216 #define PJ11 11U
217 #define PJ12 12U
218 #define PJ13 13U
219 #define PJ14 14U
220 #define PJ15 15U
221 
222 #define PK00 0U
223 #define PK01 1U
224 #define PK02 2U
225 #define PK03 3U
226 #define PK04 4U
227 #define PK05 5U
228 #define PK06 6U
229 #define PK07 7U
230 #define PK08 8U
231 #define PK09 9U
232 #define PK10 10U
233 #define PK11 11U
234 #define PK12 12U
235 #define PK13 13U
236 #define PK14 14U
237 #define PK15 15U
238 
239 /*
240  * IO lines assignments.
241  */
242 #define LINE_ADC1 PAL_LINE(GPIOA, 0U)
243 #define LINE_ADC2 PAL_LINE(GPIOA, 1U)
244 #define LINE_ADC3 PAL_LINE(GPIOA, 2U)
245 #define LINE_ADC4 PAL_LINE(GPIOA, 3U)
246 #define LINE_ADC1_SPARE2 PAL_LINE(GPIOA, 4U)
247 #define LINE_FMU_CAP1 PAL_LINE(GPIOA, 5U)
248 #define LINE_SPI1_MISO PAL_LINE(GPIOA, 6U)
249 #define LINE_HEATER PAL_LINE(GPIOA, 7U)
250 #define LINE_CAN3_RX PAL_LINE(GPIOA, 8U)
251 #define LINE_USB_VBUS PAL_LINE(GPIOA, 9U)
252 #define LINE_SERVO2 PAL_LINE(GPIOA, 10U)
253 #define LINE_USB_DM PAL_LINE(GPIOA, 11U)
254 #define LINE_USB_DP PAL_LINE(GPIOA, 12U)
255 #define LINE_SWDIO PAL_LINE(GPIOA, 13U)
256 #define LINE_SWCLK PAL_LINE(GPIOA, 14U)
257 #define LINE_CAN3_TX PAL_LINE(GPIOA, 15U)
258 
259 #define LINE_RSSI_IN PAL_LINE(GPIOB, 0U)
260 #define LINE_LED1 PAL_LINE(GPIOB, 1U)
261 #define LINE_FMU_CAP2 PAL_LINE(GPIOB, 3U)
262 #define LINE_DRDY1_ICM20689 PAL_LINE(GPIOB, 4U)
263 #define LINE_SPI6_MOSI PAL_LINE(GPIOB, 5U)
264 #define LINE_USART1_TX PAL_LINE(GPIOB, 6U)
265 #define LINE_USART1_RX PAL_LINE(GPIOB, 7U)
266 #define LINE_I2C1_SCL PAL_LINE(GPIOB, 8U)
267 #define LINE_I2C1_SDA PAL_LINE(GPIOB, 9U)
268 #define LINE_SPI5_RESET PAL_LINE(GPIOB, 10U)
269 #define LINE_FMU_CAP3 PAL_LINE(GPIOB, 11U)
270 #define LINE_CAN2_RX PAL_LINE(GPIOB, 12U)
271 #define LINE_CAN2_TX PAL_LINE(GPIOB, 13U)
272 #define LINE_DRDY2_BMI055_GYRO PAL_LINE(GPIOB, 14U)
273 #define LINE_DRDY2_BMI055_ACC PAL_LINE(GPIOB, 15U)
274 
275 #define LINE_SCALED_V5 PAL_LINE(GPIOC, 0U)
276 #define LINE_SCALED_3V3_SENSORS PAL_LINE(GPIOC, 1U)
277 #define LINE_HW_VER_SENSE PAL_LINE(GPIOC, 2U)
278 #define LINE_HW_REV_SENSE PAL_LINE(GPIOC, 3U)
279 #define LINE_ADC1_SPARE1 PAL_LINE(GPIOC, 4U)
280 #define LINE_DRDY4_ICM20602 PAL_LINE(GPIOC, 5U)
281 #define LINE_LED2 PAL_LINE(GPIOC, 6U)
282 #define LINE_LED3 PAL_LINE(GPIOC, 7U)
283 #define LINE_SDIO_D0 PAL_LINE(GPIOC, 8U)
284 #define LINE_SDIO_D1 PAL_LINE(GPIOC, 9U)
285 #define LINE_SDIO_D2 PAL_LINE(GPIOC, 10U)
286 #define LINE_SDIO_D3 PAL_LINE(GPIOC, 11U)
287 #define LINE_SDIO_CK PAL_LINE(GPIOC, 12U)
288 #define LINE_DRDY5_BMI055_GYRO PAL_LINE(GPIOC, 13U)
289 #define LINE_OSC32_IN PAL_LINE(GPIOC, 14U)
290 #define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U)
291 
292 #define LINE_UART4_RX PAL_LINE(GPIOD, 0U)
293 #define LINE_UART4_TX PAL_LINE(GPIOD, 1U)
294 #define LINE_SDIO_CMD PAL_LINE(GPIOD, 2U)
295 #define LINE_UART2_CTS PAL_LINE(GPIOD, 3U)
296 #define LINE_UART2_RTS PAL_LINE(GPIOD, 4U)
297 #define LINE_UART2_TX PAL_LINE(GPIOD, 5U)
298 #define LINE_UART2_RX PAL_LINE(GPIOD, 6U)
299 #define LINE_SPI1_MOSI PAL_LINE(GPIOD, 7U)
300 #define LINE_UART3_TX PAL_LINE(GPIOD, 8U)
301 #define LINE_UART3_RX PAL_LINE(GPIOD, 9U)
302 #define LINE_DRDY6_BMI055_ACC PAL_LINE(GPIOD, 10U)
303 #define LINE_UART3_CTS PAL_LINE(GPIOD, 11U)
304 #define LINE_UART3_RTS PAL_LINE(GPIOD, 12U)
305 #define LINE_SERVO5 PAL_LINE(GPIOD, 13U)
306 #define LINE_SERVO6 PAL_LINE(GPIOD, 14U)
307 #define LINE_DRDY7_EXTERNAL1 PAL_LINE(GPIOD, 15U)
308 
309 #define LINE_UART8_RX PAL_LINE(GPIOE, 0U)
310 #define LINE_UART8_TX PAL_LINE(GPIOE, 1U)
311 #define LINE_SPI4_SCK PAL_LINE(GPIOE, 2U)
312 #define LINE_V3V3_SENSORS_EN PAL_LINE(GPIOE, 3U)
313 #define LINE_V3V3_SPEKTRUM_EN PAL_LINE(GPIOE, 4U)
314 #define LINE_BUZZER PAL_LINE(GPIOE, 5U)
315 #define LINE_SPI4_MOSI PAL_LINE(GPIOE, 6U)
316 #define LINE_DRDY8 PAL_LINE(GPIOE, 7U)
317 #define LINE_UART7_TX PAL_LINE(GPIOE, 8U)
318 #define LINE_SERVO4 PAL_LINE(GPIOE, 9U)
319 #define LINE_SAFETY_SWITCH_IN PAL_LINE(GPIOE, 10U)
320 #define LINE_SERVO3 PAL_LINE(GPIOE, 11U)
321 #define LINE_LED4 PAL_LINE(GPIOE, 12U)
322 #define LINE_SPI4_MISO PAL_LINE(GPIOE, 13U)
323 #define LINE_SERVO1 PAL_LINE(GPIOE, 14U)
324 #define LINE_V5V_PERIPH_OC PAL_LINE(GPIOE, 15U)
325 
326 #define LINE_I2C2_SDA PAL_LINE(GPIOF, 0U)
327 #define LINE_I2C2_SCL PAL_LINE(GPIOF, 1U)
328 #define LINE_SPI_SLAVE0 PAL_LINE(GPIOF, 2U)
329 #define LINE_SPI_SLAVE1 PAL_LINE(GPIOF, 3U)
330 #define LINE_SPI_SLAVE2 PAL_LINE(GPIOF, 4U)
331 #define LINE_SPI_SLAVE3 PAL_LINE(GPIOF, 5U)
332 #define LINE_UART7_RX PAL_LINE(GPIOF, 6U)
333 #define LINE_SPI5_SCK PAL_LINE(GPIOF, 7U)
334 #define LINE_SPI5_MISO PAL_LINE(GPIOF, 8U)
335 #define LINE_SPI5_MOSI PAL_LINE(GPIOF, 9U)
336 #define LINE_SPI_SLAVE4 PAL_LINE(GPIOF, 10U)
337 #define LINE_SPI_SLAVE5 PAL_LINE(GPIOF, 11U)
338 #define LINE_V5V_HIPOWER_EN PAL_LINE(GPIOF, 12U)
339 #define LINE_V5V_HIPOWER_OC PAL_LINE(GPIOF, 13U)
340 #define LINE_I2C4_SCL PAL_LINE(GPIOF, 14U)
341 #define LINE_I2C4_SDA PAL_LINE(GPIOF, 15U)
342 
343 #define LINE_HW_VER_DRIVE PAL_LINE(GPIOG, 0U)
344 #define LINE_POWER_IN_A PAL_LINE(GPIOG, 1U)
345 #define LINE_POWER_IN_B PAL_LINE(GPIOG, 2U)
346 #define LINE_POWER_IN_C PAL_LINE(GPIOG, 3U)
347 #define LINE_V5V_PERIPH_EN PAL_LINE(GPIOG, 4U)
348 #define LINE_V5V_RC_EN PAL_LINE(GPIOG, 5U)
349 #define LINE_V5V_WIFI_EN PAL_LINE(GPIOG, 6U)
350 #define LINE_V3V3_SD_CARD_EN PAL_LINE(GPIOG, 7U)
351 #define LINE_USART6_RTS PAL_LINE(GPIOG, 8U)
352 #define LINE_USART6_RX PAL_LINE(GPIOG, 9U)
353 #define LINE_SPI_SLAVE6 PAL_LINE(GPIOG, 10U)
354 #define LINE_SPI1_SCK PAL_LINE(GPIOG, 11U)
355 #define LINE_SPI6_MISO PAL_LINE(GPIOG, 12U)
356 #define LINE_SPI6_SCK PAL_LINE(GPIOG, 13U)
357 #define LINE_USART6_TX PAL_LINE(GPIOG, 14U)
358 #define LINE_USART6_CTS PAL_LINE(GPIOG, 15U)
359 
360 #define LINE_OSC_IN PAL_LINE(GPIOH, 0U)
361 #define LINE_OSC_OUT PAL_LINE(GPIOH, 1U)
362 #define LINE_CAN1_SILENT_S0 PAL_LINE(GPIOH, 2U)
363 #define LINE_CAN2_SILENT_S1 PAL_LINE(GPIOH, 3U)
364 #define LINE_CAN3_SILENT_S2 PAL_LINE(GPIOH, 4U)
365 #define LINE_SPI_SLAVE7 PAL_LINE(GPIOH, 5U)
366 #define LINE_SERVO7 PAL_LINE(GPIOH, 6U)
367 #define LINE_I2C3_SCL PAL_LINE(GPIOH, 7U)
368 #define LINE_I2C3_SDA PAL_LINE(GPIOH, 8U)
369 #define LINE_SERVO8 PAL_LINE(GPIOH, 9U)
370 #define LINE_LED5 PAL_LINE(GPIOH, 10U)
371 #define LINE_LED6 PAL_LINE(GPIOH, 11U)
372 #define LINE_LED7 PAL_LINE(GPIOH, 12U)
373 #define LINE_CAN1_TX PAL_LINE(GPIOH, 13U)
374 #define LINE_HW_REV_DRIVE PAL_LINE(GPIOH, 14U)
375 #define LINE_SPI5_SYNC PAL_LINE(GPIOH, 15U)
376 
377 #define LINE_ARMED PAL_LINE(GPIOI, 0U)
378 #define LINE_SPI2_SCK PAL_LINE(GPIOI, 1U)
379 #define LINE_SPI2_MISO PAL_LINE(GPIOI, 2U)
380 #define LINE_SPI2_MOSI PAL_LINE(GPIOI, 3U)
381 #define LINE_SPI_SLAVE8 PAL_LINE(GPIOI, 4U)
382 #define LINE_RC_INPUT PAL_LINE(GPIOI, 5U)
383 #define LINE_SPI_SLAVE9 PAL_LINE(GPIOI, 6U)
384 #define LINE_SPI_SLAVE10 PAL_LINE(GPIOI, 7U)
385 #define LINE_SPI_SLAVE11 PAL_LINE(GPIOI, 8U)
386 #define LINE_CAN1_RX PAL_LINE(GPIOI, 9U)
387 #define LINE_SPI_SLAVE12 PAL_LINE(GPIOI, 10U)
388 #define LINE_SPI_SLAVE13 PAL_LINE(GPIOI, 11U)
389 
390 
391 /*
392  * I/O ports initial setup, this configuration is established soon after reset
393  * in the initialization code.
394  * Please refer to the STM32 Reference Manual for details.
395  */
396 #define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
397 #define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
398 #define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
399 #define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
400 #define PIN_ODR_LEVEL_LOW(n) (0U << (n))
401 #define PIN_ODR_LEVEL_HIGH(n) (1U << (n))
402 #define PIN_OTYPE_PUSHPULL(n) (0U << (n))
403 #define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
404 #define PIN_OSPEED_SPEED_VERYLOW(n) (0U << ((n) * 2U))
405 #define PIN_OSPEED_SPEED_LOW(n) (1U << ((n) * 2U))
406 #define PIN_OSPEED_SPEED_MEDIUM(n) (2U << ((n) * 2U))
407 #define PIN_OSPEED_SPEED_HIGH(n) (3U << ((n) * 2U))
408 #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
409 #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
410 #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
411 #define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
412 
413 #define VAL_GPIOA_MODER (PIN_MODE_ANALOG(PA00_ADC1) | \
414  PIN_MODE_ANALOG(PA01_ADC2) | \
415  PIN_MODE_ANALOG(PA02_ADC3) | \
416  PIN_MODE_ANALOG(PA03_ADC4) | \
417  PIN_MODE_ANALOG(PA04_ADC1_SPARE2) | \
418  PIN_MODE_INPUT(PA05_FMU_CAP1) | \
419  PIN_MODE_ALTERNATE(PA06_SPI1_MISO) | \
420  PIN_MODE_INPUT(PA07_HEATER) | \
421  PIN_MODE_ALTERNATE(PA08_CAN3_RX) | \
422  PIN_MODE_INPUT(PA09_USB_VBUS) | \
423  PIN_MODE_ALTERNATE(PA10_SERVO2) | \
424  PIN_MODE_ALTERNATE(PA11_USB_DM) | \
425  PIN_MODE_ALTERNATE(PA12_USB_DP) | \
426  PIN_MODE_ALTERNATE(PA13_SWDIO) | \
427  PIN_MODE_ALTERNATE(PA14_SWCLK) | \
428  PIN_MODE_ALTERNATE(PA15_CAN3_TX))
429 
430 #define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(PA00_ADC1) | \
431  PIN_OTYPE_PUSHPULL(PA01_ADC2) | \
432  PIN_OTYPE_PUSHPULL(PA02_ADC3) | \
433  PIN_OTYPE_PUSHPULL(PA03_ADC4) | \
434  PIN_OTYPE_PUSHPULL(PA04_ADC1_SPARE2) | \
435  PIN_OTYPE_OPENDRAIN(PA05_FMU_CAP1) | \
436  PIN_OTYPE_PUSHPULL(PA06_SPI1_MISO) | \
437  PIN_OTYPE_OPENDRAIN(PA07_HEATER) | \
438  PIN_OTYPE_PUSHPULL(PA08_CAN3_RX) | \
439  PIN_OTYPE_OPENDRAIN(PA09_USB_VBUS) | \
440  PIN_OTYPE_PUSHPULL(PA10_SERVO2) | \
441  PIN_OTYPE_PUSHPULL(PA11_USB_DM) | \
442  PIN_OTYPE_PUSHPULL(PA12_USB_DP) | \
443  PIN_OTYPE_PUSHPULL(PA13_SWDIO) | \
444  PIN_OTYPE_PUSHPULL(PA14_SWCLK) | \
445  PIN_OTYPE_PUSHPULL(PA15_CAN3_TX))
446 
447 #define VAL_GPIOA_OSPEEDR (PIN_OSPEED_SPEED_VERYLOW(PA00_ADC1) | \
448  PIN_OSPEED_SPEED_VERYLOW(PA01_ADC2) | \
449  PIN_OSPEED_SPEED_VERYLOW(PA02_ADC3) | \
450  PIN_OSPEED_SPEED_VERYLOW(PA03_ADC4) | \
451  PIN_OSPEED_SPEED_VERYLOW(PA04_ADC1_SPARE2) | \
452  PIN_OSPEED_SPEED_VERYLOW(PA05_FMU_CAP1) | \
453  PIN_OSPEED_SPEED_HIGH(PA06_SPI1_MISO) | \
454  PIN_OSPEED_SPEED_VERYLOW(PA07_HEATER) | \
455  PIN_OSPEED_SPEED_HIGH(PA08_CAN3_RX) | \
456  PIN_OSPEED_SPEED_VERYLOW(PA09_USB_VBUS) | \
457  PIN_OSPEED_SPEED_HIGH(PA10_SERVO2) | \
458  PIN_OSPEED_SPEED_HIGH(PA11_USB_DM) | \
459  PIN_OSPEED_SPEED_HIGH(PA12_USB_DP) | \
460  PIN_OSPEED_SPEED_HIGH(PA13_SWDIO) | \
461  PIN_OSPEED_SPEED_HIGH(PA14_SWCLK) | \
462  PIN_OSPEED_SPEED_HIGH(PA15_CAN3_TX))
463 
464 #define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(PA00_ADC1) | \
465  PIN_PUPDR_FLOATING(PA01_ADC2) | \
466  PIN_PUPDR_FLOATING(PA02_ADC3) | \
467  PIN_PUPDR_FLOATING(PA03_ADC4) | \
468  PIN_PUPDR_FLOATING(PA04_ADC1_SPARE2) | \
469  PIN_PUPDR_PULLDOWN(PA05_FMU_CAP1) | \
470  PIN_PUPDR_FLOATING(PA06_SPI1_MISO) | \
471  PIN_PUPDR_PULLDOWN(PA07_HEATER) | \
472  PIN_PUPDR_FLOATING(PA08_CAN3_RX) | \
473  PIN_PUPDR_PULLDOWN(PA09_USB_VBUS) | \
474  PIN_PUPDR_FLOATING(PA10_SERVO2) | \
475  PIN_PUPDR_FLOATING(PA11_USB_DM) | \
476  PIN_PUPDR_FLOATING(PA12_USB_DP) | \
477  PIN_PUPDR_FLOATING(PA13_SWDIO) | \
478  PIN_PUPDR_FLOATING(PA14_SWCLK) | \
479  PIN_PUPDR_FLOATING(PA15_CAN3_TX))
480 
481 #define VAL_GPIOA_ODR (PIN_ODR_LEVEL_LOW(PA00_ADC1) | \
482  PIN_ODR_LEVEL_LOW(PA01_ADC2) | \
483  PIN_ODR_LEVEL_LOW(PA02_ADC3) | \
484  PIN_ODR_LEVEL_LOW(PA03_ADC4) | \
485  PIN_ODR_LEVEL_LOW(PA04_ADC1_SPARE2) | \
486  PIN_ODR_LEVEL_HIGH(PA05_FMU_CAP1) | \
487  PIN_ODR_LEVEL_HIGH(PA06_SPI1_MISO) | \
488  PIN_ODR_LEVEL_HIGH(PA07_HEATER) | \
489  PIN_ODR_LEVEL_HIGH(PA08_CAN3_RX) | \
490  PIN_ODR_LEVEL_LOW(PA09_USB_VBUS) | \
491  PIN_ODR_LEVEL_LOW(PA10_SERVO2) | \
492  PIN_ODR_LEVEL_HIGH(PA11_USB_DM) | \
493  PIN_ODR_LEVEL_HIGH(PA12_USB_DP) | \
494  PIN_ODR_LEVEL_HIGH(PA13_SWDIO) | \
495  PIN_ODR_LEVEL_HIGH(PA14_SWCLK) | \
496  PIN_ODR_LEVEL_HIGH(PA15_CAN3_TX))
497 
498 #define VAL_GPIOA_AFRL (PIN_AFIO_AF(PA00_ADC1, 0) | \
499  PIN_AFIO_AF(PA01_ADC2, 0) | \
500  PIN_AFIO_AF(PA02_ADC3, 0) | \
501  PIN_AFIO_AF(PA03_ADC4, 0) | \
502  PIN_AFIO_AF(PA04_ADC1_SPARE2, 0) | \
503  PIN_AFIO_AF(PA05_FMU_CAP1, 0) | \
504  PIN_AFIO_AF(PA06_SPI1_MISO, 5) | \
505  PIN_AFIO_AF(PA07_HEATER, 0))
506 
507 #define VAL_GPIOA_AFRH (PIN_AFIO_AF(PA08_CAN3_RX, 11) | \
508  PIN_AFIO_AF(PA09_USB_VBUS, 0) | \
509  PIN_AFIO_AF(PA10_SERVO2, 1) | \
510  PIN_AFIO_AF(PA11_USB_DM, 10) | \
511  PIN_AFIO_AF(PA12_USB_DP, 10) | \
512  PIN_AFIO_AF(PA13_SWDIO, 0) | \
513  PIN_AFIO_AF(PA14_SWCLK, 0) | \
514  PIN_AFIO_AF(PA15_CAN3_TX, 11))
515 
516 #define VAL_GPIOB_MODER (PIN_MODE_ANALOG(PB00_RSSI_IN) | \
517  PIN_MODE_OUTPUT(PB01_LED1) | \
518  PIN_MODE_INPUT(PB02) | \
519  PIN_MODE_INPUT(PB03_FMU_CAP2) | \
520  PIN_MODE_INPUT(PB04_DRDY1_ICM20689) | \
521  PIN_MODE_ALTERNATE(PB05_SPI6_MOSI) | \
522  PIN_MODE_ALTERNATE(PB06_USART1_TX) | \
523  PIN_MODE_ALTERNATE(PB07_USART1_RX) | \
524  PIN_MODE_ALTERNATE(PB08_I2C1_SCL) | \
525  PIN_MODE_ALTERNATE(PB09_I2C1_SDA) | \
526  PIN_MODE_INPUT(PB10_SPI5_RESET) | \
527  PIN_MODE_INPUT(PB11_FMU_CAP3) | \
528  PIN_MODE_ALTERNATE(PB12_CAN2_RX) | \
529  PIN_MODE_ALTERNATE(PB13_CAN2_TX) | \
530  PIN_MODE_INPUT(PB14_DRDY2_BMI055_GYRO) | \
531  PIN_MODE_INPUT(PB15_DRDY2_BMI055_ACC))
532 
533 #define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(PB00_RSSI_IN) | \
534  PIN_OTYPE_PUSHPULL(PB01_LED1) | \
535  PIN_OTYPE_PUSHPULL(PB02) | \
536  PIN_OTYPE_OPENDRAIN(PB03_FMU_CAP2) | \
537  PIN_OTYPE_OPENDRAIN(PB04_DRDY1_ICM20689) | \
538  PIN_OTYPE_PUSHPULL(PB05_SPI6_MOSI) | \
539  PIN_OTYPE_PUSHPULL(PB06_USART1_TX) | \
540  PIN_OTYPE_PUSHPULL(PB07_USART1_RX) | \
541  PIN_OTYPE_OPENDRAIN(PB08_I2C1_SCL) | \
542  PIN_OTYPE_OPENDRAIN(PB09_I2C1_SDA) | \
543  PIN_OTYPE_OPENDRAIN(PB10_SPI5_RESET) | \
544  PIN_OTYPE_OPENDRAIN(PB11_FMU_CAP3) | \
545  PIN_OTYPE_PUSHPULL(PB12_CAN2_RX) | \
546  PIN_OTYPE_PUSHPULL(PB13_CAN2_TX) | \
547  PIN_OTYPE_OPENDRAIN(PB14_DRDY2_BMI055_GYRO) | \
548  PIN_OTYPE_OPENDRAIN(PB15_DRDY2_BMI055_ACC))
549 
550 #define VAL_GPIOB_OSPEEDR (PIN_OSPEED_SPEED_VERYLOW(PB00_RSSI_IN) | \
551  PIN_OSPEED_SPEED_VERYLOW(PB01_LED1) | \
552  PIN_OSPEED_SPEED_VERYLOW(PB02) | \
553  PIN_OSPEED_SPEED_VERYLOW(PB03_FMU_CAP2) | \
554  PIN_OSPEED_SPEED_VERYLOW(PB04_DRDY1_ICM20689) | \
555  PIN_OSPEED_SPEED_HIGH(PB05_SPI6_MOSI) | \
556  PIN_OSPEED_SPEED_HIGH(PB06_USART1_TX) | \
557  PIN_OSPEED_SPEED_HIGH(PB07_USART1_RX) | \
558  PIN_OSPEED_SPEED_HIGH(PB08_I2C1_SCL) | \
559  PIN_OSPEED_SPEED_HIGH(PB09_I2C1_SDA) | \
560  PIN_OSPEED_SPEED_VERYLOW(PB10_SPI5_RESET) | \
561  PIN_OSPEED_SPEED_VERYLOW(PB11_FMU_CAP3) | \
562  PIN_OSPEED_SPEED_HIGH(PB12_CAN2_RX) | \
563  PIN_OSPEED_SPEED_HIGH(PB13_CAN2_TX) | \
564  PIN_OSPEED_SPEED_VERYLOW(PB14_DRDY2_BMI055_GYRO) | \
565  PIN_OSPEED_SPEED_VERYLOW(PB15_DRDY2_BMI055_ACC))
566 
567 #define VAL_GPIOB_PUPDR (PIN_PUPDR_FLOATING(PB00_RSSI_IN) | \
568  PIN_PUPDR_FLOATING(PB01_LED1) | \
569  PIN_PUPDR_PULLDOWN(PB02) | \
570  PIN_PUPDR_PULLDOWN(PB03_FMU_CAP2) | \
571  PIN_PUPDR_PULLDOWN(PB04_DRDY1_ICM20689) | \
572  PIN_PUPDR_FLOATING(PB05_SPI6_MOSI) | \
573  PIN_PUPDR_FLOATING(PB06_USART1_TX) | \
574  PIN_PUPDR_FLOATING(PB07_USART1_RX) | \
575  PIN_PUPDR_PULLUP(PB08_I2C1_SCL) | \
576  PIN_PUPDR_PULLUP(PB09_I2C1_SDA) | \
577  PIN_PUPDR_PULLDOWN(PB10_SPI5_RESET) | \
578  PIN_PUPDR_PULLDOWN(PB11_FMU_CAP3) | \
579  PIN_PUPDR_FLOATING(PB12_CAN2_RX) | \
580  PIN_PUPDR_FLOATING(PB13_CAN2_TX) | \
581  PIN_PUPDR_PULLDOWN(PB14_DRDY2_BMI055_GYRO) | \
582  PIN_PUPDR_PULLDOWN(PB15_DRDY2_BMI055_ACC))
583 
584 #define VAL_GPIOB_ODR (PIN_ODR_LEVEL_LOW(PB00_RSSI_IN) | \
585  PIN_ODR_LEVEL_LOW(PB01_LED1) | \
586  PIN_ODR_LEVEL_LOW(PB02) | \
587  PIN_ODR_LEVEL_HIGH(PB03_FMU_CAP2) | \
588  PIN_ODR_LEVEL_HIGH(PB04_DRDY1_ICM20689) | \
589  PIN_ODR_LEVEL_HIGH(PB05_SPI6_MOSI) | \
590  PIN_ODR_LEVEL_HIGH(PB06_USART1_TX) | \
591  PIN_ODR_LEVEL_HIGH(PB07_USART1_RX) | \
592  PIN_ODR_LEVEL_HIGH(PB08_I2C1_SCL) | \
593  PIN_ODR_LEVEL_HIGH(PB09_I2C1_SDA) | \
594  PIN_ODR_LEVEL_HIGH(PB10_SPI5_RESET) | \
595  PIN_ODR_LEVEL_HIGH(PB11_FMU_CAP3) | \
596  PIN_ODR_LEVEL_HIGH(PB12_CAN2_RX) | \
597  PIN_ODR_LEVEL_HIGH(PB13_CAN2_TX) | \
598  PIN_ODR_LEVEL_HIGH(PB14_DRDY2_BMI055_GYRO) | \
599  PIN_ODR_LEVEL_HIGH(PB15_DRDY2_BMI055_ACC))
600 
601 #define VAL_GPIOB_AFRL (PIN_AFIO_AF(PB00_RSSI_IN, 0) | \
602  PIN_AFIO_AF(PB01_LED1, 0) | \
603  PIN_AFIO_AF(PB02, 0) | \
604  PIN_AFIO_AF(PB03_FMU_CAP2, 0) | \
605  PIN_AFIO_AF(PB04_DRDY1_ICM20689, 0) | \
606  PIN_AFIO_AF(PB05_SPI6_MOSI, 8) | \
607  PIN_AFIO_AF(PB06_USART1_TX, 7) | \
608  PIN_AFIO_AF(PB07_USART1_RX, 7))
609 
610 #define VAL_GPIOB_AFRH (PIN_AFIO_AF(PB08_I2C1_SCL, 4) | \
611  PIN_AFIO_AF(PB09_I2C1_SDA, 4) | \
612  PIN_AFIO_AF(PB10_SPI5_RESET, 0) | \
613  PIN_AFIO_AF(PB11_FMU_CAP3, 0) | \
614  PIN_AFIO_AF(PB12_CAN2_RX, 9) | \
615  PIN_AFIO_AF(PB13_CAN2_TX, 9) | \
616  PIN_AFIO_AF(PB14_DRDY2_BMI055_GYRO, 0) | \
617  PIN_AFIO_AF(PB15_DRDY2_BMI055_ACC, 0))
618 
619 #define VAL_GPIOC_MODER (PIN_MODE_ANALOG(PC00_SCALED_V5) | \
620  PIN_MODE_ANALOG(PC01_SCALED_3V3_SENSORS) | \
621  PIN_MODE_ANALOG(PC02_HW_VER_SENSE) | \
622  PIN_MODE_ANALOG(PC03_HW_REV_SENSE) | \
623  PIN_MODE_ANALOG(PC04_ADC1_SPARE1) | \
624  PIN_MODE_INPUT(PC05_DRDY4_ICM20602) | \
625  PIN_MODE_OUTPUT(PC06_LED2) | \
626  PIN_MODE_OUTPUT(PC07_LED3) | \
627  PIN_MODE_ALTERNATE(PC08_SDIO_D0) | \
628  PIN_MODE_ALTERNATE(PC09_SDIO_D1) | \
629  PIN_MODE_ALTERNATE(PC10_SDIO_D2) | \
630  PIN_MODE_ALTERNATE(PC11_SDIO_D3) | \
631  PIN_MODE_ALTERNATE(PC12_SDIO_CK) | \
632  PIN_MODE_INPUT(PC13_DRDY5_BMI055_GYRO) | \
633  PIN_MODE_ALTERNATE(PC14_OSC32_IN) | \
634  PIN_MODE_ALTERNATE(PC15_OSC32_OUT))
635 
636 #define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(PC00_SCALED_V5) | \
637  PIN_OTYPE_PUSHPULL(PC01_SCALED_3V3_SENSORS) | \
638  PIN_OTYPE_PUSHPULL(PC02_HW_VER_SENSE) | \
639  PIN_OTYPE_PUSHPULL(PC03_HW_REV_SENSE) | \
640  PIN_OTYPE_PUSHPULL(PC04_ADC1_SPARE1) | \
641  PIN_OTYPE_OPENDRAIN(PC05_DRDY4_ICM20602) | \
642  PIN_OTYPE_PUSHPULL(PC06_LED2) | \
643  PIN_OTYPE_PUSHPULL(PC07_LED3) | \
644  PIN_OTYPE_PUSHPULL(PC08_SDIO_D0) | \
645  PIN_OTYPE_PUSHPULL(PC09_SDIO_D1) | \
646  PIN_OTYPE_PUSHPULL(PC10_SDIO_D2) | \
647  PIN_OTYPE_PUSHPULL(PC11_SDIO_D3) | \
648  PIN_OTYPE_PUSHPULL(PC12_SDIO_CK) | \
649  PIN_OTYPE_OPENDRAIN(PC13_DRDY5_BMI055_GYRO) | \
650  PIN_OTYPE_PUSHPULL(PC14_OSC32_IN) | \
651  PIN_OTYPE_PUSHPULL(PC15_OSC32_OUT))
652 
653 #define VAL_GPIOC_OSPEEDR (PIN_OSPEED_SPEED_VERYLOW(PC00_SCALED_V5) | \
654  PIN_OSPEED_SPEED_VERYLOW(PC01_SCALED_3V3_SENSORS) | \
655  PIN_OSPEED_SPEED_VERYLOW(PC02_HW_VER_SENSE) | \
656  PIN_OSPEED_SPEED_VERYLOW(PC03_HW_REV_SENSE) | \
657  PIN_OSPEED_SPEED_VERYLOW(PC04_ADC1_SPARE1) | \
658  PIN_OSPEED_SPEED_VERYLOW(PC05_DRDY4_ICM20602) | \
659  PIN_OSPEED_SPEED_VERYLOW(PC06_LED2) | \
660  PIN_OSPEED_SPEED_VERYLOW(PC07_LED3) | \
661  PIN_OSPEED_SPEED_HIGH(PC08_SDIO_D0) | \
662  PIN_OSPEED_SPEED_HIGH(PC09_SDIO_D1) | \
663  PIN_OSPEED_SPEED_HIGH(PC10_SDIO_D2) | \
664  PIN_OSPEED_SPEED_HIGH(PC11_SDIO_D3) | \
665  PIN_OSPEED_SPEED_HIGH(PC12_SDIO_CK) | \
666  PIN_OSPEED_SPEED_VERYLOW(PC13_DRDY5_BMI055_GYRO) | \
667  PIN_OSPEED_SPEED_HIGH(PC14_OSC32_IN) | \
668  PIN_OSPEED_SPEED_HIGH(PC15_OSC32_OUT))
669 
670 #define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(PC00_SCALED_V5) | \
671  PIN_PUPDR_FLOATING(PC01_SCALED_3V3_SENSORS) | \
672  PIN_PUPDR_FLOATING(PC02_HW_VER_SENSE) | \
673  PIN_PUPDR_FLOATING(PC03_HW_REV_SENSE) | \
674  PIN_PUPDR_FLOATING(PC04_ADC1_SPARE1) | \
675  PIN_PUPDR_PULLDOWN(PC05_DRDY4_ICM20602) | \
676  PIN_PUPDR_FLOATING(PC06_LED2) | \
677  PIN_PUPDR_FLOATING(PC07_LED3) | \
678  PIN_PUPDR_PULLUP(PC08_SDIO_D0) | \
679  PIN_PUPDR_PULLUP(PC09_SDIO_D1) | \
680  PIN_PUPDR_PULLUP(PC10_SDIO_D2) | \
681  PIN_PUPDR_PULLUP(PC11_SDIO_D3) | \
682  PIN_PUPDR_PULLUP(PC12_SDIO_CK) | \
683  PIN_PUPDR_PULLDOWN(PC13_DRDY5_BMI055_GYRO) | \
684  PIN_PUPDR_FLOATING(PC14_OSC32_IN) | \
685  PIN_PUPDR_FLOATING(PC15_OSC32_OUT))
686 
687 #define VAL_GPIOC_ODR (PIN_ODR_LEVEL_LOW(PC00_SCALED_V5) | \
688  PIN_ODR_LEVEL_LOW(PC01_SCALED_3V3_SENSORS) | \
689  PIN_ODR_LEVEL_LOW(PC02_HW_VER_SENSE) | \
690  PIN_ODR_LEVEL_LOW(PC03_HW_REV_SENSE) | \
691  PIN_ODR_LEVEL_LOW(PC04_ADC1_SPARE1) | \
692  PIN_ODR_LEVEL_HIGH(PC05_DRDY4_ICM20602) | \
693  PIN_ODR_LEVEL_LOW(PC06_LED2) | \
694  PIN_ODR_LEVEL_LOW(PC07_LED3) | \
695  PIN_ODR_LEVEL_HIGH(PC08_SDIO_D0) | \
696  PIN_ODR_LEVEL_HIGH(PC09_SDIO_D1) | \
697  PIN_ODR_LEVEL_HIGH(PC10_SDIO_D2) | \
698  PIN_ODR_LEVEL_HIGH(PC11_SDIO_D3) | \
699  PIN_ODR_LEVEL_HIGH(PC12_SDIO_CK) | \
700  PIN_ODR_LEVEL_HIGH(PC13_DRDY5_BMI055_GYRO) | \
701  PIN_ODR_LEVEL_HIGH(PC14_OSC32_IN) | \
702  PIN_ODR_LEVEL_HIGH(PC15_OSC32_OUT))
703 
704 #define VAL_GPIOC_AFRL (PIN_AFIO_AF(PC00_SCALED_V5, 0) | \
705  PIN_AFIO_AF(PC01_SCALED_3V3_SENSORS, 0) | \
706  PIN_AFIO_AF(PC02_HW_VER_SENSE, 0) | \
707  PIN_AFIO_AF(PC03_HW_REV_SENSE, 0) | \
708  PIN_AFIO_AF(PC04_ADC1_SPARE1, 0) | \
709  PIN_AFIO_AF(PC05_DRDY4_ICM20602, 0) | \
710  PIN_AFIO_AF(PC06_LED2, 0) | \
711  PIN_AFIO_AF(PC07_LED3, 0))
712 
713 #define VAL_GPIOC_AFRH (PIN_AFIO_AF(PC08_SDIO_D0, 12) | \
714  PIN_AFIO_AF(PC09_SDIO_D1, 12) | \
715  PIN_AFIO_AF(PC10_SDIO_D2, 12) | \
716  PIN_AFIO_AF(PC11_SDIO_D3, 12) | \
717  PIN_AFIO_AF(PC12_SDIO_CK, 12) | \
718  PIN_AFIO_AF(PC13_DRDY5_BMI055_GYRO, 0) | \
719  PIN_AFIO_AF(PC14_OSC32_IN, 0) | \
720  PIN_AFIO_AF(PC15_OSC32_OUT, 0))
721 
722 #define VAL_GPIOD_MODER (PIN_MODE_ALTERNATE(PD00_UART4_RX) | \
723  PIN_MODE_ALTERNATE(PD01_UART4_TX) | \
724  PIN_MODE_ALTERNATE(PD02_SDIO_CMD) | \
725  PIN_MODE_INPUT(PD03_UART2_CTS) | \
726  PIN_MODE_INPUT(PD04_UART2_RTS) | \
727  PIN_MODE_ALTERNATE(PD05_UART2_TX) | \
728  PIN_MODE_ALTERNATE(PD06_UART2_RX) | \
729  PIN_MODE_ALTERNATE(PD07_SPI1_MOSI) | \
730  PIN_MODE_ALTERNATE(PD08_UART3_TX) | \
731  PIN_MODE_ALTERNATE(PD09_UART3_RX) | \
732  PIN_MODE_INPUT(PD10_DRDY6_BMI055_ACC) | \
733  PIN_MODE_INPUT(PD11_UART3_CTS) | \
734  PIN_MODE_INPUT(PD12_UART3_RTS) | \
735  PIN_MODE_ALTERNATE(PD13_SERVO5) | \
736  PIN_MODE_ALTERNATE(PD14_SERVO6) | \
737  PIN_MODE_INPUT(PD15_DRDY7_EXTERNAL1))
738 
739 #define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(PD00_UART4_RX) | \
740  PIN_OTYPE_PUSHPULL(PD01_UART4_TX) | \
741  PIN_OTYPE_PUSHPULL(PD02_SDIO_CMD) | \
742  PIN_OTYPE_OPENDRAIN(PD03_UART2_CTS) | \
743  PIN_OTYPE_OPENDRAIN(PD04_UART2_RTS) | \
744  PIN_OTYPE_PUSHPULL(PD05_UART2_TX) | \
745  PIN_OTYPE_PUSHPULL(PD06_UART2_RX) | \
746  PIN_OTYPE_PUSHPULL(PD07_SPI1_MOSI) | \
747  PIN_OTYPE_PUSHPULL(PD08_UART3_TX) | \
748  PIN_OTYPE_PUSHPULL(PD09_UART3_RX) | \
749  PIN_OTYPE_OPENDRAIN(PD10_DRDY6_BMI055_ACC) | \
750  PIN_OTYPE_OPENDRAIN(PD11_UART3_CTS) | \
751  PIN_OTYPE_OPENDRAIN(PD12_UART3_RTS) | \
752  PIN_OTYPE_PUSHPULL(PD13_SERVO5) | \
753  PIN_OTYPE_PUSHPULL(PD14_SERVO6) | \
754  PIN_OTYPE_OPENDRAIN(PD15_DRDY7_EXTERNAL1))
755 
756 #define VAL_GPIOD_OSPEEDR (PIN_OSPEED_SPEED_HIGH(PD00_UART4_RX) | \
757  PIN_OSPEED_SPEED_HIGH(PD01_UART4_TX) | \
758  PIN_OSPEED_SPEED_HIGH(PD02_SDIO_CMD) | \
759  PIN_OSPEED_SPEED_VERYLOW(PD03_UART2_CTS) | \
760  PIN_OSPEED_SPEED_VERYLOW(PD04_UART2_RTS) | \
761  PIN_OSPEED_SPEED_HIGH(PD05_UART2_TX) | \
762  PIN_OSPEED_SPEED_HIGH(PD06_UART2_RX) | \
763  PIN_OSPEED_SPEED_HIGH(PD07_SPI1_MOSI) | \
764  PIN_OSPEED_SPEED_HIGH(PD08_UART3_TX) | \
765  PIN_OSPEED_SPEED_HIGH(PD09_UART3_RX) | \
766  PIN_OSPEED_SPEED_VERYLOW(PD10_DRDY6_BMI055_ACC) | \
767  PIN_OSPEED_SPEED_VERYLOW(PD11_UART3_CTS) | \
768  PIN_OSPEED_SPEED_VERYLOW(PD12_UART3_RTS) | \
769  PIN_OSPEED_SPEED_HIGH(PD13_SERVO5) | \
770  PIN_OSPEED_SPEED_HIGH(PD14_SERVO6) | \
771  PIN_OSPEED_SPEED_VERYLOW(PD15_DRDY7_EXTERNAL1))
772 
773 #define VAL_GPIOD_PUPDR (PIN_PUPDR_FLOATING(PD00_UART4_RX) | \
774  PIN_PUPDR_FLOATING(PD01_UART4_TX) | \
775  PIN_PUPDR_PULLUP(PD02_SDIO_CMD) | \
776  PIN_PUPDR_PULLDOWN(PD03_UART2_CTS) | \
777  PIN_PUPDR_PULLDOWN(PD04_UART2_RTS) | \
778  PIN_PUPDR_FLOATING(PD05_UART2_TX) | \
779  PIN_PUPDR_FLOATING(PD06_UART2_RX) | \
780  PIN_PUPDR_FLOATING(PD07_SPI1_MOSI) | \
781  PIN_PUPDR_FLOATING(PD08_UART3_TX) | \
782  PIN_PUPDR_FLOATING(PD09_UART3_RX) | \
783  PIN_PUPDR_PULLDOWN(PD10_DRDY6_BMI055_ACC) | \
784  PIN_PUPDR_PULLDOWN(PD11_UART3_CTS) | \
785  PIN_PUPDR_PULLDOWN(PD12_UART3_RTS) | \
786  PIN_PUPDR_FLOATING(PD13_SERVO5) | \
787  PIN_PUPDR_FLOATING(PD14_SERVO6) | \
788  PIN_PUPDR_PULLDOWN(PD15_DRDY7_EXTERNAL1))
789 
790 #define VAL_GPIOD_ODR (PIN_ODR_LEVEL_HIGH(PD00_UART4_RX) | \
791  PIN_ODR_LEVEL_HIGH(PD01_UART4_TX) | \
792  PIN_ODR_LEVEL_HIGH(PD02_SDIO_CMD) | \
793  PIN_ODR_LEVEL_HIGH(PD03_UART2_CTS) | \
794  PIN_ODR_LEVEL_HIGH(PD04_UART2_RTS) | \
795  PIN_ODR_LEVEL_HIGH(PD05_UART2_TX) | \
796  PIN_ODR_LEVEL_HIGH(PD06_UART2_RX) | \
797  PIN_ODR_LEVEL_HIGH(PD07_SPI1_MOSI) | \
798  PIN_ODR_LEVEL_HIGH(PD08_UART3_TX) | \
799  PIN_ODR_LEVEL_HIGH(PD09_UART3_RX) | \
800  PIN_ODR_LEVEL_HIGH(PD10_DRDY6_BMI055_ACC) | \
801  PIN_ODR_LEVEL_HIGH(PD11_UART3_CTS) | \
802  PIN_ODR_LEVEL_HIGH(PD12_UART3_RTS) | \
803  PIN_ODR_LEVEL_LOW(PD13_SERVO5) | \
804  PIN_ODR_LEVEL_LOW(PD14_SERVO6) | \
805  PIN_ODR_LEVEL_HIGH(PD15_DRDY7_EXTERNAL1))
806 
807 #define VAL_GPIOD_AFRL (PIN_AFIO_AF(PD00_UART4_RX, 8) | \
808  PIN_AFIO_AF(PD01_UART4_TX, 8) | \
809  PIN_AFIO_AF(PD02_SDIO_CMD, 12) | \
810  PIN_AFIO_AF(PD03_UART2_CTS, 0) | \
811  PIN_AFIO_AF(PD04_UART2_RTS, 0) | \
812  PIN_AFIO_AF(PD05_UART2_TX, 7) | \
813  PIN_AFIO_AF(PD06_UART2_RX, 7) | \
814  PIN_AFIO_AF(PD07_SPI1_MOSI, 5))
815 
816 #define VAL_GPIOD_AFRH (PIN_AFIO_AF(PD08_UART3_TX, 7) | \
817  PIN_AFIO_AF(PD09_UART3_RX, 7) | \
818  PIN_AFIO_AF(PD10_DRDY6_BMI055_ACC, 0) | \
819  PIN_AFIO_AF(PD11_UART3_CTS, 0) | \
820  PIN_AFIO_AF(PD12_UART3_RTS, 0) | \
821  PIN_AFIO_AF(PD13_SERVO5, 2) | \
822  PIN_AFIO_AF(PD14_SERVO6, 2) | \
823  PIN_AFIO_AF(PD15_DRDY7_EXTERNAL1, 0))
824 
825 #define VAL_GPIOE_MODER (PIN_MODE_ALTERNATE(PE00_UART8_RX) | \
826  PIN_MODE_ALTERNATE(PE01_UART8_TX) | \
827  PIN_MODE_ALTERNATE(PE02_SPI4_SCK) | \
828  PIN_MODE_OUTPUT(PE03_V3V3_SENSORS_EN) | \
829  PIN_MODE_OUTPUT(PE04_V3V3_SPEKTRUM_EN) | \
830  PIN_MODE_INPUT(PE05_BUZZER) | \
831  PIN_MODE_ALTERNATE(PE06_SPI4_MOSI) | \
832  PIN_MODE_INPUT(PE07_DRDY8) | \
833  PIN_MODE_ALTERNATE(PE08_UART7_TX) | \
834  PIN_MODE_ALTERNATE(PE09_SERVO4) | \
835  PIN_MODE_INPUT(PE10_SAFETY_SWITCH_IN) | \
836  PIN_MODE_ALTERNATE(PE11_SERVO3) | \
837  PIN_MODE_OUTPUT(PE12_LED4) | \
838  PIN_MODE_ALTERNATE(PE13_SPI4_MISO) | \
839  PIN_MODE_ALTERNATE(PE14_SERVO1) | \
840  PIN_MODE_INPUT(PE15_V5V_PERIPH_OC))
841 
842 #define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(PE00_UART8_RX) | \
843  PIN_OTYPE_PUSHPULL(PE01_UART8_TX) | \
844  PIN_OTYPE_PUSHPULL(PE02_SPI4_SCK) | \
845  PIN_OTYPE_PUSHPULL(PE03_V3V3_SENSORS_EN) | \
846  PIN_OTYPE_PUSHPULL(PE04_V3V3_SPEKTRUM_EN) | \
847  PIN_OTYPE_OPENDRAIN(PE05_BUZZER) | \
848  PIN_OTYPE_PUSHPULL(PE06_SPI4_MOSI) | \
849  PIN_OTYPE_OPENDRAIN(PE07_DRDY8) | \
850  PIN_OTYPE_PUSHPULL(PE08_UART7_TX) | \
851  PIN_OTYPE_PUSHPULL(PE09_SERVO4) | \
852  PIN_OTYPE_OPENDRAIN(PE10_SAFETY_SWITCH_IN) | \
853  PIN_OTYPE_PUSHPULL(PE11_SERVO3) | \
854  PIN_OTYPE_PUSHPULL(PE12_LED4) | \
855  PIN_OTYPE_PUSHPULL(PE13_SPI4_MISO) | \
856  PIN_OTYPE_PUSHPULL(PE14_SERVO1) | \
857  PIN_OTYPE_OPENDRAIN(PE15_V5V_PERIPH_OC))
858 
859 #define VAL_GPIOE_OSPEEDR (PIN_OSPEED_SPEED_HIGH(PE00_UART8_RX) | \
860  PIN_OSPEED_SPEED_HIGH(PE01_UART8_TX) | \
861  PIN_OSPEED_SPEED_HIGH(PE02_SPI4_SCK) | \
862  PIN_OSPEED_SPEED_VERYLOW(PE03_V3V3_SENSORS_EN) | \
863  PIN_OSPEED_SPEED_VERYLOW(PE04_V3V3_SPEKTRUM_EN) | \
864  PIN_OSPEED_SPEED_VERYLOW(PE05_BUZZER) | \
865  PIN_OSPEED_SPEED_HIGH(PE06_SPI4_MOSI) | \
866  PIN_OSPEED_SPEED_VERYLOW(PE07_DRDY8) | \
867  PIN_OSPEED_SPEED_HIGH(PE08_UART7_TX) | \
868  PIN_OSPEED_SPEED_HIGH(PE09_SERVO4) | \
869  PIN_OSPEED_SPEED_VERYLOW(PE10_SAFETY_SWITCH_IN) | \
870  PIN_OSPEED_SPEED_HIGH(PE11_SERVO3) | \
871  PIN_OSPEED_SPEED_VERYLOW(PE12_LED4) | \
872  PIN_OSPEED_SPEED_HIGH(PE13_SPI4_MISO) | \
873  PIN_OSPEED_SPEED_HIGH(PE14_SERVO1) | \
874  PIN_OSPEED_SPEED_VERYLOW(PE15_V5V_PERIPH_OC))
875 
876 #define VAL_GPIOE_PUPDR (PIN_PUPDR_FLOATING(PE00_UART8_RX) | \
877  PIN_PUPDR_FLOATING(PE01_UART8_TX) | \
878  PIN_PUPDR_FLOATING(PE02_SPI4_SCK) | \
879  PIN_PUPDR_FLOATING(PE03_V3V3_SENSORS_EN) | \
880  PIN_PUPDR_FLOATING(PE04_V3V3_SPEKTRUM_EN) | \
881  PIN_PUPDR_PULLDOWN(PE05_BUZZER) | \
882  PIN_PUPDR_FLOATING(PE06_SPI4_MOSI) | \
883  PIN_PUPDR_PULLDOWN(PE07_DRDY8) | \
884  PIN_PUPDR_FLOATING(PE08_UART7_TX) | \
885  PIN_PUPDR_FLOATING(PE09_SERVO4) | \
886  PIN_PUPDR_PULLDOWN(PE10_SAFETY_SWITCH_IN) | \
887  PIN_PUPDR_FLOATING(PE11_SERVO3) | \
888  PIN_PUPDR_FLOATING(PE12_LED4) | \
889  PIN_PUPDR_FLOATING(PE13_SPI4_MISO) | \
890  PIN_PUPDR_FLOATING(PE14_SERVO1) | \
891  PIN_PUPDR_PULLDOWN(PE15_V5V_PERIPH_OC))
892 
893 #define VAL_GPIOE_ODR (PIN_ODR_LEVEL_HIGH(PE00_UART8_RX) | \
894  PIN_ODR_LEVEL_HIGH(PE01_UART8_TX) | \
895  PIN_ODR_LEVEL_HIGH(PE02_SPI4_SCK) | \
896  PIN_ODR_LEVEL_HIGH(PE03_V3V3_SENSORS_EN) | \
897  PIN_ODR_LEVEL_HIGH(PE04_V3V3_SPEKTRUM_EN) | \
898  PIN_ODR_LEVEL_HIGH(PE05_BUZZER) | \
899  PIN_ODR_LEVEL_HIGH(PE06_SPI4_MOSI) | \
900  PIN_ODR_LEVEL_HIGH(PE07_DRDY8) | \
901  PIN_ODR_LEVEL_HIGH(PE08_UART7_TX) | \
902  PIN_ODR_LEVEL_LOW(PE09_SERVO4) | \
903  PIN_ODR_LEVEL_LOW(PE10_SAFETY_SWITCH_IN) | \
904  PIN_ODR_LEVEL_LOW(PE11_SERVO3) | \
905  PIN_ODR_LEVEL_LOW(PE12_LED4) | \
906  PIN_ODR_LEVEL_HIGH(PE13_SPI4_MISO) | \
907  PIN_ODR_LEVEL_LOW(PE14_SERVO1) | \
908  PIN_ODR_LEVEL_HIGH(PE15_V5V_PERIPH_OC))
909 
910 #define VAL_GPIOE_AFRL (PIN_AFIO_AF(PE00_UART8_RX, 8) | \
911  PIN_AFIO_AF(PE01_UART8_TX, 8) | \
912  PIN_AFIO_AF(PE02_SPI4_SCK, 5) | \
913  PIN_AFIO_AF(PE03_V3V3_SENSORS_EN, 0) | \
914  PIN_AFIO_AF(PE04_V3V3_SPEKTRUM_EN, 0) | \
915  PIN_AFIO_AF(PE05_BUZZER, 0) | \
916  PIN_AFIO_AF(PE06_SPI4_MOSI, 5) | \
917  PIN_AFIO_AF(PE07_DRDY8, 0))
918 
919 #define VAL_GPIOE_AFRH (PIN_AFIO_AF(PE08_UART7_TX, 8) | \
920  PIN_AFIO_AF(PE09_SERVO4, 1) | \
921  PIN_AFIO_AF(PE10_SAFETY_SWITCH_IN, 0) | \
922  PIN_AFIO_AF(PE11_SERVO3, 1) | \
923  PIN_AFIO_AF(PE12_LED4, 0) | \
924  PIN_AFIO_AF(PE13_SPI4_MISO, 5) | \
925  PIN_AFIO_AF(PE14_SERVO1, 1) | \
926  PIN_AFIO_AF(PE15_V5V_PERIPH_OC, 0))
927 
928 #define VAL_GPIOF_MODER (PIN_MODE_ALTERNATE(PF00_I2C2_SDA) | \
929  PIN_MODE_ALTERNATE(PF01_I2C2_SCL) | \
930  PIN_MODE_OUTPUT(PF02_SPI_SLAVE0) | \
931  PIN_MODE_OUTPUT(PF03_SPI_SLAVE1) | \
932  PIN_MODE_OUTPUT(PF04_SPI_SLAVE2) | \
933  PIN_MODE_OUTPUT(PF05_SPI_SLAVE3) | \
934  PIN_MODE_ALTERNATE(PF06_UART7_RX) | \
935  PIN_MODE_ALTERNATE(PF07_SPI5_SCK) | \
936  PIN_MODE_ALTERNATE(PF08_SPI5_MISO) | \
937  PIN_MODE_ALTERNATE(PF09_SPI5_MOSI) | \
938  PIN_MODE_OUTPUT(PF10_SPI_SLAVE4) | \
939  PIN_MODE_OUTPUT(PF11_SPI_SLAVE5) | \
940  PIN_MODE_OUTPUT(PF12_V5V_HIPOWER_EN) | \
941  PIN_MODE_INPUT(PF13_V5V_HIPOWER_OC) | \
942  PIN_MODE_ALTERNATE(PF14_I2C4_SCL) | \
943  PIN_MODE_ALTERNATE(PF15_I2C4_SDA))
944 
945 #define VAL_GPIOF_OTYPER (PIN_OTYPE_OPENDRAIN(PF00_I2C2_SDA) | \
946  PIN_OTYPE_OPENDRAIN(PF01_I2C2_SCL) | \
947  PIN_OTYPE_PUSHPULL(PF02_SPI_SLAVE0) | \
948  PIN_OTYPE_PUSHPULL(PF03_SPI_SLAVE1) | \
949  PIN_OTYPE_PUSHPULL(PF04_SPI_SLAVE2) | \
950  PIN_OTYPE_PUSHPULL(PF05_SPI_SLAVE3) | \
951  PIN_OTYPE_PUSHPULL(PF06_UART7_RX) | \
952  PIN_OTYPE_PUSHPULL(PF07_SPI5_SCK) | \
953  PIN_OTYPE_PUSHPULL(PF08_SPI5_MISO) | \
954  PIN_OTYPE_PUSHPULL(PF09_SPI5_MOSI) | \
955  PIN_OTYPE_PUSHPULL(PF10_SPI_SLAVE4) | \
956  PIN_OTYPE_PUSHPULL(PF11_SPI_SLAVE5) | \
957  PIN_OTYPE_PUSHPULL(PF12_V5V_HIPOWER_EN) | \
958  PIN_OTYPE_OPENDRAIN(PF13_V5V_HIPOWER_OC) | \
959  PIN_OTYPE_OPENDRAIN(PF14_I2C4_SCL) | \
960  PIN_OTYPE_OPENDRAIN(PF15_I2C4_SDA))
961 
962 #define VAL_GPIOF_OSPEEDR (PIN_OSPEED_SPEED_HIGH(PF00_I2C2_SDA) | \
963  PIN_OSPEED_SPEED_HIGH(PF01_I2C2_SCL) | \
964  PIN_OSPEED_SPEED_HIGH(PF02_SPI_SLAVE0) | \
965  PIN_OSPEED_SPEED_HIGH(PF03_SPI_SLAVE1) | \
966  PIN_OSPEED_SPEED_HIGH(PF04_SPI_SLAVE2) | \
967  PIN_OSPEED_SPEED_HIGH(PF05_SPI_SLAVE3) | \
968  PIN_OSPEED_SPEED_HIGH(PF06_UART7_RX) | \
969  PIN_OSPEED_SPEED_HIGH(PF07_SPI5_SCK) | \
970  PIN_OSPEED_SPEED_HIGH(PF08_SPI5_MISO) | \
971  PIN_OSPEED_SPEED_HIGH(PF09_SPI5_MOSI) | \
972  PIN_OSPEED_SPEED_HIGH(PF10_SPI_SLAVE4) | \
973  PIN_OSPEED_SPEED_HIGH(PF11_SPI_SLAVE5) | \
974  PIN_OSPEED_SPEED_VERYLOW(PF12_V5V_HIPOWER_EN) | \
975  PIN_OSPEED_SPEED_VERYLOW(PF13_V5V_HIPOWER_OC) | \
976  PIN_OSPEED_SPEED_HIGH(PF14_I2C4_SCL) | \
977  PIN_OSPEED_SPEED_HIGH(PF15_I2C4_SDA))
978 
979 #define VAL_GPIOF_PUPDR (PIN_PUPDR_PULLUP(PF00_I2C2_SDA) | \
980  PIN_PUPDR_PULLUP(PF01_I2C2_SCL) | \
981  PIN_PUPDR_FLOATING(PF02_SPI_SLAVE0) | \
982  PIN_PUPDR_FLOATING(PF03_SPI_SLAVE1) | \
983  PIN_PUPDR_FLOATING(PF04_SPI_SLAVE2) | \
984  PIN_PUPDR_FLOATING(PF05_SPI_SLAVE3) | \
985  PIN_PUPDR_FLOATING(PF06_UART7_RX) | \
986  PIN_PUPDR_FLOATING(PF07_SPI5_SCK) | \
987  PIN_PUPDR_FLOATING(PF08_SPI5_MISO) | \
988  PIN_PUPDR_FLOATING(PF09_SPI5_MOSI) | \
989  PIN_PUPDR_FLOATING(PF10_SPI_SLAVE4) | \
990  PIN_PUPDR_FLOATING(PF11_SPI_SLAVE5) | \
991  PIN_PUPDR_FLOATING(PF12_V5V_HIPOWER_EN) | \
992  PIN_PUPDR_PULLDOWN(PF13_V5V_HIPOWER_OC) | \
993  PIN_PUPDR_PULLUP(PF14_I2C4_SCL) | \
994  PIN_PUPDR_PULLUP(PF15_I2C4_SDA))
995 
996 #define VAL_GPIOF_ODR (PIN_ODR_LEVEL_HIGH(PF00_I2C2_SDA) | \
997  PIN_ODR_LEVEL_HIGH(PF01_I2C2_SCL) | \
998  PIN_ODR_LEVEL_HIGH(PF02_SPI_SLAVE0) | \
999  PIN_ODR_LEVEL_HIGH(PF03_SPI_SLAVE1) | \
1000  PIN_ODR_LEVEL_HIGH(PF04_SPI_SLAVE2) | \
1001  PIN_ODR_LEVEL_HIGH(PF05_SPI_SLAVE3) | \
1002  PIN_ODR_LEVEL_HIGH(PF06_UART7_RX) | \
1003  PIN_ODR_LEVEL_HIGH(PF07_SPI5_SCK) | \
1004  PIN_ODR_LEVEL_HIGH(PF08_SPI5_MISO) | \
1005  PIN_ODR_LEVEL_HIGH(PF09_SPI5_MOSI) | \
1006  PIN_ODR_LEVEL_HIGH(PF10_SPI_SLAVE4) | \
1007  PIN_ODR_LEVEL_HIGH(PF11_SPI_SLAVE5) | \
1008  PIN_ODR_LEVEL_LOW(PF12_V5V_HIPOWER_EN) | \
1009  PIN_ODR_LEVEL_HIGH(PF13_V5V_HIPOWER_OC) | \
1010  PIN_ODR_LEVEL_HIGH(PF14_I2C4_SCL) | \
1011  PIN_ODR_LEVEL_HIGH(PF15_I2C4_SDA))
1012 
1013 #define VAL_GPIOF_AFRL (PIN_AFIO_AF(PF00_I2C2_SDA, 4) | \
1014  PIN_AFIO_AF(PF01_I2C2_SCL, 4) | \
1015  PIN_AFIO_AF(PF02_SPI_SLAVE0, 0) | \
1016  PIN_AFIO_AF(PF03_SPI_SLAVE1, 0) | \
1017  PIN_AFIO_AF(PF04_SPI_SLAVE2, 0) | \
1018  PIN_AFIO_AF(PF05_SPI_SLAVE3, 0) | \
1019  PIN_AFIO_AF(PF06_UART7_RX, 8) | \
1020  PIN_AFIO_AF(PF07_SPI5_SCK, 5))
1021 
1022 #define VAL_GPIOF_AFRH (PIN_AFIO_AF(PF08_SPI5_MISO, 5) | \
1023  PIN_AFIO_AF(PF09_SPI5_MOSI, 5) | \
1024  PIN_AFIO_AF(PF10_SPI_SLAVE4, 0) | \
1025  PIN_AFIO_AF(PF11_SPI_SLAVE5, 0) | \
1026  PIN_AFIO_AF(PF12_V5V_HIPOWER_EN, 0) | \
1027  PIN_AFIO_AF(PF13_V5V_HIPOWER_OC, 0) | \
1028  PIN_AFIO_AF(PF14_I2C4_SCL, 4) | \
1029  PIN_AFIO_AF(PF15_I2C4_SDA, 4))
1030 
1031 #define VAL_GPIOG_MODER (PIN_MODE_OUTPUT(PG00_HW_VER_DRIVE) | \
1032  PIN_MODE_INPUT(PG01_POWER_IN_A) | \
1033  PIN_MODE_INPUT(PG02_POWER_IN_B) | \
1034  PIN_MODE_INPUT(PG03_POWER_IN_C) | \
1035  PIN_MODE_OUTPUT(PG04_V5V_PERIPH_EN) | \
1036  PIN_MODE_OUTPUT(PG05_V5V_RC_EN) | \
1037  PIN_MODE_OUTPUT(PG06_V5V_WIFI_EN) | \
1038  PIN_MODE_OUTPUT(PG07_V3V3_SD_CARD_EN) | \
1039  PIN_MODE_INPUT(PG08_USART6_RTS) | \
1040  PIN_MODE_ALTERNATE(PG09_USART6_RX) | \
1041  PIN_MODE_OUTPUT(PG10_SPI_SLAVE6) | \
1042  PIN_MODE_ALTERNATE(PG11_SPI1_SCK) | \
1043  PIN_MODE_ALTERNATE(PG12_SPI6_MISO) | \
1044  PIN_MODE_ALTERNATE(PG13_SPI6_SCK) | \
1045  PIN_MODE_ALTERNATE(PG14_USART6_TX) | \
1046  PIN_MODE_INPUT(PG15_USART6_CTS))
1047 
1048 #define VAL_GPIOG_OTYPER (PIN_OTYPE_PUSHPULL(PG00_HW_VER_DRIVE) | \
1049  PIN_OTYPE_OPENDRAIN(PG01_POWER_IN_A) | \
1050  PIN_OTYPE_OPENDRAIN(PG02_POWER_IN_B) | \
1051  PIN_OTYPE_OPENDRAIN(PG03_POWER_IN_C) | \
1052  PIN_OTYPE_PUSHPULL(PG04_V5V_PERIPH_EN) | \
1053  PIN_OTYPE_PUSHPULL(PG05_V5V_RC_EN) | \
1054  PIN_OTYPE_PUSHPULL(PG06_V5V_WIFI_EN) | \
1055  PIN_OTYPE_PUSHPULL(PG07_V3V3_SD_CARD_EN) | \
1056  PIN_OTYPE_OPENDRAIN(PG08_USART6_RTS) | \
1057  PIN_OTYPE_PUSHPULL(PG09_USART6_RX) | \
1058  PIN_OTYPE_PUSHPULL(PG10_SPI_SLAVE6) | \
1059  PIN_OTYPE_PUSHPULL(PG11_SPI1_SCK) | \
1060  PIN_OTYPE_PUSHPULL(PG12_SPI6_MISO) | \
1061  PIN_OTYPE_PUSHPULL(PG13_SPI6_SCK) | \
1062  PIN_OTYPE_PUSHPULL(PG14_USART6_TX) | \
1063  PIN_OTYPE_OPENDRAIN(PG15_USART6_CTS))
1064 
1065 #define VAL_GPIOG_OSPEEDR (PIN_OSPEED_SPEED_VERYLOW(PG00_HW_VER_DRIVE) | \
1066  PIN_OSPEED_SPEED_VERYLOW(PG01_POWER_IN_A) | \
1067  PIN_OSPEED_SPEED_VERYLOW(PG02_POWER_IN_B) | \
1068  PIN_OSPEED_SPEED_VERYLOW(PG03_POWER_IN_C) | \
1069  PIN_OSPEED_SPEED_VERYLOW(PG04_V5V_PERIPH_EN) | \
1070  PIN_OSPEED_SPEED_VERYLOW(PG05_V5V_RC_EN) | \
1071  PIN_OSPEED_SPEED_VERYLOW(PG06_V5V_WIFI_EN) | \
1072  PIN_OSPEED_SPEED_VERYLOW(PG07_V3V3_SD_CARD_EN) | \
1073  PIN_OSPEED_SPEED_VERYLOW(PG08_USART6_RTS) | \
1074  PIN_OSPEED_SPEED_HIGH(PG09_USART6_RX) | \
1075  PIN_OSPEED_SPEED_HIGH(PG10_SPI_SLAVE6) | \
1076  PIN_OSPEED_SPEED_HIGH(PG11_SPI1_SCK) | \
1077  PIN_OSPEED_SPEED_HIGH(PG12_SPI6_MISO) | \
1078  PIN_OSPEED_SPEED_HIGH(PG13_SPI6_SCK) | \
1079  PIN_OSPEED_SPEED_HIGH(PG14_USART6_TX) | \
1080  PIN_OSPEED_SPEED_VERYLOW(PG15_USART6_CTS))
1081 
1082 #define VAL_GPIOG_PUPDR (PIN_PUPDR_FLOATING(PG00_HW_VER_DRIVE) | \
1083  PIN_PUPDR_PULLDOWN(PG01_POWER_IN_A) | \
1084  PIN_PUPDR_PULLDOWN(PG02_POWER_IN_B) | \
1085  PIN_PUPDR_PULLDOWN(PG03_POWER_IN_C) | \
1086  PIN_PUPDR_FLOATING(PG04_V5V_PERIPH_EN) | \
1087  PIN_PUPDR_FLOATING(PG05_V5V_RC_EN) | \
1088  PIN_PUPDR_FLOATING(PG06_V5V_WIFI_EN) | \
1089  PIN_PUPDR_FLOATING(PG07_V3V3_SD_CARD_EN) | \
1090  PIN_PUPDR_PULLDOWN(PG08_USART6_RTS) | \
1091  PIN_PUPDR_FLOATING(PG09_USART6_RX) | \
1092  PIN_PUPDR_FLOATING(PG10_SPI_SLAVE6) | \
1093  PIN_PUPDR_FLOATING(PG11_SPI1_SCK) | \
1094  PIN_PUPDR_FLOATING(PG12_SPI6_MISO) | \
1095  PIN_PUPDR_FLOATING(PG13_SPI6_SCK) | \
1096  PIN_PUPDR_FLOATING(PG14_USART6_TX) | \
1097  PIN_PUPDR_PULLDOWN(PG15_USART6_CTS))
1098 
1099 #define VAL_GPIOG_ODR (PIN_ODR_LEVEL_LOW(PG00_HW_VER_DRIVE) | \
1100  PIN_ODR_LEVEL_HIGH(PG01_POWER_IN_A) | \
1101  PIN_ODR_LEVEL_HIGH(PG02_POWER_IN_B) | \
1102  PIN_ODR_LEVEL_HIGH(PG03_POWER_IN_C) | \
1103  PIN_ODR_LEVEL_LOW(PG04_V5V_PERIPH_EN) | \
1104  PIN_ODR_LEVEL_HIGH(PG05_V5V_RC_EN) | \
1105  PIN_ODR_LEVEL_HIGH(PG06_V5V_WIFI_EN) | \
1106  PIN_ODR_LEVEL_HIGH(PG07_V3V3_SD_CARD_EN) | \
1107  PIN_ODR_LEVEL_HIGH(PG08_USART6_RTS) | \
1108  PIN_ODR_LEVEL_HIGH(PG09_USART6_RX) | \
1109  PIN_ODR_LEVEL_HIGH(PG10_SPI_SLAVE6) | \
1110  PIN_ODR_LEVEL_HIGH(PG11_SPI1_SCK) | \
1111  PIN_ODR_LEVEL_HIGH(PG12_SPI6_MISO) | \
1112  PIN_ODR_LEVEL_HIGH(PG13_SPI6_SCK) | \
1113  PIN_ODR_LEVEL_HIGH(PG14_USART6_TX) | \
1114  PIN_ODR_LEVEL_HIGH(PG15_USART6_CTS))
1115 
1116 #define VAL_GPIOG_AFRL (PIN_AFIO_AF(PG00_HW_VER_DRIVE, 0) | \
1117  PIN_AFIO_AF(PG01_POWER_IN_A, 0) | \
1118  PIN_AFIO_AF(PG02_POWER_IN_B, 0) | \
1119  PIN_AFIO_AF(PG03_POWER_IN_C, 0) | \
1120  PIN_AFIO_AF(PG04_V5V_PERIPH_EN, 0) | \
1121  PIN_AFIO_AF(PG05_V5V_RC_EN, 0) | \
1122  PIN_AFIO_AF(PG06_V5V_WIFI_EN, 0) | \
1123  PIN_AFIO_AF(PG07_V3V3_SD_CARD_EN, 0))
1124 
1125 #define VAL_GPIOG_AFRH (PIN_AFIO_AF(PG08_USART6_RTS, 0) | \
1126  PIN_AFIO_AF(PG09_USART6_RX, 8) | \
1127  PIN_AFIO_AF(PG10_SPI_SLAVE6, 0) | \
1128  PIN_AFIO_AF(PG11_SPI1_SCK, 5) | \
1129  PIN_AFIO_AF(PG12_SPI6_MISO, 5) | \
1130  PIN_AFIO_AF(PG13_SPI6_SCK, 5) | \
1131  PIN_AFIO_AF(PG14_USART6_TX, 8) | \
1132  PIN_AFIO_AF(PG15_USART6_CTS, 0))
1133 
1134 #define VAL_GPIOH_MODER (PIN_MODE_ALTERNATE(PH00_OSC_IN) | \
1135  PIN_MODE_ALTERNATE(PH01_OSC_OUT) | \
1136  PIN_MODE_OUTPUT(PH02_CAN1_SILENT_S0) | \
1137  PIN_MODE_OUTPUT(PH03_CAN2_SILENT_S1) | \
1138  PIN_MODE_OUTPUT(PH04_CAN3_SILENT_S2) | \
1139  PIN_MODE_OUTPUT(PH05_SPI_SLAVE7) | \
1140  PIN_MODE_ALTERNATE(PH06_SERVO7) | \
1141  PIN_MODE_ALTERNATE(PH07_I2C3_SCL) | \
1142  PIN_MODE_ALTERNATE(PH08_I2C3_SDA) | \
1143  PIN_MODE_ALTERNATE(PH09_SERVO8) | \
1144  PIN_MODE_OUTPUT(PH10_LED5) | \
1145  PIN_MODE_OUTPUT(PH11_LED6) | \
1146  PIN_MODE_OUTPUT(PH12_LED7) | \
1147  PIN_MODE_ALTERNATE(PH13_CAN1_TX) | \
1148  PIN_MODE_OUTPUT(PH14_HW_REV_DRIVE) | \
1149  PIN_MODE_INPUT(PH15_SPI5_SYNC))
1150 
1151 #define VAL_GPIOH_OTYPER (PIN_OTYPE_PUSHPULL(PH00_OSC_IN) | \
1152  PIN_OTYPE_PUSHPULL(PH01_OSC_OUT) | \
1153  PIN_OTYPE_PUSHPULL(PH02_CAN1_SILENT_S0) | \
1154  PIN_OTYPE_PUSHPULL(PH03_CAN2_SILENT_S1) | \
1155  PIN_OTYPE_PUSHPULL(PH04_CAN3_SILENT_S2) | \
1156  PIN_OTYPE_PUSHPULL(PH05_SPI_SLAVE7) | \
1157  PIN_OTYPE_PUSHPULL(PH06_SERVO7) | \
1158  PIN_OTYPE_OPENDRAIN(PH07_I2C3_SCL) | \
1159  PIN_OTYPE_OPENDRAIN(PH08_I2C3_SDA) | \
1160  PIN_OTYPE_PUSHPULL(PH09_SERVO8) | \
1161  PIN_OTYPE_PUSHPULL(PH10_LED5) | \
1162  PIN_OTYPE_PUSHPULL(PH11_LED6) | \
1163  PIN_OTYPE_PUSHPULL(PH12_LED7) | \
1164  PIN_OTYPE_PUSHPULL(PH13_CAN1_TX) | \
1165  PIN_OTYPE_PUSHPULL(PH14_HW_REV_DRIVE) | \
1166  PIN_OTYPE_OPENDRAIN(PH15_SPI5_SYNC))
1167 
1168 #define VAL_GPIOH_OSPEEDR (PIN_OSPEED_SPEED_HIGH(PH00_OSC_IN) | \
1169  PIN_OSPEED_SPEED_HIGH(PH01_OSC_OUT) | \
1170  PIN_OSPEED_SPEED_VERYLOW(PH02_CAN1_SILENT_S0) | \
1171  PIN_OSPEED_SPEED_VERYLOW(PH03_CAN2_SILENT_S1) | \
1172  PIN_OSPEED_SPEED_VERYLOW(PH04_CAN3_SILENT_S2) | \
1173  PIN_OSPEED_SPEED_HIGH(PH05_SPI_SLAVE7) | \
1174  PIN_OSPEED_SPEED_HIGH(PH06_SERVO7) | \
1175  PIN_OSPEED_SPEED_HIGH(PH07_I2C3_SCL) | \
1176  PIN_OSPEED_SPEED_HIGH(PH08_I2C3_SDA) | \
1177  PIN_OSPEED_SPEED_HIGH(PH09_SERVO8) | \
1178  PIN_OSPEED_SPEED_VERYLOW(PH10_LED5) | \
1179  PIN_OSPEED_SPEED_VERYLOW(PH11_LED6) | \
1180  PIN_OSPEED_SPEED_VERYLOW(PH12_LED7) | \
1181  PIN_OSPEED_SPEED_HIGH(PH13_CAN1_TX) | \
1182  PIN_OSPEED_SPEED_VERYLOW(PH14_HW_REV_DRIVE) | \
1183  PIN_OSPEED_SPEED_VERYLOW(PH15_SPI5_SYNC))
1184 
1185 #define VAL_GPIOH_PUPDR (PIN_PUPDR_FLOATING(PH00_OSC_IN) | \
1186  PIN_PUPDR_FLOATING(PH01_OSC_OUT) | \
1187  PIN_PUPDR_FLOATING(PH02_CAN1_SILENT_S0) | \
1188  PIN_PUPDR_FLOATING(PH03_CAN2_SILENT_S1) | \
1189  PIN_PUPDR_FLOATING(PH04_CAN3_SILENT_S2) | \
1190  PIN_PUPDR_FLOATING(PH05_SPI_SLAVE7) | \
1191  PIN_PUPDR_FLOATING(PH06_SERVO7) | \
1192  PIN_PUPDR_PULLUP(PH07_I2C3_SCL) | \
1193  PIN_PUPDR_PULLUP(PH08_I2C3_SDA) | \
1194  PIN_PUPDR_FLOATING(PH09_SERVO8) | \
1195  PIN_PUPDR_FLOATING(PH10_LED5) | \
1196  PIN_PUPDR_FLOATING(PH11_LED6) | \
1197  PIN_PUPDR_FLOATING(PH12_LED7) | \
1198  PIN_PUPDR_FLOATING(PH13_CAN1_TX) | \
1199  PIN_PUPDR_FLOATING(PH14_HW_REV_DRIVE) | \
1200  PIN_PUPDR_PULLDOWN(PH15_SPI5_SYNC))
1201 
1202 #define VAL_GPIOH_ODR (PIN_ODR_LEVEL_HIGH(PH00_OSC_IN) | \
1203  PIN_ODR_LEVEL_HIGH(PH01_OSC_OUT) | \
1204  PIN_ODR_LEVEL_LOW(PH02_CAN1_SILENT_S0) | \
1205  PIN_ODR_LEVEL_LOW(PH03_CAN2_SILENT_S1) | \
1206  PIN_ODR_LEVEL_LOW(PH04_CAN3_SILENT_S2) | \
1207  PIN_ODR_LEVEL_HIGH(PH05_SPI_SLAVE7) | \
1208  PIN_ODR_LEVEL_LOW(PH06_SERVO7) | \
1209  PIN_ODR_LEVEL_HIGH(PH07_I2C3_SCL) | \
1210  PIN_ODR_LEVEL_HIGH(PH08_I2C3_SDA) | \
1211  PIN_ODR_LEVEL_LOW(PH09_SERVO8) | \
1212  PIN_ODR_LEVEL_LOW(PH10_LED5) | \
1213  PIN_ODR_LEVEL_LOW(PH11_LED6) | \
1214  PIN_ODR_LEVEL_LOW(PH12_LED7) | \
1215  PIN_ODR_LEVEL_HIGH(PH13_CAN1_TX) | \
1216  PIN_ODR_LEVEL_LOW(PH14_HW_REV_DRIVE) | \
1217  PIN_ODR_LEVEL_HIGH(PH15_SPI5_SYNC))
1218 
1219 #define VAL_GPIOH_AFRL (PIN_AFIO_AF(PH00_OSC_IN, 0) | \
1220  PIN_AFIO_AF(PH01_OSC_OUT, 0) | \
1221  PIN_AFIO_AF(PH02_CAN1_SILENT_S0, 0) | \
1222  PIN_AFIO_AF(PH03_CAN2_SILENT_S1, 0) | \
1223  PIN_AFIO_AF(PH04_CAN3_SILENT_S2, 0) | \
1224  PIN_AFIO_AF(PH05_SPI_SLAVE7, 0) | \
1225  PIN_AFIO_AF(PH06_SERVO7, 9) | \
1226  PIN_AFIO_AF(PH07_I2C3_SCL, 4))
1227 
1228 #define VAL_GPIOH_AFRH (PIN_AFIO_AF(PH08_I2C3_SDA, 4) | \
1229  PIN_AFIO_AF(PH09_SERVO8, 9) | \
1230  PIN_AFIO_AF(PH10_LED5, 0) | \
1231  PIN_AFIO_AF(PH11_LED6, 0) | \
1232  PIN_AFIO_AF(PH12_LED7, 0) | \
1233  PIN_AFIO_AF(PH13_CAN1_TX, 9) | \
1234  PIN_AFIO_AF(PH14_HW_REV_DRIVE, 0) | \
1235  PIN_AFIO_AF(PH15_SPI5_SYNC, 0))
1236 
1237 #define VAL_GPIOI_MODER (PIN_MODE_OUTPUT(PI00_ARMED) | \
1238  PIN_MODE_ALTERNATE(PI01_SPI2_SCK) | \
1239  PIN_MODE_ALTERNATE(PI02_SPI2_MISO) | \
1240  PIN_MODE_ALTERNATE(PI03_SPI2_MOSI) | \
1241  PIN_MODE_OUTPUT(PI04_SPI_SLAVE8) | \
1242  PIN_MODE_INPUT(PI05_RC_INPUT) | \
1243  PIN_MODE_OUTPUT(PI06_SPI_SLAVE9) | \
1244  PIN_MODE_OUTPUT(PI07_SPI_SLAVE10) | \
1245  PIN_MODE_OUTPUT(PI08_SPI_SLAVE11) | \
1246  PIN_MODE_ALTERNATE(PI09_CAN1_RX) | \
1247  PIN_MODE_OUTPUT(PI10_SPI_SLAVE12) | \
1248  PIN_MODE_OUTPUT(PI11_SPI_SLAVE13) | \
1249  PIN_MODE_INPUT(PI12) | \
1250  PIN_MODE_INPUT(PI13) | \
1251  PIN_MODE_INPUT(PI14) | \
1252  PIN_MODE_INPUT(PI15))
1253 
1254 #define VAL_GPIOI_OTYPER (PIN_OTYPE_PUSHPULL(PI00_ARMED) | \
1255  PIN_OTYPE_PUSHPULL(PI01_SPI2_SCK) | \
1256  PIN_OTYPE_PUSHPULL(PI02_SPI2_MISO) | \
1257  PIN_OTYPE_PUSHPULL(PI03_SPI2_MOSI) | \
1258  PIN_OTYPE_PUSHPULL(PI04_SPI_SLAVE8) | \
1259  PIN_OTYPE_OPENDRAIN(PI05_RC_INPUT) | \
1260  PIN_OTYPE_PUSHPULL(PI06_SPI_SLAVE9) | \
1261  PIN_OTYPE_PUSHPULL(PI07_SPI_SLAVE10) | \
1262  PIN_OTYPE_PUSHPULL(PI08_SPI_SLAVE11) | \
1263  PIN_OTYPE_PUSHPULL(PI09_CAN1_RX) | \
1264  PIN_OTYPE_PUSHPULL(PI10_SPI_SLAVE12) | \
1265  PIN_OTYPE_PUSHPULL(PI11_SPI_SLAVE13) | \
1266  PIN_OTYPE_PUSHPULL(PI12) | \
1267  PIN_OTYPE_PUSHPULL(PI13) | \
1268  PIN_OTYPE_PUSHPULL(PI14) | \
1269  PIN_OTYPE_PUSHPULL(PI15))
1270 
1271 #define VAL_GPIOI_OSPEEDR (PIN_OSPEED_SPEED_VERYLOW(PI00_ARMED) | \
1272  PIN_OSPEED_SPEED_HIGH(PI01_SPI2_SCK) | \
1273  PIN_OSPEED_SPEED_HIGH(PI02_SPI2_MISO) | \
1274  PIN_OSPEED_SPEED_HIGH(PI03_SPI2_MOSI) | \
1275  PIN_OSPEED_SPEED_HIGH(PI04_SPI_SLAVE8) | \
1276  PIN_OSPEED_SPEED_VERYLOW(PI05_RC_INPUT) | \
1277  PIN_OSPEED_SPEED_HIGH(PI06_SPI_SLAVE9) | \
1278  PIN_OSPEED_SPEED_HIGH(PI07_SPI_SLAVE10) | \
1279  PIN_OSPEED_SPEED_HIGH(PI08_SPI_SLAVE11) | \
1280  PIN_OSPEED_SPEED_HIGH(PI09_CAN1_RX) | \
1281  PIN_OSPEED_SPEED_HIGH(PI10_SPI_SLAVE12) | \
1282  PIN_OSPEED_SPEED_HIGH(PI11_SPI_SLAVE13) | \
1283  PIN_OSPEED_SPEED_VERYLOW(PI12) | \
1284  PIN_OSPEED_SPEED_VERYLOW(PI13) | \
1285  PIN_OSPEED_SPEED_VERYLOW(PI14) | \
1286  PIN_OSPEED_SPEED_VERYLOW(PI15))
1287 
1288 #define VAL_GPIOI_PUPDR (PIN_PUPDR_FLOATING(PI00_ARMED) | \
1289  PIN_PUPDR_FLOATING(PI01_SPI2_SCK) | \
1290  PIN_PUPDR_FLOATING(PI02_SPI2_MISO) | \
1291  PIN_PUPDR_FLOATING(PI03_SPI2_MOSI) | \
1292  PIN_PUPDR_FLOATING(PI04_SPI_SLAVE8) | \
1293  PIN_PUPDR_PULLDOWN(PI05_RC_INPUT) | \
1294  PIN_PUPDR_FLOATING(PI06_SPI_SLAVE9) | \
1295  PIN_PUPDR_FLOATING(PI07_SPI_SLAVE10) | \
1296  PIN_PUPDR_FLOATING(PI08_SPI_SLAVE11) | \
1297  PIN_PUPDR_FLOATING(PI09_CAN1_RX) | \
1298  PIN_PUPDR_FLOATING(PI10_SPI_SLAVE12) | \
1299  PIN_PUPDR_FLOATING(PI11_SPI_SLAVE13) | \
1300  PIN_PUPDR_PULLDOWN(PI12) | \
1301  PIN_PUPDR_PULLDOWN(PI13) | \
1302  PIN_PUPDR_PULLDOWN(PI14) | \
1303  PIN_PUPDR_PULLDOWN(PI15))
1304 
1305 #define VAL_GPIOI_ODR (PIN_ODR_LEVEL_LOW(PI00_ARMED) | \
1306  PIN_ODR_LEVEL_HIGH(PI01_SPI2_SCK) | \
1307  PIN_ODR_LEVEL_HIGH(PI02_SPI2_MISO) | \
1308  PIN_ODR_LEVEL_HIGH(PI03_SPI2_MOSI) | \
1309  PIN_ODR_LEVEL_HIGH(PI04_SPI_SLAVE8) | \
1310  PIN_ODR_LEVEL_HIGH(PI05_RC_INPUT) | \
1311  PIN_ODR_LEVEL_HIGH(PI06_SPI_SLAVE9) | \
1312  PIN_ODR_LEVEL_HIGH(PI07_SPI_SLAVE10) | \
1313  PIN_ODR_LEVEL_HIGH(PI08_SPI_SLAVE11) | \
1314  PIN_ODR_LEVEL_HIGH(PI09_CAN1_RX) | \
1315  PIN_ODR_LEVEL_HIGH(PI10_SPI_SLAVE12) | \
1316  PIN_ODR_LEVEL_HIGH(PI11_SPI_SLAVE13) | \
1317  PIN_ODR_LEVEL_LOW(PI12) | \
1318  PIN_ODR_LEVEL_LOW(PI13) | \
1319  PIN_ODR_LEVEL_LOW(PI14) | \
1320  PIN_ODR_LEVEL_LOW(PI15))
1321 
1322 #define VAL_GPIOI_AFRL (PIN_AFIO_AF(PI00_ARMED, 0) | \
1323  PIN_AFIO_AF(PI01_SPI2_SCK, 5) | \
1324  PIN_AFIO_AF(PI02_SPI2_MISO, 5) | \
1325  PIN_AFIO_AF(PI03_SPI2_MOSI, 5) | \
1326  PIN_AFIO_AF(PI04_SPI_SLAVE8, 0) | \
1327  PIN_AFIO_AF(PI05_RC_INPUT, 0) | \
1328  PIN_AFIO_AF(PI06_SPI_SLAVE9, 0) | \
1329  PIN_AFIO_AF(PI07_SPI_SLAVE10, 0))
1330 
1331 #define VAL_GPIOI_AFRH (PIN_AFIO_AF(PI08_SPI_SLAVE11, 0) | \
1332  PIN_AFIO_AF(PI09_CAN1_RX, 9) | \
1333  PIN_AFIO_AF(PI10_SPI_SLAVE12, 0) | \
1334  PIN_AFIO_AF(PI11_SPI_SLAVE13, 0) | \
1335  PIN_AFIO_AF(PI12, 0) | \
1336  PIN_AFIO_AF(PI13, 0) | \
1337  PIN_AFIO_AF(PI14, 0) | \
1338  PIN_AFIO_AF(PI15, 0))
1339 
1340 #define VAL_GPIOJ_MODER (PIN_MODE_INPUT(PJ00) | \
1341  PIN_MODE_INPUT(PJ01) | \
1342  PIN_MODE_INPUT(PJ02) | \
1343  PIN_MODE_INPUT(PJ03) | \
1344  PIN_MODE_INPUT(PJ04) | \
1345  PIN_MODE_INPUT(PJ05) | \
1346  PIN_MODE_INPUT(PJ06) | \
1347  PIN_MODE_INPUT(PJ07) | \
1348  PIN_MODE_INPUT(PJ08) | \
1349  PIN_MODE_INPUT(PJ09) | \
1350  PIN_MODE_INPUT(PJ10) | \
1351  PIN_MODE_INPUT(PJ11) | \
1352  PIN_MODE_INPUT(PJ12) | \
1353  PIN_MODE_INPUT(PJ13) | \
1354  PIN_MODE_INPUT(PJ14) | \
1355  PIN_MODE_INPUT(PJ15))
1356 
1357 #define VAL_GPIOJ_OTYPER (PIN_OTYPE_PUSHPULL(PJ00) | \
1358  PIN_OTYPE_PUSHPULL(PJ01) | \
1359  PIN_OTYPE_PUSHPULL(PJ02) | \
1360  PIN_OTYPE_PUSHPULL(PJ03) | \
1361  PIN_OTYPE_PUSHPULL(PJ04) | \
1362  PIN_OTYPE_PUSHPULL(PJ05) | \
1363  PIN_OTYPE_PUSHPULL(PJ06) | \
1364  PIN_OTYPE_PUSHPULL(PJ07) | \
1365  PIN_OTYPE_PUSHPULL(PJ08) | \
1366  PIN_OTYPE_PUSHPULL(PJ09) | \
1367  PIN_OTYPE_PUSHPULL(PJ10) | \
1368  PIN_OTYPE_PUSHPULL(PJ11) | \
1369  PIN_OTYPE_PUSHPULL(PJ12) | \
1370  PIN_OTYPE_PUSHPULL(PJ13) | \
1371  PIN_OTYPE_PUSHPULL(PJ14) | \
1372  PIN_OTYPE_PUSHPULL(PJ15))
1373 
1374 #define VAL_GPIOJ_OSPEEDR (PIN_OSPEED_SPEED_VERYLOW(PJ00) | \
1375  PIN_OSPEED_SPEED_VERYLOW(PJ01) | \
1376  PIN_OSPEED_SPEED_VERYLOW(PJ02) | \
1377  PIN_OSPEED_SPEED_VERYLOW(PJ03) | \
1378  PIN_OSPEED_SPEED_VERYLOW(PJ04) | \
1379  PIN_OSPEED_SPEED_VERYLOW(PJ05) | \
1380  PIN_OSPEED_SPEED_VERYLOW(PJ06) | \
1381  PIN_OSPEED_SPEED_VERYLOW(PJ07) | \
1382  PIN_OSPEED_SPEED_VERYLOW(PJ08) | \
1383  PIN_OSPEED_SPEED_VERYLOW(PJ09) | \
1384  PIN_OSPEED_SPEED_VERYLOW(PJ10) | \
1385  PIN_OSPEED_SPEED_VERYLOW(PJ11) | \
1386  PIN_OSPEED_SPEED_VERYLOW(PJ12) | \
1387  PIN_OSPEED_SPEED_VERYLOW(PJ13) | \
1388  PIN_OSPEED_SPEED_VERYLOW(PJ14) | \
1389  PIN_OSPEED_SPEED_VERYLOW(PJ15))
1390 
1391 #define VAL_GPIOJ_PUPDR (PIN_PUPDR_PULLDOWN(PJ00) | \
1392  PIN_PUPDR_PULLDOWN(PJ01) | \
1393  PIN_PUPDR_PULLDOWN(PJ02) | \
1394  PIN_PUPDR_PULLDOWN(PJ03) | \
1395  PIN_PUPDR_PULLDOWN(PJ04) | \
1396  PIN_PUPDR_PULLDOWN(PJ05) | \
1397  PIN_PUPDR_PULLDOWN(PJ06) | \
1398  PIN_PUPDR_PULLDOWN(PJ07) | \
1399  PIN_PUPDR_PULLDOWN(PJ08) | \
1400  PIN_PUPDR_PULLDOWN(PJ09) | \
1401  PIN_PUPDR_PULLDOWN(PJ10) | \
1402  PIN_PUPDR_PULLDOWN(PJ11) | \
1403  PIN_PUPDR_PULLDOWN(PJ12) | \
1404  PIN_PUPDR_PULLDOWN(PJ13) | \
1405  PIN_PUPDR_PULLDOWN(PJ14) | \
1406  PIN_PUPDR_PULLDOWN(PJ15))
1407 
1408 #define VAL_GPIOJ_ODR (PIN_ODR_LEVEL_LOW(PJ00) | \
1409  PIN_ODR_LEVEL_LOW(PJ01) | \
1410  PIN_ODR_LEVEL_LOW(PJ02) | \
1411  PIN_ODR_LEVEL_LOW(PJ03) | \
1412  PIN_ODR_LEVEL_LOW(PJ04) | \
1413  PIN_ODR_LEVEL_LOW(PJ05) | \
1414  PIN_ODR_LEVEL_LOW(PJ06) | \
1415  PIN_ODR_LEVEL_LOW(PJ07) | \
1416  PIN_ODR_LEVEL_LOW(PJ08) | \
1417  PIN_ODR_LEVEL_LOW(PJ09) | \
1418  PIN_ODR_LEVEL_LOW(PJ10) | \
1419  PIN_ODR_LEVEL_LOW(PJ11) | \
1420  PIN_ODR_LEVEL_LOW(PJ12) | \
1421  PIN_ODR_LEVEL_LOW(PJ13) | \
1422  PIN_ODR_LEVEL_LOW(PJ14) | \
1423  PIN_ODR_LEVEL_LOW(PJ15))
1424 
1425 #define VAL_GPIOJ_AFRL (PIN_AFIO_AF(PJ00, 0) | \
1426  PIN_AFIO_AF(PJ01, 0) | \
1427  PIN_AFIO_AF(PJ02, 0) | \
1428  PIN_AFIO_AF(PJ03, 0) | \
1429  PIN_AFIO_AF(PJ04, 0) | \
1430  PIN_AFIO_AF(PJ05, 0) | \
1431  PIN_AFIO_AF(PJ06, 0) | \
1432  PIN_AFIO_AF(PJ07, 0))
1433 
1434 #define VAL_GPIOJ_AFRH (PIN_AFIO_AF(PJ08, 0) | \
1435  PIN_AFIO_AF(PJ09, 0) | \
1436  PIN_AFIO_AF(PJ10, 0) | \
1437  PIN_AFIO_AF(PJ11, 0) | \
1438  PIN_AFIO_AF(PJ12, 0) | \
1439  PIN_AFIO_AF(PJ13, 0) | \
1440  PIN_AFIO_AF(PJ14, 0) | \
1441  PIN_AFIO_AF(PJ15, 0))
1442 
1443 #define VAL_GPIOK_MODER (PIN_MODE_INPUT(PK00) | \
1444  PIN_MODE_INPUT(PK01) | \
1445  PIN_MODE_INPUT(PK02) | \
1446  PIN_MODE_INPUT(PK03) | \
1447  PIN_MODE_INPUT(PK04) | \
1448  PIN_MODE_INPUT(PK05) | \
1449  PIN_MODE_INPUT(PK06) | \
1450  PIN_MODE_INPUT(PK07) | \
1451  PIN_MODE_INPUT(PK08) | \
1452  PIN_MODE_INPUT(PK09) | \
1453  PIN_MODE_INPUT(PK10) | \
1454  PIN_MODE_INPUT(PK11) | \
1455  PIN_MODE_INPUT(PK12) | \
1456  PIN_MODE_INPUT(PK13) | \
1457  PIN_MODE_INPUT(PK14) | \
1458  PIN_MODE_INPUT(PK15))
1459 
1460 #define VAL_GPIOK_OTYPER (PIN_OTYPE_PUSHPULL(PK00) | \
1461  PIN_OTYPE_PUSHPULL(PK01) | \
1462  PIN_OTYPE_PUSHPULL(PK02) | \
1463  PIN_OTYPE_PUSHPULL(PK03) | \
1464  PIN_OTYPE_PUSHPULL(PK04) | \
1465  PIN_OTYPE_PUSHPULL(PK05) | \
1466  PIN_OTYPE_PUSHPULL(PK06) | \
1467  PIN_OTYPE_PUSHPULL(PK07) | \
1468  PIN_OTYPE_PUSHPULL(PK08) | \
1469  PIN_OTYPE_PUSHPULL(PK09) | \
1470  PIN_OTYPE_PUSHPULL(PK10) | \
1471  PIN_OTYPE_PUSHPULL(PK11) | \
1472  PIN_OTYPE_PUSHPULL(PK12) | \
1473  PIN_OTYPE_PUSHPULL(PK13) | \
1474  PIN_OTYPE_PUSHPULL(PK14) | \
1475  PIN_OTYPE_PUSHPULL(PK15))
1476 
1477 #define VAL_GPIOK_OSPEEDR (PIN_OSPEED_SPEED_VERYLOW(PK00) | \
1478  PIN_OSPEED_SPEED_VERYLOW(PK01) | \
1479  PIN_OSPEED_SPEED_VERYLOW(PK02) | \
1480  PIN_OSPEED_SPEED_VERYLOW(PK03) | \
1481  PIN_OSPEED_SPEED_VERYLOW(PK04) | \
1482  PIN_OSPEED_SPEED_VERYLOW(PK05) | \
1483  PIN_OSPEED_SPEED_VERYLOW(PK06) | \
1484  PIN_OSPEED_SPEED_VERYLOW(PK07) | \
1485  PIN_OSPEED_SPEED_VERYLOW(PK08) | \
1486  PIN_OSPEED_SPEED_VERYLOW(PK09) | \
1487  PIN_OSPEED_SPEED_VERYLOW(PK10) | \
1488  PIN_OSPEED_SPEED_VERYLOW(PK11) | \
1489  PIN_OSPEED_SPEED_VERYLOW(PK12) | \
1490  PIN_OSPEED_SPEED_VERYLOW(PK13) | \
1491  PIN_OSPEED_SPEED_VERYLOW(PK14) | \
1492  PIN_OSPEED_SPEED_VERYLOW(PK15))
1493 
1494 #define VAL_GPIOK_PUPDR (PIN_PUPDR_PULLDOWN(PK00) | \
1495  PIN_PUPDR_PULLDOWN(PK01) | \
1496  PIN_PUPDR_PULLDOWN(PK02) | \
1497  PIN_PUPDR_PULLDOWN(PK03) | \
1498  PIN_PUPDR_PULLDOWN(PK04) | \
1499  PIN_PUPDR_PULLDOWN(PK05) | \
1500  PIN_PUPDR_PULLDOWN(PK06) | \
1501  PIN_PUPDR_PULLDOWN(PK07) | \
1502  PIN_PUPDR_PULLDOWN(PK08) | \
1503  PIN_PUPDR_PULLDOWN(PK09) | \
1504  PIN_PUPDR_PULLDOWN(PK10) | \
1505  PIN_PUPDR_PULLDOWN(PK11) | \
1506  PIN_PUPDR_PULLDOWN(PK12) | \
1507  PIN_PUPDR_PULLDOWN(PK13) | \
1508  PIN_PUPDR_PULLDOWN(PK14) | \
1509  PIN_PUPDR_PULLDOWN(PK15))
1510 
1511 #define VAL_GPIOK_ODR (PIN_ODR_LEVEL_LOW(PK00) | \
1512  PIN_ODR_LEVEL_LOW(PK01) | \
1513  PIN_ODR_LEVEL_LOW(PK02) | \
1514  PIN_ODR_LEVEL_LOW(PK03) | \
1515  PIN_ODR_LEVEL_LOW(PK04) | \
1516  PIN_ODR_LEVEL_LOW(PK05) | \
1517  PIN_ODR_LEVEL_LOW(PK06) | \
1518  PIN_ODR_LEVEL_LOW(PK07) | \
1519  PIN_ODR_LEVEL_LOW(PK08) | \
1520  PIN_ODR_LEVEL_LOW(PK09) | \
1521  PIN_ODR_LEVEL_LOW(PK10) | \
1522  PIN_ODR_LEVEL_LOW(PK11) | \
1523  PIN_ODR_LEVEL_LOW(PK12) | \
1524  PIN_ODR_LEVEL_LOW(PK13) | \
1525  PIN_ODR_LEVEL_LOW(PK14) | \
1526  PIN_ODR_LEVEL_LOW(PK15))
1527 
1528 #define VAL_GPIOK_AFRL (PIN_AFIO_AF(PK00, 0) | \
1529  PIN_AFIO_AF(PK01, 0) | \
1530  PIN_AFIO_AF(PK02, 0) | \
1531  PIN_AFIO_AF(PK03, 0) | \
1532  PIN_AFIO_AF(PK04, 0) | \
1533  PIN_AFIO_AF(PK05, 0) | \
1534  PIN_AFIO_AF(PK06, 0) | \
1535  PIN_AFIO_AF(PK07, 0))
1536 
1537 #define VAL_GPIOK_AFRH (PIN_AFIO_AF(PK08, 0) | \
1538  PIN_AFIO_AF(PK09, 0) | \
1539  PIN_AFIO_AF(PK10, 0) | \
1540  PIN_AFIO_AF(PK11, 0) | \
1541  PIN_AFIO_AF(PK12, 0) | \
1542  PIN_AFIO_AF(PK13, 0) | \
1543  PIN_AFIO_AF(PK14, 0) | \
1544  PIN_AFIO_AF(PK15, 0))
1545 
1546 #define AF_PA06_SPI1_MISO 5U
1547 #define AF_LINE_SPI1_MISO 5U
1548 #define AF_PA08_CAN3_RX 11U
1549 #define AF_LINE_CAN3_RX 11U
1550 #define AF_PA10_SERVO2 1U
1551 #define AF_LINE_SERVO2 1U
1552 #define AF_PA11_USB_DM 10U
1553 #define AF_LINE_USB_DM 10U
1554 #define AF_PA12_USB_DP 10U
1555 #define AF_LINE_USB_DP 10U
1556 #define AF_PA13_SWDIO 0U
1557 #define AF_LINE_SWDIO 0U
1558 #define AF_PA14_SWCLK 0U
1559 #define AF_LINE_SWCLK 0U
1560 #define AF_PA15_CAN3_TX 11U
1561 #define AF_LINE_CAN3_TX 11U
1562 #define AF_PB05_SPI6_MOSI 8U
1563 #define AF_LINE_SPI6_MOSI 8U
1564 #define AF_PB06_USART1_TX 7U
1565 #define AF_LINE_USART1_TX 7U
1566 #define AF_PB07_USART1_RX 7U
1567 #define AF_LINE_USART1_RX 7U
1568 #define AF_PB08_I2C1_SCL 4U
1569 #define AF_LINE_I2C1_SCL 4U
1570 #define AF_PB09_I2C1_SDA 4U
1571 #define AF_LINE_I2C1_SDA 4U
1572 #define AF_PB12_CAN2_RX 9U
1573 #define AF_LINE_CAN2_RX 9U
1574 #define AF_PB13_CAN2_TX 9U
1575 #define AF_LINE_CAN2_TX 9U
1576 #define AF_PC08_SDIO_D0 12U
1577 #define AF_LINE_SDIO_D0 12U
1578 #define AF_PC09_SDIO_D1 12U
1579 #define AF_LINE_SDIO_D1 12U
1580 #define AF_PC10_SDIO_D2 12U
1581 #define AF_LINE_SDIO_D2 12U
1582 #define AF_PC11_SDIO_D3 12U
1583 #define AF_LINE_SDIO_D3 12U
1584 #define AF_PC12_SDIO_CK 12U
1585 #define AF_LINE_SDIO_CK 12U
1586 #define AF_PC14_OSC32_IN 0U
1587 #define AF_LINE_OSC32_IN 0U
1588 #define AF_PC15_OSC32_OUT 0U
1589 #define AF_LINE_OSC32_OUT 0U
1590 #define AF_PD00_UART4_RX 8U
1591 #define AF_LINE_UART4_RX 8U
1592 #define AF_PD01_UART4_TX 8U
1593 #define AF_LINE_UART4_TX 8U
1594 #define AF_PD02_SDIO_CMD 12U
1595 #define AF_LINE_SDIO_CMD 12U
1596 #define AF_PD05_UART2_TX 7U
1597 #define AF_LINE_UART2_TX 7U
1598 #define AF_PD06_UART2_RX 7U
1599 #define AF_LINE_UART2_RX 7U
1600 #define AF_PD07_SPI1_MOSI 5U
1601 #define AF_LINE_SPI1_MOSI 5U
1602 #define AF_PD08_UART3_TX 7U
1603 #define AF_LINE_UART3_TX 7U
1604 #define AF_PD09_UART3_RX 7U
1605 #define AF_LINE_UART3_RX 7U
1606 #define AF_PD13_SERVO5 2U
1607 #define AF_LINE_SERVO5 2U
1608 #define AF_PD14_SERVO6 2U
1609 #define AF_LINE_SERVO6 2U
1610 #define AF_PE00_UART8_RX 8U
1611 #define AF_LINE_UART8_RX 8U
1612 #define AF_PE01_UART8_TX 8U
1613 #define AF_LINE_UART8_TX 8U
1614 #define AF_PE02_SPI4_SCK 5U
1615 #define AF_LINE_SPI4_SCK 5U
1616 #define AF_PE06_SPI4_MOSI 5U
1617 #define AF_LINE_SPI4_MOSI 5U
1618 #define AF_PE08_UART7_TX 8U
1619 #define AF_LINE_UART7_TX 8U
1620 #define AF_PE09_SERVO4 1U
1621 #define AF_LINE_SERVO4 1U
1622 #define AF_PE11_SERVO3 1U
1623 #define AF_LINE_SERVO3 1U
1624 #define AF_PE13_SPI4_MISO 5U
1625 #define AF_LINE_SPI4_MISO 5U
1626 #define AF_PE14_SERVO1 1U
1627 #define AF_LINE_SERVO1 1U
1628 #define AF_PF00_I2C2_SDA 4U
1629 #define AF_LINE_I2C2_SDA 4U
1630 #define AF_PF01_I2C2_SCL 4U
1631 #define AF_LINE_I2C2_SCL 4U
1632 #define AF_PF06_UART7_RX 8U
1633 #define AF_LINE_UART7_RX 8U
1634 #define AF_PF07_SPI5_SCK 5U
1635 #define AF_LINE_SPI5_SCK 5U
1636 #define AF_PF08_SPI5_MISO 5U
1637 #define AF_LINE_SPI5_MISO 5U
1638 #define AF_PF09_SPI5_MOSI 5U
1639 #define AF_LINE_SPI5_MOSI 5U
1640 #define AF_PF14_I2C4_SCL 4U
1641 #define AF_LINE_I2C4_SCL 4U
1642 #define AF_PF15_I2C4_SDA 4U
1643 #define AF_LINE_I2C4_SDA 4U
1644 #define AF_PG09_USART6_RX 8U
1645 #define AF_LINE_USART6_RX 8U
1646 #define AF_PG11_SPI1_SCK 5U
1647 #define AF_LINE_SPI1_SCK 5U
1648 #define AF_PG12_SPI6_MISO 5U
1649 #define AF_LINE_SPI6_MISO 5U
1650 #define AF_PG13_SPI6_SCK 5U
1651 #define AF_LINE_SPI6_SCK 5U
1652 #define AF_PG14_USART6_TX 8U
1653 #define AF_LINE_USART6_TX 8U
1654 #define AF_PH00_OSC_IN 0U
1655 #define AF_LINE_OSC_IN 0U
1656 #define AF_PH01_OSC_OUT 0U
1657 #define AF_LINE_OSC_OUT 0U
1658 #define AF_PH06_SERVO7 9U
1659 #define AF_LINE_SERVO7 9U
1660 #define AF_PH07_I2C3_SCL 4U
1661 #define AF_LINE_I2C3_SCL 4U
1662 #define AF_PH08_I2C3_SDA 4U
1663 #define AF_LINE_I2C3_SDA 4U
1664 #define AF_PH09_SERVO8 9U
1665 #define AF_LINE_SERVO8 9U
1666 #define AF_PH13_CAN1_TX 9U
1667 #define AF_LINE_CAN1_TX 9U
1668 #define AF_PI01_SPI2_SCK 5U
1669 #define AF_LINE_SPI2_SCK 5U
1670 #define AF_PI02_SPI2_MISO 5U
1671 #define AF_LINE_SPI2_MISO 5U
1672 #define AF_PI03_SPI2_MOSI 5U
1673 #define AF_LINE_SPI2_MOSI 5U
1674 #define AF_PI09_CAN1_RX 9U
1675 #define AF_LINE_CAN1_RX 9U
1676 
1677 
1678 #if !defined(_FROM_ASM_)
1679 #ifdef __cplusplus
1680 extern "C" {
1681 #endif
1682  void boardInit(void);
1683 #ifdef __cplusplus
1684 }
1685 #endif
1686 #endif /* _FROM_ASM_ */
1687 
void boardInit(void)
Board-specific initialization code.
Definition: board.c:261