drivers/lcd/ili9341: Add custom width/height display options

Add ability to set custom height/width for each two lcd ifaces

Signed-off-by: Serg Podtynnyi <serg@podtynnyi.com>
This commit is contained in:
Serg Podtynnyi 2025-04-26 16:31:14 +07:00 committed by Alan C. Assis
parent 5ce0e93637
commit 9566b2b908
2 changed files with 28 additions and 5 deletions

View file

@ -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

View file

@ -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