From ef7234b455ef8f13a902b071f9d1521de1b7ed2c Mon Sep 17 00:00:00 2001 From: Gunar Schorcht Date: Thu, 13 Jul 2023 09:58:34 +0200 Subject: [PATCH] drivers/lcd: support of controller variant parameter If the controller-specific driver supports multiple controller variants, the variant has to be specified in the configuration parameter set. --- drivers/include/lcd.h | 6 +++++- drivers/lcd/Kconfig | 5 +++++ drivers/lcd/Makefile.include | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/include/lcd.h b/drivers/include/lcd.h index a29163342f..6f0fc15668 100644 --- a/drivers/include/lcd.h +++ b/drivers/include/lcd.h @@ -30,7 +30,6 @@ * transfer. */ - #ifndef LCD_H #define LCD_H @@ -86,6 +85,11 @@ typedef struct { uint8_t rotation; /**< Display rotation mode */ uint8_t offset_x; /**< LCD offset to apply on x axis. */ uint8_t offset_y; /**< LCD offset to apply on y axis. */ +#if MODULE_LCD_MULTI_CNTRL || DOXYGEN + uint8_t cntrl; /**< controller variant used, if the controller- + specific driver supports multiple + controller variants */ +#endif } lcd_params_t; /** diff --git a/drivers/lcd/Kconfig b/drivers/lcd/Kconfig index d5036cc0df..ddbdb30db7 100644 --- a/drivers/lcd/Kconfig +++ b/drivers/lcd/Kconfig @@ -13,6 +13,11 @@ config MODULE_LCD select MODULE_PERIPH_SPI select MODULE_PERIPH_GPIO +config MODULE_LCD_MULTI_CNTRL + bool + help + The controller-specific driver supports multiple controller variants. + menuconfig KCONFIG_USEMODULE_LCD bool "Configure LCD driver" depends on USEMODULE_LCD diff --git a/drivers/lcd/Makefile.include b/drivers/lcd/Makefile.include index 29c438bfd9..50d8dcd5fe 100644 --- a/drivers/lcd/Makefile.include +++ b/drivers/lcd/Makefile.include @@ -1,2 +1,4 @@ +PSEUDOMODULES += lcd_multi_cntrl + USEMODULE_INCLUDES_lcd := $(LAST_MAKEFILEDIR)/include USEMODULE_INCLUDES += $(USEMODULE_INCLUDES_lcd)