From cedab803a40ff55855199afff844924b2b57606d Mon Sep 17 00:00:00 2001 From: krzysztof-cabaj Date: Thu, 20 Feb 2025 21:12:42 +0100 Subject: [PATCH 1/2] boards/nucleo-f722ze: enabling ADC feature --- boards/nucleo-f722ze/Makefile.features | 1 + boards/nucleo-f722ze/include/periph_conf.h | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/boards/nucleo-f722ze/Makefile.features b/boards/nucleo-f722ze/Makefile.features index aa05bafc46de..c4dd28d9e80a 100644 --- a/boards/nucleo-f722ze/Makefile.features +++ b/boards/nucleo-f722ze/Makefile.features @@ -2,6 +2,7 @@ CPU = stm32 CPU_MODEL = stm32f722ze # Put defined MCU peripherals here (in alphabetical order) +FEATURES_PROVIDED += periph_adc FEATURES_PROVIDED += periph_i2c FEATURES_PROVIDED += periph_rtc FEATURES_PROVIDED += periph_rtt diff --git a/boards/nucleo-f722ze/include/periph_conf.h b/boards/nucleo-f722ze/include/periph_conf.h index c794f88d4d5b..cee5c19b5db6 100644 --- a/boards/nucleo-f722ze/include/periph_conf.h +++ b/boards/nucleo-f722ze/include/periph_conf.h @@ -99,6 +99,10 @@ static const uart_conf_t uart_config[] = { #define UART_NUMOF ARRAY_SIZE(uart_config) /** @} */ +static const adc_conf_t adc_config[] = {{}}; + +#define ADC_NUMOF ARRAY_SIZE(adc_config) + #ifdef __cplusplus } #endif From 83a0c142b2c8fee85c8ab48d611c634d36cb2bdf Mon Sep 17 00:00:00 2001 From: krzysztof-cabaj Date: Thu, 20 Feb 2025 21:21:02 +0100 Subject: [PATCH 2/2] boards/nucleo-f722ze: add full ADC config --- boards/nucleo-f722ze/include/periph_conf.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/boards/nucleo-f722ze/include/periph_conf.h b/boards/nucleo-f722ze/include/periph_conf.h index cee5c19b5db6..09a706d94fa8 100644 --- a/boards/nucleo-f722ze/include/periph_conf.h +++ b/boards/nucleo-f722ze/include/periph_conf.h @@ -99,7 +99,19 @@ static const uart_conf_t uart_config[] = { #define UART_NUMOF ARRAY_SIZE(uart_config) /** @} */ -static const adc_conf_t adc_config[] = {{}}; +static const adc_conf_t adc_config[] = { + {GPIO_PIN(PORT_A, 3), .dev = 2, .chan = 3}, /* ADC123_IN3 */ + {GPIO_PIN(PORT_C, 0), .dev = 2, .chan = 10}, /* ADC123_IN10 */ + {GPIO_PIN(PORT_C, 3), .dev = 2, .chan = 13}, /* ADC123_IN13 */ + {GPIO_PIN(PORT_F, 3), .dev = 2, .chan = 9}, /* ADC3_IN9 */ + {GPIO_PIN(PORT_F, 5), .dev = 2, .chan = 15}, /* ADC3_IN15 */ + {GPIO_PIN(PORT_F, 10), .dev = 2, .chan = 8}, /* ADC3_IN8 */ + {GPIO_UNDEF, .dev = 0, .chan = 18}, /* VBAT */ +}; + +#define VBAT_ADC ADC_LINE(6) /**< VBAT ADC line */ + +#define ADC_CLK_MAX MHZ(36) /**< Use a faster than default ADC clock */ #define ADC_NUMOF ARRAY_SIZE(adc_config)