From e04e8ee1289aa121b6541097cd9c900ce94c5f11 Mon Sep 17 00:00:00 2001 From: Gunar Schorcht Date: Tue, 15 Aug 2023 14:57:13 +0200 Subject: [PATCH] boards/sltb009a: enable DAC support --- boards/sltb009a/Kconfig | 1 + boards/sltb009a/Makefile.features | 1 + boards/sltb009a/include/periph_conf.h | 23 +++++++++++++++++++++++ 3 files changed, 25 insertions(+) diff --git a/boards/sltb009a/Kconfig b/boards/sltb009a/Kconfig index 508114793c..bc1ffad854 100644 --- a/boards/sltb009a/Kconfig +++ b/boards/sltb009a/Kconfig @@ -13,6 +13,7 @@ config BOARD_SLTB009A select BOARD_COMMON_SILABS select CPU_MODEL_EFM32GG12B810F1024GM64 select HAS_PERIPH_ADC + select HAS_PERIPH_DAC select HAS_PERIPH_I2C select HAS_PERIPH_RTC select HAS_PERIPH_RTT diff --git a/boards/sltb009a/Makefile.features b/boards/sltb009a/Makefile.features index 663bfabff6..7a024b717a 100644 --- a/boards/sltb009a/Makefile.features +++ b/boards/sltb009a/Makefile.features @@ -4,6 +4,7 @@ CPU_MODEL = efm32gg12b810f1024gm64 # Put defined MCU peripherals here (in alphabetical order) FEATURES_PROVIDED += periph_adc +FEATURES_PROVIDED += periph_dac FEATURES_PROVIDED += periph_i2c FEATURES_PROVIDED += periph_rtc FEATURES_PROVIDED += periph_rtt diff --git a/boards/sltb009a/include/periph_conf.h b/boards/sltb009a/include/periph_conf.h index b464f61bab..2823654e35 100644 --- a/boards/sltb009a/include/periph_conf.h +++ b/boards/sltb009a/include/periph_conf.h @@ -80,6 +80,29 @@ static const adc_chan_conf_t adc_channel_config[] = { #define ADC_NUMOF ARRAY_SIZE(adc_channel_config) /** @} */ +/** + * @name DAC configuration + * @{ + */ +static const dac_conf_t dac_config[] = { + { + .dev = VDAC0, + .ref = vdacRefAvdd, + .cmu = cmuClock_VDAC0, + }, +}; + +static const dac_chan_conf_t dac_channel_config[] = { + { + .dev = 0, + .index = 0, + }, +}; + +#define DAC_DEV_NUMOF ARRAY_SIZE(dac_config) +#define DAC_NUMOF ARRAY_SIZE(dac_channel_config) +/** @} */ + /** * @name I2C configuration * @{