From af45f94a2f43b4dea179c1b27800a674b1a3ea27 Mon Sep 17 00:00:00 2001 From: MrKevinWeiss Date: Wed, 2 Mar 2022 14:03:28 +0100 Subject: [PATCH] drivers/adcxx1c: Update kconfig model --- drivers/adcxx1c/Kconfig | 71 ++++++++++++++++++---------- tests/driver_adcxx1c/app.config.test | 1 + 2 files changed, 47 insertions(+), 25 deletions(-) diff --git a/drivers/adcxx1c/Kconfig b/drivers/adcxx1c/Kconfig index be4f322b9f..deea57db74 100644 --- a/drivers/adcxx1c/Kconfig +++ b/drivers/adcxx1c/Kconfig @@ -5,32 +5,10 @@ # directory for more details. # -choice - bool "ADCXX1C Analog-to-Digital converter" - depends on HAS_PERIPH_GPIO - depends on HAS_PERIPH_GPIO_IRQ - depends on HAS_PERIPH_I2C - depends on TEST_KCONFIG - optional - help - This driver works with adc081c, adc101c and adc121c models. Select one. - -config MODULE_ADC081C - bool "ADC081C" - select MODULE_ADCXX1C - -config MODULE_ADC101C - bool "ADC101C" - select MODULE_ADCXX1C - -config MODULE_ADC121C - bool "ADC121C" - select MODULE_ADCXX1C - -endchoice - -config MODULE_ADCXX1C +menuconfig MODULE_ADCXX1C bool + prompt "ADCXX1C Analog-to-Digital converter" if !(SAUL_DEFAULT && HAVE_ADCXX1C) + default SAUL_DEFAULT && HAVE_ADCXX1C depends on HAS_PERIPH_GPIO depends on HAS_PERIPH_GPIO_IRQ depends on HAS_PERIPH_I2C @@ -38,3 +16,46 @@ config MODULE_ADCXX1C select MODULE_PERIPH_GPIO select MODULE_PERIPH_GPIO_IRQ select MODULE_PERIPH_I2C + +choice ADCXX1C_VARIANT + bool "Variants" + depends on MODULE_ADCXX1C + default MODULE_ADC081C if HAVE_ADC081C + default MODULE_ADC101C if HAVE_ADC101C + default MODULE_ADC121C if HAVE_ADC121C + help + This driver works with adc081c, adc101c and adc121c models. Select one. + +config MODULE_ADC081C + bool "ADC081C" + +config MODULE_ADC101C + bool "ADC101C" + +config MODULE_ADC121C + bool "ADC121C" + +endchoice + +config HAVE_ADCXX1C + bool + help + Indicates that ADCXX1C Analog-to-Digital is present. + +config HAVE_ADC081C + bool + select HAVE_ADCXX1C + help + Indicates that ADC081C Analog-to-Digital is present. + +config HAVE_ADC101C + bool + select HAVE_ADCXX1C + help + Indicates that ADC101C Analog-to-Digital is present. + +config HAVE_ADC121C + bool + select HAVE_ADCXX1C + help + Indicates that ADC121C Analog-to-Digital is present. diff --git a/tests/driver_adcxx1c/app.config.test b/tests/driver_adcxx1c/app.config.test index 038dc8fd2d..1c7df91a88 100644 --- a/tests/driver_adcxx1c/app.config.test +++ b/tests/driver_adcxx1c/app.config.test @@ -1,4 +1,5 @@ # this file enables modules defined in Kconfig. Do not use this file for # application configuration. This is only needed during migration. CONFIG_MODULE_ADC081C=y +CONFIG_MODULE_ADCXX1C=y CONFIG_MODULE_XTIMER=y