From 9c0dfaada976bf5c0cc7d0ccfc7cf8a128dc2a69 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Mon, 9 Dec 2019 19:53:00 +0100 Subject: [PATCH] boards/msba2: add ADC configuration ADC pins are on the AD/DA pins (JP8). Configure AD0.0 - AD0.2 as laid out on the board schematics. --- boards/msba2/Makefile.features | 1 + boards/msba2/include/periph_conf.h | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/boards/msba2/Makefile.features b/boards/msba2/Makefile.features index 86ce00383f..1f563e7c87 100644 --- a/boards/msba2/Makefile.features +++ b/boards/msba2/Makefile.features @@ -1,6 +1,7 @@ CPU = lpc2387 # Put defined MCU peripherals here (in alphabetical order) +FEATURES_PROVIDED += periph_adc FEATURES_PROVIDED += periph_pwm FEATURES_PROVIDED += periph_rtc FEATURES_PROVIDED += periph_spi diff --git a/boards/msba2/include/periph_conf.h b/boards/msba2/include/periph_conf.h index f92c6144d9..94ad2487b7 100644 --- a/boards/msba2/include/periph_conf.h +++ b/boards/msba2/include/periph_conf.h @@ -121,6 +121,32 @@ static const uart_conf_t uart_config[] = { #define SPI_NUMOF (1) /** @} */ +/** + * @name ADC configuration + * @{ + */ +static const adc_conf_t adc_config[] = { + { /* P0.23 */ + .chan = 0, + .pinsel = 1, + .pinsel_msk = BIT14, + }, + { /* P0.24 */ + .chan = 1, + .pinsel = 1, + .pinsel_msk = BIT16, + }, + { /* P0.25 */ + .chan = 2, + .pinsel = 1, + .pinsel_msk = BIT18, + }, +}; + +#define ADC_NUMOF ARRAY_SIZE(adc_config) +/** @} */ + + #ifdef __cplusplus } #endif