Skip to content

Commit

Permalink
Fix GC9A01 display driver, and update LVGL config file
Browse files Browse the repository at this point in the history
  • Loading branch information
PGNetHun committed Jan 8, 2024
1 parent b92d64b commit a641920
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
5 changes: 3 additions & 2 deletions driver/esp32/ili9XXX.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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):

Expand Down
18 changes: 6 additions & 12 deletions lv_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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*/
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a641920

Please sign in to comment.