drivers/apds99xx/Kconfig: fix multimodel selection

This commit is contained in:
Francisco Molina 2021-11-30 14:44:05 +01:00
parent 2dab9eeb32
commit 39cfa43262
3 changed files with 56 additions and 13 deletions

View File

@ -5,11 +5,12 @@
# directory for more details. # directory for more details.
# #
choice menuconfig MODULE_APDS99XX
bool "APDS99XX proximity and ambient light sensor" bool
prompt "APDS99xx Broadcom Sensors" if !(MODULE_SAUL_DEFAULT && HAVE_APDS99XX)
depends on HAS_PERIPH_I2C depends on HAS_PERIPH_I2C
depends on TEST_KCONFIG depends on TEST_KCONFIG
optional select MODULE_PERIPH_I2C
help help
The driver can be used with following Broadcom sensors: APDS9900, The driver can be used with following Broadcom sensors: APDS9900,
APDS9901, APDS9930, APDS9950, APDS9960. Select one model. APDS9901, APDS9930, APDS9950, APDS9960. Select one model.
@ -24,36 +25,76 @@ choice
interrupts can be used to retrieve data. In addition, threshold interrupts can be used to retrieve data. In addition, threshold
interrupts can be used and configured. interrupts can be used and configured.
if MODULE_APDS99XX
choice APDS99XX_VARIANT
bool "Model"
default MODULE_APDS9900 if HAVE_APDS9900
default MODULE_APDS9901 if HAVE_APDS9901
default MODULE_APDS9930 if HAVE_APDS9930
default MODULE_APDS9950 if HAVE_APDS9950
default MODULE_APDS9960 if HAVE_APDS9960
help
The driver can be used with following Broadcom sensors: APDS9900,
APDS9901, APDS9930, APDS9950, APDS9960. Select one model.
config MODULE_APDS9900 config MODULE_APDS9900
bool "APDS9900" bool "APDS9900"
select MODULE_APDS99XX
config MODULE_APDS9901 config MODULE_APDS9901
bool "APDS9901" bool "APDS9901"
select MODULE_APDS99XX
config MODULE_APDS9930 config MODULE_APDS9930
bool "APDS9930" bool "APDS9930"
select MODULE_APDS99XX
config MODULE_APDS9950 config MODULE_APDS9950
bool "APDS9950" bool "APDS9950"
select MODULE_APDS99XX
config MODULE_APDS9960 config MODULE_APDS9960
bool "APDS9960" bool "APDS9960"
select MODULE_APDS99XX
endchoice endchoice
config MODULE_APDS99XX endif # MODULE_APDS99XX
bool
depends on HAS_PERIPH_I2C
depends on TEST_KCONFIG
select MODULE_PERIPH_I2C
config MODULE_APDS99XX_FULL config MODULE_APDS99XX_FULL
bool "APDS99XX Full functionalities" bool "APDS99XX Full functionalities"
depends on MODULE_APDS99XX depends on MODULE_APDS99XX
depends on HAS_PERIPH_GPIO_IRQ depends on HAS_PERIPH_GPIO_IRQ
select MODULE_PERIPH_GPIO_IRQ select MODULE_PERIPH_GPIO_IRQ
config HAVE_APDS99XX
bool
select MODULE_APDS99XX if MODULE_SAUL_DEFAULT
help
Indicates that a apds99xx sensor is present.
config HAVE_APDS9900
bool
select HAVE_APDS99XX
help
Indicates that a apds9900 sensor is present.
config HAVE_APDS9901
bool
select HAVE_APDS99XX
help
Indicates that a apds9901 sensor is present.
config HAVE_APDS9930
bool
select HAVE_APDS99XX
help
Indicates that a apds9930 sensor is present.
config HAVE_APDS9950
bool
select HAVE_APDS99XX
help
Indicates that a apds9950 sensor is present.
config HAVE_APDS9960
bool
select HAVE_APDS99XX
help
Indicates that a apds9960 sensor is present.

View File

@ -1,4 +1,5 @@
# this file enables modules defined in Kconfig. Do not use this file for # this file enables modules defined in Kconfig. Do not use this file for
# application configuration. This is only needed during migration. # application configuration. This is only needed during migration.
CONFIG_MODULE_APDS9960=y CONFIG_MODULE_APDS9960=y
CONFIG_MODULE_APDS99XX=y
CONFIG_MODULE_XTIMER=y CONFIG_MODULE_XTIMER=y

View File

@ -1,5 +1,6 @@
# this file enables modules defined in Kconfig. Do not use this file for # this file enables modules defined in Kconfig. Do not use this file for
# application configuration. This is only needed during migration. # application configuration. This is only needed during migration.
CONFIG_MODULE_APDS9960=y CONFIG_MODULE_APDS9960=y
CONFIG_MODULE_APDS99XX=y
CONFIG_MODULE_APDS99XX_FULL=y CONFIG_MODULE_APDS99XX_FULL=y
CONFIG_MODULE_CORE_THREAD_FLAGS=y CONFIG_MODULE_CORE_THREAD_FLAGS=y