Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
px4fmu.h
Go to the documentation of this file.
1
#ifndef CONFIG_PX4FMU_5_00_H
2
#define CONFIG_PX4FMU_5_00_H
3
4
#define BOARD_PX4FMU
5
9
#include "
boards/px4fmu/chibios/v5.0/board.h
"
10
15
/*
16
* AHB_CLK
17
*/
18
#define AHB_CLK STM32_HCLK
19
20
/*
21
* LEDs
22
*/
23
#if defined(LINE_LED1)
24
#ifndef USE_LED_1
25
#define USE_LED_1 1
26
#endif
27
#define LED_1_GPIO PAL_PORT(LINE_LED1)
28
#define LED_1_GPIO_PIN PAL_PAD(LINE_LED1)
29
#define LED_1_GPIO_ON gpio_clear
30
#define LED_1_GPIO_OFF gpio_set
31
#define LED_1_AFIO_REMAP ((void)0)
32
#endif
33
34
#if defined(LINE_LED2)
35
#ifndef USE_LED_2
36
#define USE_LED_2 1
37
#endif
38
#define LED_2_GPIO PAL_PORT(LINE_LED2)
39
#define LED_2_GPIO_PIN PAL_PAD(LINE_LED2)
40
#define LED_2_GPIO_ON gpio_clear
41
#define LED_2_GPIO_OFF gpio_set
42
#define LED_2_AFIO_REMAP ((void)0)
43
#endif
44
45
#if defined(LINE_LED3)
46
#ifndef USE_LED_3
47
#define USE_LED_3 1
48
#endif
49
#define LED_3_GPIO PAL_PORT(LINE_LED3)
50
#define LED_3_GPIO_PIN PAL_PAD(LINE_LED3)
51
#define LED_3_GPIO_ON gpio_clear
52
#define LED_3_GPIO_OFF gpio_set
53
#define LED_3_AFIO_REMAP ((void)0)
54
#endif
55
56
#if defined(LINE_LED4)
57
#ifndef USE_LED_4
58
#define USE_LED_4 1
59
#endif
60
#define LED_4_GPIO PAL_PORT(LINE_LED4)
61
#define LED_4_GPIO_PIN PAL_PAD(LINE_LED4)
62
#define LED_4_GPIO_ON gpio_clear
63
#define LED_4_GPIO_OFF gpio_set
64
#define LED_4_AFIO_REMAP ((void)0)
65
#endif
66
67
/*
68
* ADCs
69
*/
70
#if defined(LINE_ADC1)
71
#ifndef USE_ADC_1
72
#define USE_ADC_1 1
73
#endif
74
#if USE_ADC_1
75
#define AD1_1_CHANNEL ADC_CHANNEL_IN0
76
#define ADC_1 AD1_1
77
#define ADC_1_GPIO_PORT PAL_PORT(LINE_ADC1)
78
#define ADC_1_GPIO_PIN PAL_PAD(LINE_ADC1)
79
#endif
80
#endif
81
82
#if defined(LINE_ADC2)
83
#ifndef USE_ADC_2
84
#define USE_ADC_2 1
85
#endif
86
#if USE_ADC_2
87
#define AD1_2_CHANNEL ADC_CHANNEL_IN1
88
#define ADC_2 AD1_2
89
#define ADC_2_GPIO_PORT PAL_PORT(LINE_ADC2)
90
#define ADC_2_GPIO_PIN PAL_PAD(LINE_ADC2)
91
#endif
92
#endif
93
94
#if defined(LINE_ADC3)
95
#ifndef USE_ADC_3
96
#define USE_ADC_3 1
97
#endif
98
#if USE_ADC_3
99
#define AD1_3_CHANNEL ADC_CHANNEL_IN2
100
#define ADC_3 AD1_3
101
#define ADC_3_GPIO_PORT PAL_PORT(LINE_ADC3)
102
#define ADC_3_GPIO_PIN PAL_PAD(LINE_ADC3)
103
#endif
104
#endif
105
106
#if defined(LINE_ADC4)
107
#ifndef USE_ADC_4
108
#define USE_ADC_4 1
109
#endif
110
#if USE_ADC_4
111
#define AD1_4_CHANNEL ADC_CHANNEL_IN3
112
#define ADC_4 AD1_4
113
#define ADC_4_GPIO_PORT PAL_PORT(LINE_ADC4)
114
#define ADC_4_GPIO_PIN PAL_PAD(LINE_ADC4)
115
#endif
116
#endif
117
118
/* allow to define ADC_CHANNEL_VSUPPLY in the airframe file*/
119
#ifndef ADC_CHANNEL_VSUPPLY
120
#define ADC_CHANNEL_VSUPPLY ADC_1
121
#endif
122
123
/* allow to define ADC_CHANNEL_CURRENT in the airframe file*/
124
#if !defined(ADC_CHANNEL_CURRENT) && !ADC_CURRENT_DISABLE
125
#define ADC_CHANNEL_CURRENT ADC_2
126
#endif
127
128
/* Default powerbrick values */
129
#define DefaultVoltageOfAdc(adc) ((3.3f/4096.0f) * 10.3208191126f * adc)
130
#define MilliAmpereOfAdc(adc) ((3.3f/4096.0f) * 24000.0f * adc)
131
132
/*
133
* PWM defines (TODO DRIVER and CHANNEL)
134
*/
135
#if defined(LINE_SERVO1)
136
#ifndef USE_PWM1
137
#define USE_PWM1 1
138
#endif
139
#if USE_PWM1
140
#define PWM_SERVO_1 0
141
#define PWM_SERVO_1_GPIO PAL_PORT(LINE_SERVO1)
142
#define PWM_SERVO_1_PIN PAL_PAD(LINE_SERVO1)
143
#define PWM_SERVO_1_AF AF_LINE_SERVO1
144
#define PWM_SERVO_1_DRIVER PWMD1
145
#define PWM_SERVO_1_CHANNEL 4-1
146
#define PWM_SERVO_1_ACTIVE PWM_OUTPUT_ACTIVE_HIGH
147
#else
148
#define PWM_SERVO_1_ACTIVE PWM_OUTPUT_DISABLED
149
#endif
150
#endif
151
152
#if defined(LINE_SERVO2)
153
#ifndef USE_PWM2
154
#define USE_PWM2 1
155
#endif
156
#if USE_PWM2
157
#define PWM_SERVO_2 1
158
#define PWM_SERVO_2_GPIO PAL_PORT(LINE_SERVO2)
159
#define PWM_SERVO_2_PIN PAL_PAD(LINE_SERVO2)
160
#define PWM_SERVO_2_AF AF_LINE_SERVO2
161
#define PWM_SERVO_2_DRIVER PWMD1
162
#define PWM_SERVO_2_CHANNEL 3-1
163
#define PWM_SERVO_2_ACTIVE PWM_OUTPUT_ACTIVE_HIGH
164
#else
165
#define PWM_SERVO_2_ACTIVE PWM_OUTPUT_DISABLED
166
#endif
167
#endif
168
169
#if defined(LINE_SERVO3)
170
#ifndef USE_PWM3
171
#define USE_PWM3 1
172
#endif
173
#if USE_PWM3
174
#define PWM_SERVO_3 2
175
#define PWM_SERVO_3_GPIO PAL_PORT(LINE_SERVO3)
176
#define PWM_SERVO_3_PIN PAL_PAD(LINE_SERVO3)
177
#define PWM_SERVO_3_AF AF_LINE_SERVO3
178
#define PWM_SERVO_3_DRIVER PWMD1
179
#define PWM_SERVO_3_CHANNEL 2-1
180
#define PWM_SERVO_3_ACTIVE PWM_OUTPUT_ACTIVE_HIGH
181
#else
182
#define PWM_SERVO_3_ACTIVE PWM_OUTPUT_DISABLED
183
#endif
184
#endif
185
186
#if defined(LINE_SERVO4)
187
#ifndef USE_PWM4
188
#define USE_PWM4 1
189
#endif
190
#if USE_PWM4
191
#define PWM_SERVO_4 3
192
#define PWM_SERVO_4_GPIO PAL_PORT(LINE_SERVO4)
193
#define PWM_SERVO_4_PIN PAL_PAD(LINE_SERVO4)
194
#define PWM_SERVO_4_AF AF_LINE_SERVO4
195
#define PWM_SERVO_4_DRIVER PWMD1
196
#define PWM_SERVO_4_CHANNEL 1-1
197
#define PWM_SERVO_4_ACTIVE PWM_OUTPUT_ACTIVE_HIGH
198
#else
199
#define PWM_SERVO_4_ACTIVE PWM_OUTPUT_DISABLED
200
#endif
201
#endif
202
203
#if defined(LINE_SERVO5)
204
#ifndef USE_PWM5
205
#define USE_PWM5 1
206
#endif
207
#if USE_PWM5
208
#define PWM_SERVO_5 4
209
#define PWM_SERVO_5_GPIO PAL_PORT(LINE_SERVO5)
210
#define PWM_SERVO_5_PIN PAL_PAD(LINE_SERVO5)
211
#define PWM_SERVO_5_AF AF_LINE_SERVO5
212
#define PWM_SERVO_5_DRIVER PWMD4
213
#define PWM_SERVO_5_CHANNEL 2-1
214
#define PWM_SERVO_5_ACTIVE PWM_OUTPUT_ACTIVE_HIGH
215
#else
216
#define PWM_SERVO_5_ACTIVE PWM_OUTPUT_DISABLED
217
#endif
218
#endif
219
220
#if defined(LINE_SERVO6)
221
#ifndef USE_PWM6
222
#define USE_PWM6 1
223
#endif
224
#if USE_PWM6
225
#define PWM_SERVO_6 5
226
#define PWM_SERVO_6_GPIO PAL_PORT(LINE_SERVO6)
227
#define PWM_SERVO_6_PIN PAL_PAD(LINE_SERVO6)
228
#define PWM_SERVO_6_AF AF_LINE_SERVO6
229
#define PWM_SERVO_6_DRIVER PWMD4
230
#define PWM_SERVO_6_CHANNEL 3-1
231
#define PWM_SERVO_6_ACTIVE PWM_OUTPUT_ACTIVE_HIGH
232
#else
233
#define PWM_SERVO_6_ACTIVE PWM_OUTPUT_DISABLED
234
#endif
235
#endif
236
237
#if defined(LINE_SERVO7)
238
#ifndef USE_PWM7
239
#define USE_PWM7 1
240
#endif
241
#if USE_PWM7
242
#define PWM_SERVO_7 6
243
#define PWM_SERVO_7_GPIO PAL_PORT(LINE_SERVO7)
244
#define PWM_SERVO_7_PIN PAL_PAD(LINE_SERVO7)
245
#define PWM_SERVO_7_AF AF_LINE_SERVO7
246
#define PWM_SERVO_7_DRIVER PWMD12
247
#define PWM_SERVO_7_CHANNEL 1-1
248
#define PWM_SERVO_7_ACTIVE PWM_OUTPUT_ACTIVE_HIGH
249
#else
250
#define PWM_SERVO_7_ACTIVE PWM_OUTPUT_DISABLED
251
#endif
252
#endif
253
254
#if defined(LINE_SERVO8)
255
#ifndef USE_PWM8
256
#define USE_PWM8 1
257
#endif
258
#if USE_PWM8
259
#define PWM_SERVO_8 7
260
#define PWM_SERVO_8_GPIO PAL_PORT(LINE_SERVO8)
261
#define PWM_SERVO_8_PIN PAL_PAD(LINE_SERVO8)
262
#define PWM_SERVO_8_AF AF_LINE_SERVO8
263
#define PWM_SERVO_8_DRIVER PWMD12
264
#define PWM_SERVO_8_CHANNEL 2-1
265
#define PWM_SERVO_8_ACTIVE PWM_OUTPUT_ACTIVE_HIGH
266
#else
267
#define PWM_SERVO_8_ACTIVE PWM_OUTPUT_DISABLED
268
#endif
269
#endif
270
271
272
#ifdef STM32_PWM_USE_TIM1
273
#define PWM_CONF_TIM1 STM32_PWM_USE_TIM1
274
#else
275
#define PWM_CONF_TIM1 1
276
#endif
277
#define PWM_CONF1_DEF { \
278
PWM_FREQUENCY, \
279
PWM_FREQUENCY/TIM1_SERVO_HZ, \
280
NULL, \
281
{ \
282
{ PWM_SERVO_4_ACTIVE, NULL }, \
283
{ PWM_SERVO_3_ACTIVE, NULL }, \
284
{ PWM_SERVO_2_ACTIVE, NULL }, \
285
{ PWM_SERVO_1_ACTIVE, NULL }, \
286
}, \
287
0, \
288
0 \
289
}
290
291
#ifdef STM32_PWM_USE_TIM4
292
#define PWM_CONF_TIM4 STM32_PWM_USE_TIM4
293
#else
294
#define PWM_CONF_TIM4 1
295
#endif
296
#define PWM_CONF4_DEF { \
297
PWM_FREQUENCY, \
298
PWM_FREQUENCY/TIM4_SERVO_HZ, \
299
NULL, \
300
{ \
301
{ PWM_OUTPUT_DISABLED, NULL }, \
302
{ PWM_SERVO_5_ACTIVE, NULL }, \
303
{ PWM_SERVO_6_ACTIVE, NULL }, \
304
{ PWM_OUTPUT_DISABLED, NULL }, \
305
}, \
306
0, \
307
0 \
308
}
309
310
#ifdef STM32_PWM_USE_TIM12
311
#define PWM_CONF_TIM12 STM32_PWM_USE_TIM12
312
#else
313
#define PWM_CONF_TIM12 1
314
#endif
315
#define PWM_CONF12_DEF { \
316
PWM_FREQUENCY, \
317
PWM_FREQUENCY/TIM12_SERVO_HZ, \
318
NULL, \
319
{ \
320
{ PWM_SERVO_7_ACTIVE, NULL }, \
321
{ PWM_SERVO_8_ACTIVE, NULL }, \
322
{ PWM_OUTPUT_DISABLED, NULL }, \
323
{ PWM_OUTPUT_DISABLED, NULL }, \
324
}, \
325
0, \
326
0 \
327
}
328
332
#if defined(LINE_UART1_TX)
333
#define UART1_GPIO_PORT_TX PAL_PORT(LINE_UART1_TX)
334
#define UART1_GPIO_TX PAL_PAD(LINE_UART1_TX)
335
#endif
336
#if defined(LINE_UART1_RX)
337
#define UART1_GPIO_PORT_RX PAL_PORT(LINE_UART1_RX)
338
#define UART1_GPIO_RX PAL_PAD(LINE_UART1_RX)
339
#endif
340
#if defined(AF_LINE_UART1_TX)
341
#define UART1_GPIO_AF AF_LINE_UART1_TX
342
#elif defined(AF_LINE_UART1_RX)
343
#define UART1_GPIO_AF AF_LINE_UART1_RX
344
#else
345
#define UART1_GPIO_AF ((void)0)
346
#endif
347
348
#if defined(LINE_UART2_TX)
349
#define UART2_GPIO_PORT_TX PAL_PORT(LINE_UART2_TX)
350
#define UART2_GPIO_TX PAL_PAD(LINE_UART2_TX)
351
#endif
352
#if defined(LINE_UART2_RX)
353
#define UART2_GPIO_PORT_RX PAL_PORT(LINE_UART2_RX)
354
#define UART2_GPIO_RX PAL_PAD(LINE_UART2_RX)
355
#endif
356
#if defined(AF_LINE_UART2_TX)
357
#define UART2_GPIO_AF AF_LINE_UART2_TX
358
#elif defined(AF_LINE_UART2_RX)
359
#define UART2_GPIO_AF AF_LINE_UART2_RX
360
#else
361
#define UART2_GPIO_AF ((void)0)
362
#endif
363
364
#if defined(LINE_UART3_TX)
365
#define UART3_GPIO_PORT_TX PAL_PORT(LINE_UART3_TX)
366
#define UART3_GPIO_TX PAL_PAD(LINE_UART3_TX)
367
#endif
368
#if defined(LINE_UART3_RX)
369
#define UART3_GPIO_PORT_RX PAL_PORT(LINE_UART3_RX)
370
#define UART3_GPIO_RX PAL_PAD(LINE_UART3_RX)
371
#endif
372
#if defined(AF_LINE_UART3_TX)
373
#define UART3_GPIO_AF AF_LINE_UART3_TX
374
#elif defined(AF_LINE_UART3_RX)
375
#define UART3_GPIO_AF AF_LINE_UART3_RX
376
#else
377
#define UART3_GPIO_AF ((void)0)
378
#endif
379
380
#if defined(LINE_UART4_TX)
381
#define UART4_GPIO_PORT_TX PAL_PORT(LINE_UART4_TX)
382
#define UART4_GPIO_TX PAL_PAD(LINE_UART4_TX)
383
#endif
384
#if defined(LINE_UART4_RX)
385
#define UART4_GPIO_PORT_RX PAL_PORT(LINE_UART4_RX)
386
#define UART4_GPIO_RX PAL_PAD(LINE_UART4_RX)
387
#endif
388
#if defined(AF_LINE_UART4_TX)
389
#define UART4_GPIO_AF AF_LINE_UART4_TX
390
#elif defined(AF_LINE_UART4_RX)
391
#define UART4_GPIO_AF AF_LINE_UART4_RX
392
#else
393
#define UART4_GPIO_AF ((void)0)
394
#endif
395
396
#if defined(LINE_UART5_TX)
397
#define UART5_GPIO_PORT_TX PAL_PORT(LINE_UART5_TX)
398
#define UART5_GPIO_TX PAL_PAD(LINE_UART5_TX)
399
#endif
400
#if defined(LINE_UART5_RX)
401
#define UART5_GPIO_PORT_RX PAL_PORT(LINE_UART5_RX)
402
#define UART5_GPIO_RX PAL_PAD(LINE_UART5_RX)
403
#endif
404
#if defined(AF_LINE_UART5_TX)
405
#define UART5_GPIO_AF AF_LINE_UART5_TX
406
#elif defined(AF_LINE_UART5_RX)
407
#define UART5_GPIO_AF AF_LINE_UART5_RX
408
#else
409
#define UART5_GPIO_AF ((void)0)
410
#endif
411
412
#if defined(LINE_UART6_TX)
413
#define UART6_GPIO_PORT_TX PAL_PORT(LINE_UART6_TX)
414
#define UART6_GPIO_TX PAL_PAD(LINE_UART6_TX)
415
#endif
416
#if defined(LINE_UART6_RX)
417
#define UART6_GPIO_PORT_RX PAL_PORT(LINE_UART6_RX)
418
#define UART6_GPIO_RX PAL_PAD(LINE_UART6_RX)
419
#endif
420
#if defined(AF_LINE_UART6_TX)
421
#define UART6_GPIO_AF AF_LINE_UART6_TX
422
#elif defined(AF_LINE_UART6_RX)
423
#define UART6_GPIO_AF AF_LINE_UART6_RX
424
#else
425
#define UART6_GPIO_AF ((void)0)
426
#endif
427
428
#if defined(LINE_UART7_TX)
429
#define UART7_GPIO_PORT_TX PAL_PORT(LINE_UART7_TX)
430
#define UART7_GPIO_TX PAL_PAD(LINE_UART7_TX)
431
#endif
432
#if defined(LINE_UART7_RX)
433
#define UART7_GPIO_PORT_RX PAL_PORT(LINE_UART7_RX)
434
#define UART7_GPIO_RX PAL_PAD(LINE_UART7_RX)
435
#endif
436
#if defined(AF_LINE_UART7_TX)
437
#define UART7_GPIO_AF AF_LINE_UART7_TX
438
#elif defined(AF_LINE_UART7_RX)
439
#define UART7_GPIO_AF AF_LINE_UART7_RX
440
#else
441
#define UART7_GPIO_AF ((void)0)
442
#endif
443
444
#if defined(LINE_UART8_TX)
445
#define UART8_GPIO_PORT_TX PAL_PORT(LINE_UART8_TX)
446
#define UART8_GPIO_TX PAL_PAD(LINE_UART8_TX)
447
#endif
448
#if defined(LINE_UART8_RX)
449
#define UART8_GPIO_PORT_RX PAL_PORT(LINE_UART8_RX)
450
#define UART8_GPIO_RX PAL_PAD(LINE_UART8_RX)
451
#endif
452
#if defined(AF_LINE_UART8_TX)
453
#define UART8_GPIO_AF AF_LINE_UART8_TX
454
#elif defined(AF_LINE_UART8_RX)
455
#define UART8_GPIO_AF AF_LINE_UART8_RX
456
#else
457
#define UART8_GPIO_AF ((void)0)
458
#endif
459
466
// Digital noise filter: 0 disabled, [0x1 - 0xF] enable up to n t_I2CCLK
467
#define STM32_CR1_DNF(n) ((n & 0x0f) << 8)
468
// Timing register
469
#define I2C_FAST_400KHZ_DNF0_100NS_PCLK54MHZ_TIMINGR (STM32_TIMINGR_PRESC(0U) | \
470
STM32_TIMINGR_SCLDEL(10U) | STM32_TIMINGR_SDADEL(0U) | \
471
STM32_TIMINGR_SCLH(34U) | STM32_TIMINGR_SCLL(86U))
472
#define I2C_STD_100KHZ_DNF0_100NS_PCLK54MHZ_TIMINGR (STM32_TIMINGR_PRESC(1U) | \
473
STM32_TIMINGR_SCLDEL(9U) | STM32_TIMINGR_SDADEL(0U) | \
474
STM32_TIMINGR_SCLH(105U) | STM32_TIMINGR_SCLL(153U))
475
476
477
#ifndef I2C1_CLOCK_SPEED
478
#define I2C1_CLOCK_SPEED 400000
479
#endif
480
481
#if I2C1_CLOCK_SPEED == 400000
482
#define I2C1_CFG_DEF { \
483
.timingr = I2C_FAST_400KHZ_DNF0_100NS_PCLK54MHZ_TIMINGR, \
484
.cr1 = STM32_CR1_DNF(0), \
485
.cr2 = 0 \
486
}
487
#elif I2C1_CLOCK_SPEED == 100000
488
#define I2C1_CFG_DEF { \
489
.timingr = I2C_STD_100KHZ_DNF0_100NS_PCLK54MHZ_TIMINGR, \
490
.cr1 = STM32_CR1_DNF(0), \
491
.cr2 = 0 \
492
}
493
#else
494
#error "Unknown I2C1 clock speed"
495
#endif
496
497
498
#ifndef I2C2_CLOCK_SPEED
499
#define I2C2_CLOCK_SPEED 400000
500
#endif
501
502
#if I2C2_CLOCK_SPEED == 400000
503
#define I2C2_CFG_DEF { \
504
.timingr = I2C_FAST_400KHZ_DNF0_100NS_PCLK54MHZ_TIMINGR, \
505
.cr1 = STM32_CR1_DNF(0), \
506
.cr2 = 0 \
507
}
508
#elif I2C2_CLOCK_SPEED == 100000
509
#define I2C2_CFG_DEF { \
510
.timingr = I2C_STD_100KHZ_DNF0_100NS_PCLK54MHZ_TIMINGR, \
511
.cr1 = STM32_CR1_DNF(0), \
512
.cr2 = 0 \
513
}
514
#else
515
#error "Unknown I2C2 clock speed"
516
#endif
517
518
#ifndef I2C3_CLOCK_SPEED
519
#define I2C3_CLOCK_SPEED 400000
520
#endif
521
522
#if I2C3_CLOCK_SPEED == 400000
523
#define I2C3_CFG_DEF { \
524
.timingr = I2C_FAST_400KHZ_DNF0_100NS_PCLK54MHZ_TIMINGR, \
525
.cr1 = STM32_CR1_DNF(0), \
526
.cr2 = 0 \
527
}
528
#elif I2C3_CLOCK_SPEED == 100000
529
#define I2C3_CFG_DEF { \
530
.timingr = I2C_STD_100KHZ_DNF0_100NS_PCLK54MHZ_TIMINGR, \
531
.cr1 = STM32_CR1_DNF(0), \
532
.cr2 = 0 \
533
}
534
#else
535
#error "Unknown I2C3 clock speed"
536
#endif
537
538
#ifndef I2C4_CLOCK_SPEED
539
#define I2C4_CLOCK_SPEED 400000
540
#endif
541
542
#if I2C4_CLOCK_SPEED == 400000
543
#define I2C4_CFG_DEF { \
544
.timingr = I2C_FAST_400KHZ_DNF0_100NS_PCLK54MHZ_TIMINGR, \
545
.cr1 = STM32_CR1_DNF(0), \
546
.cr2 = 0 \
547
}
548
#elif I2C4_CLOCK_SPEED == 100000
549
#define I2C4_CFG_DEF { \
550
.timingr = I2C_STD_100KHZ_DNF0_100NS_PCLK54MHZ_TIMINGR, \
551
.cr1 = STM32_CR1_DNF(0), \
552
.cr2 = 0 \
553
}
554
#else
555
#error "Unknown I2C4 clock speed"
556
#endif
557
561
#if defined(LINE_SPI1_MISO) && defined(LINE_SPI1_MOSI) && defined(LINE_SPI1_SCK)
562
#define SPI1_GPIO_PORT_MISO PAL_PORT(LINE_SPI1_MISO)
563
#define SPI1_GPIO_MISO PAL_PAD(LINE_SPI1_MISO)
564
#define SPI1_GPIO_PORT_MOSI PAL_PORT(LINE_SPI1_MOSI)
565
#define SPI1_GPIO_MOSI PAL_PAD(LINE_SPI1_MOSI)
566
#define SPI1_GPIO_PORT_SCK PAL_PORT(LINE_SPI1_SCK)
567
#define SPI1_GPIO_SCK PAL_PAD(LINE_SPI1_SCK)
568
569
#if defined(AF_LINE_SPI1_SCK)
570
#define SPI1_GPIO_AF AF_LINE_SPI1_SCK
571
#endif
572
#endif
573
574
#if defined(LINE_SPI2_MISO) && defined(LINE_SPI2_MOSI) && defined(LINE_SPI2_SCK)
575
#define SPI2_GPIO_PORT_MISO PAL_PORT(LINE_SPI2_MISO)
576
#define SPI2_GPIO_MISO PAL_PAD(LINE_SPI2_MISO)
577
#define SPI2_GPIO_PORT_MOSI PAL_PORT(LINE_SPI2_MOSI)
578
#define SPI2_GPIO_MOSI PAL_PAD(LINE_SPI2_MOSI)
579
#define SPI2_GPIO_PORT_SCK PAL_PORT(LINE_SPI2_SCK)
580
#define SPI2_GPIO_SCK PAL_PAD(LINE_SPI2_SCK)
581
582
#if defined(AF_LINE_SPI2_SCK)
583
#define SPI2_GPIO_AF AF_LINE_SPI2_SCK
584
#endif
585
#endif
586
587
#if defined(LINE_SPI3_MISO) && defined(LINE_SPI3_MOSI) && defined(LINE_SPI3_SCK)
588
#define SPI3_GPIO_PORT_MISO PAL_PORT(LINE_SPI3_MISO)
589
#define SPI3_GPIO_MISO PAL_PAD(LINE_SPI3_MISO)
590
#define SPI3_GPIO_PORT_MOSI PAL_PORT(LINE_SPI3_MOSI)
591
#define SPI3_GPIO_MOSI PAL_PAD(LINE_SPI3_MOSI)
592
#define SPI3_GPIO_PORT_SCK PAL_PORT(LINE_SPI3_SCK)
593
#define SPI3_GPIO_SCK PAL_PAD(LINE_SPI3_SCK)
594
595
#if defined(AF_LINE_SPI3_SCK)
596
#define SPI3_GPIO_AF AF_LINE_SPI3_SCK
597
#endif
598
#endif
599
600
#if defined(LINE_SPI4_MISO) && defined(LINE_SPI4_MOSI) && defined(LINE_SPI4_SCK)
601
#define SPI4_GPIO_PORT_MISO PAL_PORT(LINE_SPI4_MISO)
602
#define SPI4_GPIO_MISO PAL_PAD(LINE_SPI4_MISO)
603
#define SPI4_GPIO_PORT_MOSI PAL_PORT(LINE_SPI4_MOSI)
604
#define SPI4_GPIO_MOSI PAL_PAD(LINE_SPI4_MOSI)
605
#define SPI4_GPIO_PORT_SCK PAL_PORT(LINE_SPI4_SCK)
606
#define SPI4_GPIO_SCK PAL_PAD(LINE_SPI4_SCK)
607
608
#if defined(AF_LINE_SPI4_SCK)
609
#define SPI4_GPIO_AF AF_LINE_SPI4_SCK
610
#endif
611
#endif
612
613
#if defined(LINE_SPI5_MISO) && defined(LINE_SPI5_MOSI) && defined(LINE_SPI5_SCK)
614
#define SPI5_GPIO_PORT_MISO PAL_PORT(LINE_SPI5_MISO)
615
#define SPI5_GPIO_MISO PAL_PAD(LINE_SPI5_MISO)
616
#define SPI5_GPIO_PORT_MOSI PAL_PORT(LINE_SPI5_MOSI)
617
#define SPI5_GPIO_MOSI PAL_PAD(LINE_SPI5_MOSI)
618
#define SPI5_GPIO_PORT_SCK PAL_PORT(LINE_SPI5_SCK)
619
#define SPI5_GPIO_SCK PAL_PAD(LINE_SPI5_SCK)
620
621
#if defined(AF_LINE_SPI5_SCK)
622
#define SPI5_GPIO_AF AF_LINE_SPI5_SCK
623
#endif
624
#endif
625
626
#if defined(LINE_SPI6_MISO) && defined(LINE_SPI6_MOSI) && defined(LINE_SPI6_SCK)
627
#define SPI6_GPIO_PORT_MISO PAL_PORT(LINE_SPI6_MISO)
628
#define SPI6_GPIO_MISO PAL_PAD(LINE_SPI6_MISO)
629
#define SPI6_GPIO_PORT_MOSI PAL_PORT(LINE_SPI6_MOSI)
630
#define SPI6_GPIO_MOSI PAL_PAD(LINE_SPI6_MOSI)
631
#define SPI6_GPIO_PORT_SCK PAL_PORT(LINE_SPI6_SCK)
632
#define SPI6_GPIO_SCK PAL_PAD(LINE_SPI6_SCK)
633
634
#if defined(AF_LINE_SPI6_SCK)
635
#define SPI6_GPIO_AF AF_LINE_SPI6_SCK
636
#endif
637
#endif
638
642
#if defined(LINE_SPI_SLAVE0)
643
#define SPI_SELECT_SLAVE0_PORT PAL_PORT(LINE_SPI_SLAVE0)
644
#define SPI_SELECT_SLAVE0_PIN PAL_PAD(LINE_SPI_SLAVE0)
645
#endif
646
647
#if defined(LINE_SPI_SLAVE1)
648
#define SPI_SELECT_SLAVE1_PORT PAL_PORT(LINE_SPI_SLAVE1)
649
#define SPI_SELECT_SLAVE1_PIN PAL_PAD(LINE_SPI_SLAVE1)
650
#endif
651
652
#if defined(LINE_SPI_SLAVE2)
653
#define SPI_SELECT_SLAVE2_PORT PAL_PORT(LINE_SPI_SLAVE2)
654
#define SPI_SELECT_SLAVE2_PIN PAL_PAD(LINE_SPI_SLAVE2)
655
#endif
656
657
#if defined(LINE_SPI_SLAVE3)
658
#define SPI_SELECT_SLAVE3_PORT PAL_PORT(LINE_SPI_SLAVE3)
659
#define SPI_SELECT_SLAVE3_PIN PAL_PAD(LINE_SPI_SLAVE3)
660
#endif
661
662
#if defined(LINE_SPI_SLAVE4)
663
#define SPI_SELECT_SLAVE4_PORT PAL_PORT(LINE_SPI_SLAVE4)
664
#define SPI_SELECT_SLAVE4_PIN PAL_PAD(LINE_SPI_SLAVE4)
665
#endif
666
667
#if defined(LINE_SPI_SLAVE5)
668
#define SPI_SELECT_SLAVE5_PORT PAL_PORT(LINE_SPI_SLAVE5)
669
#define SPI_SELECT_SLAVE5_PIN PAL_PAD(LINE_SPI_SLAVE5)
670
#endif
671
672
#if defined(LINE_SPI_SLAVE6)
673
#define SPI_SELECT_SLAVE6_PORT PAL_PORT(LINE_SPI_SLAVE6)
674
#define SPI_SELECT_SLAVE6_PIN PAL_PAD(LINE_SPI_SLAVE6)
675
#endif
676
683
#ifndef USE_BARO_BOARD
684
#define USE_BARO_BOARD 1
685
#endif
686
690
#if defined(LINE_SDIO_D0) && defined(LINE_SDIO_D1) && defined(LINE_SDIO_D2) && defined(LINE_SDIO_D3) && defined(LINE_SDIO_CK) && defined(LINE_SDIO_CMD)
691
#define SDIO_D0_PORT PAL_PORT(LINE_SDIO_D0)
692
#define SDIO_D0_PIN PAL_PAD(LINE_SDIO_D0)
693
#define SDIO_D1_PORT PAL_PORT(LINE_SDIO_D1)
694
#define SDIO_D1_PIN PAL_PAD(LINE_SDIO_D1)
695
#define SDIO_D2_PORT PAL_PORT(LINE_SDIO_D2)
696
#define SDIO_D2_PIN PAL_PAD(LINE_SDIO_D2)
697
#define SDIO_D3_PORT PAL_PORT(LINE_SDIO_D3)
698
#define SDIO_D3_PIN PAL_PAD(LINE_SDIO_D3)
699
#define SDIO_CK_PORT PAL_PORT(LINE_SDIO_CK)
700
#define SDIO_CK_PIN PAL_PAD(LINE_SDIO_CK)
701
#define SDIO_CMD_PORT PAL_PORT(LINE_SDIO_CMD)
702
#define SDIO_CMD_PIN PAL_PAD(LINE_SDIO_CMD)
703
704
#if defined(AF_LINE_SDIO_CMD)
705
#define SDIO_AF AF_LINE_SDIO_CMD
706
#else
707
#define SDIO_AF ((void)0)
708
#endif
709
#endif
710
711
#if defined(LINE_USB_VBUS)
712
#define SDLOG_USB_VBUS_PORT PAL_PORT(LINE_USB_VBUS)
713
#define SDLOG_USB_VBUS_PIN PAL_PAD(LINE_USB_VBUS)
714
#endif
715
716
// bat monitoring for file closing
717
#define SDLOG_BAT_ADC ADCD1
718
#define SDLOG_BAT_CHAN AD1_1_CHANNEL
719
// usb led status
720
#define SDLOG_USB_LED 3
721
722
723
/*
724
* Actuators for fixedwing
725
*/
726
/* Default actuators driver */
727
#define DEFAULT_ACTUATORS "subsystems/actuators/actuators_pwm.h"
728
#define ActuatorDefaultSet(_x,_y) ActuatorPwmSet(_x,_y)
729
#define ActuatorsDefaultInit() ActuatorsPwmInit()
730
#define ActuatorsDefaultCommit() ActuatorsPwmCommit()
731
732
#endif
/* CONFIG_PX4FMU_4_00_H */
733
board.h
sw
airborne
boards
px4fmu
chibios
v5.0
px4fmu.h
Generated on Tue Feb 1 2022 13:51:13 for Paparazzi UAS by
1.8.17