Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
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 MOTOR1 1U
59
#define E_TX2 2U
60
#define E_RX2 3U
61
#define NRF_FLOW_CTRL 4U
62
#define E_SCK 5U
63
#define E_MISO 6U
64
#define E_MOSI 7U
65
#define I2C3_SCL 8U
66
#define PA09 9U
67
#define USB_ID 10U
68
#define USB_DM 11U
69
#define USB_DP 12U
70
#define STM_SWIO 13U
71
#define STM_SWCLK 14U
72
#define MOTOR3 15U
73
74
#define PB00 0U
75
#define PB01 1U
76
#define BOOT1 2U
77
#define PB03 3U
78
#define E_CS1 4U
79
#define E_CS2 5U
80
#define I2C1_SCL 6U
81
#define I2C1_SDA 7U
82
#define E_CS3 8U
83
#define MOTOR4 9U
84
#define PB10 10U
85
#define MOTOR2 11U
86
#define PB12 12U
87
#define NRF_SWCLK 13U
88
#define PB14 14U
89
#define NRF_SWIO 15U
90
91
#define LED_RED_L 0U
92
#define LED_GREEN_L 1U
93
#define LED_GREEN_R 2U
94
#define LED_RED_R 3U
95
#define PC04 4U
96
#define PC05 5U
97
#define NRF_TX 6U
98
#define NRF_RX 7U
99
#define PC08 8U
100
#define I2C3_SDA 9U
101
#define E_TX1 10U
102
#define E_RX1 11U
103
#define E_CS0 12U
104
#define PC13 13U
105
#define PC14 14U
106
#define PC15 15U
107
108
#define PD00 0U
109
#define PD01 1U
110
#define LED_BLUE_L 2U
111
#define PD03 3U
112
#define PD04 4U
113
#define PD05 5U
114
#define PD06 6U
115
#define PD07 7U
116
#define PD08 8U
117
#define PD09 9U
118
#define PD10 10U
119
#define PD11 11U
120
#define PD12 12U
121
#define PD13 13U
122
#define PD14 14U
123
#define PD15 15U
124
125
#define PE00 0U
126
#define PE01 1U
127
#define PE02 2U
128
#define PE03 3U
129
#define PE04 4U
130
#define PE05 5U
131
#define PE06 6U
132
#define PE07 7U
133
#define PE08 8U
134
#define PE09 9U
135
#define PE10 10U
136
#define PE11 11U
137
#define PE12 12U
138
#define PE13 13U
139
#define PE14 14U
140
#define PE15 15U
141
142
#define PF00 0U
143
#define PF01 1U
144
#define PF02 2U
145
#define PF03 3U
146
#define PF04 4U
147
#define PF05 5U
148
#define PF06 6U
149
#define PF07 7U
150
#define PF08 8U
151
#define PF09 9U
152
#define PF10 10U
153
#define PF11 11U
154
#define PF12 12U
155
#define PF13 13U
156
#define PF14 14U
157
#define PF15 15U
158
159
#define PG00 0U
160
#define PG01 1U
161
#define PG02 2U
162
#define PG03 3U
163
#define PG04 4U
164
#define PG05 5U
165
#define PG06 6U
166
#define PG07 7U
167
#define PG08 8U
168
#define PG09 9U
169
#define PG10 10U
170
#define PG11 11U
171
#define PG12 12U
172
#define PG13 13U
173
#define PG14 14U
174
#define PG15 15U
175
176
#define OSC_IN 0U
177
#define OSC_OUT 1U
178
#define PH02 2U
179
#define PH03 3U
180
#define PH04 4U
181
#define PH05 5U
182
#define PH06 6U
183
#define PH07 7U
184
#define PH08 8U
185
#define PH09 9U
186
#define PH10 10U
187
#define PH11 11U
188
#define PH12 12U
189
#define PH13 13U
190
#define PH14 14U
191
#define PH15 15U
192
193
#define PI00 0U
194
#define PI01 1U
195
#define PI02 2U
196
#define PI03 3U
197
#define PI04 4U
198
#define PI05 5U
199
#define PI06 6U
200
#define PI07 7U
201
#define PI08 8U
202
#define PI09 9U
203
#define PI10 10U
204
#define PI11 11U
205
#define PI12 12U
206
#define PI13 13U
207
#define PI14 14U
208
#define PI15 15U
209
210
#define PJ00 0U
211
#define PJ01 1U
212
#define PJ02 2U
213
#define PJ03 3U
214
#define PJ04 4U
215
#define PJ05 5U
216
#define PJ06 6U
217
#define PJ07 7U
218
#define PJ08 8U
219
#define PJ09 9U
220
#define PJ10 10U
221
#define PJ11 11U
222
#define PJ12 12U
223
#define PJ13 13U
224
#define PJ14 14U
225
#define PJ15 15U
226
227
#define PK00 0U
228
#define PK01 1U
229
#define PK02 2U
230
#define PK03 3U
231
#define PK04 4U
232
#define PK05 5U
233
#define PK06 6U
234
#define PK07 7U
235
#define PK08 8U
236
#define PK09 9U
237
#define PK10 10U
238
#define PK11 11U
239
#define PK12 12U
240
#define PK13 13U
241
#define PK14 14U
242
#define PK15 15U
243
244
/*
245
* IO lines assignments.
246
*/
247
#define LINE_MOTOR1 PAL_LINE(GPIOA, 1U)
248
#define LINE_E_TX2 PAL_LINE(GPIOA, 2U)
249
#define LINE_E_RX2 PAL_LINE(GPIOA, 3U)
250
#define LINE_NRF_FLOW_CTRL PAL_LINE(GPIOA, 4U)
251
#define LINE_E_SCK PAL_LINE(GPIOA, 5U)
252
#define LINE_E_MISO PAL_LINE(GPIOA, 6U)
253
#define LINE_E_MOSI PAL_LINE(GPIOA, 7U)
254
#define LINE_I2C3_SCL PAL_LINE(GPIOA, 8U)
255
#define LINE_USB_ID PAL_LINE(GPIOA, 10U)
256
#define LINE_USB_DM PAL_LINE(GPIOA, 11U)
257
#define LINE_USB_DP PAL_LINE(GPIOA, 12U)
258
#define LINE_STM_SWIO PAL_LINE(GPIOA, 13U)
259
#define LINE_STM_SWCLK PAL_LINE(GPIOA, 14U)
260
#define LINE_MOTOR3 PAL_LINE(GPIOA, 15U)
261
262
#define LINE_BOOT1 PAL_LINE(GPIOB, 2U)
263
#define LINE_E_CS1 PAL_LINE(GPIOB, 4U)
264
#define LINE_E_CS2 PAL_LINE(GPIOB, 5U)
265
#define LINE_I2C1_SCL PAL_LINE(GPIOB, 6U)
266
#define LINE_I2C1_SDA PAL_LINE(GPIOB, 7U)
267
#define LINE_E_CS3 PAL_LINE(GPIOB, 8U)
268
#define LINE_MOTOR4 PAL_LINE(GPIOB, 9U)
269
#define LINE_MOTOR2 PAL_LINE(GPIOB, 11U)
270
#define LINE_NRF_SWCLK PAL_LINE(GPIOB, 13U)
271
#define LINE_NRF_SWIO PAL_LINE(GPIOB, 15U)
272
273
#define LINE_LED_RED_L PAL_LINE(GPIOC, 0U)
274
#define LINE_LED_GREEN_L PAL_LINE(GPIOC, 1U)
275
#define LINE_LED_GREEN_R PAL_LINE(GPIOC, 2U)
276
#define LINE_LED_RED_R PAL_LINE(GPIOC, 3U)
277
#define LINE_NRF_TX PAL_LINE(GPIOC, 6U)
278
#define LINE_NRF_RX PAL_LINE(GPIOC, 7U)
279
#define LINE_I2C3_SDA PAL_LINE(GPIOC, 9U)
280
#define LINE_E_TX1 PAL_LINE(GPIOC, 10U)
281
#define LINE_E_RX1 PAL_LINE(GPIOC, 11U)
282
#define LINE_E_CS0 PAL_LINE(GPIOC, 12U)
283
284
#define LINE_LED_BLUE_L PAL_LINE(GPIOD, 2U)
285
286
#define LINE_OSC_IN PAL_LINE(GPIOH, 0U)
287
#define LINE_OSC_OUT PAL_LINE(GPIOH, 1U)
288
289
290
/*
291
* I/O ports initial setup, this configuration is established soon after reset
292
* in the initialization code.
293
* Please refer to the STM32 Reference Manual for details.
294
*/
295
#define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
296
#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
297
#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
298
#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
299
#define PIN_ODR_LEVEL_LOW(n) (0U << (n))
300
#define PIN_ODR_LEVEL_HIGH(n) (1U << (n))
301
#define PIN_OTYPE_PUSHPULL(n) (0U << (n))
302
#define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
303
#define PIN_OSPEED_SPEED_VERYLOW(n) (0U << ((n) * 2U))
304
#define PIN_OSPEED_SPEED_LOW(n) (1U << ((n) * 2U))
305
#define PIN_OSPEED_SPEED_MEDIUM(n) (2U << ((n) * 2U))
306
#define PIN_OSPEED_SPEED_HIGH(n) (3U << ((n) * 2U))
307
#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
308
#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
309
#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
310
#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
311
312
#define VAL_GPIOA_MODER (PIN_MODE_INPUT(PA00) | \
313
PIN_MODE_ALTERNATE(MOTOR1) | \
314
PIN_MODE_ALTERNATE(E_TX2) | \
315
PIN_MODE_ALTERNATE(E_RX2) | \
316
PIN_MODE_INPUT(NRF_FLOW_CTRL) | \
317
PIN_MODE_ALTERNATE(E_SCK) | \
318
PIN_MODE_ALTERNATE(E_MISO) | \
319
PIN_MODE_ALTERNATE(E_MOSI) | \
320
PIN_MODE_ALTERNATE(I2C3_SCL) | \
321
PIN_MODE_INPUT(PA09) | \
322
PIN_MODE_ALTERNATE(USB_ID) | \
323
PIN_MODE_ALTERNATE(USB_DM) | \
324
PIN_MODE_ALTERNATE(USB_DP) | \
325
PIN_MODE_ALTERNATE(STM_SWIO) | \
326
PIN_MODE_ALTERNATE(STM_SWCLK) | \
327
PIN_MODE_ALTERNATE(MOTOR3))
328
329
#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(PA00) | \
330
PIN_OTYPE_PUSHPULL(MOTOR1) | \
331
PIN_OTYPE_PUSHPULL(E_TX2) | \
332
PIN_OTYPE_PUSHPULL(E_RX2) | \
333
PIN_OTYPE_OPENDRAIN(NRF_FLOW_CTRL) | \
334
PIN_OTYPE_PUSHPULL(E_SCK) | \
335
PIN_OTYPE_PUSHPULL(E_MISO) | \
336
PIN_OTYPE_PUSHPULL(E_MOSI) | \
337
PIN_OTYPE_OPENDRAIN(I2C3_SCL) | \
338
PIN_OTYPE_PUSHPULL(PA09) | \
339
PIN_OTYPE_PUSHPULL(USB_ID) | \
340
PIN_OTYPE_PUSHPULL(USB_DM) | \
341
PIN_OTYPE_PUSHPULL(USB_DP) | \
342
PIN_OTYPE_PUSHPULL(STM_SWIO) | \
343
PIN_OTYPE_PUSHPULL(STM_SWCLK) | \
344
PIN_OTYPE_PUSHPULL(MOTOR3))
345
346
#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_SPEED_VERYLOW(PA00) | \
347
PIN_OSPEED_SPEED_HIGH(MOTOR1) | \
348
PIN_OSPEED_SPEED_HIGH(E_TX2) | \
349
PIN_OSPEED_SPEED_HIGH(E_RX2) | \
350
PIN_OSPEED_SPEED_VERYLOW(NRF_FLOW_CTRL) | \
351
PIN_OSPEED_SPEED_HIGH(E_SCK) | \
352
PIN_OSPEED_SPEED_HIGH(E_MISO) | \
353
PIN_OSPEED_SPEED_HIGH(E_MOSI) | \
354
PIN_OSPEED_SPEED_HIGH(I2C3_SCL) | \
355
PIN_OSPEED_SPEED_VERYLOW(PA09) | \
356
PIN_OSPEED_SPEED_HIGH(USB_ID) | \
357
PIN_OSPEED_SPEED_HIGH(USB_DM) | \
358
PIN_OSPEED_SPEED_HIGH(USB_DP) | \
359
PIN_OSPEED_SPEED_HIGH(STM_SWIO) | \
360
PIN_OSPEED_SPEED_HIGH(STM_SWCLK) | \
361
PIN_OSPEED_SPEED_HIGH(MOTOR3))
362
363
#define VAL_GPIOA_PUPDR (PIN_PUPDR_PULLDOWN(PA00) | \
364
PIN_PUPDR_FLOATING(MOTOR1) | \
365
PIN_PUPDR_FLOATING(E_TX2) | \
366
PIN_PUPDR_FLOATING(E_RX2) | \
367
PIN_PUPDR_FLOATING(NRF_FLOW_CTRL) | \
368
PIN_PUPDR_FLOATING(E_SCK) | \
369
PIN_PUPDR_FLOATING(E_MISO) | \
370
PIN_PUPDR_FLOATING(E_MOSI) | \
371
PIN_PUPDR_PULLUP(I2C3_SCL) | \
372
PIN_PUPDR_PULLDOWN(PA09) | \
373
PIN_PUPDR_FLOATING(USB_ID) | \
374
PIN_PUPDR_FLOATING(USB_DM) | \
375
PIN_PUPDR_FLOATING(USB_DP) | \
376
PIN_PUPDR_FLOATING(STM_SWIO) | \
377
PIN_PUPDR_FLOATING(STM_SWCLK) | \
378
PIN_PUPDR_FLOATING(MOTOR3))
379
380
#define VAL_GPIOA_ODR (PIN_ODR_LEVEL_LOW(PA00) | \
381
PIN_ODR_LEVEL_LOW(MOTOR1) | \
382
PIN_ODR_LEVEL_HIGH(E_TX2) | \
383
PIN_ODR_LEVEL_HIGH(E_RX2) | \
384
PIN_ODR_LEVEL_LOW(NRF_FLOW_CTRL) | \
385
PIN_ODR_LEVEL_HIGH(E_SCK) | \
386
PIN_ODR_LEVEL_HIGH(E_MISO) | \
387
PIN_ODR_LEVEL_HIGH(E_MOSI) | \
388
PIN_ODR_LEVEL_HIGH(I2C3_SCL) | \
389
PIN_ODR_LEVEL_LOW(PA09) | \
390
PIN_ODR_LEVEL_HIGH(USB_ID) | \
391
PIN_ODR_LEVEL_HIGH(USB_DM) | \
392
PIN_ODR_LEVEL_HIGH(USB_DP) | \
393
PIN_ODR_LEVEL_HIGH(STM_SWIO) | \
394
PIN_ODR_LEVEL_HIGH(STM_SWCLK) | \
395
PIN_ODR_LEVEL_LOW(MOTOR3))
396
397
#define VAL_GPIOA_AFRL (PIN_AFIO_AF(PA00, 0) | \
398
PIN_AFIO_AF(MOTOR1, 1) | \
399
PIN_AFIO_AF(E_TX2, 7) | \
400
PIN_AFIO_AF(E_RX2, 7) | \
401
PIN_AFIO_AF(NRF_FLOW_CTRL, 0) | \
402
PIN_AFIO_AF(E_SCK, 5) | \
403
PIN_AFIO_AF(E_MISO, 5) | \
404
PIN_AFIO_AF(E_MOSI, 5))
405
406
#define VAL_GPIOA_AFRH (PIN_AFIO_AF(I2C3_SCL, 4) | \
407
PIN_AFIO_AF(PA09, 0) | \
408
PIN_AFIO_AF(USB_ID, 10) | \
409
PIN_AFIO_AF(USB_DM, 10) | \
410
PIN_AFIO_AF(USB_DP, 10) | \
411
PIN_AFIO_AF(STM_SWIO, 0) | \
412
PIN_AFIO_AF(STM_SWCLK, 0) | \
413
PIN_AFIO_AF(MOTOR3, 1))
414
415
#define VAL_GPIOB_MODER (PIN_MODE_INPUT(PB00) | \
416
PIN_MODE_INPUT(PB01) | \
417
PIN_MODE_INPUT(BOOT1) | \
418
PIN_MODE_INPUT(PB03) | \
419
PIN_MODE_INPUT(E_CS1) | \
420
PIN_MODE_INPUT(E_CS2) | \
421
PIN_MODE_ALTERNATE(I2C1_SCL) | \
422
PIN_MODE_ALTERNATE(I2C1_SDA) | \
423
PIN_MODE_INPUT(E_CS3) | \
424
PIN_MODE_ALTERNATE(MOTOR4) | \
425
PIN_MODE_INPUT(PB10) | \
426
PIN_MODE_ALTERNATE(MOTOR2) | \
427
PIN_MODE_INPUT(PB12) | \
428
PIN_MODE_INPUT(NRF_SWCLK) | \
429
PIN_MODE_INPUT(PB14) | \
430
PIN_MODE_INPUT(NRF_SWIO))
431
432
#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(PB00) | \
433
PIN_OTYPE_PUSHPULL(PB01) | \
434
PIN_OTYPE_OPENDRAIN(BOOT1) | \
435
PIN_OTYPE_PUSHPULL(PB03) | \
436
PIN_OTYPE_OPENDRAIN(E_CS1) | \
437
PIN_OTYPE_OPENDRAIN(E_CS2) | \
438
PIN_OTYPE_OPENDRAIN(I2C1_SCL) | \
439
PIN_OTYPE_OPENDRAIN(I2C1_SDA) | \
440
PIN_OTYPE_OPENDRAIN(E_CS3) | \
441
PIN_OTYPE_PUSHPULL(MOTOR4) | \
442
PIN_OTYPE_PUSHPULL(PB10) | \
443
PIN_OTYPE_PUSHPULL(MOTOR2) | \
444
PIN_OTYPE_PUSHPULL(PB12) | \
445
PIN_OTYPE_OPENDRAIN(NRF_SWCLK) | \
446
PIN_OTYPE_PUSHPULL(PB14) | \
447
PIN_OTYPE_OPENDRAIN(NRF_SWIO))
448
449
#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_SPEED_VERYLOW(PB00) | \
450
PIN_OSPEED_SPEED_VERYLOW(PB01) | \
451
PIN_OSPEED_SPEED_VERYLOW(BOOT1) | \
452
PIN_OSPEED_SPEED_VERYLOW(PB03) | \
453
PIN_OSPEED_SPEED_VERYLOW(E_CS1) | \
454
PIN_OSPEED_SPEED_VERYLOW(E_CS2) | \
455
PIN_OSPEED_SPEED_HIGH(I2C1_SCL) | \
456
PIN_OSPEED_SPEED_HIGH(I2C1_SDA) | \
457
PIN_OSPEED_SPEED_VERYLOW(E_CS3) | \
458
PIN_OSPEED_SPEED_HIGH(MOTOR4) | \
459
PIN_OSPEED_SPEED_VERYLOW(PB10) | \
460
PIN_OSPEED_SPEED_HIGH(MOTOR2) | \
461
PIN_OSPEED_SPEED_VERYLOW(PB12) | \
462
PIN_OSPEED_SPEED_VERYLOW(NRF_SWCLK) | \
463
PIN_OSPEED_SPEED_VERYLOW(PB14) | \
464
PIN_OSPEED_SPEED_VERYLOW(NRF_SWIO))
465
466
#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLDOWN(PB00) | \
467
PIN_PUPDR_PULLDOWN(PB01) | \
468
PIN_PUPDR_FLOATING(BOOT1) | \
469
PIN_PUPDR_PULLDOWN(PB03) | \
470
PIN_PUPDR_FLOATING(E_CS1) | \
471
PIN_PUPDR_FLOATING(E_CS2) | \
472
PIN_PUPDR_PULLUP(I2C1_SCL) | \
473
PIN_PUPDR_PULLUP(I2C1_SDA) | \
474
PIN_PUPDR_FLOATING(E_CS3) | \
475
PIN_PUPDR_FLOATING(MOTOR4) | \
476
PIN_PUPDR_PULLDOWN(PB10) | \
477
PIN_PUPDR_FLOATING(MOTOR2) | \
478
PIN_PUPDR_PULLDOWN(PB12) | \
479
PIN_PUPDR_FLOATING(NRF_SWCLK) | \
480
PIN_PUPDR_PULLDOWN(PB14) | \
481
PIN_PUPDR_FLOATING(NRF_SWIO))
482
483
#define VAL_GPIOB_ODR (PIN_ODR_LEVEL_LOW(PB00) | \
484
PIN_ODR_LEVEL_LOW(PB01) | \
485
PIN_ODR_LEVEL_LOW(BOOT1) | \
486
PIN_ODR_LEVEL_LOW(PB03) | \
487
PIN_ODR_LEVEL_LOW(E_CS1) | \
488
PIN_ODR_LEVEL_LOW(E_CS2) | \
489
PIN_ODR_LEVEL_HIGH(I2C1_SCL) | \
490
PIN_ODR_LEVEL_HIGH(I2C1_SDA) | \
491
PIN_ODR_LEVEL_LOW(E_CS3) | \
492
PIN_ODR_LEVEL_LOW(MOTOR4) | \
493
PIN_ODR_LEVEL_LOW(PB10) | \
494
PIN_ODR_LEVEL_LOW(MOTOR2) | \
495
PIN_ODR_LEVEL_LOW(PB12) | \
496
PIN_ODR_LEVEL_LOW(NRF_SWCLK) | \
497
PIN_ODR_LEVEL_LOW(PB14) | \
498
PIN_ODR_LEVEL_LOW(NRF_SWIO))
499
500
#define VAL_GPIOB_AFRL (PIN_AFIO_AF(PB00, 0) | \
501
PIN_AFIO_AF(PB01, 0) | \
502
PIN_AFIO_AF(BOOT1, 0) | \
503
PIN_AFIO_AF(PB03, 0) | \
504
PIN_AFIO_AF(E_CS1, 0) | \
505
PIN_AFIO_AF(E_CS2, 0) | \
506
PIN_AFIO_AF(I2C1_SCL, 4) | \
507
PIN_AFIO_AF(I2C1_SDA, 4))
508
509
#define VAL_GPIOB_AFRH (PIN_AFIO_AF(E_CS3, 0) | \
510
PIN_AFIO_AF(MOTOR4, 2) | \
511
PIN_AFIO_AF(PB10, 0) | \
512
PIN_AFIO_AF(MOTOR2, 1) | \
513
PIN_AFIO_AF(PB12, 0) | \
514
PIN_AFIO_AF(NRF_SWCLK, 0) | \
515
PIN_AFIO_AF(PB14, 0) | \
516
PIN_AFIO_AF(NRF_SWIO, 0))
517
518
#define VAL_GPIOC_MODER (PIN_MODE_OUTPUT(LED_RED_L) | \
519
PIN_MODE_OUTPUT(LED_GREEN_L) | \
520
PIN_MODE_OUTPUT(LED_GREEN_R) | \
521
PIN_MODE_OUTPUT(LED_RED_R) | \
522
PIN_MODE_INPUT(PC04) | \
523
PIN_MODE_INPUT(PC05) | \
524
PIN_MODE_ALTERNATE(NRF_TX) | \
525
PIN_MODE_ALTERNATE(NRF_RX) | \
526
PIN_MODE_INPUT(PC08) | \
527
PIN_MODE_ALTERNATE(I2C3_SDA) | \
528
PIN_MODE_ALTERNATE(E_TX1) | \
529
PIN_MODE_ALTERNATE(E_RX1) | \
530
PIN_MODE_INPUT(E_CS0) | \
531
PIN_MODE_INPUT(PC13) | \
532
PIN_MODE_INPUT(PC14) | \
533
PIN_MODE_INPUT(PC15))
534
535
#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(LED_RED_L) | \
536
PIN_OTYPE_PUSHPULL(LED_GREEN_L) | \
537
PIN_OTYPE_PUSHPULL(LED_GREEN_R) | \
538
PIN_OTYPE_PUSHPULL(LED_RED_R) | \
539
PIN_OTYPE_PUSHPULL(PC04) | \
540
PIN_OTYPE_PUSHPULL(PC05) | \
541
PIN_OTYPE_PUSHPULL(NRF_TX) | \
542
PIN_OTYPE_PUSHPULL(NRF_RX) | \
543
PIN_OTYPE_PUSHPULL(PC08) | \
544
PIN_OTYPE_OPENDRAIN(I2C3_SDA) | \
545
PIN_OTYPE_PUSHPULL(E_TX1) | \
546
PIN_OTYPE_PUSHPULL(E_RX1) | \
547
PIN_OTYPE_OPENDRAIN(E_CS0) | \
548
PIN_OTYPE_PUSHPULL(PC13) | \
549
PIN_OTYPE_PUSHPULL(PC14) | \
550
PIN_OTYPE_PUSHPULL(PC15))
551
552
#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_SPEED_VERYLOW(LED_RED_L) | \
553
PIN_OSPEED_SPEED_VERYLOW(LED_GREEN_L) | \
554
PIN_OSPEED_SPEED_VERYLOW(LED_GREEN_R) | \
555
PIN_OSPEED_SPEED_VERYLOW(LED_RED_R) | \
556
PIN_OSPEED_SPEED_VERYLOW(PC04) | \
557
PIN_OSPEED_SPEED_VERYLOW(PC05) | \
558
PIN_OSPEED_SPEED_HIGH(NRF_TX) | \
559
PIN_OSPEED_SPEED_HIGH(NRF_RX) | \
560
PIN_OSPEED_SPEED_VERYLOW(PC08) | \
561
PIN_OSPEED_SPEED_HIGH(I2C3_SDA) | \
562
PIN_OSPEED_SPEED_HIGH(E_TX1) | \
563
PIN_OSPEED_SPEED_HIGH(E_RX1) | \
564
PIN_OSPEED_SPEED_VERYLOW(E_CS0) | \
565
PIN_OSPEED_SPEED_VERYLOW(PC13) | \
566
PIN_OSPEED_SPEED_VERYLOW(PC14) | \
567
PIN_OSPEED_SPEED_VERYLOW(PC15))
568
569
#define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(LED_RED_L) | \
570
PIN_PUPDR_FLOATING(LED_GREEN_L) | \
571
PIN_PUPDR_FLOATING(LED_GREEN_R) | \
572
PIN_PUPDR_FLOATING(LED_RED_R) | \
573
PIN_PUPDR_PULLDOWN(PC04) | \
574
PIN_PUPDR_PULLDOWN(PC05) | \
575
PIN_PUPDR_FLOATING(NRF_TX) | \
576
PIN_PUPDR_FLOATING(NRF_RX) | \
577
PIN_PUPDR_PULLDOWN(PC08) | \
578
PIN_PUPDR_PULLUP(I2C3_SDA) | \
579
PIN_PUPDR_FLOATING(E_TX1) | \
580
PIN_PUPDR_FLOATING(E_RX1) | \
581
PIN_PUPDR_FLOATING(E_CS0) | \
582
PIN_PUPDR_PULLDOWN(PC13) | \
583
PIN_PUPDR_PULLDOWN(PC14) | \
584
PIN_PUPDR_PULLDOWN(PC15))
585
586
#define VAL_GPIOC_ODR (PIN_ODR_LEVEL_LOW(LED_RED_L) | \
587
PIN_ODR_LEVEL_LOW(LED_GREEN_L) | \
588
PIN_ODR_LEVEL_LOW(LED_GREEN_R) | \
589
PIN_ODR_LEVEL_LOW(LED_RED_R) | \
590
PIN_ODR_LEVEL_LOW(PC04) | \
591
PIN_ODR_LEVEL_LOW(PC05) | \
592
PIN_ODR_LEVEL_HIGH(NRF_TX) | \
593
PIN_ODR_LEVEL_HIGH(NRF_RX) | \
594
PIN_ODR_LEVEL_LOW(PC08) | \
595
PIN_ODR_LEVEL_HIGH(I2C3_SDA) | \
596
PIN_ODR_LEVEL_HIGH(E_TX1) | \
597
PIN_ODR_LEVEL_HIGH(E_RX1) | \
598
PIN_ODR_LEVEL_LOW(E_CS0) | \
599
PIN_ODR_LEVEL_LOW(PC13) | \
600
PIN_ODR_LEVEL_LOW(PC14) | \
601
PIN_ODR_LEVEL_LOW(PC15))
602
603
#define VAL_GPIOC_AFRL (PIN_AFIO_AF(LED_RED_L, 0) | \
604
PIN_AFIO_AF(LED_GREEN_L, 0) | \
605
PIN_AFIO_AF(LED_GREEN_R, 0) | \
606
PIN_AFIO_AF(LED_RED_R, 0) | \
607
PIN_AFIO_AF(PC04, 0) | \
608
PIN_AFIO_AF(PC05, 0) | \
609
PIN_AFIO_AF(NRF_TX, 8) | \
610
PIN_AFIO_AF(NRF_RX, 8))
611
612
#define VAL_GPIOC_AFRH (PIN_AFIO_AF(PC08, 0) | \
613
PIN_AFIO_AF(I2C3_SDA, 4) | \
614
PIN_AFIO_AF(E_TX1, 7) | \
615
PIN_AFIO_AF(E_RX1, 7) | \
616
PIN_AFIO_AF(E_CS0, 0) | \
617
PIN_AFIO_AF(PC13, 0) | \
618
PIN_AFIO_AF(PC14, 0) | \
619
PIN_AFIO_AF(PC15, 0))
620
621
#define VAL_GPIOD_MODER (PIN_MODE_INPUT(PD00) | \
622
PIN_MODE_INPUT(PD01) | \
623
PIN_MODE_OUTPUT(LED_BLUE_L) | \
624
PIN_MODE_INPUT(PD03) | \
625
PIN_MODE_INPUT(PD04) | \
626
PIN_MODE_INPUT(PD05) | \
627
PIN_MODE_INPUT(PD06) | \
628
PIN_MODE_INPUT(PD07) | \
629
PIN_MODE_INPUT(PD08) | \
630
PIN_MODE_INPUT(PD09) | \
631
PIN_MODE_INPUT(PD10) | \
632
PIN_MODE_INPUT(PD11) | \
633
PIN_MODE_INPUT(PD12) | \
634
PIN_MODE_INPUT(PD13) | \
635
PIN_MODE_INPUT(PD14) | \
636
PIN_MODE_INPUT(PD15))
637
638
#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(PD00) | \
639
PIN_OTYPE_PUSHPULL(PD01) | \
640
PIN_OTYPE_PUSHPULL(LED_BLUE_L) | \
641
PIN_OTYPE_PUSHPULL(PD03) | \
642
PIN_OTYPE_PUSHPULL(PD04) | \
643
PIN_OTYPE_PUSHPULL(PD05) | \
644
PIN_OTYPE_PUSHPULL(PD06) | \
645
PIN_OTYPE_PUSHPULL(PD07) | \
646
PIN_OTYPE_PUSHPULL(PD08) | \
647
PIN_OTYPE_PUSHPULL(PD09) | \
648
PIN_OTYPE_PUSHPULL(PD10) | \
649
PIN_OTYPE_PUSHPULL(PD11) | \
650
PIN_OTYPE_PUSHPULL(PD12) | \
651
PIN_OTYPE_PUSHPULL(PD13) | \
652
PIN_OTYPE_PUSHPULL(PD14) | \
653
PIN_OTYPE_PUSHPULL(PD15))
654
655
#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_SPEED_VERYLOW(PD00) | \
656
PIN_OSPEED_SPEED_VERYLOW(PD01) | \
657
PIN_OSPEED_SPEED_VERYLOW(LED_BLUE_L) | \
658
PIN_OSPEED_SPEED_VERYLOW(PD03) | \
659
PIN_OSPEED_SPEED_VERYLOW(PD04) | \
660
PIN_OSPEED_SPEED_VERYLOW(PD05) | \
661
PIN_OSPEED_SPEED_VERYLOW(PD06) | \
662
PIN_OSPEED_SPEED_VERYLOW(PD07) | \
663
PIN_OSPEED_SPEED_VERYLOW(PD08) | \
664
PIN_OSPEED_SPEED_VERYLOW(PD09) | \
665
PIN_OSPEED_SPEED_VERYLOW(PD10) | \
666
PIN_OSPEED_SPEED_VERYLOW(PD11) | \
667
PIN_OSPEED_SPEED_VERYLOW(PD12) | \
668
PIN_OSPEED_SPEED_VERYLOW(PD13) | \
669
PIN_OSPEED_SPEED_VERYLOW(PD14) | \
670
PIN_OSPEED_SPEED_VERYLOW(PD15))
671
672
#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLDOWN(PD00) | \
673
PIN_PUPDR_PULLDOWN(PD01) | \
674
PIN_PUPDR_FLOATING(LED_BLUE_L) | \
675
PIN_PUPDR_PULLDOWN(PD03) | \
676
PIN_PUPDR_PULLDOWN(PD04) | \
677
PIN_PUPDR_PULLDOWN(PD05) | \
678
PIN_PUPDR_PULLDOWN(PD06) | \
679
PIN_PUPDR_PULLDOWN(PD07) | \
680
PIN_PUPDR_PULLDOWN(PD08) | \
681
PIN_PUPDR_PULLDOWN(PD09) | \
682
PIN_PUPDR_PULLDOWN(PD10) | \
683
PIN_PUPDR_PULLDOWN(PD11) | \
684
PIN_PUPDR_PULLDOWN(PD12) | \
685
PIN_PUPDR_PULLDOWN(PD13) | \
686
PIN_PUPDR_PULLDOWN(PD14) | \
687
PIN_PUPDR_PULLDOWN(PD15))
688
689
#define VAL_GPIOD_ODR (PIN_ODR_LEVEL_LOW(PD00) | \
690
PIN_ODR_LEVEL_LOW(PD01) | \
691
PIN_ODR_LEVEL_LOW(LED_BLUE_L) | \
692
PIN_ODR_LEVEL_LOW(PD03) | \
693
PIN_ODR_LEVEL_LOW(PD04) | \
694
PIN_ODR_LEVEL_LOW(PD05) | \
695
PIN_ODR_LEVEL_LOW(PD06) | \
696
PIN_ODR_LEVEL_LOW(PD07) | \
697
PIN_ODR_LEVEL_LOW(PD08) | \
698
PIN_ODR_LEVEL_LOW(PD09) | \
699
PIN_ODR_LEVEL_LOW(PD10) | \
700
PIN_ODR_LEVEL_LOW(PD11) | \
701
PIN_ODR_LEVEL_LOW(PD12) | \
702
PIN_ODR_LEVEL_LOW(PD13) | \
703
PIN_ODR_LEVEL_LOW(PD14) | \
704
PIN_ODR_LEVEL_LOW(PD15))
705
706
#define VAL_GPIOD_AFRL (PIN_AFIO_AF(PD00, 0) | \
707
PIN_AFIO_AF(PD01, 0) | \
708
PIN_AFIO_AF(LED_BLUE_L, 0) | \
709
PIN_AFIO_AF(PD03, 0) | \
710
PIN_AFIO_AF(PD04, 0) | \
711
PIN_AFIO_AF(PD05, 0) | \
712
PIN_AFIO_AF(PD06, 0) | \
713
PIN_AFIO_AF(PD07, 0))
714
715
#define VAL_GPIOD_AFRH (PIN_AFIO_AF(PD08, 0) | \
716
PIN_AFIO_AF(PD09, 0) | \
717
PIN_AFIO_AF(PD10, 0) | \
718
PIN_AFIO_AF(PD11, 0) | \
719
PIN_AFIO_AF(PD12, 0) | \
720
PIN_AFIO_AF(PD13, 0) | \
721
PIN_AFIO_AF(PD14, 0) | \
722
PIN_AFIO_AF(PD15, 0))
723
724
#define VAL_GPIOE_MODER (PIN_MODE_INPUT(PE00) | \
725
PIN_MODE_INPUT(PE01) | \
726
PIN_MODE_INPUT(PE02) | \
727
PIN_MODE_INPUT(PE03) | \
728
PIN_MODE_INPUT(PE04) | \
729
PIN_MODE_INPUT(PE05) | \
730
PIN_MODE_INPUT(PE06) | \
731
PIN_MODE_INPUT(PE07) | \
732
PIN_MODE_INPUT(PE08) | \
733
PIN_MODE_INPUT(PE09) | \
734
PIN_MODE_INPUT(PE10) | \
735
PIN_MODE_INPUT(PE11) | \
736
PIN_MODE_INPUT(PE12) | \
737
PIN_MODE_INPUT(PE13) | \
738
PIN_MODE_INPUT(PE14) | \
739
PIN_MODE_INPUT(PE15))
740
741
#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(PE00) | \
742
PIN_OTYPE_PUSHPULL(PE01) | \
743
PIN_OTYPE_PUSHPULL(PE02) | \
744
PIN_OTYPE_PUSHPULL(PE03) | \
745
PIN_OTYPE_PUSHPULL(PE04) | \
746
PIN_OTYPE_PUSHPULL(PE05) | \
747
PIN_OTYPE_PUSHPULL(PE06) | \
748
PIN_OTYPE_PUSHPULL(PE07) | \
749
PIN_OTYPE_PUSHPULL(PE08) | \
750
PIN_OTYPE_PUSHPULL(PE09) | \
751
PIN_OTYPE_PUSHPULL(PE10) | \
752
PIN_OTYPE_PUSHPULL(PE11) | \
753
PIN_OTYPE_PUSHPULL(PE12) | \
754
PIN_OTYPE_PUSHPULL(PE13) | \
755
PIN_OTYPE_PUSHPULL(PE14) | \
756
PIN_OTYPE_PUSHPULL(PE15))
757
758
#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_SPEED_VERYLOW(PE00) | \
759
PIN_OSPEED_SPEED_VERYLOW(PE01) | \
760
PIN_OSPEED_SPEED_VERYLOW(PE02) | \
761
PIN_OSPEED_SPEED_VERYLOW(PE03) | \
762
PIN_OSPEED_SPEED_VERYLOW(PE04) | \
763
PIN_OSPEED_SPEED_VERYLOW(PE05) | \
764
PIN_OSPEED_SPEED_VERYLOW(PE06) | \
765
PIN_OSPEED_SPEED_VERYLOW(PE07) | \
766
PIN_OSPEED_SPEED_VERYLOW(PE08) | \
767
PIN_OSPEED_SPEED_VERYLOW(PE09) | \
768
PIN_OSPEED_SPEED_VERYLOW(PE10) | \
769
PIN_OSPEED_SPEED_VERYLOW(PE11) | \
770
PIN_OSPEED_SPEED_VERYLOW(PE12) | \
771
PIN_OSPEED_SPEED_VERYLOW(PE13) | \
772
PIN_OSPEED_SPEED_VERYLOW(PE14) | \
773
PIN_OSPEED_SPEED_VERYLOW(PE15))
774
775
#define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLDOWN(PE00) | \
776
PIN_PUPDR_PULLDOWN(PE01) | \
777
PIN_PUPDR_PULLDOWN(PE02) | \
778
PIN_PUPDR_PULLDOWN(PE03) | \
779
PIN_PUPDR_PULLDOWN(PE04) | \
780
PIN_PUPDR_PULLDOWN(PE05) | \
781
PIN_PUPDR_PULLDOWN(PE06) | \
782
PIN_PUPDR_PULLDOWN(PE07) | \
783
PIN_PUPDR_PULLDOWN(PE08) | \
784
PIN_PUPDR_PULLDOWN(PE09) | \
785
PIN_PUPDR_PULLDOWN(PE10) | \
786
PIN_PUPDR_PULLDOWN(PE11) | \
787
PIN_PUPDR_PULLDOWN(PE12) | \
788
PIN_PUPDR_PULLDOWN(PE13) | \
789
PIN_PUPDR_PULLDOWN(PE14) | \
790
PIN_PUPDR_PULLDOWN(PE15))
791
792
#define VAL_GPIOE_ODR (PIN_ODR_LEVEL_LOW(PE00) | \
793
PIN_ODR_LEVEL_LOW(PE01) | \
794
PIN_ODR_LEVEL_LOW(PE02) | \
795
PIN_ODR_LEVEL_LOW(PE03) | \
796
PIN_ODR_LEVEL_LOW(PE04) | \
797
PIN_ODR_LEVEL_LOW(PE05) | \
798
PIN_ODR_LEVEL_LOW(PE06) | \
799
PIN_ODR_LEVEL_LOW(PE07) | \
800
PIN_ODR_LEVEL_LOW(PE08) | \
801
PIN_ODR_LEVEL_LOW(PE09) | \
802
PIN_ODR_LEVEL_LOW(PE10) | \
803
PIN_ODR_LEVEL_LOW(PE11) | \
804
PIN_ODR_LEVEL_LOW(PE12) | \
805
PIN_ODR_LEVEL_LOW(PE13) | \
806
PIN_ODR_LEVEL_LOW(PE14) | \
807
PIN_ODR_LEVEL_LOW(PE15))
808
809
#define VAL_GPIOE_AFRL (PIN_AFIO_AF(PE00, 0) | \
810
PIN_AFIO_AF(PE01, 0) | \
811
PIN_AFIO_AF(PE02, 0) | \
812
PIN_AFIO_AF(PE03, 0) | \
813
PIN_AFIO_AF(PE04, 0) | \
814
PIN_AFIO_AF(PE05, 0) | \
815
PIN_AFIO_AF(PE06, 0) | \
816
PIN_AFIO_AF(PE07, 0))
817
818
#define VAL_GPIOE_AFRH (PIN_AFIO_AF(PE08, 0) | \
819
PIN_AFIO_AF(PE09, 0) | \
820
PIN_AFIO_AF(PE10, 0) | \
821
PIN_AFIO_AF(PE11, 0) | \
822
PIN_AFIO_AF(PE12, 0) | \
823
PIN_AFIO_AF(PE13, 0) | \
824
PIN_AFIO_AF(PE14, 0) | \
825
PIN_AFIO_AF(PE15, 0))
826
827
#define VAL_GPIOF_MODER (PIN_MODE_INPUT(PF00) | \
828
PIN_MODE_INPUT(PF01) | \
829
PIN_MODE_INPUT(PF02) | \
830
PIN_MODE_INPUT(PF03) | \
831
PIN_MODE_INPUT(PF04) | \
832
PIN_MODE_INPUT(PF05) | \
833
PIN_MODE_INPUT(PF06) | \
834
PIN_MODE_INPUT(PF07) | \
835
PIN_MODE_INPUT(PF08) | \
836
PIN_MODE_INPUT(PF09) | \
837
PIN_MODE_INPUT(PF10) | \
838
PIN_MODE_INPUT(PF11) | \
839
PIN_MODE_INPUT(PF12) | \
840
PIN_MODE_INPUT(PF13) | \
841
PIN_MODE_INPUT(PF14) | \
842
PIN_MODE_INPUT(PF15))
843
844
#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(PF00) | \
845
PIN_OTYPE_PUSHPULL(PF01) | \
846
PIN_OTYPE_PUSHPULL(PF02) | \
847
PIN_OTYPE_PUSHPULL(PF03) | \
848
PIN_OTYPE_PUSHPULL(PF04) | \
849
PIN_OTYPE_PUSHPULL(PF05) | \
850
PIN_OTYPE_PUSHPULL(PF06) | \
851
PIN_OTYPE_PUSHPULL(PF07) | \
852
PIN_OTYPE_PUSHPULL(PF08) | \
853
PIN_OTYPE_PUSHPULL(PF09) | \
854
PIN_OTYPE_PUSHPULL(PF10) | \
855
PIN_OTYPE_PUSHPULL(PF11) | \
856
PIN_OTYPE_PUSHPULL(PF12) | \
857
PIN_OTYPE_PUSHPULL(PF13) | \
858
PIN_OTYPE_PUSHPULL(PF14) | \
859
PIN_OTYPE_PUSHPULL(PF15))
860
861
#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_SPEED_VERYLOW(PF00) | \
862
PIN_OSPEED_SPEED_VERYLOW(PF01) | \
863
PIN_OSPEED_SPEED_VERYLOW(PF02) | \
864
PIN_OSPEED_SPEED_VERYLOW(PF03) | \
865
PIN_OSPEED_SPEED_VERYLOW(PF04) | \
866
PIN_OSPEED_SPEED_VERYLOW(PF05) | \
867
PIN_OSPEED_SPEED_VERYLOW(PF06) | \
868
PIN_OSPEED_SPEED_VERYLOW(PF07) | \
869
PIN_OSPEED_SPEED_VERYLOW(PF08) | \
870
PIN_OSPEED_SPEED_VERYLOW(PF09) | \
871
PIN_OSPEED_SPEED_VERYLOW(PF10) | \
872
PIN_OSPEED_SPEED_VERYLOW(PF11) | \
873
PIN_OSPEED_SPEED_VERYLOW(PF12) | \
874
PIN_OSPEED_SPEED_VERYLOW(PF13) | \
875
PIN_OSPEED_SPEED_VERYLOW(PF14) | \
876
PIN_OSPEED_SPEED_VERYLOW(PF15))
877
878
#define VAL_GPIOF_PUPDR (PIN_PUPDR_PULLDOWN(PF00) | \
879
PIN_PUPDR_PULLDOWN(PF01) | \
880
PIN_PUPDR_PULLDOWN(PF02) | \
881
PIN_PUPDR_PULLDOWN(PF03) | \
882
PIN_PUPDR_PULLDOWN(PF04) | \
883
PIN_PUPDR_PULLDOWN(PF05) | \
884
PIN_PUPDR_PULLDOWN(PF06) | \
885
PIN_PUPDR_PULLDOWN(PF07) | \
886
PIN_PUPDR_PULLDOWN(PF08) | \
887
PIN_PUPDR_PULLDOWN(PF09) | \
888
PIN_PUPDR_PULLDOWN(PF10) | \
889
PIN_PUPDR_PULLDOWN(PF11) | \
890
PIN_PUPDR_PULLDOWN(PF12) | \
891
PIN_PUPDR_PULLDOWN(PF13) | \
892
PIN_PUPDR_PULLDOWN(PF14) | \
893
PIN_PUPDR_PULLDOWN(PF15))
894
895
#define VAL_GPIOF_ODR (PIN_ODR_LEVEL_LOW(PF00) | \
896
PIN_ODR_LEVEL_LOW(PF01) | \
897
PIN_ODR_LEVEL_LOW(PF02) | \
898
PIN_ODR_LEVEL_LOW(PF03) | \
899
PIN_ODR_LEVEL_LOW(PF04) | \
900
PIN_ODR_LEVEL_LOW(PF05) | \
901
PIN_ODR_LEVEL_LOW(PF06) | \
902
PIN_ODR_LEVEL_LOW(PF07) | \
903
PIN_ODR_LEVEL_LOW(PF08) | \
904
PIN_ODR_LEVEL_LOW(PF09) | \
905
PIN_ODR_LEVEL_LOW(PF10) | \
906
PIN_ODR_LEVEL_LOW(PF11) | \
907
PIN_ODR_LEVEL_LOW(PF12) | \
908
PIN_ODR_LEVEL_LOW(PF13) | \
909
PIN_ODR_LEVEL_LOW(PF14) | \
910
PIN_ODR_LEVEL_LOW(PF15))
911
912
#define VAL_GPIOF_AFRL (PIN_AFIO_AF(PF00, 0) | \
913
PIN_AFIO_AF(PF01, 0) | \
914
PIN_AFIO_AF(PF02, 0) | \
915
PIN_AFIO_AF(PF03, 0) | \
916
PIN_AFIO_AF(PF04, 0) | \
917
PIN_AFIO_AF(PF05, 0) | \
918
PIN_AFIO_AF(PF06, 0) | \
919
PIN_AFIO_AF(PF07, 0))
920
921
#define VAL_GPIOF_AFRH (PIN_AFIO_AF(PF08, 0) | \
922
PIN_AFIO_AF(PF09, 0) | \
923
PIN_AFIO_AF(PF10, 0) | \
924
PIN_AFIO_AF(PF11, 0) | \
925
PIN_AFIO_AF(PF12, 0) | \
926
PIN_AFIO_AF(PF13, 0) | \
927
PIN_AFIO_AF(PF14, 0) | \
928
PIN_AFIO_AF(PF15, 0))
929
930
#define VAL_GPIOG_MODER (PIN_MODE_INPUT(PG00) | \
931
PIN_MODE_INPUT(PG01) | \
932
PIN_MODE_INPUT(PG02) | \
933
PIN_MODE_INPUT(PG03) | \
934
PIN_MODE_INPUT(PG04) | \
935
PIN_MODE_INPUT(PG05) | \
936
PIN_MODE_INPUT(PG06) | \
937
PIN_MODE_INPUT(PG07) | \
938
PIN_MODE_INPUT(PG08) | \
939
PIN_MODE_INPUT(PG09) | \
940
PIN_MODE_INPUT(PG10) | \
941
PIN_MODE_INPUT(PG11) | \
942
PIN_MODE_INPUT(PG12) | \
943
PIN_MODE_INPUT(PG13) | \
944
PIN_MODE_INPUT(PG14) | \
945
PIN_MODE_INPUT(PG15))
946
947
#define VAL_GPIOG_OTYPER (PIN_OTYPE_PUSHPULL(PG00) | \
948
PIN_OTYPE_PUSHPULL(PG01) | \
949
PIN_OTYPE_PUSHPULL(PG02) | \
950
PIN_OTYPE_PUSHPULL(PG03) | \
951
PIN_OTYPE_PUSHPULL(PG04) | \
952
PIN_OTYPE_PUSHPULL(PG05) | \
953
PIN_OTYPE_PUSHPULL(PG06) | \
954
PIN_OTYPE_PUSHPULL(PG07) | \
955
PIN_OTYPE_PUSHPULL(PG08) | \
956
PIN_OTYPE_PUSHPULL(PG09) | \
957
PIN_OTYPE_PUSHPULL(PG10) | \
958
PIN_OTYPE_PUSHPULL(PG11) | \
959
PIN_OTYPE_PUSHPULL(PG12) | \
960
PIN_OTYPE_PUSHPULL(PG13) | \
961
PIN_OTYPE_PUSHPULL(PG14) | \
962
PIN_OTYPE_PUSHPULL(PG15))
963
964
#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_SPEED_VERYLOW(PG00) | \
965
PIN_OSPEED_SPEED_VERYLOW(PG01) | \
966
PIN_OSPEED_SPEED_VERYLOW(PG02) | \
967
PIN_OSPEED_SPEED_VERYLOW(PG03) | \
968
PIN_OSPEED_SPEED_VERYLOW(PG04) | \
969
PIN_OSPEED_SPEED_VERYLOW(PG05) | \
970
PIN_OSPEED_SPEED_VERYLOW(PG06) | \
971
PIN_OSPEED_SPEED_VERYLOW(PG07) | \
972
PIN_OSPEED_SPEED_VERYLOW(PG08) | \
973
PIN_OSPEED_SPEED_VERYLOW(PG09) | \
974
PIN_OSPEED_SPEED_VERYLOW(PG10) | \
975
PIN_OSPEED_SPEED_VERYLOW(PG11) | \
976
PIN_OSPEED_SPEED_VERYLOW(PG12) | \
977
PIN_OSPEED_SPEED_VERYLOW(PG13) | \
978
PIN_OSPEED_SPEED_VERYLOW(PG14) | \
979
PIN_OSPEED_SPEED_VERYLOW(PG15))
980
981
#define VAL_GPIOG_PUPDR (PIN_PUPDR_PULLDOWN(PG00) | \
982
PIN_PUPDR_PULLDOWN(PG01) | \
983
PIN_PUPDR_PULLDOWN(PG02) | \
984
PIN_PUPDR_PULLDOWN(PG03) | \
985
PIN_PUPDR_PULLDOWN(PG04) | \
986
PIN_PUPDR_PULLDOWN(PG05) | \
987
PIN_PUPDR_PULLDOWN(PG06) | \
988
PIN_PUPDR_PULLDOWN(PG07) | \
989
PIN_PUPDR_PULLDOWN(PG08) | \
990
PIN_PUPDR_PULLDOWN(PG09) | \
991
PIN_PUPDR_PULLDOWN(PG10) | \
992
PIN_PUPDR_PULLDOWN(PG11) | \
993
PIN_PUPDR_PULLDOWN(PG12) | \
994
PIN_PUPDR_PULLDOWN(PG13) | \
995
PIN_PUPDR_PULLDOWN(PG14) | \
996
PIN_PUPDR_PULLDOWN(PG15))
997
998
#define VAL_GPIOG_ODR (PIN_ODR_LEVEL_LOW(PG00) | \
999
PIN_ODR_LEVEL_LOW(PG01) | \
1000
PIN_ODR_LEVEL_LOW(PG02) | \
1001
PIN_ODR_LEVEL_LOW(PG03) | \
1002
PIN_ODR_LEVEL_LOW(PG04) | \
1003
PIN_ODR_LEVEL_LOW(PG05) | \
1004
PIN_ODR_LEVEL_LOW(PG06) | \
1005
PIN_ODR_LEVEL_LOW(PG07) | \
1006
PIN_ODR_LEVEL_LOW(PG08) | \
1007
PIN_ODR_LEVEL_LOW(PG09) | \
1008
PIN_ODR_LEVEL_LOW(PG10) | \
1009
PIN_ODR_LEVEL_LOW(PG11) | \
1010
PIN_ODR_LEVEL_LOW(PG12) | \
1011
PIN_ODR_LEVEL_LOW(PG13) | \
1012
PIN_ODR_LEVEL_LOW(PG14) | \
1013
PIN_ODR_LEVEL_LOW(PG15))
1014
1015
#define VAL_GPIOG_AFRL (PIN_AFIO_AF(PG00, 0) | \
1016
PIN_AFIO_AF(PG01, 0) | \
1017
PIN_AFIO_AF(PG02, 0) | \
1018
PIN_AFIO_AF(PG03, 0) | \
1019
PIN_AFIO_AF(PG04, 0) | \
1020
PIN_AFIO_AF(PG05, 0) | \
1021
PIN_AFIO_AF(PG06, 0) | \
1022
PIN_AFIO_AF(PG07, 0))
1023
1024
#define VAL_GPIOG_AFRH (PIN_AFIO_AF(PG08, 0) | \
1025
PIN_AFIO_AF(PG09, 0) | \
1026
PIN_AFIO_AF(PG10, 0) | \
1027
PIN_AFIO_AF(PG11, 0) | \
1028
PIN_AFIO_AF(PG12, 0) | \
1029
PIN_AFIO_AF(PG13, 0) | \
1030
PIN_AFIO_AF(PG14, 0) | \
1031
PIN_AFIO_AF(PG15, 0))
1032
1033
#define VAL_GPIOH_MODER (PIN_MODE_ALTERNATE(OSC_IN) | \
1034
PIN_MODE_ALTERNATE(OSC_OUT) | \
1035
PIN_MODE_INPUT(PH02) | \
1036
PIN_MODE_INPUT(PH03) | \
1037
PIN_MODE_INPUT(PH04) | \
1038
PIN_MODE_INPUT(PH05) | \
1039
PIN_MODE_INPUT(PH06) | \
1040
PIN_MODE_INPUT(PH07) | \
1041
PIN_MODE_INPUT(PH08) | \
1042
PIN_MODE_INPUT(PH09) | \
1043
PIN_MODE_INPUT(PH10) | \
1044
PIN_MODE_INPUT(PH11) | \
1045
PIN_MODE_INPUT(PH12) | \
1046
PIN_MODE_INPUT(PH13) | \
1047
PIN_MODE_INPUT(PH14) | \
1048
PIN_MODE_INPUT(PH15))
1049
1050
#define VAL_GPIOH_OTYPER (PIN_OTYPE_PUSHPULL(OSC_IN) | \
1051
PIN_OTYPE_PUSHPULL(OSC_OUT) | \
1052
PIN_OTYPE_PUSHPULL(PH02) | \
1053
PIN_OTYPE_PUSHPULL(PH03) | \
1054
PIN_OTYPE_PUSHPULL(PH04) | \
1055
PIN_OTYPE_PUSHPULL(PH05) | \
1056
PIN_OTYPE_PUSHPULL(PH06) | \
1057
PIN_OTYPE_PUSHPULL(PH07) | \
1058
PIN_OTYPE_PUSHPULL(PH08) | \
1059
PIN_OTYPE_PUSHPULL(PH09) | \
1060
PIN_OTYPE_PUSHPULL(PH10) | \
1061
PIN_OTYPE_PUSHPULL(PH11) | \
1062
PIN_OTYPE_PUSHPULL(PH12) | \
1063
PIN_OTYPE_PUSHPULL(PH13) | \
1064
PIN_OTYPE_PUSHPULL(PH14) | \
1065
PIN_OTYPE_PUSHPULL(PH15))
1066
1067
#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_SPEED_HIGH(OSC_IN) | \
1068
PIN_OSPEED_SPEED_HIGH(OSC_OUT) | \
1069
PIN_OSPEED_SPEED_VERYLOW(PH02) | \
1070
PIN_OSPEED_SPEED_VERYLOW(PH03) | \
1071
PIN_OSPEED_SPEED_VERYLOW(PH04) | \
1072
PIN_OSPEED_SPEED_VERYLOW(PH05) | \
1073
PIN_OSPEED_SPEED_VERYLOW(PH06) | \
1074
PIN_OSPEED_SPEED_VERYLOW(PH07) | \
1075
PIN_OSPEED_SPEED_VERYLOW(PH08) | \
1076
PIN_OSPEED_SPEED_VERYLOW(PH09) | \
1077
PIN_OSPEED_SPEED_VERYLOW(PH10) | \
1078
PIN_OSPEED_SPEED_VERYLOW(PH11) | \
1079
PIN_OSPEED_SPEED_VERYLOW(PH12) | \
1080
PIN_OSPEED_SPEED_VERYLOW(PH13) | \
1081
PIN_OSPEED_SPEED_VERYLOW(PH14) | \
1082
PIN_OSPEED_SPEED_VERYLOW(PH15))
1083
1084
#define VAL_GPIOH_PUPDR (PIN_PUPDR_FLOATING(OSC_IN) | \
1085
PIN_PUPDR_FLOATING(OSC_OUT) | \
1086
PIN_PUPDR_PULLDOWN(PH02) | \
1087
PIN_PUPDR_PULLDOWN(PH03) | \
1088
PIN_PUPDR_PULLDOWN(PH04) | \
1089
PIN_PUPDR_PULLDOWN(PH05) | \
1090
PIN_PUPDR_PULLDOWN(PH06) | \
1091
PIN_PUPDR_PULLDOWN(PH07) | \
1092
PIN_PUPDR_PULLDOWN(PH08) | \
1093
PIN_PUPDR_PULLDOWN(PH09) | \
1094
PIN_PUPDR_PULLDOWN(PH10) | \
1095
PIN_PUPDR_PULLDOWN(PH11) | \
1096
PIN_PUPDR_PULLDOWN(PH12) | \
1097
PIN_PUPDR_PULLDOWN(PH13) | \
1098
PIN_PUPDR_PULLDOWN(PH14) | \
1099
PIN_PUPDR_PULLDOWN(PH15))
1100
1101
#define VAL_GPIOH_ODR (PIN_ODR_LEVEL_HIGH(OSC_IN) | \
1102
PIN_ODR_LEVEL_HIGH(OSC_OUT) | \
1103
PIN_ODR_LEVEL_LOW(PH02) | \
1104
PIN_ODR_LEVEL_LOW(PH03) | \
1105
PIN_ODR_LEVEL_LOW(PH04) | \
1106
PIN_ODR_LEVEL_LOW(PH05) | \
1107
PIN_ODR_LEVEL_LOW(PH06) | \
1108
PIN_ODR_LEVEL_LOW(PH07) | \
1109
PIN_ODR_LEVEL_LOW(PH08) | \
1110
PIN_ODR_LEVEL_LOW(PH09) | \
1111
PIN_ODR_LEVEL_LOW(PH10) | \
1112
PIN_ODR_LEVEL_LOW(PH11) | \
1113
PIN_ODR_LEVEL_LOW(PH12) | \
1114
PIN_ODR_LEVEL_LOW(PH13) | \
1115
PIN_ODR_LEVEL_LOW(PH14) | \
1116
PIN_ODR_LEVEL_LOW(PH15))
1117
1118
#define VAL_GPIOH_AFRL (PIN_AFIO_AF(OSC_IN, 0) | \
1119
PIN_AFIO_AF(OSC_OUT, 0) | \
1120
PIN_AFIO_AF(PH02, 0) | \
1121
PIN_AFIO_AF(PH03, 0) | \
1122
PIN_AFIO_AF(PH04, 0) | \
1123
PIN_AFIO_AF(PH05, 0) | \
1124
PIN_AFIO_AF(PH06, 0) | \
1125
PIN_AFIO_AF(PH07, 0))
1126
1127
#define VAL_GPIOH_AFRH (PIN_AFIO_AF(PH08, 0) | \
1128
PIN_AFIO_AF(PH09, 0) | \
1129
PIN_AFIO_AF(PH10, 0) | \
1130
PIN_AFIO_AF(PH11, 0) | \
1131
PIN_AFIO_AF(PH12, 0) | \
1132
PIN_AFIO_AF(PH13, 0) | \
1133
PIN_AFIO_AF(PH14, 0) | \
1134
PIN_AFIO_AF(PH15, 0))
1135
1136
#define VAL_GPIOI_MODER (PIN_MODE_INPUT(PI00) | \
1137
PIN_MODE_INPUT(PI01) | \
1138
PIN_MODE_INPUT(PI02) | \
1139
PIN_MODE_INPUT(PI03) | \
1140
PIN_MODE_INPUT(PI04) | \
1141
PIN_MODE_INPUT(PI05) | \
1142
PIN_MODE_INPUT(PI06) | \
1143
PIN_MODE_INPUT(PI07) | \
1144
PIN_MODE_INPUT(PI08) | \
1145
PIN_MODE_INPUT(PI09) | \
1146
PIN_MODE_INPUT(PI10) | \
1147
PIN_MODE_INPUT(PI11) | \
1148
PIN_MODE_INPUT(PI12) | \
1149
PIN_MODE_INPUT(PI13) | \
1150
PIN_MODE_INPUT(PI14) | \
1151
PIN_MODE_INPUT(PI15))
1152
1153
#define VAL_GPIOI_OTYPER (PIN_OTYPE_PUSHPULL(PI00) | \
1154
PIN_OTYPE_PUSHPULL(PI01) | \
1155
PIN_OTYPE_PUSHPULL(PI02) | \
1156
PIN_OTYPE_PUSHPULL(PI03) | \
1157
PIN_OTYPE_PUSHPULL(PI04) | \
1158
PIN_OTYPE_PUSHPULL(PI05) | \
1159
PIN_OTYPE_PUSHPULL(PI06) | \
1160
PIN_OTYPE_PUSHPULL(PI07) | \
1161
PIN_OTYPE_PUSHPULL(PI08) | \
1162
PIN_OTYPE_PUSHPULL(PI09) | \
1163
PIN_OTYPE_PUSHPULL(PI10) | \
1164
PIN_OTYPE_PUSHPULL(PI11) | \
1165
PIN_OTYPE_PUSHPULL(PI12) | \
1166
PIN_OTYPE_PUSHPULL(PI13) | \
1167
PIN_OTYPE_PUSHPULL(PI14) | \
1168
PIN_OTYPE_PUSHPULL(PI15))
1169
1170
#define VAL_GPIOI_OSPEEDR (PIN_OSPEED_SPEED_VERYLOW(PI00) | \
1171
PIN_OSPEED_SPEED_VERYLOW(PI01) | \
1172
PIN_OSPEED_SPEED_VERYLOW(PI02) | \
1173
PIN_OSPEED_SPEED_VERYLOW(PI03) | \
1174
PIN_OSPEED_SPEED_VERYLOW(PI04) | \
1175
PIN_OSPEED_SPEED_VERYLOW(PI05) | \
1176
PIN_OSPEED_SPEED_VERYLOW(PI06) | \
1177
PIN_OSPEED_SPEED_VERYLOW(PI07) | \
1178
PIN_OSPEED_SPEED_VERYLOW(PI08) | \
1179
PIN_OSPEED_SPEED_VERYLOW(PI09) | \
1180
PIN_OSPEED_SPEED_VERYLOW(PI10) | \
1181
PIN_OSPEED_SPEED_VERYLOW(PI11) | \
1182
PIN_OSPEED_SPEED_VERYLOW(PI12) | \
1183
PIN_OSPEED_SPEED_VERYLOW(PI13) | \
1184
PIN_OSPEED_SPEED_VERYLOW(PI14) | \
1185
PIN_OSPEED_SPEED_VERYLOW(PI15))
1186
1187
#define VAL_GPIOI_PUPDR (PIN_PUPDR_PULLDOWN(PI00) | \
1188
PIN_PUPDR_PULLDOWN(PI01) | \
1189
PIN_PUPDR_PULLDOWN(PI02) | \
1190
PIN_PUPDR_PULLDOWN(PI03) | \
1191
PIN_PUPDR_PULLDOWN(PI04) | \
1192
PIN_PUPDR_PULLDOWN(PI05) | \
1193
PIN_PUPDR_PULLDOWN(PI06) | \
1194
PIN_PUPDR_PULLDOWN(PI07) | \
1195
PIN_PUPDR_PULLDOWN(PI08) | \
1196
PIN_PUPDR_PULLDOWN(PI09) | \
1197
PIN_PUPDR_PULLDOWN(PI10) | \
1198
PIN_PUPDR_PULLDOWN(PI11) | \
1199
PIN_PUPDR_PULLDOWN(PI12) | \
1200
PIN_PUPDR_PULLDOWN(PI13) | \
1201
PIN_PUPDR_PULLDOWN(PI14) | \
1202
PIN_PUPDR_PULLDOWN(PI15))
1203
1204
#define VAL_GPIOI_ODR (PIN_ODR_LEVEL_LOW(PI00) | \
1205
PIN_ODR_LEVEL_LOW(PI01) | \
1206
PIN_ODR_LEVEL_LOW(PI02) | \
1207
PIN_ODR_LEVEL_LOW(PI03) | \
1208
PIN_ODR_LEVEL_LOW(PI04) | \
1209
PIN_ODR_LEVEL_LOW(PI05) | \
1210
PIN_ODR_LEVEL_LOW(PI06) | \
1211
PIN_ODR_LEVEL_LOW(PI07) | \
1212
PIN_ODR_LEVEL_LOW(PI08) | \
1213
PIN_ODR_LEVEL_LOW(PI09) | \
1214
PIN_ODR_LEVEL_LOW(PI10) | \
1215
PIN_ODR_LEVEL_LOW(PI11) | \
1216
PIN_ODR_LEVEL_LOW(PI12) | \
1217
PIN_ODR_LEVEL_LOW(PI13) | \
1218
PIN_ODR_LEVEL_LOW(PI14) | \
1219
PIN_ODR_LEVEL_LOW(PI15))
1220
1221
#define VAL_GPIOI_AFRL (PIN_AFIO_AF(PI00, 0) | \
1222
PIN_AFIO_AF(PI01, 0) | \
1223
PIN_AFIO_AF(PI02, 0) | \
1224
PIN_AFIO_AF(PI03, 0) | \
1225
PIN_AFIO_AF(PI04, 0) | \
1226
PIN_AFIO_AF(PI05, 0) | \
1227
PIN_AFIO_AF(PI06, 0) | \
1228
PIN_AFIO_AF(PI07, 0))
1229
1230
#define VAL_GPIOI_AFRH (PIN_AFIO_AF(PI08, 0) | \
1231
PIN_AFIO_AF(PI09, 0) | \
1232
PIN_AFIO_AF(PI10, 0) | \
1233
PIN_AFIO_AF(PI11, 0) | \
1234
PIN_AFIO_AF(PI12, 0) | \
1235
PIN_AFIO_AF(PI13, 0) | \
1236
PIN_AFIO_AF(PI14, 0) | \
1237
PIN_AFIO_AF(PI15, 0))
1238
1239
#define VAL_GPIOJ_MODER (PIN_MODE_INPUT(PJ00) | \
1240
PIN_MODE_INPUT(PJ01) | \
1241
PIN_MODE_INPUT(PJ02) | \
1242
PIN_MODE_INPUT(PJ03) | \
1243
PIN_MODE_INPUT(PJ04) | \
1244
PIN_MODE_INPUT(PJ05) | \
1245
PIN_MODE_INPUT(PJ06) | \
1246
PIN_MODE_INPUT(PJ07) | \
1247
PIN_MODE_INPUT(PJ08) | \
1248
PIN_MODE_INPUT(PJ09) | \
1249
PIN_MODE_INPUT(PJ10) | \
1250
PIN_MODE_INPUT(PJ11) | \
1251
PIN_MODE_INPUT(PJ12) | \
1252
PIN_MODE_INPUT(PJ13) | \
1253
PIN_MODE_INPUT(PJ14) | \
1254
PIN_MODE_INPUT(PJ15))
1255
1256
#define VAL_GPIOJ_OTYPER (PIN_OTYPE_PUSHPULL(PJ00) | \
1257
PIN_OTYPE_PUSHPULL(PJ01) | \
1258
PIN_OTYPE_PUSHPULL(PJ02) | \
1259
PIN_OTYPE_PUSHPULL(PJ03) | \
1260
PIN_OTYPE_PUSHPULL(PJ04) | \
1261
PIN_OTYPE_PUSHPULL(PJ05) | \
1262
PIN_OTYPE_PUSHPULL(PJ06) | \
1263
PIN_OTYPE_PUSHPULL(PJ07) | \
1264
PIN_OTYPE_PUSHPULL(PJ08) | \
1265
PIN_OTYPE_PUSHPULL(PJ09) | \
1266
PIN_OTYPE_PUSHPULL(PJ10) | \
1267
PIN_OTYPE_PUSHPULL(PJ11) | \
1268
PIN_OTYPE_PUSHPULL(PJ12) | \
1269
PIN_OTYPE_PUSHPULL(PJ13) | \
1270
PIN_OTYPE_PUSHPULL(PJ14) | \
1271
PIN_OTYPE_PUSHPULL(PJ15))
1272
1273
#define VAL_GPIOJ_OSPEEDR (PIN_OSPEED_SPEED_VERYLOW(PJ00) | \
1274
PIN_OSPEED_SPEED_VERYLOW(PJ01) | \
1275
PIN_OSPEED_SPEED_VERYLOW(PJ02) | \
1276
PIN_OSPEED_SPEED_VERYLOW(PJ03) | \
1277
PIN_OSPEED_SPEED_VERYLOW(PJ04) | \
1278
PIN_OSPEED_SPEED_VERYLOW(PJ05) | \
1279
PIN_OSPEED_SPEED_VERYLOW(PJ06) | \
1280
PIN_OSPEED_SPEED_VERYLOW(PJ07) | \
1281
PIN_OSPEED_SPEED_VERYLOW(PJ08) | \
1282
PIN_OSPEED_SPEED_VERYLOW(PJ09) | \
1283
PIN_OSPEED_SPEED_VERYLOW(PJ10) | \
1284
PIN_OSPEED_SPEED_VERYLOW(PJ11) | \
1285
PIN_OSPEED_SPEED_VERYLOW(PJ12) | \
1286
PIN_OSPEED_SPEED_VERYLOW(PJ13) | \
1287
PIN_OSPEED_SPEED_VERYLOW(PJ14) | \
1288
PIN_OSPEED_SPEED_VERYLOW(PJ15))
1289
1290
#define VAL_GPIOJ_PUPDR (PIN_PUPDR_PULLDOWN(PJ00) | \
1291
PIN_PUPDR_PULLDOWN(PJ01) | \
1292
PIN_PUPDR_PULLDOWN(PJ02) | \
1293
PIN_PUPDR_PULLDOWN(PJ03) | \
1294
PIN_PUPDR_PULLDOWN(PJ04) | \
1295
PIN_PUPDR_PULLDOWN(PJ05) | \
1296
PIN_PUPDR_PULLDOWN(PJ06) | \
1297
PIN_PUPDR_PULLDOWN(PJ07) | \
1298
PIN_PUPDR_PULLDOWN(PJ08) | \
1299
PIN_PUPDR_PULLDOWN(PJ09) | \
1300
PIN_PUPDR_PULLDOWN(PJ10) | \
1301
PIN_PUPDR_PULLDOWN(PJ11) | \
1302
PIN_PUPDR_PULLDOWN(PJ12) | \
1303
PIN_PUPDR_PULLDOWN(PJ13) | \
1304
PIN_PUPDR_PULLDOWN(PJ14) | \
1305
PIN_PUPDR_PULLDOWN(PJ15))
1306
1307
#define VAL_GPIOJ_ODR (PIN_ODR_LEVEL_LOW(PJ00) | \
1308
PIN_ODR_LEVEL_LOW(PJ01) | \
1309
PIN_ODR_LEVEL_LOW(PJ02) | \
1310
PIN_ODR_LEVEL_LOW(PJ03) | \
1311
PIN_ODR_LEVEL_LOW(PJ04) | \
1312
PIN_ODR_LEVEL_LOW(PJ05) | \
1313
PIN_ODR_LEVEL_LOW(PJ06) | \
1314
PIN_ODR_LEVEL_LOW(PJ07) | \
1315
PIN_ODR_LEVEL_LOW(PJ08) | \
1316
PIN_ODR_LEVEL_LOW(PJ09) | \
1317
PIN_ODR_LEVEL_LOW(PJ10) | \
1318
PIN_ODR_LEVEL_LOW(PJ11) | \
1319
PIN_ODR_LEVEL_LOW(PJ12) | \
1320
PIN_ODR_LEVEL_LOW(PJ13) | \
1321
PIN_ODR_LEVEL_LOW(PJ14) | \
1322
PIN_ODR_LEVEL_LOW(PJ15))
1323
1324
#define VAL_GPIOJ_AFRL (PIN_AFIO_AF(PJ00, 0) | \
1325
PIN_AFIO_AF(PJ01, 0) | \
1326
PIN_AFIO_AF(PJ02, 0) | \
1327
PIN_AFIO_AF(PJ03, 0) | \
1328
PIN_AFIO_AF(PJ04, 0) | \
1329
PIN_AFIO_AF(PJ05, 0) | \
1330
PIN_AFIO_AF(PJ06, 0) | \
1331
PIN_AFIO_AF(PJ07, 0))
1332
1333
#define VAL_GPIOJ_AFRH (PIN_AFIO_AF(PJ08, 0) | \
1334
PIN_AFIO_AF(PJ09, 0) | \
1335
PIN_AFIO_AF(PJ10, 0) | \
1336
PIN_AFIO_AF(PJ11, 0) | \
1337
PIN_AFIO_AF(PJ12, 0) | \
1338
PIN_AFIO_AF(PJ13, 0) | \
1339
PIN_AFIO_AF(PJ14, 0) | \
1340
PIN_AFIO_AF(PJ15, 0))
1341
1342
#define VAL_GPIOK_MODER (PIN_MODE_INPUT(PK00) | \
1343
PIN_MODE_INPUT(PK01) | \
1344
PIN_MODE_INPUT(PK02) | \
1345
PIN_MODE_INPUT(PK03) | \
1346
PIN_MODE_INPUT(PK04) | \
1347
PIN_MODE_INPUT(PK05) | \
1348
PIN_MODE_INPUT(PK06) | \
1349
PIN_MODE_INPUT(PK07) | \
1350
PIN_MODE_INPUT(PK08) | \
1351
PIN_MODE_INPUT(PK09) | \
1352
PIN_MODE_INPUT(PK10) | \
1353
PIN_MODE_INPUT(PK11) | \
1354
PIN_MODE_INPUT(PK12) | \
1355
PIN_MODE_INPUT(PK13) | \
1356
PIN_MODE_INPUT(PK14) | \
1357
PIN_MODE_INPUT(PK15))
1358
1359
#define VAL_GPIOK_OTYPER (PIN_OTYPE_PUSHPULL(PK00) | \
1360
PIN_OTYPE_PUSHPULL(PK01) | \
1361
PIN_OTYPE_PUSHPULL(PK02) | \
1362
PIN_OTYPE_PUSHPULL(PK03) | \
1363
PIN_OTYPE_PUSHPULL(PK04) | \
1364
PIN_OTYPE_PUSHPULL(PK05) | \
1365
PIN_OTYPE_PUSHPULL(PK06) | \
1366
PIN_OTYPE_PUSHPULL(PK07) | \
1367
PIN_OTYPE_PUSHPULL(PK08) | \
1368
PIN_OTYPE_PUSHPULL(PK09) | \
1369
PIN_OTYPE_PUSHPULL(PK10) | \
1370
PIN_OTYPE_PUSHPULL(PK11) | \
1371
PIN_OTYPE_PUSHPULL(PK12) | \
1372
PIN_OTYPE_PUSHPULL(PK13) | \
1373
PIN_OTYPE_PUSHPULL(PK14) | \
1374
PIN_OTYPE_PUSHPULL(PK15))
1375
1376
#define VAL_GPIOK_OSPEEDR (PIN_OSPEED_SPEED_VERYLOW(PK00) | \
1377
PIN_OSPEED_SPEED_VERYLOW(PK01) | \
1378
PIN_OSPEED_SPEED_VERYLOW(PK02) | \
1379
PIN_OSPEED_SPEED_VERYLOW(PK03) | \
1380
PIN_OSPEED_SPEED_VERYLOW(PK04) | \
1381
PIN_OSPEED_SPEED_VERYLOW(PK05) | \
1382
PIN_OSPEED_SPEED_VERYLOW(PK06) | \
1383
PIN_OSPEED_SPEED_VERYLOW(PK07) | \
1384
PIN_OSPEED_SPEED_VERYLOW(PK08) | \
1385
PIN_OSPEED_SPEED_VERYLOW(PK09) | \
1386
PIN_OSPEED_SPEED_VERYLOW(PK10) | \
1387
PIN_OSPEED_SPEED_VERYLOW(PK11) | \
1388
PIN_OSPEED_SPEED_VERYLOW(PK12) | \
1389
PIN_OSPEED_SPEED_VERYLOW(PK13) | \
1390
PIN_OSPEED_SPEED_VERYLOW(PK14) | \
1391
PIN_OSPEED_SPEED_VERYLOW(PK15))
1392
1393
#define VAL_GPIOK_PUPDR (PIN_PUPDR_PULLDOWN(PK00) | \
1394
PIN_PUPDR_PULLDOWN(PK01) | \
1395
PIN_PUPDR_PULLDOWN(PK02) | \
1396
PIN_PUPDR_PULLDOWN(PK03) | \
1397
PIN_PUPDR_PULLDOWN(PK04) | \
1398
PIN_PUPDR_PULLDOWN(PK05) | \
1399
PIN_PUPDR_PULLDOWN(PK06) | \
1400
PIN_PUPDR_PULLDOWN(PK07) | \
1401
PIN_PUPDR_PULLDOWN(PK08) | \
1402
PIN_PUPDR_PULLDOWN(PK09) | \
1403
PIN_PUPDR_PULLDOWN(PK10) | \
1404
PIN_PUPDR_PULLDOWN(PK11) | \
1405
PIN_PUPDR_PULLDOWN(PK12) | \
1406
PIN_PUPDR_PULLDOWN(PK13) | \
1407
PIN_PUPDR_PULLDOWN(PK14) | \
1408
PIN_PUPDR_PULLDOWN(PK15))
1409
1410
#define VAL_GPIOK_ODR (PIN_ODR_LEVEL_LOW(PK00) | \
1411
PIN_ODR_LEVEL_LOW(PK01) | \
1412
PIN_ODR_LEVEL_LOW(PK02) | \
1413
PIN_ODR_LEVEL_LOW(PK03) | \
1414
PIN_ODR_LEVEL_LOW(PK04) | \
1415
PIN_ODR_LEVEL_LOW(PK05) | \
1416
PIN_ODR_LEVEL_LOW(PK06) | \
1417
PIN_ODR_LEVEL_LOW(PK07) | \
1418
PIN_ODR_LEVEL_LOW(PK08) | \
1419
PIN_ODR_LEVEL_LOW(PK09) | \
1420
PIN_ODR_LEVEL_LOW(PK10) | \
1421
PIN_ODR_LEVEL_LOW(PK11) | \
1422
PIN_ODR_LEVEL_LOW(PK12) | \
1423
PIN_ODR_LEVEL_LOW(PK13) | \
1424
PIN_ODR_LEVEL_LOW(PK14) | \
1425
PIN_ODR_LEVEL_LOW(PK15))
1426
1427
#define VAL_GPIOK_AFRL (PIN_AFIO_AF(PK00, 0) | \
1428
PIN_AFIO_AF(PK01, 0) | \
1429
PIN_AFIO_AF(PK02, 0) | \
1430
PIN_AFIO_AF(PK03, 0) | \
1431
PIN_AFIO_AF(PK04, 0) | \
1432
PIN_AFIO_AF(PK05, 0) | \
1433
PIN_AFIO_AF(PK06, 0) | \
1434
PIN_AFIO_AF(PK07, 0))
1435
1436
#define VAL_GPIOK_AFRH (PIN_AFIO_AF(PK08, 0) | \
1437
PIN_AFIO_AF(PK09, 0) | \
1438
PIN_AFIO_AF(PK10, 0) | \
1439
PIN_AFIO_AF(PK11, 0) | \
1440
PIN_AFIO_AF(PK12, 0) | \
1441
PIN_AFIO_AF(PK13, 0) | \
1442
PIN_AFIO_AF(PK14, 0) | \
1443
PIN_AFIO_AF(PK15, 0))
1444
1445
#define AF_MOTOR1 1U
1446
#define AF_LINE_MOTOR1 1U
1447
#define AF_E_TX2 7U
1448
#define AF_LINE_E_TX2 7U
1449
#define AF_E_RX2 7U
1450
#define AF_LINE_E_RX2 7U
1451
#define AF_E_SCK 5U
1452
#define AF_LINE_E_SCK 5U
1453
#define AF_E_MISO 5U
1454
#define AF_LINE_E_MISO 5U
1455
#define AF_E_MOSI 5U
1456
#define AF_LINE_E_MOSI 5U
1457
#define AF_I2C3_SCL 4U
1458
#define AF_LINE_I2C3_SCL 4U
1459
#define AF_USB_ID 10U
1460
#define AF_LINE_USB_ID 10U
1461
#define AF_USB_DM 10U
1462
#define AF_LINE_USB_DM 10U
1463
#define AF_USB_DP 10U
1464
#define AF_LINE_USB_DP 10U
1465
#define AF_STM_SWIO 0U
1466
#define AF_LINE_STM_SWIO 0U
1467
#define AF_STM_SWCLK 0U
1468
#define AF_LINE_STM_SWCLK 0U
1469
#define AF_MOTOR3 1U
1470
#define AF_LINE_MOTOR3 1U
1471
#define AF_I2C1_SCL 4U
1472
#define AF_LINE_I2C1_SCL 4U
1473
#define AF_I2C1_SDA 4U
1474
#define AF_LINE_I2C1_SDA 4U
1475
#define AF_MOTOR4 2U
1476
#define AF_LINE_MOTOR4 2U
1477
#define AF_MOTOR2 1U
1478
#define AF_LINE_MOTOR2 1U
1479
#define AF_NRF_TX 8U
1480
#define AF_LINE_NRF_TX 8U
1481
#define AF_NRF_RX 8U
1482
#define AF_LINE_NRF_RX 8U
1483
#define AF_I2C3_SDA 4U
1484
#define AF_LINE_I2C3_SDA 4U
1485
#define AF_E_TX1 7U
1486
#define AF_LINE_E_TX1 7U
1487
#define AF_E_RX1 7U
1488
#define AF_LINE_E_RX1 7U
1489
#define AF_OSC_IN 0U
1490
#define AF_LINE_OSC_IN 0U
1491
#define AF_OSC_OUT 0U
1492
#define AF_LINE_OSC_OUT 0U
1493
1494
1495
1496
#define BOARD_GROUP_DECLFOREACH(line, group) \
1497
static const ioline_t group ## _ARRAY[] = {group}; \
1498
for (ioline_t i=0, line = group ## _ARRAY[i]; (i < group ## _SIZE) && (line = group ## _ARRAY[i]); i++)
1499
1500
#define BOARD_GROUP_FOREACH(line, group) \
1501
for (ioline_t i=0, line = group ## _ARRAY[i]; (i < group ## _SIZE) && (line = group ## _ARRAY[i]); i++)
1502
1503
1504
#define BOARD_GROUP_DECLFOR(array, index, group) \
1505
static const ioline_t group ## _ARRAY[] = {group}; \
1506
for (ioline_t index=0, *array = (ioline_t *) group ## _ARRAY; index < group ## _SIZE; index++)
1507
1508
#define BOARD_GROUP_FOR(array, index, group) \
1509
for (ioline_t index=0, *array = (ioline_t *) group ## _ARRAY; index < group ## _SIZE; index++)
1510
1511
#if !defined(_FROM_ASM_)
1512
#ifdef __cplusplus
1513
extern
"C"
{
1514
#endif
1515
void
boardInit
(
void
);
1516
#ifdef __cplusplus
1517
}
1518
#endif
1519
#endif
/* _FROM_ASM_ */
1520
boardInit
void boardInit(void)
Board-specific initialization code.
Definition:
board.c:317
sw
airborne
boards
crazyflie
chibios
v2.1
board.h
Generated on Fri Nov 8 2024 14:10:44 for Paparazzi UAS by
1.9.1