diff --git a/boards/nucleo-f439zi/include/periph_conf.h b/boards/nucleo-f439zi/include/periph_conf.h index febb5ac9e7..588d3aee9b 100644 --- a/boards/nucleo-f439zi/include/periph_conf.h +++ b/boards/nucleo-f439zi/include/periph_conf.h @@ -198,9 +198,43 @@ static const eth_conf_t eth_config = { #define ETH_DMA_ISR isr_dma2_stream0 /** @} */ -static const adc_conf_t adc_config[] = {{}}; +/** + * @name ADC configuration + * + * Note that we do not configure all ADC channels, + * and not in the STM32F439ZI order. Instead, we + * just define 6 ADC channels, for the Nucleo + * Arduino header pins A0-A5 and the internal VBAT channel. + * + * To find appropriate device and channel find in the + * board manual, table showing pin assignments and + * information about ADC - a text similar to ADC[X]_IN[Y], + * where: + * [X] - describes used device - indexed from 0, + * for example ADC12_IN10 is device 0 or device 1, + * [Y] - describes used channel - indexed from 1, + * for example ADC12_IN10 is channel 10 + * + * For STM32F439ZI this information is in MCU datasheet, + * Table 10, page 53 or in Nucleo-f439ZI board manual, + * Table 17, page 52. + + * @{ + */ +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_NUMOF ARRAY_SIZE(adc_config) +/** @} */ #ifdef __cplusplus }