From fba9cad9873cdbf36c9e76aa17b80132c7dec23b Mon Sep 17 00:00:00 2001 From: MrKevinWeiss Date: Wed, 24 Nov 2021 11:22:25 +0100 Subject: [PATCH] periph/gpio: Model TAMPER_WAKE for kconfig --- cpu/sam0_common/periph/Kconfig | 2 +- drivers/periph_common/Kconfig.gpio | 15 ++++++++++++++- tests/periph_gpio/Kconfig | 1 + 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/cpu/sam0_common/periph/Kconfig b/cpu/sam0_common/periph/Kconfig index b8a673789e..db82e7e99f 100644 --- a/cpu/sam0_common/periph/Kconfig +++ b/cpu/sam0_common/periph/Kconfig @@ -18,7 +18,7 @@ config MODULE_SAM0_COMMON_PERIPH config MODULE_PERIPH_RTC_RTT bool - default y if MODULE_PERIPH_RTT || MODULE_PERIPH_RTC + default y if MODULE_PERIPH_RTT || MODULE_PERIPH_RTC || MODULE_PERIPH_GPIO_TAMPER_WAKE config MODULE_PERIPH_UART_NONBLOCKING depends on HAS_PERIPH_UART_NONBLOCKING diff --git a/drivers/periph_common/Kconfig.gpio b/drivers/periph_common/Kconfig.gpio index 8c7aa4cbfe..33a2f6d37f 100644 --- a/drivers/periph_common/Kconfig.gpio +++ b/drivers/periph_common/Kconfig.gpio @@ -29,7 +29,15 @@ config MODULE_PERIPH_GPIO_FAST_READ This trades an increase in power consumption for a decrease in GPIO pin read latency. -# TODO: this module is actually just an artifact from the way periph_init_% +config MODULE_PERIPH_GPIO_TAMPER_WAKE + bool "enable wake from Deep Sleep by RTC tamper pins" + depends on HAS_PERIPH_GPIO_TAMPER_WAKE + help + If you enable this, a RTC tamper pin that has been configured as an + interrupt can wake the CPU from Deep Sleep. Only RTC tamper pins + (and the RTC alarm) can wake the CPU from Deep Sleep. + +# TODO: this module is actually jus t an artifact from the way periph_init_% # modules are handled in Makefile. We need to define it to keep the list the # same for now. We should be able to remove it later on. @@ -43,6 +51,11 @@ config MODULE_PERIPH_INIT_GPIO_FAST_READ default y if MODULE_PERIPH_INIT depends on MODULE_PERIPH_GPIO_FAST_READ +config MODULE_PERIPH_INIT_GPIO_TAMPER_WAKE + bool "Auto initialize tamper detection" + default y if MODULE_PERIPH_INIT + depends on MODULE_PERIPH_GPIO_TAMPER_WAKE + endif # MODULE_PERIPH_GPIO osource "$(RIOTCPU)/$(CPU)/periph/Kconfig.gpio" diff --git a/tests/periph_gpio/Kconfig b/tests/periph_gpio/Kconfig index 7bb0ceb3d3..6afcd6bde7 100644 --- a/tests/periph_gpio/Kconfig +++ b/tests/periph_gpio/Kconfig @@ -10,4 +10,5 @@ config APPLICATION default y imply MODULE_PERIPH_GPIO_IRQ imply MODULE_PERIPH_GPIO_FAST_READ + imply MODULE_PERIPH_GPIO_TAMPER_WAKE depends on TEST_KCONFIG