From a64192006d98d096a28bc9b658be17d2eb75c35b Mon Sep 17 00:00:00 2001 From: Gabor Peresztegi Date: Mon, 8 Jan 2024 21:48:14 +0100 Subject: [PATCH] Fix GC9A01 display driver, and update LVGL config file --- driver/esp32/ili9XXX.py | 5 +++-- lv_conf.h | 18 ++++++------------ 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/driver/esp32/ili9XXX.py b/driver/esp32/ili9XXX.py index 389a8676f..80eb6bd3e 100644 --- a/driver/esp32/ili9XXX.py +++ b/driver/esp32/ili9XXX.py @@ -685,7 +685,7 @@ def __init__(self, miso=5, mosi=18, clk=19, cs=13, dc=12, rst=4, power=14, backlight=15, backlight_on=0, power_on=0, spihost=esp.HSPI_HOST, spimode=0, mhz=60, factor=4, hybrid=True, width=240, height=240, colormode=COLOR_MODE_RGB, rot=PORTRAIT, invert=False, double_buffer=True, half_duplex=True, asynchronous=False, initialize=True, - color_format=None + color_format=None, swap_rgb565_bytes=True ): if lv.COLOR_DEPTH != 16: @@ -760,7 +760,8 @@ def __init__(self, super().__init__(miso=miso, mosi=mosi, clk=clk, cs=cs, dc=dc, rst=rst, power=power, backlight=backlight, backlight_on=backlight_on, power_on=power_on, spihost=spihost, spimode=spimode, mhz=mhz, factor=factor, hybrid=hybrid, width=width, height=height, invert=invert, double_buffer=double_buffer, half_duplex=half_duplex, - display_type=DISPLAY_TYPE_GC9A01, asynchronous=asynchronous, initialize=initialize, color_format=color_format) + display_type=DISPLAY_TYPE_GC9A01, asynchronous=asynchronous, initialize=initialize, color_format=color_format, + swap_rgb565_bytes=swap_rgb565_bytes) class st7789(ili9XXX): diff --git a/lv_conf.h b/lv_conf.h index a8982c1c3..25da64608 100644 --- a/lv_conf.h +++ b/lv_conf.h @@ -289,7 +289,7 @@ extern void mp_lv_init_gc(); #ifdef MICROPY_CACHE_SIZE #define LV_CACHE_DEF_SIZE MICROPY_CACHE_SIZE #else - #define LV_CACHE_DEF_SIZE 1024 * 1024 + #define LV_CACHE_DEF_SIZE 0 #endif /*Number of stops allowed per gradient. Increase this to allow more stops. @@ -592,7 +592,7 @@ extern void mp_lv_init_gc(); /*API for fopen, fread, etc*/ #define LV_USE_FS_STDIO 0 #if LV_USE_FS_STDIO - #define LV_FS_STDIO_LETTER 'A' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ + #define LV_FS_STDIO_LETTER 'A' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ #define LV_FS_STDIO_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/ #define LV_FS_STDIO_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ #endif @@ -675,26 +675,20 @@ extern void mp_lv_init_gc(); /*Let FreeType to use LVGL memory and file porting*/ #define LV_FREETYPE_USE_LVGL_PORT 0 - /*FreeType cache type: - * LV_FREETYPE_CACHE_TYPE_IMAGE - Image cache - * LV_FREETYPE_CACHE_TYPE_SBIT - Sbit cache - * LV_FREETYPE_CACHE_TYPE_OUTLINE - Outline cache*/ - #define LV_FREETYPE_CACHE_TYPE LV_FREETYPE_CACHE_TYPE_IMAGE - /* Maximum number of opened FT_Face/FT_Size objects managed by this cache instance. */ /* (0:use system defaults) */ #define LV_FREETYPE_CACHE_FT_FACES 8 #define LV_FREETYPE_CACHE_FT_SIZES 8 - #define LV_FREETYPE_CACHE_FT_OUTLINES 256 + #define LV_FREETYPE_CACHE_FT_GLYPH_CNT 256 #endif /* Built-in TTF decoder */ #ifndef LV_USE_TINY_TTF - #define LV_USE_TINY_TTF 1 + #define LV_USE_TINY_TTF 0 #endif #if LV_USE_TINY_TTF /* Enable loading TTF data from files */ - #define LV_TINY_TTF_FILE_SUPPORT 1 + #define LV_TINY_TTF_FILE_SUPPORT 0 #endif /*Rlottie library*/ @@ -897,7 +891,7 @@ extern void mp_lv_init_gc(); *==================*/ /*Enable the examples to be built with the library*/ -#define LV_BUILD_EXAMPLES 0 +#define LV_BUILD_EXAMPLES 1 /*=================== * DEMO USAGE