Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
mcuconf_h7.h
Go to the documentation of this file.
1
/*
2
ChibiOS - Copyright (C) 2006..2023 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
#ifndef MCUCONF_H7_H
18
#define MCUCONF_H7_H
19
20
/* Always enforce the old version */
21
#define STM32_ENFORCE_H7_REV_XY
22
23
/* Default clock configuration */
24
#ifndef STM32_LSECLK
25
#define STM32_LSECLK 32768U
26
#endif
27
28
#ifndef STM32_LSEDRV
29
#define STM32_LSEDRV (3U << 3U)
30
#endif
31
32
/*
33
* STM32H7xx drivers configuration.
34
* The following settings override the default settings present in
35
* the various device driver implementation headers.
36
* Note that the settings for each driver only have effect if the whole
37
* driver is enabled in halconf.h.
38
*
39
* IRQ priorities:
40
* 15...0 Lowest...Highest.
41
*
42
* DMA priorities:
43
* 0...3 Lowest...Highest.
44
*/
45
46
#define STM32H7xx_MCUCONF
47
#define STM32H742_MCUCONF
48
#define STM32H743_MCUCONF
49
#define STM32H753_MCUCONF
50
#define STM32H745_MCUCONF
51
#define STM32H755_MCUCONF
52
#define STM32H747_MCUCONF
53
#define STM32H757_MCUCONF
54
#define STM32H750_MCUCONF
55
56
/*
57
* General settings.
58
*/
59
#define STM32_NO_INIT FALSE
60
#define STM32_TARGET_CORE 1
61
62
/*
63
* Memory attributes settings.
64
*/
65
#define STM32_NOCACHE_ENABLE FALSE
66
#define STM32_NOCACHE_MPU_REGION MPU_REGION_6
67
#define STM32_NOCACHE_RBAR 0x24000000U
68
#define STM32_NOCACHE_RASR MPU_RASR_SIZE_64K
69
70
/*
71
* PWR system settings.
72
* Reading STM32 Reference Manual is required, settings in PWR_CR3 are
73
* very critical.
74
* Register constants are taken from the ST header.
75
*/
76
#define STM32_VOS STM32_VOS_SCALE1
77
#define STM32_PWR_CR1 (PWR_CR1_SVOS_1 | PWR_CR1_SVOS_0)
78
#define STM32_PWR_CR2 (PWR_CR2_BREN)
79
#if SMPS_PWR
80
#define STM32_PWR_CR3 (PWR_CR3_SMPSEN | PWR_CR3_USB33DEN)
81
#else
82
#define STM32_PWR_CR3 (PWR_CR3_LDOEN | PWR_CR3_USB33DEN)
83
#endif
84
#define STM32_PWR_CPUCR 0
85
86
/*
87
* Clock tree static settings.
88
* Reading STM32 Reference Manual is required.
89
*/
90
#define STM32_HSI_ENABLED FALSE
91
#define STM32_LSI_ENABLED FALSE
92
#define STM32_CSI_ENABLED FALSE
93
#define STM32_HSI48_ENABLED TRUE
94
#define STM32_HSE_ENABLED TRUE
95
#define STM32_LSE_ENABLED FALSE
96
#define STM32_HSIDIV STM32_HSIDIV_DIV1
97
98
/*
99
* PLLs static settings.
100
* Reading STM32 Reference Manual is required.
101
*/
102
#if STM32_HSECLK == 16000000U
103
#define STM32_PLLSRC STM32_PLLSRC_HSE_CK
104
#define STM32_PLLCFGR_MASK ~0
105
#define STM32_PLL1_ENABLED TRUE
106
#define STM32_PLL1_P_ENABLED TRUE
107
#define STM32_PLL1_Q_ENABLED TRUE
108
#define STM32_PLL1_R_ENABLED TRUE
109
#define STM32_PLL1_DIVM_VALUE 2
110
#define STM32_PLL1_DIVN_VALUE 100
111
#define STM32_PLL1_FRACN_VALUE 0
112
#define STM32_PLL1_DIVP_VALUE 2
113
#define STM32_PLL1_DIVQ_VALUE 10
114
#define STM32_PLL1_DIVR_VALUE 2
115
#define STM32_PLL2_ENABLED TRUE
116
#define STM32_PLL2_P_ENABLED TRUE
117
#define STM32_PLL2_Q_ENABLED TRUE
118
#define STM32_PLL2_R_ENABLED TRUE
119
#define STM32_PLL2_DIVM_VALUE 2
120
#define STM32_PLL2_DIVN_VALUE 75
121
#define STM32_PLL2_FRACN_VALUE 0
122
#define STM32_PLL2_DIVP_VALUE 3
123
#define STM32_PLL2_DIVQ_VALUE 6
124
#define STM32_PLL2_DIVR_VALUE 3
125
#define STM32_PLL3_ENABLED TRUE
126
#define STM32_PLL3_P_ENABLED FALSE
127
#define STM32_PLL3_Q_ENABLED TRUE
128
#define STM32_PLL3_R_ENABLED TRUE
129
#define STM32_PLL3_DIVM_VALUE 4
130
#define STM32_PLL3_DIVN_VALUE 72
131
#define STM32_PLL3_FRACN_VALUE 0
132
#define STM32_PLL3_DIVP_VALUE 2
133
#define STM32_PLL3_DIVQ_VALUE 6
134
#define STM32_PLL3_DIVR_VALUE 9
135
136
#elif STM32_HSECLK == 24000000U
137
#define STM32_PLLSRC STM32_PLLSRC_HSE_CK
138
#define STM32_PLLCFGR_MASK ~0
139
#define STM32_PLL1_ENABLED TRUE
140
#define STM32_PLL1_P_ENABLED TRUE
141
#define STM32_PLL1_Q_ENABLED TRUE
142
#define STM32_PLL1_R_ENABLED TRUE
143
#define STM32_PLL1_DIVM_VALUE 3
144
#define STM32_PLL1_DIVN_VALUE 100
145
#define STM32_PLL1_FRACN_VALUE 0
146
#define STM32_PLL1_DIVP_VALUE 2
147
#define STM32_PLL1_DIVQ_VALUE 10
148
#define STM32_PLL1_DIVR_VALUE 2
149
#define STM32_PLL2_ENABLED TRUE
150
#define STM32_PLL2_P_ENABLED TRUE
151
#define STM32_PLL2_Q_ENABLED TRUE
152
#define STM32_PLL2_R_ENABLED TRUE
153
#define STM32_PLL2_DIVM_VALUE 2
154
#define STM32_PLL2_DIVN_VALUE 30
155
#define STM32_PLL2_FRACN_VALUE 0
156
#define STM32_PLL2_DIVP_VALUE 2
157
#define STM32_PLL2_DIVQ_VALUE 5
158
#define STM32_PLL2_DIVR_VALUE 1
159
#define STM32_PLL3_ENABLED TRUE
160
#define STM32_PLL3_P_ENABLED TRUE
161
#define STM32_PLL3_Q_ENABLED TRUE
162
#define STM32_PLL3_R_ENABLED TRUE
163
#define STM32_PLL3_DIVM_VALUE 6
164
#define STM32_PLL3_DIVN_VALUE 72
165
#define STM32_PLL3_FRACN_VALUE 0
166
#define STM32_PLL3_DIVP_VALUE 2
167
#define STM32_PLL3_DIVQ_VALUE 6
168
#define STM32_PLL3_DIVR_VALUE 9
169
#endif
/* STM32_HSECLK */
170
171
/*
172
* Core clocks dynamic settings (can be changed at runtime).
173
* Reading STM32 Reference Manual is required.
174
*/
175
#define STM32_SW STM32_SW_PLL1_P_CK
176
#define STM32_RTCSEL STM32_RTCSEL_NOCLK
177
#define STM32_D1CPRE STM32_D1CPRE_DIV1
178
#define STM32_D1HPRE STM32_D1HPRE_DIV2
179
#define STM32_D1PPRE3 STM32_D1PPRE3_DIV2
180
#define STM32_D2PPRE1 STM32_D2PPRE1_DIV2
181
#define STM32_D2PPRE2 STM32_D2PPRE2_DIV2
182
#define STM32_D3PPRE4 STM32_D3PPRE4_DIV2
183
184
/*
185
* Peripherals clocks static settings.
186
* Reading STM32 Reference Manual is required.
187
*/
188
#define STM32_MCO1SEL STM32_MCO1SEL_HSE_CK
189
#define STM32_MCO1PRE_VALUE 4
190
#define STM32_MCO2SEL STM32_MCO2SEL_SYS_CK
191
#define STM32_MCO2PRE_VALUE 4
192
#define STM32_TIMPRE_ENABLE TRUE
193
#define STM32_HRTIMSEL 0
194
#define STM32_STOPKERWUCK 0
195
#define STM32_STOPWUCK 0
196
#define STM32_RTCPRE_VALUE 8
197
#define STM32_CKPERSEL STM32_CKPERSEL_HSE_CK
198
#define STM32_SDMMCSEL STM32_SDMMCSEL_PLL1_Q_CK
199
#define STM32_QSPISEL STM32_QSPISEL_PLL2_R_CK
200
#define STM32_FMCSEL STM32_FMCSEL_HCLK
201
#define STM32_SWPSEL STM32_SWPSEL_PCLK1
202
#define STM32_FDCANSEL STM32_FDCANSEL_PLL1_Q_CK
203
#define STM32_DFSDM1SEL STM32_DFSDM1SEL_PCLK2
204
#define STM32_SPDIFSEL STM32_SPDIFSEL_PLL1_Q_CK
205
#define STM32_SPI45SEL STM32_SPI45SEL_PCLK2
206
#define STM32_SPI123SEL STM32_SPI123SEL_PLL1_Q_CK
207
#define STM32_SAI23SEL STM32_SAI23SEL_PLL1_Q_CK
208
#define STM32_SAI1SEL STM32_SAI1SEL_PLL1_Q_CK
209
#define STM32_LPTIM1SEL STM32_LPTIM1SEL_PCLK1
210
#define STM32_CECSEL STM32_CECSEL_DISABLE
211
#define STM32_USBSEL STM32_USBSEL_PLL3_Q_CK
212
#define STM32_I2C123SEL STM32_I2C123SEL_PLL3_R_CK
213
#define STM32_RNGSEL STM32_RNGSEL_HSI48_CK
214
#define STM32_USART16SEL STM32_USART16SEL_PCLK2
215
#define STM32_USART234578SEL STM32_USART234578SEL_PCLK1
216
#define STM32_SPI6SEL STM32_SPI6SEL_PCLK4
217
#define STM32_SAI4BSEL STM32_SAI4BSEL_PLL1_Q_CK
218
#define STM32_SAI4ASEL STM32_SAI4ASEL_PLL1_Q_CK
219
#define STM32_ADCSEL STM32_ADCSEL_PLL3_R_CK
220
#define STM32_LPTIM345SEL STM32_LPTIM345SEL_PCLK4
221
#define STM32_LPTIM2SEL STM32_LPTIM2SEL_PCLK4
222
#define STM32_I2C4SEL STM32_I2C4SEL_PLL3_R_CK
223
#define STM32_LPUART1SEL STM32_LPUART1SEL_PCLK4
224
225
/*
226
* IRQ system settings.
227
*/
228
#define STM32_IRQ_EXTI0_PRIORITY 6
229
#define STM32_IRQ_EXTI1_PRIORITY 6
230
#define STM32_IRQ_EXTI2_PRIORITY 6
231
#define STM32_IRQ_EXTI3_PRIORITY 6
232
#define STM32_IRQ_EXTI4_PRIORITY 6
233
#define STM32_IRQ_EXTI5_9_PRIORITY 6
234
#define STM32_IRQ_EXTI10_15_PRIORITY 6
235
#define STM32_IRQ_EXTI16_PRIORITY 6
236
#define STM32_IRQ_EXTI17_PRIORITY 15
//#TODO: is this correct?
237
#define STM32_IRQ_EXTI18_PRIORITY 6
238
#define STM32_IRQ_EXTI19_PRIORITY 6
239
#define STM32_IRQ_EXTI20_21_PRIORITY 6
240
241
#define STM32_IRQ_FDCAN1_PRIORITY 10
242
#define STM32_IRQ_FDCAN2_PRIORITY 10
243
244
#define STM32_IRQ_MDMA_PRIORITY 9
245
246
#define STM32_IRQ_QUADSPI1_PRIORITY 10
247
248
#define STM32_IRQ_SDMMC1_PRIORITY 9
249
#define STM32_IRQ_SDMMC2_PRIORITY 9
250
251
#define STM32_IRQ_TIM1_UP_PRIORITY 7
252
#define STM32_IRQ_TIM1_CC_PRIORITY 7
253
#define STM32_IRQ_TIM2_PRIORITY 7
254
#define STM32_IRQ_TIM3_PRIORITY 7
255
#define STM32_IRQ_TIM4_PRIORITY 7
256
#define STM32_IRQ_TIM5_PRIORITY 7
257
#define STM32_IRQ_TIM6_PRIORITY 7
258
#define STM32_IRQ_TIM7_PRIORITY 7
259
#define STM32_IRQ_TIM8_BRK_TIM12_PRIORITY 7
260
#define STM32_IRQ_TIM8_UP_TIM13_PRIORITY 7
261
#define STM32_IRQ_TIM8_TRGCO_TIM14_PRIORITY 7
262
#define STM32_IRQ_TIM8_CC_PRIORITY 7
263
#define STM32_IRQ_TIM15_PRIORITY 7
264
#define STM32_IRQ_TIM16_PRIORITY 7
265
#define STM32_IRQ_TIM17_PRIORITY 7
266
267
#define STM32_IRQ_USART1_PRIORITY 12
268
#define STM32_IRQ_USART2_PRIORITY 12
269
#define STM32_IRQ_USART3_PRIORITY 12
270
#define STM32_IRQ_UART4_PRIORITY 12
271
#define STM32_IRQ_UART5_PRIORITY 12
272
#define STM32_IRQ_USART6_PRIORITY 12
273
#define STM32_IRQ_UART7_PRIORITY 12
274
#define STM32_IRQ_UART8_PRIORITY 12
275
#define STM32_IRQ_LPUART1_PRIORITY 12
276
277
/*
278
* ADC driver system settings.
279
*/
280
#define STM32_ADC_DUAL_MODE FALSE
281
#define STM32_ADC_SAMPLES_SIZE 16
282
#define STM32_ADC_USE_ADC12 TRUE
283
#define STM32_ADC_USE_ADC3 TRUE
284
#define STM32_ADC_ADC12_DMA_STREAM STM32_DMA_STREAM_ID_ANY
285
#define STM32_ADC_ADC3_BDMA_STREAM 7
286
#define STM32_ADC_ADC12_DMA_PRIORITY 2
287
#define STM32_ADC_ADC3_DMA_PRIORITY 2
288
#define STM32_ADC_ADC12_IRQ_PRIORITY 5
289
#define STM32_ADC_ADC3_IRQ_PRIORITY 5
290
#define STM32_ADC_ADC12_CLOCK_MODE ADC_CCR_CKMODE_ADCCK
291
#define STM32_ADC_ADC3_CLOCK_MODE ADC_CCR_CKMODE_ADCCK
292
293
/*
294
* CAN driver system settings.
295
*/
296
#if USE_CAN1
297
#define STM32_CAN_USE_FDCAN1 TRUE
298
#else
299
#define STM32_CAN_USE_FDCAN1 FALSE
300
#endif
301
#if USE_CAN2
302
#define STM32_CAN_USE_FDCAN2 TRUE
303
#else
304
#define STM32_CAN_USE_FDCAN2 FALSE
305
#endif
306
307
/*
308
* DAC driver system settings.
309
*/
310
#define STM32_DAC_DUAL_MODE FALSE
311
#define STM32_DAC_USE_DAC1_CH1 FALSE
312
#define STM32_DAC_USE_DAC1_CH2 FALSE
313
#define STM32_DAC_DAC1_CH1_IRQ_PRIORITY 10
314
#define STM32_DAC_DAC1_CH2_IRQ_PRIORITY 10
315
#define STM32_DAC_DAC1_CH1_DMA_PRIORITY 2
316
#define STM32_DAC_DAC1_CH2_DMA_PRIORITY 2
317
#define STM32_DAC_DAC1_CH1_DMA_STREAM STM32_DMA_STREAM_ID_ANY
318
#define STM32_DAC_DAC1_CH2_DMA_STREAM STM32_DMA_STREAM_ID_ANY
319
320
/*
321
* GPT driver system settings.
322
*/
323
#define STM32_GPT_USE_TIM1 FALSE
324
#define STM32_GPT_USE_TIM2 FALSE
325
#define STM32_GPT_USE_TIM3 FALSE
326
#define STM32_GPT_USE_TIM4 FALSE
327
#define STM32_GPT_USE_TIM5 FALSE
328
#define STM32_GPT_USE_TIM6 FALSE
329
#define STM32_GPT_USE_TIM7 FALSE
330
#define STM32_GPT_USE_TIM8 FALSE
331
#define STM32_GPT_USE_TIM12 FALSE
332
#define STM32_GPT_USE_TIM13 FALSE
333
#define STM32_GPT_USE_TIM14 FALSE
334
#define STM32_GPT_USE_TIM15 FALSE
335
#define STM32_GPT_USE_TIM16 FALSE
336
#define STM32_GPT_USE_TIM17 FALSE
337
338
/*
339
* I2C driver system settings.
340
*/
341
#if USE_I2C1
342
#define STM32_I2C_USE_I2C1 TRUE
343
#else
344
#define STM32_I2C_USE_I2C1 FALSE
345
#endif
346
#if USE_I2C2
347
#define STM32_I2C_USE_I2C2 TRUE
348
#else
349
#define STM32_I2C_USE_I2C2 FALSE
350
#endif
351
#if USE_I2C3
352
#define STM32_I2C_USE_I2C3 TRUE
353
#else
354
#define STM32_I2C_USE_I2C3 FALSE
355
#endif
356
#if USE_I2C4
357
#define STM32_I2C_USE_I2C4 TRUE
358
#else
359
#define STM32_I2C_USE_I2C4 FALSE
360
#endif
361
//TODO #define STM32_I2C_ISR_LIMIT 6
362
#define STM32_I2C_BUSY_TIMEOUT 0
363
#define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
364
#define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
365
#define STM32_I2C_I2C2_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
366
#define STM32_I2C_I2C2_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
367
#define STM32_I2C_I2C3_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
368
#define STM32_I2C_I2C3_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
369
#define STM32_I2C_I2C4_RX_BDMA_STREAM 1
370
#define STM32_I2C_I2C4_TX_BDMA_STREAM 2
371
#define STM32_I2C_I2C1_IRQ_PRIORITY 5
372
#define STM32_I2C_I2C2_IRQ_PRIORITY 5
373
#define STM32_I2C_I2C3_IRQ_PRIORITY 5
374
#define STM32_I2C_I2C4_IRQ_PRIORITY 5
375
#define STM32_I2C_I2C1_DMA_PRIORITY 3
376
#define STM32_I2C_I2C2_DMA_PRIORITY 3
377
#define STM32_I2C_I2C3_DMA_PRIORITY 3
378
#define STM32_I2C_I2C4_DMA_PRIORITY 3
379
#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure"
)
380
381
/*
382
* ICU driver system settings.
383
*/
384
#define STM32_ICU_USE_TIM1 FALSE
385
#define STM32_ICU_USE_TIM2 FALSE
386
#define STM32_ICU_USE_TIM3 FALSE
387
#define STM32_ICU_USE_TIM4 FALSE
388
#define STM32_ICU_USE_TIM5 FALSE
389
#define STM32_ICU_USE_TIM8 FALSE
390
#define STM32_ICU_USE_TIM12 FALSE
391
#define STM32_ICU_USE_TIM13 FALSE
392
#define STM32_ICU_USE_TIM14 FALSE
393
#define STM32_ICU_USE_TIM15 FALSE
394
#define STM32_ICU_USE_TIM16 FALSE
395
#define STM32_ICU_USE_TIM17 FALSE
396
397
/*
398
* MAC driver system settings.
399
*/
400
#define STM32_MAC_TRANSMIT_BUFFERS 2
401
#define STM32_MAC_RECEIVE_BUFFERS 4
402
#define STM32_MAC_BUFFERS_SIZE 1522
403
#define STM32_MAC_PHY_TIMEOUT 100
404
#define STM32_MAC_ETH1_CHANGE_PHY_STATE TRUE
405
#define STM32_MAC_ETH1_IRQ_PRIORITY 13
406
#define STM32_MAC_IP_CHECKSUM_OFFLOAD 0
407
408
/*
409
* PWM driver system settings.
410
*/
411
#if USE_PWM_TIM1 || USE_DSHOT_TIM1
412
#define STM32_PWM_USE_TIM1 TRUE
413
#else
414
#define STM32_PWM_USE_TIM1 FALSE
415
#endif
416
#if USE_PWM_TIM2 || USE_DSHOT_TIM2
417
#define STM32_PWM_USE_TIM2 TRUE
418
#else
419
#define STM32_PWM_USE_TIM2 FALSE
420
#endif
421
#if USE_PWM_TIM3 || USE_DSHOT_TIM3
422
#define STM32_PWM_USE_TIM3 TRUE
423
#else
424
#define STM32_PWM_USE_TIM3 FALSE
425
#endif
426
#if USE_PWM_TIM4 || USE_DSHOT_TIM4
427
#define STM32_PWM_USE_TIM4 TRUE
428
#else
429
#define STM32_PWM_USE_TIM4 FALSE
430
#endif
431
#if USE_PWM_TIM5 || USE_DSHOT_TIM5
432
#define STM32_PWM_USE_TIM5 TRUE
433
#else
434
#define STM32_PWM_USE_TIM5 FALSE
435
#endif
436
#if USE_PWM_TIM8 || USE_DSHOT_TIM8
437
#define STM32_PWM_USE_TIM8 TRUE
438
#else
439
#define STM32_PWM_USE_TIM8 FALSE
440
#endif
441
#if USE_PWM_TIM12 || USE_DSHOT_TIM12
442
#define STM32_PWM_USE_TIM12 TRUE
443
#else
444
#define STM32_PWM_USE_TIM12 FALSE
445
#endif
446
#define STM32_PWM_USE_TIM13 FALSE
447
#define STM32_PWM_USE_TIM14 FALSE
448
#define STM32_PWM_USE_TIM15 FALSE
449
#define STM32_PWM_USE_TIM16 FALSE
450
#define STM32_PWM_USE_TIM17 FALSE
451
452
/*
453
* RTC driver system settings.
454
*/
455
#define STM32_RTC_PRESA_VALUE 32
456
#define STM32_RTC_PRESS_VALUE 1024
457
#define STM32_RTC_CR_INIT 0
458
#define STM32_RTC_TAMPCR_INIT 0
459
460
/*
461
* SDC driver system settings.
462
*/
463
#if USE_SDCD1
464
#define STM32_SDC_USE_SDMMC1 TRUE
465
#else
466
#define STM32_SDC_USE_SDMMC1 FALSE
467
#endif
468
#if USE_SDCD2
469
#define STM32_SDC_USE_SDMMC2 TRUE
470
#else
471
#define STM32_SDC_USE_SDMMC2 FALSE
472
#endif
473
#define STM32_SDC_SDMMC_UNALIGNED_SUPPORT TRUE
474
#define STM32_SDC_SDMMC_WRITE_TIMEOUT 6000000
475
#define STM32_SDC_SDMMC_READ_TIMEOUT 6000000
476
#define STM32_SDC_SDMMC_CLOCK_DELAY 20
477
#define STM32_SDC_SDMMC_PWRSAV TRUE
478
//TODO #define STM32_SDC_FORCE_25MHZ TRUE
479
480
/*
481
* SERIAL driver system settings.
482
*/
483
#if USE_UART1
484
#define STM32_SERIAL_USE_USART1 TRUE
485
#else
486
#define STM32_SERIAL_USE_USART1 FALSE
487
#endif
488
#if USE_UART2
489
#define STM32_SERIAL_USE_USART2 TRUE
490
#else
491
#define STM32_SERIAL_USE_USART2 FALSE
492
#endif
493
#if USE_UART3
494
#define STM32_SERIAL_USE_USART3 TRUE
495
#else
496
#define STM32_SERIAL_USE_USART3 FALSE
497
#endif
498
#if USE_UART4
499
#define STM32_SERIAL_USE_UART4 TRUE
500
#else
501
#define STM32_SERIAL_USE_UART4 FALSE
502
#endif
503
#if USE_UART5
504
#define STM32_SERIAL_USE_UART5 TRUE
505
#else
506
#define STM32_SERIAL_USE_UART5 FALSE
507
#endif
508
#if USE_UART6
509
#define STM32_SERIAL_USE_USART6 TRUE
510
#else
511
#define STM32_SERIAL_USE_USART6 FALSE
512
#endif
513
#if USE_UART7
514
#define STM32_SERIAL_USE_UART7 TRUE
515
#else
516
#define STM32_SERIAL_USE_UART7 FALSE
517
#endif
518
#if USE_UART8
519
#define STM32_SERIAL_USE_UART8 TRUE
520
#else
521
#define STM32_SERIAL_USE_UART8 FALSE
522
#endif
523
#define STM32_SERIAL_USE_LPUART1 FALSE
524
525
/*
526
* SIO driver system settings.
527
*/
528
#define STM32_SIO_USE_USART1 FALSE
529
#define STM32_SIO_USE_USART2 FALSE
530
#define STM32_SIO_USE_USART3 FALSE
531
#define STM32_SIO_USE_UART4 FALSE
532
#define STM32_SIO_USE_UART5 FALSE
533
#define STM32_SIO_USE_USART6 FALSE
534
#define STM32_SIO_USE_UART7 FALSE
535
#define STM32_SIO_USE_UART8 FALSE
536
#define STM32_SIO_USE_LPUART1 FALSE
537
538
/*
539
* SPI driver system settings.
540
*/
541
#if USE_SPI1
542
#define STM32_SPI_USE_SPI1 TRUE
543
#else
544
#define STM32_SPI_USE_SPI1 FALSE
545
#endif
546
#if USE_SPI2
547
#define STM32_SPI_USE_SPI2 TRUE
548
#else
549
#define STM32_SPI_USE_SPI2 FALSE
550
#endif
551
#if USE_SPI3
552
#define STM32_SPI_USE_SPI3 TRUE
553
#else
554
#define STM32_SPI_USE_SPI3 FALSE
555
#endif
556
#if USE_SPI4
557
#define STM32_SPI_USE_SPI4 TRUE
558
#else
559
#define STM32_SPI_USE_SPI4 FALSE
560
#endif
561
#if USE_SPI4
562
#define STM32_SPI_USE_SPI5 TRUE
563
#else
564
#define STM32_SPI_USE_SPI5 FALSE
565
#endif
566
#if USE_SPI6
567
#define STM32_SPI_USE_SPI6 TRUE
568
#else
569
#define STM32_SPI_USE_SPI6 FALSE
570
#endif
571
#define STM32_SPI_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
572
#define STM32_SPI_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
573
#define STM32_SPI_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
574
#define STM32_SPI_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
575
#define STM32_SPI_SPI3_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
576
#define STM32_SPI_SPI3_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
577
#define STM32_SPI_SPI4_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
578
#define STM32_SPI_SPI4_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
579
#define STM32_SPI_SPI5_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
580
#define STM32_SPI_SPI5_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
581
#define STM32_SPI_SPI6_RX_BDMA_STREAM STM32_BDMA_STREAM_ID_ANY
582
#define STM32_SPI_SPI6_TX_BDMA_STREAM STM32_BDMA_STREAM_ID_ANY
583
#define STM32_SPI_SPI1_DMA_PRIORITY 1
584
#define STM32_SPI_SPI2_DMA_PRIORITY 1
585
#define STM32_SPI_SPI3_DMA_PRIORITY 1
586
#define STM32_SPI_SPI4_DMA_PRIORITY 1
587
#define STM32_SPI_SPI5_DMA_PRIORITY 1
588
#define STM32_SPI_SPI6_DMA_PRIORITY 1
589
#define STM32_SPI_SPI1_IRQ_PRIORITY 10
590
#define STM32_SPI_SPI2_IRQ_PRIORITY 10
591
#define STM32_SPI_SPI3_IRQ_PRIORITY 10
592
#define STM32_SPI_SPI4_IRQ_PRIORITY 10
593
#define STM32_SPI_SPI5_IRQ_PRIORITY 10
594
#define STM32_SPI_SPI6_IRQ_PRIORITY 10
595
#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure"
)
596
597
/*
598
* ST driver system settings.
599
*/
600
#define STM32_ST_IRQ_PRIORITY 8
601
#define STM32_ST_USE_TIMER 5
602
603
/*
604
* TRNG driver system settings.
605
*/
606
#define STM32_TRNG_USE_RNG1 FALSE
607
608
/*
609
* UART driver system settings.
610
*/
611
#define STM32_UART_USE_USART1 FALSE
612
#define STM32_UART_USE_USART2 FALSE
613
#define STM32_UART_USE_USART3 FALSE
614
#define STM32_UART_USE_UART4 FALSE
615
#define STM32_UART_USE_UART5 FALSE
616
#define STM32_UART_USE_USART6 FALSE
617
#define STM32_UART_USE_UART7 FALSE
618
#define STM32_UART_USE_UART8 FALSE
619
#define STM32_UART_USART1_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
620
#define STM32_UART_USART1_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
621
#define STM32_UART_USART2_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
622
#define STM32_UART_USART2_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
623
#define STM32_UART_USART3_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
624
#define STM32_UART_USART3_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
625
#define STM32_UART_UART4_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
626
#define STM32_UART_UART4_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
627
#define STM32_UART_UART5_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
628
#define STM32_UART_UART5_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
629
#define STM32_UART_USART6_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
630
#define STM32_UART_USART6_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
631
#define STM32_UART_UART7_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
632
#define STM32_UART_UART7_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
633
#define STM32_UART_UART8_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
634
#define STM32_UART_UART8_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
635
#define STM32_UART_USART1_DMA_PRIORITY 1
636
#define STM32_UART_USART2_DMA_PRIORITY 0
637
#define STM32_UART_USART3_DMA_PRIORITY 0
638
#define STM32_UART_UART4_DMA_PRIORITY 0
639
#define STM32_UART_UART5_DMA_PRIORITY 0
640
#define STM32_UART_USART6_DMA_PRIORITY 0
641
#define STM32_UART_UART7_DMA_PRIORITY 0
642
#define STM32_UART_UART8_DMA_PRIORITY 0
643
#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure"
)
644
645
/*
646
* USB driver system settings.
647
*/
648
#define STM32_USB_USE_OTG1 TRUE
// FS, DFU_BOOT
649
#define STM32_USB_USE_OTG2 FALSE
// HS
650
#define STM32_USB_OTG1_IRQ_PRIORITY 14
651
#define STM32_USB_OTG2_IRQ_PRIORITY 14
652
#define STM32_USB_OTG1_RX_FIFO_SIZE 512
653
#define STM32_USB_OTG2_RX_FIFO_SIZE 512
654
#define STM32_USB_HOST_WAKEUP_DURATION 2
655
656
/*
657
* WDG driver system settings.
658
*/
659
#define STM32_WDG_USE_IWDG FALSE
660
661
/*
662
* WSPI driver system settings.
663
*/
664
#define STM32_WSPI_USE_QUADSPI1 FALSE
665
#define STM32_WSPI_QUADSPI1_PRESCALER_VALUE ((STM32_QSPICLK / HAL_QSPI1_CLK) - 1)
666
#define STM32_WSPI_SET_CR_SSHIFT TRUE
667
#define STM32_WSPI_QUADSPI1_MDMA_CHANNEL STM32_MDMA_CHANNEL_ID_ANY
668
#define STM32_WSPI_QUADSPI1_MDMA_PRIORITY 1
669
#define STM32_WSPI_MDMA_ERROR_HOOK(wspip) osalSysHalt("MDMA failure"
)
670
671
/*
672
sdlog message buffer and queue configuration
673
*/
674
#define SDLOG_QUEUE_BUCKETS 1024
675
#define SDLOG_MAX_MESSAGE_LEN 300
676
#define SDLOG_NUM_FILES 2
677
#define SDLOG_ALL_BUFFERS_SIZE (SDLOG_NUM_FILES*16*1024)
678
679
#endif
/* MCUCONF_H7_H */
sw
airborne
arch
chibios
mcuconf_h7.h
Generated on Fri Nov 8 2024 14:10:44 for Paparazzi UAS by
1.9.1