1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-24 22:13:52 +01:00

Merge pull request #17458 from aabadie/pr/boards/stm32f429i-disc1_kconfig_deps_fix

{disp,touch}_dev: improve Kconfig at different levels
This commit is contained in:
Kevin "Tristate Tom" Weiss 2022-01-24 12:00:44 +01:00 committed by GitHub
commit c94033016e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 46 additions and 15 deletions

View File

@ -29,5 +29,7 @@ config BOARD_STM32F429I_DISC1
select BOARD_HAS_LSE
select HAVE_SAUL_GPIO
select HAVE_ILI9341
select HAVE_STMPE811_I2C
source "$(RIOTBOARD)/common/stm32/Kconfig"

View File

@ -5,36 +5,56 @@
# directory for more details.
#
config MODULE_STMPE811
menuconfig MODULE_STMPE811
bool
prompt "STMPE811 Touchscreen Controller" if !(MODULE_TOUCH_DEV && HAVE_STMPE811)
default (MODULE_TOUCH_DEV && HAVE_STMPE811)
depends on HAS_PERIPH_GPIO
depends on HAS_PERIPH_GPIO_IRQ
depends on HAS_PERIPH_I2C
depends on TEST_KCONFIG
select MODULE_PERIPH_GPIO
select MODULE_PERIPH_GPIO_IRQ
select MODULE_ZTIMER
select MODULE_ZTIMER_MSEC
depends on TEST_KCONFIG
choice
bool "STMPE811 Touchscreen Controller"
optional
depends on TEST_KCONFIG
if MODULE_STMPE811
choice STMPE811_VARIANT
bool "Model"
default MODULE_STMPE811_I2C if HAVE_STMPE811_I2C
default MODULE_STMPE811_SPI if HAVE_STMPE811_SPI
help
The driver supports both STMPE811 connected either via SPI or
The driver supports both stmpe811 connected either via SPI or
I2C bus. Select one combination.
config MODULE_STMPE811_I2C
bool "STMPE811 on I2C"
depends on HAS_PERIPH_I2C
select MODULE_PERIPH_I2C
select MODULE_STMPE811
config MODULE_STMPE811_SPI
bool "STMPE811 on SPI"
depends on HAS_PERIPH_SPI
depends on HAS_PERIPH_GPIO
select MODULE_PERIPH_SPI
select MODULE_STMPE811
select MODULE_PERIPH_GPIO
endchoice
endif # MODULE_STMPE811
config HAVE_STMPE811
bool
help
Indicates that an STMPE811 is present.
config HAVE_STMPE811_I2C
bool
select HAVE_STMPE811
help
Indicates that an STMPE811 over I2C touch panel is present.
config HAVE_STMPE811_SPI
bool
select HAVE_STMPE811
help
Indicates that an STMPE811 over SPI touch panel is present.

View File

@ -0,0 +1,3 @@
# this file enables modules defined in Kconfig. Do not use this file for
# application configuration. This is only needed during migration.
CONFIG_MODULE_DISP_DEV=y

View File

@ -1,3 +1,3 @@
# this file enables modules defined in Kconfig. Do not use this file for
# application configuration. This is only needed during migration.
CONFIG_MODULE_STMPE811_I2C=y
CONFIG_MODULE_STMPE811=y

View File

@ -4,6 +4,7 @@ include ../Makefile.tests_common
DISABLE_MODULE += test_utils_interactive_sync
USEMODULE += touch_dev
USEMODULE += xtimer
USEMODULE += ztimer
USEMODULE += ztimer_msec
include $(RIOTBASE)/Makefile.include

View File

@ -0,0 +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_TOUCH_DEV=y
CONFIG_MODULE_ZTIMER=y
CONFIG_MODULE_ZTIMER_MSEC=y

View File

@ -21,7 +21,7 @@
#include <stdio.h>
#include <stdbool.h>
#include "xtimer.h"
#include "ztimer.h"
#include "touch_dev.h"
@ -77,7 +77,7 @@ int main(void)
printf("X: %i, Y:%i\n", touches[0].x, touches[0].y);
}
xtimer_msleep(10);
ztimer_sleep(ZTIMER_MSEC, 10);
}
return 0;