From b4ff23580c3054ee7b9f741cb89988d92a12910a Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Thu, 30 Mar 2017 15:02:50 +0200 Subject: [PATCH] boards/nucleo-l1: add adc and dac configuration --- boards/nucleo-l1/Makefile.features | 2 ++ boards/nucleo-l1/include/periph_conf.h | 34 ++++++++++++++++++++------ 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/boards/nucleo-l1/Makefile.features b/boards/nucleo-l1/Makefile.features index 0458cbfedf..322a9f2b42 100644 --- a/boards/nucleo-l1/Makefile.features +++ b/boards/nucleo-l1/Makefile.features @@ -1,5 +1,7 @@ # Put defined MCU peripherals here (in alphabetical order) +FEATURES_PROVIDED += periph_adc FEATURES_PROVIDED += periph_cpuid +FEATURES_PROVIDED += periph_dac FEATURES_PROVIDED += periph_gpio FEATURES_PROVIDED += periph_i2c FEATURES_PROVIDED += periph_pwm diff --git a/boards/nucleo-l1/include/periph_conf.h b/boards/nucleo-l1/include/periph_conf.h index c74b43ecb1..ab587432a4 100644 --- a/boards/nucleo-l1/include/periph_conf.h +++ b/boards/nucleo-l1/include/periph_conf.h @@ -49,13 +49,6 @@ extern "C" { #define CLOCK_APB1 (CLOCK_CORECLOCK / 1) /** @} */ -/** - * @name DAC configuration - * @{ - */ -#define DAC_NUMOF (0) -/** @} */ - /** * @name Timer configuration * @{ @@ -221,7 +214,34 @@ static const i2c_conf_t i2c_config[] = { {I2C2, GPIO_PIN(PORT_B, 10), GPIO_PIN(PORT_B, 11), GPIO_OD_PU, GPIO_AF4, I2C2_ER_IRQn, I2C2_EV_IRQn}, }; +/** @} */ +/** + * @name ADC configuration + * @{ + */ +#define ADC_CONFIG { \ + { GPIO_PIN(PORT_A, 0), 0 }, \ + { GPIO_PIN(PORT_A, 1), 1 }, \ + { GPIO_PIN(PORT_A, 4), 4 }, \ + { GPIO_PIN(PORT_B, 0), 8 }, \ + { GPIO_PIN(PORT_C, 1), 11 }, \ + { GPIO_PIN(PORT_C, 0), 10 }, \ +} + +#define ADC_NUMOF (6U) +/** @} */ + +/** + * @name DAC configuration + * @{ + */ +#define DAC_CONFIG { \ + { GPIO_PIN(PORT_A, 4), 1}, \ + { GPIO_PIN(PORT_A, 5), 2}, \ +} + +#define DAC_NUMOF (2U) /** @} */ #ifdef __cplusplus