Paparazzi UAS
v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
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_ST_CRAZYFLIE
23
#define BOARD_NAME "Bitcraze Crazyflie 2.1"
24
25
/*
26
* Board oscillators-related settings.
27
* NOTE: LSE fitted.
28
*/
29
#if !defined(STM32_LSECLK)
30
#define STM32_LSECLK 32768
31
#endif
32
33
#if !defined(STM32_HSECLK)
34
#define STM32_HSECLK 8000000
35
#endif
36
37
/*
38
* Board voltages.
39
* Required for performance limits calculation.
40
*/
41
#define STM32_VDD 300
42
43
/*
44
* MCU type as defined in the ST header file stm32f4xx.h.
45
*/
46
#define STM32F405xx
47
48
/*
49
* AHB_CLK
50
*/
51
#define AHB_CLK STM32_HCLK
52
53
54
/*
55
* IO pins assignments.
56
*/
57
#define PA00 0U
58
#define PA00_PORT GPIOA
59
#define MOTOR1 1U
60
#define MOTOR1_PORT GPIOA
61
#define E_TX2 2U
62
#define E_TX2_PORT GPIOA
63
#define E_RX2 3U
64
#define E_RX2_PORT GPIOA
65
#define NRF_FLOW_CTRL 4U
66
#define NRF_FLOW_CTRL_PORT GPIOA
67
#define E_SCK 5U
68
#define E_SCK_PORT GPIOA
69
#define E_MISO 6U
70
#define E_MISO_PORT GPIOA
71
#define E_MOSI 7U
72
#define E_MOSI_PORT GPIOA
73
#define IMU_SCL 8U
74
#define IMU_SCL_PORT GPIOA
75
#define PA09 9U
76
#define PA09_PORT GPIOA
77
#define USB_ID 10U
78
#define USB_ID_PORT GPIOA
79
#define USB_DM 11U
80
#define USB_DM_PORT GPIOA
81
#define USB_DP 12U
82
#define USB_DP_PORT GPIOA
83
#define STM_SWIO 13U
84
#define STM_SWIO_PORT GPIOA
85
#define STM_SWCLK 14U
86
#define STM_SWCLK_PORT GPIOA
87
#define MOTOR3 15U
88
#define MOTOR3_PORT GPIOA
89
90
#define PB00 0U
91
#define PB00_PORT GPIOB
92
#define PB01 1U
93
#define PB01_PORT GPIOB
94
#define BOOT1 2U
95
#define BOOT1_PORT GPIOB
96
#define PB03 3U
97
#define PB03_PORT GPIOB
98
#define E_CS1 4U
99
#define E_CS1_PORT GPIOB
100
#define E_CS2 5U
101
#define E_CS2_PORT GPIOB
102
#define E_SCL 6U
103
#define E_SCL_PORT GPIOB
104
#define E_SDA 7U
105
#define E_SDA_PORT GPIOB
106
#define E_CS3 8U
107
#define E_CS3_PORT GPIOB
108
#define MOTOR4 9U
109
#define MOTOR4_PORT GPIOB
110
#define PB10 10U
111
#define PB10_PORT GPIOB
112
#define MOTOR2 11U
113
#define MOTOR2_PORT GPIOB
114
#define PB12 12U
115
#define PB12_PORT GPIOB
116
#define NRF_SWCLK 13U
117
#define NRF_SWCLK_PORT GPIOB
118
#define PB14 14U
119
#define PB14_PORT GPIOB
120
#define NRF_SWIO 15U
121
#define NRF_SWIO_PORT GPIOB
122
123
#define LED_RED_L 0U
124
#define LED_RED_L_PORT GPIOC
125
#define LED_GREEN_L 1U
126
#define LED_GREEN_L_PORT GPIOC
127
#define LED_GREEN_R 2U
128
#define LED_GREEN_R_PORT GPIOC
129
#define LED_RED_R 3U
130
#define LED_RED_R_PORT GPIOC
131
#define PC04 4U
132
#define PC04_PORT GPIOC
133
#define PC05 5U
134
#define PC05_PORT GPIOC
135
#define NRF_TX 6U
136
#define NRF_TX_PORT GPIOC
137
#define NRF_RX 7U
138
#define NRF_RX_PORT GPIOC
139
#define PC08 8U
140
#define PC08_PORT GPIOC
141
#define IMU_SDA 9U
142
#define IMU_SDA_PORT GPIOC
143
#define E_TX1 10U
144
#define E_TX1_PORT GPIOC
145
#define E_RX1 11U
146
#define E_RX1_PORT GPIOC
147
#define E_CS0 12U
148
#define E_CS0_PORT GPIOC
149
#define PC13 13U
150
#define PC13_PORT GPIOC
151
#define PC14 14U
152
#define PC14_PORT GPIOC
153
#define PC15 15U
154
#define PC15_PORT GPIOC
155
156
#define PD00 0U
157
#define PD00_PORT GPIOD
158
#define PD01 1U
159
#define PD01_PORT GPIOD
160
#define LED_BLUE_L 2U
161
#define LED_BLUE_L_PORT GPIOD
162
#define PD03 3U
163
#define PD03_PORT GPIOD
164
#define PD04 4U
165
#define PD04_PORT GPIOD
166
#define PD05 5U
167
#define PD05_PORT GPIOD
168
#define PD06 6U
169
#define PD06_PORT GPIOD
170
#define PD07 7U
171
#define PD07_PORT GPIOD
172
#define PD08 8U
173
#define PD08_PORT GPIOD
174
#define PD09 9U
175
#define PD09_PORT GPIOD
176
#define PD10 10U
177
#define PD10_PORT GPIOD
178
#define PD11 11U
179
#define PD11_PORT GPIOD
180
#define PD12 12U
181
#define PD12_PORT GPIOD
182
#define PD13 13U
183
#define PD13_PORT GPIOD
184
#define PD14 14U
185
#define PD14_PORT GPIOD
186
#define PD15 15U
187
#define PD15_PORT GPIOD
188
189
#define PE00 0U
190
#define PE00_PORT GPIOE
191
#define PE01 1U
192
#define PE01_PORT GPIOE
193
#define PE02 2U
194
#define PE02_PORT GPIOE
195
#define PE03 3U
196
#define PE03_PORT GPIOE
197
#define PE04 4U
198
#define PE04_PORT GPIOE
199
#define PE05 5U
200
#define PE05_PORT GPIOE
201
#define PE06 6U
202
#define PE06_PORT GPIOE
203
#define PE07 7U
204
#define PE07_PORT GPIOE
205
#define PE08 8U
206
#define PE08_PORT GPIOE
207
#define PE09 9U
208
#define PE09_PORT GPIOE
209
#define PE10 10U
210
#define PE10_PORT GPIOE
211
#define PE11 11U
212
#define PE11_PORT GPIOE
213
#define PE12 12U
214
#define PE12_PORT GPIOE
215
#define PE13 13U
216
#define PE13_PORT GPIOE
217
#define PE14 14U
218
#define PE14_PORT GPIOE
219
#define PE15 15U
220
#define PE15_PORT GPIOE
221
222
#define PF00 0U
223
#define PF00_PORT GPIOF
224
#define PF01 1U
225
#define PF01_PORT GPIOF
226
#define PF02 2U
227
#define PF02_PORT GPIOF
228
#define PF03 3U
229
#define PF03_PORT GPIOF
230
#define PF04 4U
231
#define PF04_PORT GPIOF
232
#define PF05 5U
233
#define PF05_PORT GPIOF
234
#define PF06 6U
235
#define PF06_PORT GPIOF
236
#define PF07 7U
237
#define PF07_PORT GPIOF
238
#define PF08 8U
239
#define PF08_PORT GPIOF
240
#define PF09 9U
241
#define PF09_PORT GPIOF
242
#define PF10 10U
243
#define PF10_PORT GPIOF
244
#define PF11 11U
245
#define PF11_PORT GPIOF
246
#define PF12 12U
247
#define PF12_PORT GPIOF
248
#define PF13 13U
249
#define PF13_PORT GPIOF
250
#define PF14 14U
251
#define PF14_PORT GPIOF
252
#define PF15 15U
253
#define PF15_PORT GPIOF
254
255
#define PG00 0U
256
#define PG00_PORT GPIOG
257
#define PG01 1U
258
#define PG01_PORT GPIOG
259
#define PG02 2U
260
#define PG02_PORT GPIOG
261
#define PG03 3U
262
#define PG03_PORT GPIOG
263
#define PG04 4U
264
#define PG04_PORT GPIOG
265
#define PG05 5U
266
#define PG05_PORT GPIOG
267
#define PG06 6U
268
#define PG06_PORT GPIOG
269
#define PG07 7U
270
#define PG07_PORT GPIOG
271
#define PG08 8U
272
#define PG08_PORT GPIOG
273
#define PG09 9U
274
#define PG09_PORT GPIOG
275
#define PG10 10U
276
#define PG10_PORT GPIOG
277
#define PG11 11U
278
#define PG11_PORT GPIOG
279
#define PG12 12U
280
#define PG12_PORT GPIOG
281
#define PG13 13U
282
#define PG13_PORT GPIOG
283
#define PG14 14U
284
#define PG14_PORT GPIOG
285
#define PG15 15U
286
#define PG15_PORT GPIOG
287
288
#define OSC_IN 0U
289
#define OSC_IN_PORT GPIOH
290
#define OSC_OUT 1U
291
#define OSC_OUT_PORT GPIOH
292
#define PH02 2U
293
#define PH02_PORT GPIOH
294
#define PH03 3U
295
#define PH03_PORT GPIOH
296
#define PH04 4U
297
#define PH04_PORT GPIOH
298
#define PH05 5U
299
#define PH05_PORT GPIOH
300
#define PH06 6U
301
#define PH06_PORT GPIOH
302
#define PH07 7U
303
#define PH07_PORT GPIOH
304
#define PH08 8U
305
#define PH08_PORT GPIOH
306
#define PH09 9U
307
#define PH09_PORT GPIOH
308
#define PH10 10U
309
#define PH10_PORT GPIOH
310
#define PH11 11U
311
#define PH11_PORT GPIOH
312
#define PH12 12U
313
#define PH12_PORT GPIOH
314
#define PH13 13U
315
#define PH13_PORT GPIOH
316
#define PH14 14U
317
#define PH14_PORT GPIOH
318
#define PH15 15U
319
#define PH15_PORT GPIOH
320
321
#define PI00 0U
322
#define PI00_PORT GPIOI
323
#define PI01 1U
324
#define PI01_PORT GPIOI
325
#define PI02 2U
326
#define PI02_PORT GPIOI
327
#define PI03 3U
328
#define PI03_PORT GPIOI
329
#define PI04 4U
330
#define PI04_PORT GPIOI
331
#define PI05 5U
332
#define PI05_PORT GPIOI
333
#define PI06 6U
334
#define PI06_PORT GPIOI
335
#define PI07 7U
336
#define PI07_PORT GPIOI
337
#define PI08 8U
338
#define PI08_PORT GPIOI
339
#define PI09 9U
340
#define PI09_PORT GPIOI
341
#define PI10 10U
342
#define PI10_PORT GPIOI
343
#define PI11 11U
344
#define PI11_PORT GPIOI
345
#define PI12 12U
346
#define PI12_PORT GPIOI
347
#define PI13 13U
348
#define PI13_PORT GPIOI
349
#define PI14 14U
350
#define PI14_PORT GPIOI
351
#define PI15 15U
352
#define PI15_PORT GPIOI
353
354
#define PJ00 0U
355
#define PJ00_PORT GPIOJ
356
#define PJ01 1U
357
#define PJ01_PORT GPIOJ
358
#define PJ02 2U
359
#define PJ02_PORT GPIOJ
360
#define PJ03 3U
361
#define PJ03_PORT GPIOJ
362
#define PJ04 4U
363
#define PJ04_PORT GPIOJ
364
#define PJ05 5U
365
#define PJ05_PORT GPIOJ
366
#define PJ06 6U
367
#define PJ06_PORT GPIOJ
368
#define PJ07 7U
369
#define PJ07_PORT GPIOJ
370
#define PJ08 8U
371
#define PJ08_PORT GPIOJ
372
#define PJ09 9U
373
#define PJ09_PORT GPIOJ
374
#define PJ10 10U
375
#define PJ10_PORT GPIOJ
376
#define PJ11 11U
377
#define PJ11_PORT GPIOJ
378
#define PJ12 12U
379
#define PJ12_PORT GPIOJ
380
#define PJ13 13U
381
#define PJ13_PORT GPIOJ
382
#define PJ14 14U
383
#define PJ14_PORT GPIOJ
384
#define PJ15 15U
385
#define PJ15_PORT GPIOJ
386
387
#define PK00 0U
388
#define PK00_PORT GPIOK
389
#define PK01 1U
390
#define PK01_PORT GPIOK
391
#define PK02 2U
392
#define PK02_PORT GPIOK
393
#define PK03 3U
394
#define PK03_PORT GPIOK
395
#define PK04 4U
396
#define PK04_PORT GPIOK
397
#define PK05 5U
398
#define PK05_PORT GPIOK
399
#define PK06 6U
400
#define PK06_PORT GPIOK
401
#define PK07 7U
402
#define PK07_PORT GPIOK
403
#define PK08 8U
404
#define PK08_PORT GPIOK
405
#define PK09 9U
406
#define PK09_PORT GPIOK
407
#define PK10 10U
408
#define PK10_PORT GPIOK
409
#define PK11 11U
410
#define PK11_PORT GPIOK
411
#define PK12 12U
412
#define PK12_PORT GPIOK
413
#define PK13 13U
414
#define PK13_PORT GPIOK
415
#define PK14 14U
416
#define PK14_PORT GPIOK
417
#define PK15 15U
418
#define PK15_PORT GPIOK
419
420
/*
421
* IO lines assignments.
422
*/
423
#define LINE_MOTOR1 PAL_LINE(GPIOA, 1U)
424
#define LINE_E_TX2 PAL_LINE(GPIOA, 2U)
425
#define LINE_E_RX2 PAL_LINE(GPIOA, 3U)
426
#define LINE_NRF_FLOW_CTRL PAL_LINE(GPIOA, 4U)
427
#define LINE_E_SCK PAL_LINE(GPIOA, 5U)
428
#define LINE_E_MISO PAL_LINE(GPIOA, 6U)
429
#define LINE_E_MOSI PAL_LINE(GPIOA, 7U)
430
#define LINE_IMU_SCL PAL_LINE(GPIOA, 8U)
431
#define LINE_USB_ID PAL_LINE(GPIOA, 10U)
432
#define LINE_USB_DM PAL_LINE(GPIOA, 11U)
433
#define LINE_USB_DP PAL_LINE(GPIOA, 12U)
434
#define LINE_STM_SWIO PAL_LINE(GPIOA, 13U)
435
#define LINE_STM_SWCLK PAL_LINE(GPIOA, 14U)
436
#define LINE_MOTOR3 PAL_LINE(GPIOA, 15U)
437
438
#define LINE_BOOT1 PAL_LINE(GPIOB, 2U)
439
#define LINE_E_CS1 PAL_LINE(GPIOB, 4U)
440
#define LINE_E_CS2 PAL_LINE(GPIOB, 5U)
441
#define LINE_E_SCL PAL_LINE(GPIOB, 6U)
442
#define LINE_E_SDA PAL_LINE(GPIOB, 7U)
443
#define LINE_E_CS3 PAL_LINE(GPIOB, 8U)
444
#define LINE_MOTOR4 PAL_LINE(GPIOB, 9U)
445
#define LINE_MOTOR2 PAL_LINE(GPIOB, 11U)
446
#define LINE_NRF_SWCLK PAL_LINE(GPIOB, 13U)
447
#define LINE_NRF_SWIO PAL_LINE(GPIOB, 15U)
448
449
#define LINE_LED_RED_L PAL_LINE(GPIOC, 0U)
450
#define LINE_LED_GREEN_L PAL_LINE(GPIOC, 1U)
451
#define LINE_LED_GREEN_R PAL_LINE(GPIOC, 2U)
452
#define LINE_LED_RED_R PAL_LINE(GPIOC, 3U)
453
#define LINE_NRF_TX PAL_LINE(GPIOC, 6U)
454
#define LINE_NRF_RX PAL_LINE(GPIOC, 7U)
455
#define LINE_IMU_SDA PAL_LINE(GPIOC, 9U)
456
#define LINE_E_TX1 PAL_LINE(GPIOC, 10U)
457
#define LINE_E_RX1 PAL_LINE(GPIOC, 11U)
458
#define LINE_E_CS0 PAL_LINE(GPIOC, 12U)
459
460
#define LINE_LED_BLUE_L PAL_LINE(GPIOD, 2U)
461
462
#define LINE_OSC_IN PAL_LINE(GPIOH, 0U)
463
#define LINE_OSC_OUT PAL_LINE(GPIOH, 1U)
464
465
466
/*
467
* I/O ports initial setup, this configuration is established soon after reset
468
* in the initialization code.
469
* Please refer to the STM32 Reference Manual for details.
470
*/
471
#define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
472
#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
473
#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
474
#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
475
#define PIN_ODR_LEVEL_LOW(n) (0U << (n))
476
#define PIN_ODR_LEVEL_HIGH(n) (1U << (n))
477
#define PIN_OTYPE_PUSHPULL(n) (0U << (n))
478
#define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
479
#define PIN_OSPEED_SPEED_VERYLOW(n) (0U << ((n) * 2U))
480
#define PIN_OSPEED_SPEED_LOW(n) (1U << ((n) * 2U))
481
#define PIN_OSPEED_SPEED_MEDIUM(n) (2U << ((n) * 2U))
482
#define PIN_OSPEED_SPEED_HIGH(n) (3U << ((n) * 2U))
483
#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
484
#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
485
#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
486
#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
487
488
#define VAL_GPIOA_MODER (PIN_MODE_INPUT(PA00) | \
489
PIN_MODE_ALTERNATE(MOTOR1) | \
490
PIN_MODE_ALTERNATE(E_TX2) | \
491
PIN_MODE_ALTERNATE(E_RX2) | \
492
PIN_MODE_INPUT(NRF_FLOW_CTRL) | \
493
PIN_MODE_ALTERNATE(E_SCK) | \
494
PIN_MODE_ALTERNATE(E_MISO) | \
495
PIN_MODE_ALTERNATE(E_MOSI) | \
496
PIN_MODE_ALTERNATE(IMU_SCL) | \
497
PIN_MODE_INPUT(PA09) | \
498
PIN_MODE_ALTERNATE(USB_ID) | \
499
PIN_MODE_ALTERNATE(USB_DM) | \
500
PIN_MODE_ALTERNATE(USB_DP) | \
501
PIN_MODE_ALTERNATE(STM_SWIO) | \
502
PIN_MODE_ALTERNATE(STM_SWCLK) | \
503
PIN_MODE_ALTERNATE(MOTOR3))
504
505
#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(PA00) | \
506
PIN_OTYPE_PUSHPULL(MOTOR1) | \
507
PIN_OTYPE_PUSHPULL(E_TX2) | \
508
PIN_OTYPE_PUSHPULL(E_RX2) | \
509
PIN_OTYPE_OPENDRAIN(NRF_FLOW_CTRL) | \
510
PIN_OTYPE_PUSHPULL(E_SCK) | \
511
PIN_OTYPE_PUSHPULL(E_MISO) | \
512
PIN_OTYPE_PUSHPULL(E_MOSI) | \
513
PIN_OTYPE_OPENDRAIN(IMU_SCL) | \
514
PIN_OTYPE_PUSHPULL(PA09) | \
515
PIN_OTYPE_PUSHPULL(USB_ID) | \
516
PIN_OTYPE_PUSHPULL(USB_DM) | \
517
PIN_OTYPE_PUSHPULL(USB_DP) | \
518
PIN_OTYPE_PUSHPULL(STM_SWIO) | \
519
PIN_OTYPE_PUSHPULL(STM_SWCLK) | \
520
PIN_OTYPE_PUSHPULL(MOTOR3))
521
522
#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_SPEED_VERYLOW(PA00) | \
523
PIN_OSPEED_SPEED_HIGH(MOTOR1) | \
524
PIN_OSPEED_SPEED_HIGH(E_TX2) | \
525
PIN_OSPEED_SPEED_HIGH(E_RX2) | \
526
PIN_OSPEED_SPEED_VERYLOW(NRF_FLOW_CTRL) | \
527
PIN_OSPEED_SPEED_HIGH(E_SCK) | \
528
PIN_OSPEED_SPEED_HIGH(E_MISO) | \
529
PIN_OSPEED_SPEED_HIGH(E_MOSI) | \
530
PIN_OSPEED_SPEED_HIGH(IMU_SCL) | \
531
PIN_OSPEED_SPEED_VERYLOW(PA09) | \
532
PIN_OSPEED_SPEED_HIGH(USB_ID) | \
533
PIN_OSPEED_SPEED_HIGH(USB_DM) | \
534
PIN_OSPEED_SPEED_HIGH(USB_DP) | \
535
PIN_OSPEED_SPEED_HIGH(STM_SWIO) | \
536
PIN_OSPEED_SPEED_HIGH(STM_SWCLK) | \
537
PIN_OSPEED_SPEED_HIGH(MOTOR3))
538
539
#define VAL_GPIOA_PUPDR (PIN_PUPDR_PULLDOWN(PA00) | \
540
PIN_PUPDR_FLOATING(MOTOR1) | \
541
PIN_PUPDR_FLOATING(E_TX2) | \
542
PIN_PUPDR_FLOATING(E_RX2) | \
543
PIN_PUPDR_FLOATING(NRF_FLOW_CTRL) | \
544
PIN_PUPDR_FLOATING(E_SCK) | \
545
PIN_PUPDR_FLOATING(E_MISO) | \
546
PIN_PUPDR_FLOATING(E_MOSI) | \
547
PIN_PUPDR_PULLUP(IMU_SCL) | \
548
PIN_PUPDR_PULLDOWN(PA09) | \
549
PIN_PUPDR_FLOATING(USB_ID) | \
550
PIN_PUPDR_FLOATING(USB_DM) | \
551
PIN_PUPDR_FLOATING(USB_DP) | \
552
PIN_PUPDR_FLOATING(STM_SWIO) | \
553
PIN_PUPDR_FLOATING(STM_SWCLK) | \
554
PIN_PUPDR_FLOATING(MOTOR3))
555
556
#define VAL_GPIOA_ODR (PIN_ODR_LEVEL_LOW(PA00) | \
557
PIN_ODR_LEVEL_LOW(MOTOR1) | \
558
PIN_ODR_LEVEL_HIGH(E_TX2) | \
559
PIN_ODR_LEVEL_HIGH(E_RX2) | \
560
PIN_ODR_LEVEL_LOW(NRF_FLOW_CTRL) | \
561
PIN_ODR_LEVEL_HIGH(E_SCK) | \
562
PIN_ODR_LEVEL_HIGH(E_MISO) | \
563
PIN_ODR_LEVEL_HIGH(E_MOSI) | \
564
PIN_ODR_LEVEL_HIGH(IMU_SCL) | \
565
PIN_ODR_LEVEL_LOW(PA09) | \
566
PIN_ODR_LEVEL_HIGH(USB_ID) | \
567
PIN_ODR_LEVEL_HIGH(USB_DM) | \
568
PIN_ODR_LEVEL_HIGH(USB_DP) | \
569
PIN_ODR_LEVEL_HIGH(STM_SWIO) | \
570
PIN_ODR_LEVEL_HIGH(STM_SWCLK) | \
571
PIN_ODR_LEVEL_LOW(MOTOR3))
572
573
#define VAL_GPIOA_AFRL (PIN_AFIO_AF(PA00, 0) | \
574
PIN_AFIO_AF(MOTOR1, 1) | \
575
PIN_AFIO_AF(E_TX2, 7) | \
576
PIN_AFIO_AF(E_RX2, 7) | \
577
PIN_AFIO_AF(NRF_FLOW_CTRL, 0) | \
578
PIN_AFIO_AF(E_SCK, 5) | \
579
PIN_AFIO_AF(E_MISO, 5) | \
580
PIN_AFIO_AF(E_MOSI, 5))
581
582
#define VAL_GPIOA_AFRH (PIN_AFIO_AF(IMU_SCL, 4) | \
583
PIN_AFIO_AF(PA09, 0) | \
584
PIN_AFIO_AF(USB_ID, 10) | \
585
PIN_AFIO_AF(USB_DM, 10) | \
586
PIN_AFIO_AF(USB_DP, 10) | \
587
PIN_AFIO_AF(STM_SWIO, 0) | \
588
PIN_AFIO_AF(STM_SWCLK, 0) | \
589
PIN_AFIO_AF(MOTOR3, 1))
590
591
#define VAL_GPIOB_MODER (PIN_MODE_INPUT(PB00) | \
592
PIN_MODE_INPUT(PB01) | \
593
PIN_MODE_INPUT(BOOT1) | \
594
PIN_MODE_INPUT(PB03) | \
595
PIN_MODE_INPUT(E_CS1) | \
596
PIN_MODE_INPUT(E_CS2) | \
597
PIN_MODE_ALTERNATE(E_SCL) | \
598
PIN_MODE_ALTERNATE(E_SDA) | \
599
PIN_MODE_INPUT(E_CS3) | \
600
PIN_MODE_ALTERNATE(MOTOR4) | \
601
PIN_MODE_INPUT(PB10) | \
602
PIN_MODE_ALTERNATE(MOTOR2) | \
603
PIN_MODE_INPUT(PB12) | \
604
PIN_MODE_INPUT(NRF_SWCLK) | \
605
PIN_MODE_INPUT(PB14) | \
606
PIN_MODE_INPUT(NRF_SWIO))
607
608
#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(PB00) | \
609
PIN_OTYPE_PUSHPULL(PB01) | \
610
PIN_OTYPE_OPENDRAIN(BOOT1) | \
611
PIN_OTYPE_PUSHPULL(PB03) | \
612
PIN_OTYPE_OPENDRAIN(E_CS1) | \
613
PIN_OTYPE_OPENDRAIN(E_CS2) | \
614
PIN_OTYPE_OPENDRAIN(E_SCL) | \
615
PIN_OTYPE_OPENDRAIN(E_SDA) | \
616
PIN_OTYPE_OPENDRAIN(E_CS3) | \
617
PIN_OTYPE_PUSHPULL(MOTOR4) | \
618
PIN_OTYPE_PUSHPULL(PB10) | \
619
PIN_OTYPE_PUSHPULL(MOTOR2) | \
620
PIN_OTYPE_PUSHPULL(PB12) | \
621
PIN_OTYPE_OPENDRAIN(NRF_SWCLK) | \
622
PIN_OTYPE_PUSHPULL(PB14) | \
623
PIN_OTYPE_OPENDRAIN(NRF_SWIO))
624
625
#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_SPEED_VERYLOW(PB00) | \
626
PIN_OSPEED_SPEED_VERYLOW(PB01) | \
627
PIN_OSPEED_SPEED_VERYLOW(BOOT1) | \
628
PIN_OSPEED_SPEED_VERYLOW(PB03) | \
629
PIN_OSPEED_SPEED_VERYLOW(E_CS1) | \
630
PIN_OSPEED_SPEED_VERYLOW(E_CS2) | \
631
PIN_OSPEED_SPEED_HIGH(E_SCL) | \
632
PIN_OSPEED_SPEED_HIGH(E_SDA) | \
633
PIN_OSPEED_SPEED_VERYLOW(E_CS3) | \
634
PIN_OSPEED_SPEED_HIGH(MOTOR4) | \
635
PIN_OSPEED_SPEED_VERYLOW(PB10) | \
636
PIN_OSPEED_SPEED_HIGH(MOTOR2) | \
637
PIN_OSPEED_SPEED_VERYLOW(PB12) | \
638
PIN_OSPEED_SPEED_VERYLOW(NRF_SWCLK) | \
639
PIN_OSPEED_SPEED_VERYLOW(PB14) | \
640
PIN_OSPEED_SPEED_VERYLOW(NRF_SWIO))
641
642
#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLDOWN(PB00) | \
643
PIN_PUPDR_PULLDOWN(PB01) | \
644
PIN_PUPDR_FLOATING(BOOT1) | \
645
PIN_PUPDR_PULLDOWN(PB03) | \
646
PIN_PUPDR_FLOATING(E_CS1) | \
647
PIN_PUPDR_FLOATING(E_CS2) | \
648
PIN_PUPDR_PULLUP(E_SCL) | \
649
PIN_PUPDR_PULLUP(E_SDA) | \
650
PIN_PUPDR_FLOATING(E_CS3) | \
651
PIN_PUPDR_FLOATING(MOTOR4) | \
652
PIN_PUPDR_PULLDOWN(PB10) | \
653
PIN_PUPDR_FLOATING(MOTOR2) | \
654
PIN_PUPDR_PULLDOWN(PB12) | \
655
PIN_PUPDR_FLOATING(NRF_SWCLK) | \
656
PIN_PUPDR_PULLDOWN(PB14) | \
657
PIN_PUPDR_FLOATING(NRF_SWIO))
658
659
#define VAL_GPIOB_ODR (PIN_ODR_LEVEL_LOW(PB00) | \
660
PIN_ODR_LEVEL_LOW(PB01) | \
661
PIN_ODR_LEVEL_LOW(BOOT1) | \
662
PIN_ODR_LEVEL_LOW(PB03) | \
663
PIN_ODR_LEVEL_LOW(E_CS1) | \
664
PIN_ODR_LEVEL_LOW(E_CS2) | \
665
PIN_ODR_LEVEL_HIGH(E_SCL) | \
666
PIN_ODR_LEVEL_HIGH(E_SDA) | \
667
PIN_ODR_LEVEL_LOW(E_CS3) | \
668
PIN_ODR_LEVEL_LOW(MOTOR4) | \
669
PIN_ODR_LEVEL_LOW(PB10) | \
670
PIN_ODR_LEVEL_LOW(MOTOR2) | \
671
PIN_ODR_LEVEL_LOW(PB12) | \
672
PIN_ODR_LEVEL_LOW(NRF_SWCLK) | \
673
PIN_ODR_LEVEL_LOW(PB14) | \
674
PIN_ODR_LEVEL_LOW(NRF_SWIO))
675
676
#define VAL_GPIOB_AFRL (PIN_AFIO_AF(PB00, 0) | \
677
PIN_AFIO_AF(PB01, 0) | \
678
PIN_AFIO_AF(BOOT1, 0) | \
679
PIN_AFIO_AF(PB03, 0) | \
680
PIN_AFIO_AF(E_CS1, 0) | \
681
PIN_AFIO_AF(E_CS2, 0) | \
682
PIN_AFIO_AF(E_SCL, 4) | \
683
PIN_AFIO_AF(E_SDA, 4))
684
685
#define VAL_GPIOB_AFRH (PIN_AFIO_AF(E_CS3, 0) | \
686
PIN_AFIO_AF(MOTOR4, 2) | \
687
PIN_AFIO_AF(PB10, 0) | \
688
PIN_AFIO_AF(MOTOR2, 1) | \
689
PIN_AFIO_AF(PB12, 0) | \
690
PIN_AFIO_AF(NRF_SWCLK, 0) | \
691
PIN_AFIO_AF(PB14, 0) | \
692
PIN_AFIO_AF(NRF_SWIO, 0))
693
694
#define VAL_GPIOC_MODER (PIN_MODE_OUTPUT(LED_RED_L) | \
695
PIN_MODE_OUTPUT(LED_GREEN_L) | \
696
PIN_MODE_OUTPUT(LED_GREEN_R) | \
697
PIN_MODE_OUTPUT(LED_RED_R) | \
698
PIN_MODE_INPUT(PC04) | \
699
PIN_MODE_INPUT(PC05) | \
700
PIN_MODE_ALTERNATE(NRF_TX) | \
701
PIN_MODE_ALTERNATE(NRF_RX) | \
702
PIN_MODE_INPUT(PC08) | \
703
PIN_MODE_ALTERNATE(IMU_SDA) | \
704
PIN_MODE_ALTERNATE(E_TX1) | \
705
PIN_MODE_ALTERNATE(E_RX1) | \
706
PIN_MODE_INPUT(E_CS0) | \
707
PIN_MODE_INPUT(PC13) | \
708
PIN_MODE_INPUT(PC14) | \
709
PIN_MODE_INPUT(PC15))
710
711
#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(LED_RED_L) | \
712
PIN_OTYPE_PUSHPULL(LED_GREEN_L) | \
713
PIN_OTYPE_PUSHPULL(LED_GREEN_R) | \
714
PIN_OTYPE_PUSHPULL(LED_RED_R) | \
715
PIN_OTYPE_PUSHPULL(PC04) | \
716
PIN_OTYPE_PUSHPULL(PC05) | \
717
PIN_OTYPE_PUSHPULL(NRF_TX) | \
718
PIN_OTYPE_PUSHPULL(NRF_RX) | \
719
PIN_OTYPE_PUSHPULL(PC08) | \
720
PIN_OTYPE_OPENDRAIN(IMU_SDA) | \
721
PIN_OTYPE_PUSHPULL(E_TX1) | \
722
PIN_OTYPE_PUSHPULL(E_RX1) | \
723
PIN_OTYPE_OPENDRAIN(E_CS0) | \
724
PIN_OTYPE_PUSHPULL(PC13) | \
725
PIN_OTYPE_PUSHPULL(PC14) | \
726
PIN_OTYPE_PUSHPULL(PC15))
727
728
#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_SPEED_VERYLOW(LED_RED_L) | \
729
PIN_OSPEED_SPEED_VERYLOW(LED_GREEN_L) | \
730
PIN_OSPEED_SPEED_VERYLOW(LED_GREEN_R) | \
731
PIN_OSPEED_SPEED_VERYLOW(LED_RED_R) | \
732
PIN_OSPEED_SPEED_VERYLOW(PC04) | \
733
PIN_OSPEED_SPEED_VERYLOW(PC05) | \
734
PIN_OSPEED_SPEED_HIGH(NRF_TX) | \
735
PIN_OSPEED_SPEED_HIGH(NRF_RX) | \
736
PIN_OSPEED_SPEED_VERYLOW(PC08) | \
737
PIN_OSPEED_SPEED_HIGH(IMU_SDA) | \
738
PIN_OSPEED_SPEED_HIGH(E_TX1) | \
739
PIN_OSPEED_SPEED_HIGH(E_RX1) | \
740
PIN_OSPEED_SPEED_VERYLOW(E_CS0) | \
741
PIN_OSPEED_SPEED_VERYLOW(PC13) | \
742
PIN_OSPEED_SPEED_VERYLOW(PC14) | \
743
PIN_OSPEED_SPEED_VERYLOW(PC15))
744
745
#define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(LED_RED_L) | \
746
PIN_PUPDR_FLOATING(LED_GREEN_L) | \
747
PIN_PUPDR_FLOATING(LED_GREEN_R) | \
748
PIN_PUPDR_FLOATING(LED_RED_R) | \
749
PIN_PUPDR_PULLDOWN(PC04) | \
750
PIN_PUPDR_PULLDOWN(PC05) | \
751
PIN_PUPDR_FLOATING(NRF_TX) | \
752
PIN_PUPDR_FLOATING(NRF_RX) | \
753
PIN_PUPDR_PULLDOWN(PC08) | \
754
PIN_PUPDR_PULLUP(IMU_SDA) | \
755
PIN_PUPDR_FLOATING(E_TX1) | \
756
PIN_PUPDR_FLOATING(E_RX1) | \
757
PIN_PUPDR_FLOATING(E_CS0) | \
758
PIN_PUPDR_PULLDOWN(PC13) | \
759
PIN_PUPDR_PULLDOWN(PC14) | \
760
PIN_PUPDR_PULLDOWN(PC15))
761
762
#define VAL_GPIOC_ODR (PIN_ODR_LEVEL_LOW(LED_RED_L) | \
763
PIN_ODR_LEVEL_LOW(LED_GREEN_L) | \
764
PIN_ODR_LEVEL_LOW(LED_GREEN_R) | \
765
PIN_ODR_LEVEL_LOW(LED_RED_R) | \
766
PIN_ODR_LEVEL_LOW(PC04) | \
767
PIN_ODR_LEVEL_LOW(PC05) | \
768
PIN_ODR_LEVEL_HIGH(NRF_TX) | \
769
PIN_ODR_LEVEL_HIGH(NRF_RX) | \
770
PIN_ODR_LEVEL_LOW(PC08) | \
771
PIN_ODR_LEVEL_HIGH(IMU_SDA) | \
772
PIN_ODR_LEVEL_HIGH(E_TX1) | \
773
PIN_ODR_LEVEL_HIGH(E_RX1) | \
774
PIN_ODR_LEVEL_LOW(E_CS0) | \
775
PIN_ODR_LEVEL_LOW(PC13) | \
776
PIN_ODR_LEVEL_LOW(PC14) | \
777
PIN_ODR_LEVEL_LOW(PC15))
778
779
#define VAL_GPIOC_AFRL (PIN_AFIO_AF(LED_RED_L, 0) | \
780
PIN_AFIO_AF(LED_GREEN_L, 0) | \
781
PIN_AFIO_AF(LED_GREEN_R, 0) | \
782
PIN_AFIO_AF(LED_RED_R, 0) | \
783
PIN_AFIO_AF(PC04, 0) | \
784
PIN_AFIO_AF(PC05, 0) | \
785
PIN_AFIO_AF(NRF_TX, 8) | \
786
PIN_AFIO_AF(NRF_RX, 8))
787
788
#define VAL_GPIOC_AFRH (PIN_AFIO_AF(PC08, 0) | \
789
PIN_AFIO_AF(IMU_SDA, 4) | \
790
PIN_AFIO_AF(E_TX1, 7) | \
791
PIN_AFIO_AF(E_RX1, 7) | \
792
PIN_AFIO_AF(E_CS0, 0) | \
793
PIN_AFIO_AF(PC13, 0) | \
794
PIN_AFIO_AF(PC14, 0) | \
795
PIN_AFIO_AF(PC15, 0))
796
797
#define VAL_GPIOD_MODER (PIN_MODE_INPUT(PD00) | \
798
PIN_MODE_INPUT(PD01) | \
799
PIN_MODE_OUTPUT(LED_BLUE_L) | \
800
PIN_MODE_INPUT(PD03) | \
801
PIN_MODE_INPUT(PD04) | \
802
PIN_MODE_INPUT(PD05) | \
803
PIN_MODE_INPUT(PD06) | \
804
PIN_MODE_INPUT(PD07) | \
805
PIN_MODE_INPUT(PD08) | \
806
PIN_MODE_INPUT(PD09) | \
807
PIN_MODE_INPUT(PD10) | \
808
PIN_MODE_INPUT(PD11) | \
809
PIN_MODE_INPUT(PD12) | \
810
PIN_MODE_INPUT(PD13) | \
811
PIN_MODE_INPUT(PD14) | \
812
PIN_MODE_INPUT(PD15))
813
814
#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(PD00) | \
815
PIN_OTYPE_PUSHPULL(PD01) | \
816
PIN_OTYPE_PUSHPULL(LED_BLUE_L) | \
817
PIN_OTYPE_PUSHPULL(PD03) | \
818
PIN_OTYPE_PUSHPULL(PD04) | \
819
PIN_OTYPE_PUSHPULL(PD05) | \
820
PIN_OTYPE_PUSHPULL(PD06) | \
821
PIN_OTYPE_PUSHPULL(PD07) | \
822
PIN_OTYPE_PUSHPULL(PD08) | \
823
PIN_OTYPE_PUSHPULL(PD09) | \
824
PIN_OTYPE_PUSHPULL(PD10) | \
825
PIN_OTYPE_PUSHPULL(PD11) | \
826
PIN_OTYPE_PUSHPULL(PD12) | \
827
PIN_OTYPE_PUSHPULL(PD13) | \
828
PIN_OTYPE_PUSHPULL(PD14) | \
829
PIN_OTYPE_PUSHPULL(PD15))
830
831
#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_SPEED_VERYLOW(PD00) | \
832
PIN_OSPEED_SPEED_VERYLOW(PD01) | \
833
PIN_OSPEED_SPEED_VERYLOW(LED_BLUE_L) | \
834
PIN_OSPEED_SPEED_VERYLOW(PD03) | \
835
PIN_OSPEED_SPEED_VERYLOW(PD04) | \
836
PIN_OSPEED_SPEED_VERYLOW(PD05) | \
837
PIN_OSPEED_SPEED_VERYLOW(PD06) | \
838
PIN_OSPEED_SPEED_VERYLOW(PD07) | \
839
PIN_OSPEED_SPEED_VERYLOW(PD08) | \
840
PIN_OSPEED_SPEED_VERYLOW(PD09) | \
841
PIN_OSPEED_SPEED_VERYLOW(PD10) | \
842
PIN_OSPEED_SPEED_VERYLOW(PD11) | \
843
PIN_OSPEED_SPEED_VERYLOW(PD12) | \
844
PIN_OSPEED_SPEED_VERYLOW(PD13) | \
845
PIN_OSPEED_SPEED_VERYLOW(PD14) | \
846
PIN_OSPEED_SPEED_VERYLOW(PD15))
847
848
#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLDOWN(PD00) | \
849
PIN_PUPDR_PULLDOWN(PD01) | \
850
PIN_PUPDR_FLOATING(LED_BLUE_L) | \
851
PIN_PUPDR_PULLDOWN(PD03) | \
852
PIN_PUPDR_PULLDOWN(PD04) | \
853
PIN_PUPDR_PULLDOWN(PD05) | \
854
PIN_PUPDR_PULLDOWN(PD06) | \
855
PIN_PUPDR_PULLDOWN(PD07) | \
856
PIN_PUPDR_PULLDOWN(PD08) | \
857
PIN_PUPDR_PULLDOWN(PD09) | \
858
PIN_PUPDR_PULLDOWN(PD10) | \
859
PIN_PUPDR_PULLDOWN(PD11) | \
860
PIN_PUPDR_PULLDOWN(PD12) | \
861
PIN_PUPDR_PULLDOWN(PD13) | \
862
PIN_PUPDR_PULLDOWN(PD14) | \
863
PIN_PUPDR_PULLDOWN(PD15))
864
865
#define VAL_GPIOD_ODR (PIN_ODR_LEVEL_LOW(PD00) | \
866
PIN_ODR_LEVEL_LOW(PD01) | \
867
PIN_ODR_LEVEL_LOW(LED_BLUE_L) | \
868
PIN_ODR_LEVEL_LOW(PD03) | \
869
PIN_ODR_LEVEL_LOW(PD04) | \
870
PIN_ODR_LEVEL_LOW(PD05) | \
871
PIN_ODR_LEVEL_LOW(PD06) | \
872
PIN_ODR_LEVEL_LOW(PD07) | \
873
PIN_ODR_LEVEL_LOW(PD08) | \
874
PIN_ODR_LEVEL_LOW(PD09) | \
875
PIN_ODR_LEVEL_LOW(PD10) | \
876
PIN_ODR_LEVEL_LOW(PD11) | \
877
PIN_ODR_LEVEL_LOW(PD12) | \
878
PIN_ODR_LEVEL_LOW(PD13) | \
879
PIN_ODR_LEVEL_LOW(PD14) | \
880
PIN_ODR_LEVEL_LOW(PD15))
881
882
#define VAL_GPIOD_AFRL (PIN_AFIO_AF(PD00, 0) | \
883
PIN_AFIO_AF(PD01, 0) | \
884
PIN_AFIO_AF(LED_BLUE_L, 0) | \
885
PIN_AFIO_AF(PD03, 0) | \
886
PIN_AFIO_AF(PD04, 0) | \
887
PIN_AFIO_AF(PD05, 0) | \
888
PIN_AFIO_AF(PD06, 0) | \
889
PIN_AFIO_AF(PD07, 0))
890
891
#define VAL_GPIOD_AFRH (PIN_AFIO_AF(PD08, 0) | \
892
PIN_AFIO_AF(PD09, 0) | \
893
PIN_AFIO_AF(PD10, 0) | \
894
PIN_AFIO_AF(PD11, 0) | \
895
PIN_AFIO_AF(PD12, 0) | \
896
PIN_AFIO_AF(PD13, 0) | \
897
PIN_AFIO_AF(PD14, 0) | \
898
PIN_AFIO_AF(PD15, 0))
899
900
#define VAL_GPIOE_MODER (PIN_MODE_INPUT(PE00) | \
901
PIN_MODE_INPUT(PE01) | \
902
PIN_MODE_INPUT(PE02) | \
903
PIN_MODE_INPUT(PE03) | \
904
PIN_MODE_INPUT(PE04) | \
905
PIN_MODE_INPUT(PE05) | \
906
PIN_MODE_INPUT(PE06) | \
907
PIN_MODE_INPUT(PE07) | \
908
PIN_MODE_INPUT(PE08) | \
909
PIN_MODE_INPUT(PE09) | \
910
PIN_MODE_INPUT(PE10) | \
911
PIN_MODE_INPUT(PE11) | \
912
PIN_MODE_INPUT(PE12) | \
913
PIN_MODE_INPUT(PE13) | \
914
PIN_MODE_INPUT(PE14) | \
915
PIN_MODE_INPUT(PE15))
916
917
#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(PE00) | \
918
PIN_OTYPE_PUSHPULL(PE01) | \
919
PIN_OTYPE_PUSHPULL(PE02) | \
920
PIN_OTYPE_PUSHPULL(PE03) | \
921
PIN_OTYPE_PUSHPULL(PE04) | \
922
PIN_OTYPE_PUSHPULL(PE05) | \
923
PIN_OTYPE_PUSHPULL(PE06) | \
924
PIN_OTYPE_PUSHPULL(PE07) | \
925
PIN_OTYPE_PUSHPULL(PE08) | \
926
PIN_OTYPE_PUSHPULL(PE09) | \
927
PIN_OTYPE_PUSHPULL(PE10) | \
928
PIN_OTYPE_PUSHPULL(PE11) | \
929
PIN_OTYPE_PUSHPULL(PE12) | \
930
PIN_OTYPE_PUSHPULL(PE13) | \
931
PIN_OTYPE_PUSHPULL(PE14) | \
932
PIN_OTYPE_PUSHPULL(PE15))
933
934
#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_SPEED_VERYLOW(PE00) | \
935
PIN_OSPEED_SPEED_VERYLOW(PE01) | \
936
PIN_OSPEED_SPEED_VERYLOW(PE02) | \
937
PIN_OSPEED_SPEED_VERYLOW(PE03) | \
938
PIN_OSPEED_SPEED_VERYLOW(PE04) | \
939
PIN_OSPEED_SPEED_VERYLOW(PE05) | \
940
PIN_OSPEED_SPEED_VERYLOW(PE06) | \
941
PIN_OSPEED_SPEED_VERYLOW(PE07) | \
942
PIN_OSPEED_SPEED_VERYLOW(PE08) | \
943
PIN_OSPEED_SPEED_VERYLOW(PE09) | \
944
PIN_OSPEED_SPEED_VERYLOW(PE10) | \
945
PIN_OSPEED_SPEED_VERYLOW(PE11) | \
946
PIN_OSPEED_SPEED_VERYLOW(PE12) | \
947
PIN_OSPEED_SPEED_VERYLOW(PE13) | \
948
PIN_OSPEED_SPEED_VERYLOW(PE14) | \
949
PIN_OSPEED_SPEED_VERYLOW(PE15))
950
951
#define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLDOWN(PE00) | \
952
PIN_PUPDR_PULLDOWN(PE01) | \
953
PIN_PUPDR_PULLDOWN(PE02) | \
954
PIN_PUPDR_PULLDOWN(PE03) | \
955
PIN_PUPDR_PULLDOWN(PE04) | \
956
PIN_PUPDR_PULLDOWN(PE05) | \
957
PIN_PUPDR_PULLDOWN(PE06) | \
958
PIN_PUPDR_PULLDOWN(PE07) | \
959
PIN_PUPDR_PULLDOWN(PE08) | \
960
PIN_PUPDR_PULLDOWN(PE09) | \
961
PIN_PUPDR_PULLDOWN(PE10) | \
962
PIN_PUPDR_PULLDOWN(PE11) | \
963
PIN_PUPDR_PULLDOWN(PE12) | \
964
PIN_PUPDR_PULLDOWN(PE13) | \
965
PIN_PUPDR_PULLDOWN(PE14) | \
966
PIN_PUPDR_PULLDOWN(PE15))
967
968
#define VAL_GPIOE_ODR (PIN_ODR_LEVEL_LOW(PE00) | \
969
PIN_ODR_LEVEL_LOW(PE01) | \
970
PIN_ODR_LEVEL_LOW(PE02) | \
971
PIN_ODR_LEVEL_LOW(PE03) | \
972
PIN_ODR_LEVEL_LOW(PE04) | \
973
PIN_ODR_LEVEL_LOW(PE05) | \
974
PIN_ODR_LEVEL_LOW(PE06) | \
975
PIN_ODR_LEVEL_LOW(PE07) | \
976
PIN_ODR_LEVEL_LOW(PE08) | \
977
PIN_ODR_LEVEL_LOW(PE09) | \
978
PIN_ODR_LEVEL_LOW(PE10) | \
979
PIN_ODR_LEVEL_LOW(PE11) | \
980
PIN_ODR_LEVEL_LOW(PE12) | \
981
PIN_ODR_LEVEL_LOW(PE13) | \
982
PIN_ODR_LEVEL_LOW(PE14) | \
983
PIN_ODR_LEVEL_LOW(PE15))
984
985
#define VAL_GPIOE_AFRL (PIN_AFIO_AF(PE00, 0) | \
986
PIN_AFIO_AF(PE01, 0) | \
987
PIN_AFIO_AF(PE02, 0) | \
988
PIN_AFIO_AF(PE03, 0) | \
989
PIN_AFIO_AF(PE04, 0) | \
990
PIN_AFIO_AF(PE05, 0) | \
991
PIN_AFIO_AF(PE06, 0) | \
992
PIN_AFIO_AF(PE07, 0))
993
994
#define VAL_GPIOE_AFRH (PIN_AFIO_AF(PE08, 0) | \
995
PIN_AFIO_AF(PE09, 0) | \
996
PIN_AFIO_AF(PE10, 0) | \
997
PIN_AFIO_AF(PE11, 0) | \
998
PIN_AFIO_AF(PE12, 0) | \
999
PIN_AFIO_AF(PE13, 0) | \
1000
PIN_AFIO_AF(PE14, 0) | \
1001
PIN_AFIO_AF(PE15, 0))
1002
1003
#define VAL_GPIOF_MODER (PIN_MODE_INPUT(PF00) | \
1004
PIN_MODE_INPUT(PF01) | \
1005
PIN_MODE_INPUT(PF02) | \
1006
PIN_MODE_INPUT(PF03) | \
1007
PIN_MODE_INPUT(PF04) | \
1008
PIN_MODE_INPUT(PF05) | \
1009
PIN_MODE_INPUT(PF06) | \
1010
PIN_MODE_INPUT(PF07) | \
1011
PIN_MODE_INPUT(PF08) | \
1012
PIN_MODE_INPUT(PF09) | \
1013
PIN_MODE_INPUT(PF10) | \
1014
PIN_MODE_INPUT(PF11) | \
1015
PIN_MODE_INPUT(PF12) | \
1016
PIN_MODE_INPUT(PF13) | \
1017
PIN_MODE_INPUT(PF14) | \
1018
PIN_MODE_INPUT(PF15))
1019
1020
#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(PF00) | \
1021
PIN_OTYPE_PUSHPULL(PF01) | \
1022
PIN_OTYPE_PUSHPULL(PF02) | \
1023
PIN_OTYPE_PUSHPULL(PF03) | \
1024
PIN_OTYPE_PUSHPULL(PF04) | \
1025
PIN_OTYPE_PUSHPULL(PF05) | \
1026
PIN_OTYPE_PUSHPULL(PF06) | \
1027
PIN_OTYPE_PUSHPULL(PF07) | \
1028
PIN_OTYPE_PUSHPULL(PF08) | \
1029
PIN_OTYPE_PUSHPULL(PF09) | \
1030
PIN_OTYPE_PUSHPULL(PF10) | \
1031
PIN_OTYPE_PUSHPULL(PF11) | \
1032
PIN_OTYPE_PUSHPULL(PF12) | \
1033
PIN_OTYPE_PUSHPULL(PF13) | \
1034
PIN_OTYPE_PUSHPULL(PF14) | \
1035
PIN_OTYPE_PUSHPULL(PF15))
1036
1037
#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_SPEED_VERYLOW(PF00) | \
1038
PIN_OSPEED_SPEED_VERYLOW(PF01) | \
1039
PIN_OSPEED_SPEED_VERYLOW(PF02) | \
1040
PIN_OSPEED_SPEED_VERYLOW(PF03) | \
1041
PIN_OSPEED_SPEED_VERYLOW(PF04) | \
1042
PIN_OSPEED_SPEED_VERYLOW(PF05) | \
1043
PIN_OSPEED_SPEED_VERYLOW(PF06) | \
1044
PIN_OSPEED_SPEED_VERYLOW(PF07) | \
1045
PIN_OSPEED_SPEED_VERYLOW(PF08) | \
1046
PIN_OSPEED_SPEED_VERYLOW(PF09) | \
1047
PIN_OSPEED_SPEED_VERYLOW(PF10) | \
1048
PIN_OSPEED_SPEED_VERYLOW(PF11) | \
1049
PIN_OSPEED_SPEED_VERYLOW(PF12) | \
1050
PIN_OSPEED_SPEED_VERYLOW(PF13) | \
1051
PIN_OSPEED_SPEED_VERYLOW(PF14) | \
1052
PIN_OSPEED_SPEED_VERYLOW(PF15))
1053
1054
#define VAL_GPIOF_PUPDR (PIN_PUPDR_PULLDOWN(PF00) | \
1055
PIN_PUPDR_PULLDOWN(PF01) | \
1056
PIN_PUPDR_PULLDOWN(PF02) | \
1057
PIN_PUPDR_PULLDOWN(PF03) | \
1058
PIN_PUPDR_PULLDOWN(PF04) | \
1059
PIN_PUPDR_PULLDOWN(PF05) | \
1060
PIN_PUPDR_PULLDOWN(PF06) | \
1061
PIN_PUPDR_PULLDOWN(PF07) | \
1062
PIN_PUPDR_PULLDOWN(PF08) | \
1063
PIN_PUPDR_PULLDOWN(PF09) | \
1064
PIN_PUPDR_PULLDOWN(PF10) | \
1065
PIN_PUPDR_PULLDOWN(PF11) | \
1066
PIN_PUPDR_PULLDOWN(PF12) | \
1067
PIN_PUPDR_PULLDOWN(PF13) | \
1068
PIN_PUPDR_PULLDOWN(PF14) | \
1069
PIN_PUPDR_PULLDOWN(PF15))
1070
1071
#define VAL_GPIOF_ODR (PIN_ODR_LEVEL_LOW(PF00) | \
1072
PIN_ODR_LEVEL_LOW(PF01) | \
1073
PIN_ODR_LEVEL_LOW(PF02) | \
1074
PIN_ODR_LEVEL_LOW(PF03) | \
1075
PIN_ODR_LEVEL_LOW(PF04) | \
1076
PIN_ODR_LEVEL_LOW(PF05) | \
1077
PIN_ODR_LEVEL_LOW(PF06) | \
1078
PIN_ODR_LEVEL_LOW(PF07) | \
1079
PIN_ODR_LEVEL_LOW(PF08) | \
1080
PIN_ODR_LEVEL_LOW(PF09) | \
1081
PIN_ODR_LEVEL_LOW(PF10) | \
1082
PIN_ODR_LEVEL_LOW(PF11) | \
1083
PIN_ODR_LEVEL_LOW(PF12) | \
1084
PIN_ODR_LEVEL_LOW(PF13) | \
1085
PIN_ODR_LEVEL_LOW(PF14) | \
1086
PIN_ODR_LEVEL_LOW(PF15))
1087
1088
#define VAL_GPIOF_AFRL (PIN_AFIO_AF(PF00, 0) | \
1089
PIN_AFIO_AF(PF01, 0) | \
1090
PIN_AFIO_AF(PF02, 0) | \
1091
PIN_AFIO_AF(PF03, 0) | \
1092
PIN_AFIO_AF(PF04, 0) | \
1093
PIN_AFIO_AF(PF05, 0) | \
1094
PIN_AFIO_AF(PF06, 0) | \
1095
PIN_AFIO_AF(PF07, 0))
1096
1097
#define VAL_GPIOF_AFRH (PIN_AFIO_AF(PF08, 0) | \
1098
PIN_AFIO_AF(PF09, 0) | \
1099
PIN_AFIO_AF(PF10, 0) | \
1100
PIN_AFIO_AF(PF11, 0) | \
1101
PIN_AFIO_AF(PF12, 0) | \
1102
PIN_AFIO_AF(PF13, 0) | \
1103
PIN_AFIO_AF(PF14, 0) | \
1104
PIN_AFIO_AF(PF15, 0))
1105
1106
#define VAL_GPIOG_MODER (PIN_MODE_INPUT(PG00) | \
1107
PIN_MODE_INPUT(PG01) | \
1108
PIN_MODE_INPUT(PG02) | \
1109
PIN_MODE_INPUT(PG03) | \
1110
PIN_MODE_INPUT(PG04) | \
1111
PIN_MODE_INPUT(PG05) | \
1112
PIN_MODE_INPUT(PG06) | \
1113
PIN_MODE_INPUT(PG07) | \
1114
PIN_MODE_INPUT(PG08) | \
1115
PIN_MODE_INPUT(PG09) | \
1116
PIN_MODE_INPUT(PG10) | \
1117
PIN_MODE_INPUT(PG11) | \
1118
PIN_MODE_INPUT(PG12) | \
1119
PIN_MODE_INPUT(PG13) | \
1120
PIN_MODE_INPUT(PG14) | \
1121
PIN_MODE_INPUT(PG15))
1122
1123
#define VAL_GPIOG_OTYPER (PIN_OTYPE_PUSHPULL(PG00) | \
1124
PIN_OTYPE_PUSHPULL(PG01) | \
1125
PIN_OTYPE_PUSHPULL(PG02) | \
1126
PIN_OTYPE_PUSHPULL(PG03) | \
1127
PIN_OTYPE_PUSHPULL(PG04) | \
1128
PIN_OTYPE_PUSHPULL(PG05) | \
1129
PIN_OTYPE_PUSHPULL(PG06) | \
1130
PIN_OTYPE_PUSHPULL(PG07) | \
1131
PIN_OTYPE_PUSHPULL(PG08) | \
1132
PIN_OTYPE_PUSHPULL(PG09) | \
1133
PIN_OTYPE_PUSHPULL(PG10) | \
1134
PIN_OTYPE_PUSHPULL(PG11) | \
1135
PIN_OTYPE_PUSHPULL(PG12) | \
1136
PIN_OTYPE_PUSHPULL(PG13) | \
1137
PIN_OTYPE_PUSHPULL(PG14) | \
1138
PIN_OTYPE_PUSHPULL(PG15))
1139
1140
#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_SPEED_VERYLOW(PG00) | \
1141
PIN_OSPEED_SPEED_VERYLOW(PG01) | \
1142
PIN_OSPEED_SPEED_VERYLOW(PG02) | \
1143
PIN_OSPEED_SPEED_VERYLOW(PG03) | \
1144
PIN_OSPEED_SPEED_VERYLOW(PG04) | \
1145
PIN_OSPEED_SPEED_VERYLOW(PG05) | \
1146
PIN_OSPEED_SPEED_VERYLOW(PG06) | \
1147
PIN_OSPEED_SPEED_VERYLOW(PG07) | \
1148
PIN_OSPEED_SPEED_VERYLOW(PG08) | \
1149
PIN_OSPEED_SPEED_VERYLOW(PG09) | \
1150
PIN_OSPEED_SPEED_VERYLOW(PG10) | \
1151
PIN_OSPEED_SPEED_VERYLOW(PG11) | \
1152
PIN_OSPEED_SPEED_VERYLOW(PG12) | \
1153
PIN_OSPEED_SPEED_VERYLOW(PG13) | \
1154
PIN_OSPEED_SPEED_VERYLOW(PG14) | \
1155
PIN_OSPEED_SPEED_VERYLOW(PG15))
1156
1157
#define VAL_GPIOG_PUPDR (PIN_PUPDR_PULLDOWN(PG00) | \
1158
PIN_PUPDR_PULLDOWN(PG01) | \
1159
PIN_PUPDR_PULLDOWN(PG02) | \
1160
PIN_PUPDR_PULLDOWN(PG03) | \
1161
PIN_PUPDR_PULLDOWN(PG04) | \
1162
PIN_PUPDR_PULLDOWN(PG05) | \
1163
PIN_PUPDR_PULLDOWN(PG06) | \
1164
PIN_PUPDR_PULLDOWN(PG07) | \
1165
PIN_PUPDR_PULLDOWN(PG08) | \
1166
PIN_PUPDR_PULLDOWN(PG09) | \
1167
PIN_PUPDR_PULLDOWN(PG10) | \
1168
PIN_PUPDR_PULLDOWN(PG11) | \
1169
PIN_PUPDR_PULLDOWN(PG12) | \
1170
PIN_PUPDR_PULLDOWN(PG13) | \
1171
PIN_PUPDR_PULLDOWN(PG14) | \
1172
PIN_PUPDR_PULLDOWN(PG15))
1173
1174
#define VAL_GPIOG_ODR (PIN_ODR_LEVEL_LOW(PG00) | \
1175
PIN_ODR_LEVEL_LOW(PG01) | \
1176
PIN_ODR_LEVEL_LOW(PG02) | \
1177
PIN_ODR_LEVEL_LOW(PG03) | \
1178
PIN_ODR_LEVEL_LOW(PG04) | \
1179
PIN_ODR_LEVEL_LOW(PG05) | \
1180
PIN_ODR_LEVEL_LOW(PG06) | \
1181
PIN_ODR_LEVEL_LOW(PG07) | \
1182
PIN_ODR_LEVEL_LOW(PG08) | \
1183
PIN_ODR_LEVEL_LOW(PG09) | \
1184
PIN_ODR_LEVEL_LOW(PG10) | \
1185
PIN_ODR_LEVEL_LOW(PG11) | \
1186
PIN_ODR_LEVEL_LOW(PG12) | \
1187
PIN_ODR_LEVEL_LOW(PG13) | \
1188
PIN_ODR_LEVEL_LOW(PG14) | \
1189
PIN_ODR_LEVEL_LOW(PG15))
1190
1191
#define VAL_GPIOG_AFRL (PIN_AFIO_AF(PG00, 0) | \
1192
PIN_AFIO_AF(PG01, 0) | \
1193
PIN_AFIO_AF(PG02, 0) | \
1194
PIN_AFIO_AF(PG03, 0) | \
1195
PIN_AFIO_AF(PG04, 0) | \
1196
PIN_AFIO_AF(PG05, 0) | \
1197
PIN_AFIO_AF(PG06, 0) | \
1198
PIN_AFIO_AF(PG07, 0))
1199
1200
#define VAL_GPIOG_AFRH (PIN_AFIO_AF(PG08, 0) | \
1201
PIN_AFIO_AF(PG09, 0) | \
1202
PIN_AFIO_AF(PG10, 0) | \
1203
PIN_AFIO_AF(PG11, 0) | \
1204
PIN_AFIO_AF(PG12, 0) | \
1205
PIN_AFIO_AF(PG13, 0) | \
1206
PIN_AFIO_AF(PG14, 0) | \
1207
PIN_AFIO_AF(PG15, 0))
1208
1209
#define VAL_GPIOH_MODER (PIN_MODE_ALTERNATE(OSC_IN) | \
1210
PIN_MODE_ALTERNATE(OSC_OUT) | \
1211
PIN_MODE_INPUT(PH02) | \
1212
PIN_MODE_INPUT(PH03) | \
1213
PIN_MODE_INPUT(PH04) | \
1214
PIN_MODE_INPUT(PH05) | \
1215
PIN_MODE_INPUT(PH06) | \
1216
PIN_MODE_INPUT(PH07) | \
1217
PIN_MODE_INPUT(PH08) | \
1218
PIN_MODE_INPUT(PH09) | \
1219
PIN_MODE_INPUT(PH10) | \
1220
PIN_MODE_INPUT(PH11) | \
1221
PIN_MODE_INPUT(PH12) | \
1222
PIN_MODE_INPUT(PH13) | \
1223
PIN_MODE_INPUT(PH14) | \
1224
PIN_MODE_INPUT(PH15))
1225
1226
#define VAL_GPIOH_OTYPER (PIN_OTYPE_PUSHPULL(OSC_IN) | \
1227
PIN_OTYPE_PUSHPULL(OSC_OUT) | \
1228
PIN_OTYPE_PUSHPULL(PH02) | \
1229
PIN_OTYPE_PUSHPULL(PH03) | \
1230
PIN_OTYPE_PUSHPULL(PH04) | \
1231
PIN_OTYPE_PUSHPULL(PH05) | \
1232
PIN_OTYPE_PUSHPULL(PH06) | \
1233
PIN_OTYPE_PUSHPULL(PH07) | \
1234
PIN_OTYPE_PUSHPULL(PH08) | \
1235
PIN_OTYPE_PUSHPULL(PH09) | \
1236
PIN_OTYPE_PUSHPULL(PH10) | \
1237
PIN_OTYPE_PUSHPULL(PH11) | \
1238
PIN_OTYPE_PUSHPULL(PH12) | \
1239
PIN_OTYPE_PUSHPULL(PH13) | \
1240
PIN_OTYPE_PUSHPULL(PH14) | \
1241
PIN_OTYPE_PUSHPULL(PH15))
1242
1243
#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_SPEED_HIGH(OSC_IN) | \
1244
PIN_OSPEED_SPEED_HIGH(OSC_OUT) | \
1245
PIN_OSPEED_SPEED_VERYLOW(PH02) | \
1246
PIN_OSPEED_SPEED_VERYLOW(PH03) | \
1247
PIN_OSPEED_SPEED_VERYLOW(PH04) | \
1248
PIN_OSPEED_SPEED_VERYLOW(PH05) | \
1249
PIN_OSPEED_SPEED_VERYLOW(PH06) | \
1250
PIN_OSPEED_SPEED_VERYLOW(PH07) | \
1251
PIN_OSPEED_SPEED_VERYLOW(PH08) | \
1252
PIN_OSPEED_SPEED_VERYLOW(PH09) | \
1253
PIN_OSPEED_SPEED_VERYLOW(PH10) | \
1254
PIN_OSPEED_SPEED_VERYLOW(PH11) | \
1255
PIN_OSPEED_SPEED_VERYLOW(PH12) | \
1256
PIN_OSPEED_SPEED_VERYLOW(PH13) | \
1257
PIN_OSPEED_SPEED_VERYLOW(PH14) | \
1258
PIN_OSPEED_SPEED_VERYLOW(PH15))
1259
1260
#define VAL_GPIOH_PUPDR (PIN_PUPDR_FLOATING(OSC_IN) | \
1261
PIN_PUPDR_FLOATING(OSC_OUT) | \
1262
PIN_PUPDR_PULLDOWN(PH02) | \
1263
PIN_PUPDR_PULLDOWN(PH03) | \
1264
PIN_PUPDR_PULLDOWN(PH04) | \
1265
PIN_PUPDR_PULLDOWN(PH05) | \
1266
PIN_PUPDR_PULLDOWN(PH06) | \
1267
PIN_PUPDR_PULLDOWN(PH07) | \
1268
PIN_PUPDR_PULLDOWN(PH08) | \
1269
PIN_PUPDR_PULLDOWN(PH09) | \
1270
PIN_PUPDR_PULLDOWN(PH10) | \
1271
PIN_PUPDR_PULLDOWN(PH11) | \
1272
PIN_PUPDR_PULLDOWN(PH12) | \
1273
PIN_PUPDR_PULLDOWN(PH13) | \
1274
PIN_PUPDR_PULLDOWN(PH14) | \
1275
PIN_PUPDR_PULLDOWN(PH15))
1276
1277
#define VAL_GPIOH_ODR (PIN_ODR_LEVEL_HIGH(OSC_IN) | \
1278
PIN_ODR_LEVEL_HIGH(OSC_OUT) | \
1279
PIN_ODR_LEVEL_LOW(PH02) | \
1280
PIN_ODR_LEVEL_LOW(PH03) | \
1281
PIN_ODR_LEVEL_LOW(PH04) | \
1282
PIN_ODR_LEVEL_LOW(PH05) | \
1283
PIN_ODR_LEVEL_LOW(PH06) | \
1284
PIN_ODR_LEVEL_LOW(PH07) | \
1285
PIN_ODR_LEVEL_LOW(PH08) | \
1286
PIN_ODR_LEVEL_LOW(PH09) | \
1287
PIN_ODR_LEVEL_LOW(PH10) | \
1288
PIN_ODR_LEVEL_LOW(PH11) | \
1289
PIN_ODR_LEVEL_LOW(PH12) | \
1290
PIN_ODR_LEVEL_LOW(PH13) | \
1291
PIN_ODR_LEVEL_LOW(PH14) | \
1292
PIN_ODR_LEVEL_LOW(PH15))
1293
1294
#define VAL_GPIOH_AFRL (PIN_AFIO_AF(OSC_IN, 0) | \
1295
PIN_AFIO_AF(OSC_OUT, 0) | \
1296
PIN_AFIO_AF(PH02, 0) | \
1297
PIN_AFIO_AF(PH03, 0) | \
1298
PIN_AFIO_AF(PH04, 0) | \
1299
PIN_AFIO_AF(PH05, 0) | \
1300
PIN_AFIO_AF(PH06, 0) | \
1301
PIN_AFIO_AF(PH07, 0))
1302
1303
#define VAL_GPIOH_AFRH (PIN_AFIO_AF(PH08, 0) | \
1304
PIN_AFIO_AF(PH09, 0) | \
1305
PIN_AFIO_AF(PH10, 0) | \
1306
PIN_AFIO_AF(PH11, 0) | \
1307
PIN_AFIO_AF(PH12, 0) | \
1308
PIN_AFIO_AF(PH13, 0) | \
1309
PIN_AFIO_AF(PH14, 0) | \
1310
PIN_AFIO_AF(PH15, 0))
1311
1312
#define VAL_GPIOI_MODER (PIN_MODE_INPUT(PI00) | \
1313
PIN_MODE_INPUT(PI01) | \
1314
PIN_MODE_INPUT(PI02) | \
1315
PIN_MODE_INPUT(PI03) | \
1316
PIN_MODE_INPUT(PI04) | \
1317
PIN_MODE_INPUT(PI05) | \
1318
PIN_MODE_INPUT(PI06) | \
1319
PIN_MODE_INPUT(PI07) | \
1320
PIN_MODE_INPUT(PI08) | \
1321
PIN_MODE_INPUT(PI09) | \
1322
PIN_MODE_INPUT(PI10) | \
1323
PIN_MODE_INPUT(PI11) | \
1324
PIN_MODE_INPUT(PI12) | \
1325
PIN_MODE_INPUT(PI13) | \
1326
PIN_MODE_INPUT(PI14) | \
1327
PIN_MODE_INPUT(PI15))
1328
1329
#define VAL_GPIOI_OTYPER (PIN_OTYPE_PUSHPULL(PI00) | \
1330
PIN_OTYPE_PUSHPULL(PI01) | \
1331
PIN_OTYPE_PUSHPULL(PI02) | \
1332
PIN_OTYPE_PUSHPULL(PI03) | \
1333
PIN_OTYPE_PUSHPULL(PI04) | \
1334
PIN_OTYPE_PUSHPULL(PI05) | \
1335
PIN_OTYPE_PUSHPULL(PI06) | \
1336
PIN_OTYPE_PUSHPULL(PI07) | \
1337
PIN_OTYPE_PUSHPULL(PI08) | \
1338
PIN_OTYPE_PUSHPULL(PI09) | \
1339
PIN_OTYPE_PUSHPULL(PI10) | \
1340
PIN_OTYPE_PUSHPULL(PI11) | \
1341
PIN_OTYPE_PUSHPULL(PI12) | \
1342
PIN_OTYPE_PUSHPULL(PI13) | \
1343
PIN_OTYPE_PUSHPULL(PI14) | \
1344
PIN_OTYPE_PUSHPULL(PI15))
1345
1346
#define VAL_GPIOI_OSPEEDR (PIN_OSPEED_SPEED_VERYLOW(PI00) | \
1347
PIN_OSPEED_SPEED_VERYLOW(PI01) | \
1348
PIN_OSPEED_SPEED_VERYLOW(PI02) | \
1349
PIN_OSPEED_SPEED_VERYLOW(PI03) | \
1350
PIN_OSPEED_SPEED_VERYLOW(PI04) | \
1351
PIN_OSPEED_SPEED_VERYLOW(PI05) | \
1352
PIN_OSPEED_SPEED_VERYLOW(PI06) | \
1353
PIN_OSPEED_SPEED_VERYLOW(PI07) | \
1354
PIN_OSPEED_SPEED_VERYLOW(PI08) | \
1355
PIN_OSPEED_SPEED_VERYLOW(PI09) | \
1356
PIN_OSPEED_SPEED_VERYLOW(PI10) | \
1357
PIN_OSPEED_SPEED_VERYLOW(PI11) | \
1358
PIN_OSPEED_SPEED_VERYLOW(PI12) | \
1359
PIN_OSPEED_SPEED_VERYLOW(PI13) | \
1360
PIN_OSPEED_SPEED_VERYLOW(PI14) | \
1361
PIN_OSPEED_SPEED_VERYLOW(PI15))
1362
1363
#define VAL_GPIOI_PUPDR (PIN_PUPDR_PULLDOWN(PI00) | \
1364
PIN_PUPDR_PULLDOWN(PI01) | \
1365
PIN_PUPDR_PULLDOWN(PI02) | \
1366
PIN_PUPDR_PULLDOWN(PI03) | \
1367
PIN_PUPDR_PULLDOWN(PI04) | \
1368
PIN_PUPDR_PULLDOWN(PI05) | \
1369
PIN_PUPDR_PULLDOWN(PI06) | \
1370
PIN_PUPDR_PULLDOWN(PI07) | \
1371
PIN_PUPDR_PULLDOWN(PI08) | \
1372
PIN_PUPDR_PULLDOWN(PI09) | \
1373
PIN_PUPDR_PULLDOWN(PI10) | \
1374
PIN_PUPDR_PULLDOWN(PI11) | \
1375
PIN_PUPDR_PULLDOWN(PI12) | \
1376
PIN_PUPDR_PULLDOWN(PI13) | \
1377
PIN_PUPDR_PULLDOWN(PI14) | \
1378
PIN_PUPDR_PULLDOWN(PI15))
1379
1380
#define VAL_GPIOI_ODR (PIN_ODR_LEVEL_LOW(PI00) | \
1381
PIN_ODR_LEVEL_LOW(PI01) | \
1382
PIN_ODR_LEVEL_LOW(PI02) | \
1383
PIN_ODR_LEVEL_LOW(PI03) | \
1384
PIN_ODR_LEVEL_LOW(PI04) | \
1385
PIN_ODR_LEVEL_LOW(PI05) | \
1386
PIN_ODR_LEVEL_LOW(PI06) | \
1387
PIN_ODR_LEVEL_LOW(PI07) | \
1388
PIN_ODR_LEVEL_LOW(PI08) | \
1389
PIN_ODR_LEVEL_LOW(PI09) | \
1390
PIN_ODR_LEVEL_LOW(PI10) | \
1391
PIN_ODR_LEVEL_LOW(PI11) | \
1392
PIN_ODR_LEVEL_LOW(PI12) | \
1393
PIN_ODR_LEVEL_LOW(PI13) | \
1394
PIN_ODR_LEVEL_LOW(PI14) | \
1395
PIN_ODR_LEVEL_LOW(PI15))
1396
1397
#define VAL_GPIOI_AFRL (PIN_AFIO_AF(PI00, 0) | \
1398
PIN_AFIO_AF(PI01, 0) | \
1399
PIN_AFIO_AF(PI02, 0) | \
1400
PIN_AFIO_AF(PI03, 0) | \
1401
PIN_AFIO_AF(PI04, 0) | \
1402
PIN_AFIO_AF(PI05, 0) | \
1403
PIN_AFIO_AF(PI06, 0) | \
1404
PIN_AFIO_AF(PI07, 0))
1405
1406
#define VAL_GPIOI_AFRH (PIN_AFIO_AF(PI08, 0) | \
1407
PIN_AFIO_AF(PI09, 0) | \
1408
PIN_AFIO_AF(PI10, 0) | \
1409
PIN_AFIO_AF(PI11, 0) | \
1410
PIN_AFIO_AF(PI12, 0) | \
1411
PIN_AFIO_AF(PI13, 0) | \
1412
PIN_AFIO_AF(PI14, 0) | \
1413
PIN_AFIO_AF(PI15, 0))
1414
1415
#define VAL_GPIOJ_MODER (PIN_MODE_INPUT(PJ00) | \
1416
PIN_MODE_INPUT(PJ01) | \
1417
PIN_MODE_INPUT(PJ02) | \
1418
PIN_MODE_INPUT(PJ03) | \
1419
PIN_MODE_INPUT(PJ04) | \
1420
PIN_MODE_INPUT(PJ05) | \
1421
PIN_MODE_INPUT(PJ06) | \
1422
PIN_MODE_INPUT(PJ07) | \
1423
PIN_MODE_INPUT(PJ08) | \
1424
PIN_MODE_INPUT(PJ09) | \
1425
PIN_MODE_INPUT(PJ10) | \
1426
PIN_MODE_INPUT(PJ11) | \
1427
PIN_MODE_INPUT(PJ12) | \
1428
PIN_MODE_INPUT(PJ13) | \
1429
PIN_MODE_INPUT(PJ14) | \
1430
PIN_MODE_INPUT(PJ15))
1431
1432
#define VAL_GPIOJ_OTYPER (PIN_OTYPE_PUSHPULL(PJ00) | \
1433
PIN_OTYPE_PUSHPULL(PJ01) | \
1434
PIN_OTYPE_PUSHPULL(PJ02) | \
1435
PIN_OTYPE_PUSHPULL(PJ03) | \
1436
PIN_OTYPE_PUSHPULL(PJ04) | \
1437
PIN_OTYPE_PUSHPULL(PJ05) | \
1438
PIN_OTYPE_PUSHPULL(PJ06) | \
1439
PIN_OTYPE_PUSHPULL(PJ07) | \
1440
PIN_OTYPE_PUSHPULL(PJ08) | \
1441
PIN_OTYPE_PUSHPULL(PJ09) | \
1442
PIN_OTYPE_PUSHPULL(PJ10) | \
1443
PIN_OTYPE_PUSHPULL(PJ11) | \
1444
PIN_OTYPE_PUSHPULL(PJ12) | \
1445
PIN_OTYPE_PUSHPULL(PJ13) | \
1446
PIN_OTYPE_PUSHPULL(PJ14) | \
1447
PIN_OTYPE_PUSHPULL(PJ15))
1448
1449
#define VAL_GPIOJ_OSPEEDR (PIN_OSPEED_SPEED_VERYLOW(PJ00) | \
1450
PIN_OSPEED_SPEED_VERYLOW(PJ01) | \
1451
PIN_OSPEED_SPEED_VERYLOW(PJ02) | \
1452
PIN_OSPEED_SPEED_VERYLOW(PJ03) | \
1453
PIN_OSPEED_SPEED_VERYLOW(PJ04) | \
1454
PIN_OSPEED_SPEED_VERYLOW(PJ05) | \
1455
PIN_OSPEED_SPEED_VERYLOW(PJ06) | \
1456
PIN_OSPEED_SPEED_VERYLOW(PJ07) | \
1457
PIN_OSPEED_SPEED_VERYLOW(PJ08) | \
1458
PIN_OSPEED_SPEED_VERYLOW(PJ09) | \
1459
PIN_OSPEED_SPEED_VERYLOW(PJ10) | \
1460
PIN_OSPEED_SPEED_VERYLOW(PJ11) | \
1461
PIN_OSPEED_SPEED_VERYLOW(PJ12) | \
1462
PIN_OSPEED_SPEED_VERYLOW(PJ13) | \
1463
PIN_OSPEED_SPEED_VERYLOW(PJ14) | \
1464
PIN_OSPEED_SPEED_VERYLOW(PJ15))
1465
1466
#define VAL_GPIOJ_PUPDR (PIN_PUPDR_PULLDOWN(PJ00) | \
1467
PIN_PUPDR_PULLDOWN(PJ01) | \
1468
PIN_PUPDR_PULLDOWN(PJ02) | \
1469
PIN_PUPDR_PULLDOWN(PJ03) | \
1470
PIN_PUPDR_PULLDOWN(PJ04) | \
1471
PIN_PUPDR_PULLDOWN(PJ05) | \
1472
PIN_PUPDR_PULLDOWN(PJ06) | \
1473
PIN_PUPDR_PULLDOWN(PJ07) | \
1474
PIN_PUPDR_PULLDOWN(PJ08) | \
1475
PIN_PUPDR_PULLDOWN(PJ09) | \
1476
PIN_PUPDR_PULLDOWN(PJ10) | \
1477
PIN_PUPDR_PULLDOWN(PJ11) | \
1478
PIN_PUPDR_PULLDOWN(PJ12) | \
1479
PIN_PUPDR_PULLDOWN(PJ13) | \
1480
PIN_PUPDR_PULLDOWN(PJ14) | \
1481
PIN_PUPDR_PULLDOWN(PJ15))
1482
1483
#define VAL_GPIOJ_ODR (PIN_ODR_LEVEL_LOW(PJ00) | \
1484
PIN_ODR_LEVEL_LOW(PJ01) | \
1485
PIN_ODR_LEVEL_LOW(PJ02) | \
1486
PIN_ODR_LEVEL_LOW(PJ03) | \
1487
PIN_ODR_LEVEL_LOW(PJ04) | \
1488
PIN_ODR_LEVEL_LOW(PJ05) | \
1489
PIN_ODR_LEVEL_LOW(PJ06) | \
1490
PIN_ODR_LEVEL_LOW(PJ07) | \
1491
PIN_ODR_LEVEL_LOW(PJ08) | \
1492
PIN_ODR_LEVEL_LOW(PJ09) | \
1493
PIN_ODR_LEVEL_LOW(PJ10) | \
1494
PIN_ODR_LEVEL_LOW(PJ11) | \
1495
PIN_ODR_LEVEL_LOW(PJ12) | \
1496
PIN_ODR_LEVEL_LOW(PJ13) | \
1497
PIN_ODR_LEVEL_LOW(PJ14) | \
1498
PIN_ODR_LEVEL_LOW(PJ15))
1499
1500
#define VAL_GPIOJ_AFRL (PIN_AFIO_AF(PJ00, 0) | \
1501
PIN_AFIO_AF(PJ01, 0) | \
1502
PIN_AFIO_AF(PJ02, 0) | \
1503
PIN_AFIO_AF(PJ03, 0) | \
1504
PIN_AFIO_AF(PJ04, 0) | \
1505
PIN_AFIO_AF(PJ05, 0) | \
1506
PIN_AFIO_AF(PJ06, 0) | \
1507
PIN_AFIO_AF(PJ07, 0))
1508
1509
#define VAL_GPIOJ_AFRH (PIN_AFIO_AF(PJ08, 0) | \
1510
PIN_AFIO_AF(PJ09, 0) | \
1511
PIN_AFIO_AF(PJ10, 0) | \
1512
PIN_AFIO_AF(PJ11, 0) | \
1513
PIN_AFIO_AF(PJ12, 0) | \
1514
PIN_AFIO_AF(PJ13, 0) | \
1515
PIN_AFIO_AF(PJ14, 0) | \
1516
PIN_AFIO_AF(PJ15, 0))
1517
1518
#define VAL_GPIOK_MODER (PIN_MODE_INPUT(PK00) | \
1519
PIN_MODE_INPUT(PK01) | \
1520
PIN_MODE_INPUT(PK02) | \
1521
PIN_MODE_INPUT(PK03) | \
1522
PIN_MODE_INPUT(PK04) | \
1523
PIN_MODE_INPUT(PK05) | \
1524
PIN_MODE_INPUT(PK06) | \
1525
PIN_MODE_INPUT(PK07) | \
1526
PIN_MODE_INPUT(PK08) | \
1527
PIN_MODE_INPUT(PK09) | \
1528
PIN_MODE_INPUT(PK10) | \
1529
PIN_MODE_INPUT(PK11) | \
1530
PIN_MODE_INPUT(PK12) | \
1531
PIN_MODE_INPUT(PK13) | \
1532
PIN_MODE_INPUT(PK14) | \
1533
PIN_MODE_INPUT(PK15))
1534
1535
#define VAL_GPIOK_OTYPER (PIN_OTYPE_PUSHPULL(PK00) | \
1536
PIN_OTYPE_PUSHPULL(PK01) | \
1537
PIN_OTYPE_PUSHPULL(PK02) | \
1538
PIN_OTYPE_PUSHPULL(PK03) | \
1539
PIN_OTYPE_PUSHPULL(PK04) | \
1540
PIN_OTYPE_PUSHPULL(PK05) | \
1541
PIN_OTYPE_PUSHPULL(PK06) | \
1542
PIN_OTYPE_PUSHPULL(PK07) | \
1543
PIN_OTYPE_PUSHPULL(PK08) | \
1544
PIN_OTYPE_PUSHPULL(PK09) | \
1545
PIN_OTYPE_PUSHPULL(PK10) | \
1546
PIN_OTYPE_PUSHPULL(PK11) | \
1547
PIN_OTYPE_PUSHPULL(PK12) | \
1548
PIN_OTYPE_PUSHPULL(PK13) | \
1549
PIN_OTYPE_PUSHPULL(PK14) | \
1550
PIN_OTYPE_PUSHPULL(PK15))
1551
1552
#define VAL_GPIOK_OSPEEDR (PIN_OSPEED_SPEED_VERYLOW(PK00) | \
1553
PIN_OSPEED_SPEED_VERYLOW(PK01) | \
1554
PIN_OSPEED_SPEED_VERYLOW(PK02) | \
1555
PIN_OSPEED_SPEED_VERYLOW(PK03) | \
1556
PIN_OSPEED_SPEED_VERYLOW(PK04) | \
1557
PIN_OSPEED_SPEED_VERYLOW(PK05) | \
1558
PIN_OSPEED_SPEED_VERYLOW(PK06) | \
1559
PIN_OSPEED_SPEED_VERYLOW(PK07) | \
1560
PIN_OSPEED_SPEED_VERYLOW(PK08) | \
1561
PIN_OSPEED_SPEED_VERYLOW(PK09) | \
1562
PIN_OSPEED_SPEED_VERYLOW(PK10) | \
1563
PIN_OSPEED_SPEED_VERYLOW(PK11) | \
1564
PIN_OSPEED_SPEED_VERYLOW(PK12) | \
1565
PIN_OSPEED_SPEED_VERYLOW(PK13) | \
1566
PIN_OSPEED_SPEED_VERYLOW(PK14) | \
1567
PIN_OSPEED_SPEED_VERYLOW(PK15))
1568
1569
#define VAL_GPIOK_PUPDR (PIN_PUPDR_PULLDOWN(PK00) | \
1570
PIN_PUPDR_PULLDOWN(PK01) | \
1571
PIN_PUPDR_PULLDOWN(PK02) | \
1572
PIN_PUPDR_PULLDOWN(PK03) | \
1573
PIN_PUPDR_PULLDOWN(PK04) | \
1574
PIN_PUPDR_PULLDOWN(PK05) | \
1575
PIN_PUPDR_PULLDOWN(PK06) | \
1576
PIN_PUPDR_PULLDOWN(PK07) | \
1577
PIN_PUPDR_PULLDOWN(PK08) | \
1578
PIN_PUPDR_PULLDOWN(PK09) | \
1579
PIN_PUPDR_PULLDOWN(PK10) | \
1580
PIN_PUPDR_PULLDOWN(PK11) | \
1581
PIN_PUPDR_PULLDOWN(PK12) | \
1582
PIN_PUPDR_PULLDOWN(PK13) | \
1583
PIN_PUPDR_PULLDOWN(PK14) | \
1584
PIN_PUPDR_PULLDOWN(PK15))
1585
1586
#define VAL_GPIOK_ODR (PIN_ODR_LEVEL_LOW(PK00) | \
1587
PIN_ODR_LEVEL_LOW(PK01) | \
1588
PIN_ODR_LEVEL_LOW(PK02) | \
1589
PIN_ODR_LEVEL_LOW(PK03) | \
1590
PIN_ODR_LEVEL_LOW(PK04) | \
1591
PIN_ODR_LEVEL_LOW(PK05) | \
1592
PIN_ODR_LEVEL_LOW(PK06) | \
1593
PIN_ODR_LEVEL_LOW(PK07) | \
1594
PIN_ODR_LEVEL_LOW(PK08) | \
1595
PIN_ODR_LEVEL_LOW(PK09) | \
1596
PIN_ODR_LEVEL_LOW(PK10) | \
1597
PIN_ODR_LEVEL_LOW(PK11) | \
1598
PIN_ODR_LEVEL_LOW(PK12) | \
1599
PIN_ODR_LEVEL_LOW(PK13) | \
1600
PIN_ODR_LEVEL_LOW(PK14) | \
1601
PIN_ODR_LEVEL_LOW(PK15))
1602
1603
#define VAL_GPIOK_AFRL (PIN_AFIO_AF(PK00, 0) | \
1604
PIN_AFIO_AF(PK01, 0) | \
1605
PIN_AFIO_AF(PK02, 0) | \
1606
PIN_AFIO_AF(PK03, 0) | \
1607
PIN_AFIO_AF(PK04, 0) | \
1608
PIN_AFIO_AF(PK05, 0) | \
1609
PIN_AFIO_AF(PK06, 0) | \
1610
PIN_AFIO_AF(PK07, 0))
1611
1612
#define VAL_GPIOK_AFRH (PIN_AFIO_AF(PK08, 0) | \
1613
PIN_AFIO_AF(PK09, 0) | \
1614
PIN_AFIO_AF(PK10, 0) | \
1615
PIN_AFIO_AF(PK11, 0) | \
1616
PIN_AFIO_AF(PK12, 0) | \
1617
PIN_AFIO_AF(PK13, 0) | \
1618
PIN_AFIO_AF(PK14, 0) | \
1619
PIN_AFIO_AF(PK15, 0))
1620
1621
#define AF_MOTOR1 1U
1622
#define AF_LINE_MOTOR1 1U
1623
#define AF_E_TX2 7U
1624
#define AF_LINE_E_TX2 7U
1625
#define AF_E_RX2 7U
1626
#define AF_LINE_E_RX2 7U
1627
#define AF_E_SCK 5U
1628
#define AF_LINE_E_SCK 5U
1629
#define AF_E_MISO 5U
1630
#define AF_LINE_E_MISO 5U
1631
#define AF_E_MOSI 5U
1632
#define AF_LINE_E_MOSI 5U
1633
#define AF_IMU_SCL 4U
1634
#define AF_LINE_IMU_SCL 4U
1635
#define AF_USB_ID 10U
1636
#define AF_LINE_USB_ID 10U
1637
#define AF_USB_DM 10U
1638
#define AF_LINE_USB_DM 10U
1639
#define AF_USB_DP 10U
1640
#define AF_LINE_USB_DP 10U
1641
#define AF_STM_SWIO 0U
1642
#define AF_LINE_STM_SWIO 0U
1643
#define AF_STM_SWCLK 0U
1644
#define AF_LINE_STM_SWCLK 0U
1645
#define AF_MOTOR3 1U
1646
#define AF_LINE_MOTOR3 1U
1647
#define AF_E_SCL 4U
1648
#define AF_LINE_E_SCL 4U
1649
#define AF_E_SDA 4U
1650
#define AF_LINE_E_SDA 4U
1651
#define AF_MOTOR4 2U
1652
#define AF_LINE_MOTOR4 2U
1653
#define AF_MOTOR2 1U
1654
#define AF_LINE_MOTOR2 1U
1655
#define AF_NRF_TX 8U
1656
#define AF_LINE_NRF_TX 8U
1657
#define AF_NRF_RX 8U
1658
#define AF_LINE_NRF_RX 8U
1659
#define AF_IMU_SDA 4U
1660
#define AF_LINE_IMU_SDA 4U
1661
#define AF_E_TX1 7U
1662
#define AF_LINE_E_TX1 7U
1663
#define AF_E_RX1 7U
1664
#define AF_LINE_E_RX1 7U
1665
#define AF_OSC_IN 0U
1666
#define AF_LINE_OSC_IN 0U
1667
#define AF_OSC_OUT 0U
1668
#define AF_LINE_OSC_OUT 0U
1669
1670
1671
#if !defined(_FROM_ASM_)
1672
#ifdef __cplusplus
1673
extern
"C"
{
1674
#endif
1675
void
boardInit
(
void
);
1676
#ifdef __cplusplus
1677
}
1678
#endif
1679
#endif
/* _FROM_ASM_ */
1680
boardInit
void boardInit(void)
Board-specific initialization code.
Definition:
board.c:261
sw
airborne
boards
crazyflie
chibios
v2.1
board.h
Generated on Wed Feb 10 2021 04:33:56 for Paparazzi UAS by
1.8.8