AP_HAL_ChibiOS: fix usage of ADC2 and ADC3 in STM32H730

This commit is contained in:
Andy Piper 2023-04-26 15:18:36 +01:00 committed by Andrew Tridgell
parent e6c1897dd3
commit d69b8c2693
3 changed files with 46 additions and 1 deletions

View File

@ -390,7 +390,7 @@
#endif
#define STM32_ADC_COMPACT_SAMPLES FALSE
#define STM32_ADC_USE_ADC12 TRUE
#if !defined(STM32H750xx) && !defined(STM32H730xx)
#if !defined(STM32H750xx)
#ifndef STM32_ADC_USE_ADC3
#define STM32_ADC_USE_ADC3 TRUE
#endif

View File

@ -322,8 +322,12 @@
/*
* ADC driver system settings.
*/
#ifndef STM32_ADC_DUAL_MODE
#define STM32_ADC_DUAL_MODE FALSE
#endif
#ifndef STM32_ADC_SAMPLES_SIZE
#define STM32_ADC_SAMPLES_SIZE 16
#endif
#define STM32_ADC_COMPACT_SAMPLES FALSE
#define STM32_ADC_USE_ADC12 TRUE
#define STM32_ADC_ADC12_DMA_PRIORITY 2
@ -597,3 +601,8 @@
#define STM32_SPI_SPI6_RX_BDMA_STREAM 4
#define STM32_SPI_SPI6_TX_BDMA_STREAM 5
#define STM32_ADC_ADC3_BDMA_STREAM 7
// disable DMA on I2C by default on H7
#ifndef STM32_I2C_USE_DMA
#define STM32_I2C_USE_DMA FALSE
#endif

View File

@ -1267,3 +1267,39 @@ ADC1_map = {
"PA4" : 18,
"PA5" : 19,
}
ADC2_map = {
"PF13" : 2,
"PA6" : 3,
"PC4" : 4,
"PB1" : 5,
"PF14" : 6,
"PA7" : 7,
"PC5" : 8,
"PB0" : 9,
"PC0" : 10,
"PC1" : 11,
"PC2" : 12,
"PC3" : 13,
"PA2" : 14,
"PA3" : 15,
"N/A" : 16,
"N/A" : 17,
"PA4" : 18,
"PA5" : 19,
}
ADC3_map = {
"PF9" : 2,
"PF7" : 3,
"PF5" : 4,
"PF3" : 5,
"PF10" : 6,
"PF8" : 7,
"PF6" : 8,
"PF4" : 9,
"PH2" : 13,
"PH3" : 14,
"PH4" : 15,
"PH5" : 16,
}