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