From b443ca579497a63aa5b955553febd4fe2484a83a Mon Sep 17 00:00:00 2001 From: MrKevinWeiss Date: Wed, 2 Mar 2022 14:03:52 +0100 Subject: [PATCH] drivers/pn532: Update kconfig model --- drivers/pn532/Kconfig | 56 ++++++++++++++++++++---------- tests/driver_pn532/app.config.test | 1 + 2 files changed, 38 insertions(+), 19 deletions(-) diff --git a/drivers/pn532/Kconfig b/drivers/pn532/Kconfig index 45314ca0be..d2ca1ecafa 100644 --- a/drivers/pn532/Kconfig +++ b/drivers/pn532/Kconfig @@ -6,32 +6,50 @@ # directory for more details. # -if TEST_KCONFIG && HAS_PERIPH_GPIO && HAS_PERIPH_GPIO_IRQ - -menu "PN532 NFC reader" - -config MODULE_PN532_I2C - bool "PN532 with I2C support" - depends on HAS_PERIPH_I2C - select MODULE_PERIPH_I2C - select MODULE_PN532 - -config MODULE_PN532_SPI - bool "PN532 with SPI support" - depends on HAS_PERIPH_SPI - select MODULE_PERIPH_SPI - select MODULE_PN532 - -config MODULE_PN532 +menuconfig MODULE_PN532 bool + prompt "PN532 NFC reader" if !(MODULE_SAUL_DEFAULT && HAVE_PN532) + default (MODULE_SAUL_DEFAULT && HAVE_PN532) + depends on TEST_KCONFIG + depends on HAS_PERIPH_GPIO + depends on HAS_PERIPH_GPIO_IRQ select MODULE_PERIPH_GPIO select MODULE_PERIPH_GPIO_IRQ select MODULE_ZTIMER select MODULE_ZTIMER_MSEC -endmenu # PN532 NFC reader +if MODULE_PN532 -endif # TEST_KCONFIG && HAS_PERIPH_GPIO && HAS_PERIPH_GPIO_IRQ +config MODULE_PN532_I2C + bool "PN532 with I2C support" + default HAVE_PN532_I2C + depends on HAS_PERIPH_I2C + select MODULE_PERIPH_I2C + +config MODULE_PN532_SPI + bool "PN532 with SPI support" + default HAVE_PN532_SPI + depends on HAS_PERIPH_SPI + select MODULE_PERIPH_SPI + +endif # MODULE_PN532 + +config HAVE_PN532 + bool + help + Indicates that a PN532 NFC reader is present. + +config HAVE_PN532_I2C + bool + select HAVE_PN532 + help + Indicates that a PN532 NFC reader is present on the i2c bus. + +config HAVE_PN532_SPI + bool + select HAVE_PN532 + help + Indicates that a PN532 NFC reader is present on the spi bus. menuconfig KCONFIG_USEMODULE_PN532 bool "Configure PN532 driver" diff --git a/tests/driver_pn532/app.config.test b/tests/driver_pn532/app.config.test index 8aa03c7b53..d017f96d44 100644 --- a/tests/driver_pn532/app.config.test +++ b/tests/driver_pn532/app.config.test @@ -1,6 +1,7 @@ # this file enables modules defined in Kconfig. Do not use this file for # application configuration. This is only needed during migration. +CONFIG_MODULE_PN532=y # select if you want to build the SPI or the I2C version of the driver CONFIG_MODULE_PN532_I2C=y # CONFIG_MODULE_PN532_SPI=y