diff --git a/drivers/lcd/Kconfig b/drivers/lcd/Kconfig index 029ffb5ffb..be32c7946e 100644 --- a/drivers/lcd/Kconfig +++ b/drivers/lcd/Kconfig @@ -1450,6 +1450,18 @@ config LCD_ILI9341_IFACE0 Configure first LCD Display. if LCD_ILI9341_IFACE0 +config LCD_ILI9341_IFACE0_WIDTH + int "Width of the display" + default 240 + ---help--- + Define the width of the display. + +config LCD_ILI9341_IFACE0_HEIGHT + int "Height of the display" + default 320 + ---help--- + Define the the height of the display. + choice prompt "LCD Orientation" default LCD_ILI9341_IFACE0_LANDSCAPE @@ -1499,6 +1511,18 @@ config LCD_ILI9341_IFACE1 Configure second LCD Display. if LCD_ILI9341_IFACE1 +config LCD_ILI9341_IFACE1_WIDTH + int "Width of the display" + default 240 + ---help--- + Define the width of the display. + +config LCD_ILI9341_IFACE1_HEIGHT + int "Height of the display" + default 320 + ---help--- + Define the the height of the display. + choice prompt "LCD Orientation" default LCD_ILI9341_IFACE1_LANDSCAPE diff --git a/drivers/lcd/ili9341.c b/drivers/lcd/ili9341.c index bc3a1d7e09..931521ee63 100644 --- a/drivers/lcd/ili9341.c +++ b/drivers/lcd/ili9341.c @@ -285,11 +285,6 @@ #define ILI9341_PIXSET_18BITMCU_PARAM1 (ILI9341_PIXSET_18BITDPI | \ ILI9341_PIXSET_18BITDBI) -/* General fix display resolution */ - -#define ILI9341_XRES 240 -#define ILI9341_YRES 320 - /* Validate configuration */ #if CONFIG_LCD_ILI9341_NINTERFACES < 1 @@ -301,6 +296,8 @@ /* First LCD display */ #ifdef CONFIG_LCD_ILI9341_IFACE0 +# define ILI9341_XRES CONFIG_LCD_ILI9341_IFACE0_WIDTH +# define ILI9341_YRES CONFIG_LCD_ILI9341_IFACE0_HEIGHT # if defined(CONFIG_LCD_ILI9341_IFACE0_LANDSCAPE) # define ILI9341_IFACE0_ORIENT ILI9341_MADCTL_LANDSCAPE_PARAM1 # define ILI9341_IFACE0_STRIDE ILI9341_YRES @@ -326,6 +323,8 @@ /* Second LCD display */ #ifdef CONFIG_LCD_ILI9341_IFACE1 +# define ILI9341_XRES CONFIG_LCD_ILI9341_IFACE1_WIDTH +# define ILI9341_YRES CONFIG_LCD_ILI9341_IFACE1_HEIGHT # ifdef CONFIG_LCD_ILI9341_IFACE1_LANDSCAPE # define ILI9341_IFACE1_ORIENT ILI9341_MADCTL_LANDSCAPE_PARAM1 # define ILI9341_IFACE1_STRIDE ILI9341_YRES