From 8fca896d0dbd44aaf97c516172024827fa3e38ed Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Fri, 23 Jun 2017 16:46:12 +0200 Subject: [PATCH] board/nucleo144-f412: add ADC configuration --- boards/nucleo144-f412/Makefile.features | 1 + boards/nucleo144-f412/include/periph_conf.h | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/boards/nucleo144-f412/Makefile.features b/boards/nucleo144-f412/Makefile.features index 86755db659..b780768dbe 100644 --- a/boards/nucleo144-f412/Makefile.features +++ b/boards/nucleo144-f412/Makefile.features @@ -1,4 +1,5 @@ # Put defined MCU peripherals here (in alphabetical order) +FEATURES_PROVIDED += periph_adc FEATURES_PROVIDED += periph_cpuid FEATURES_PROVIDED += periph_gpio FEATURES_PROVIDED += periph_i2c diff --git a/boards/nucleo144-f412/include/periph_conf.h b/boards/nucleo144-f412/include/periph_conf.h index 52fa28f868..2b0d8c3ac9 100644 --- a/boards/nucleo144-f412/include/periph_conf.h +++ b/boards/nucleo144-f412/include/periph_conf.h @@ -226,10 +226,24 @@ static const spi_conf_t spi_config[] = { /** @} */ /** - * @name ADC configuration + * @name ADC configuration + * + * Note that we do not configure all ADC channels, + * and not in the STM32F412zg order. Instead, we + * just define 6 ADC channels, for the Nucleo + * Arduino header pins A0-A5 + * * @{ */ -#define ADC_NUMOF (0) +#define ADC_NUMOF (6U) +#define ADC_CONFIG { \ + {GPIO_PIN(PORT_A, 3), 0, 3}, \ + {GPIO_PIN(PORT_C, 0), 0, 10}, \ + {GPIO_PIN(PORT_C, 3), 0, 13}, \ + {GPIO_PIN(PORT_C, 1), 0, 11}, \ + {GPIO_PIN(PORT_C, 4), 0, 14}, \ + {GPIO_PIN(PORT_C, 5), 0, 15}, \ +} /** @} */ /**