From 80686e6bc4cb17e9d856647084725203fa63ebe6 Mon Sep 17 00:00:00 2001 From: guowenxue <guowenxue@gmail.com> Date: Mon, 19 Aug 2024 16:47:42 +0800 Subject: [PATCH] Add LCD API examples --- hal/lcd/lvgl/libs_lvgl/patches/lvgl-8.0.2-imx6ull.patch | 92 ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 92 insertions(+), 0 deletions(-) diff --git a/hal/lcd/lvgl/libs_lvgl/patches/lvgl-8.0.2-imx6ull.patch b/hal/lcd/lvgl/libs_lvgl/patches/lvgl-8.0.2-imx6ull.patch new file mode 100644 index 0000000..5ae5a78 --- /dev/null +++ b/hal/lcd/lvgl/libs_lvgl/patches/lvgl-8.0.2-imx6ull.patch @@ -0,0 +1,92 @@ +diff -Nuar lvgl-8.0.2/CMakeLists.txt lvgl-8.0.2-imx6ull/CMakeLists.txt +--- lvgl-8.0.2/CMakeLists.txt 2021-07-16 23:40:51.000000000 +0800 ++++ lvgl-8.0.2-imx6ull/CMakeLists.txt 2021-09-27 22:30:20.360008641 +0800 +@@ -1,3 +1,7 @@ ++ ++set(CMAKE_C_COMPILER "/opt/buildroot/cortex-a7/bin/arm-linux-gcc") ++include_directories(..) ++ + if(ESP_PLATFORM) + + file(GLOB_RECURSE SOURCES src/*.c) +diff -Nuar lvgl-8.0.2/lv_conf_template.h lvgl-8.0.2-imx6ull/lv_conf_template.h +--- lvgl-8.0.2/lv_conf_template.h 2021-07-16 23:40:51.000000000 +0800 ++++ lvgl-8.0.2-imx6ull/lv_conf_template.h 2021-09-27 22:33:47.448012614 +0800 +@@ -7,7 +7,7 @@ + * COPY THIS FILE AS `lv_conf.h` NEXT TO the `lvgl` FOLDER + */ + +-#if 0 /*Set it to "1" to enable content*/ ++#if 1 /*Set it to "1" to enable content*/ + + #ifndef LV_CONF_H + #define LV_CONF_H +@@ -21,7 +21,7 @@ + *====================*/ + + /*Color depth: 1 (1 byte per pixel), 8 (RGB332), 16 (RGB565), 32 (ARGB8888)*/ +-#define LV_COLOR_DEPTH 32 ++#define LV_COLOR_DEPTH 16 + + /*Swap the 2 bytes of RGB565 color. Useful if the display has a 8 bit interface (e.g. SPI)*/ + #define LV_COLOR_16_SWAP 0 +@@ -42,7 +42,7 @@ + #define LV_MEM_CUSTOM 0 + #if LV_MEM_CUSTOM == 0 + /*Size of the memory available for `lv_mem_alloc()` in bytes (>= 2kB)*/ +-# define LV_MEM_SIZE (32U * 1024U) /*[bytes]*/ ++# define LV_MEM_SIZE (128U * 1024U) /*[bytes]*/ + + /*Set an address for the memory pool instead of allocating it as a normal array. Can be in external SRAM too.*/ + # define LV_MEM_ADR 0 /*0: unused*/ +@@ -68,9 +68,10 @@ + + /*Use a custom tick source that tells the elapsed time in milliseconds. + *It removes the need to manually update the tick with `lv_tick_inc()`)*/ +-#define LV_TICK_CUSTOM 0 ++#define LV_TICK_CUSTOM 1 + #if LV_TICK_CUSTOM +-#define LV_TICK_CUSTOM_INCLUDE "Arduino.h" /*Header for the system time function*/ ++extern uint32_t millis(void); ++#define LV_TICK_CUSTOM_INCLUDE <stdint.h> /*Header for the system time function*/ + #define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis()) /*Expression evaluating to current system time in ms*/ + #endif /*LV_TICK_CUSTOM*/ + +@@ -137,7 +138,7 @@ + *-----------*/ + + /*Enable the log module*/ +-#define LV_USE_LOG 0 ++#define LV_USE_LOG 1 + #if LV_USE_LOG + + /*How important log should be added: +@@ -151,7 +152,7 @@ + + /*1: Print the log with 'printf'; + *0: User need to register a callback with `lv_log_register_print_cb()`*/ +-# define LV_LOG_PRINTF 0 ++# define LV_LOG_PRINTF 1 + + /*Enable/disable LV_LOG_TRACE in modules that produces a huge number of logs*/ + # define LV_LOG_TRACE_MEM 1 +@@ -262,13 +263,13 @@ + + /*Montserrat fonts with ASCII range and some symbols using bpp = 4 + *https://fonts.google.com/specimen/Montserrat*/ +-#define LV_FONT_MONTSERRAT_8 0 +-#define LV_FONT_MONTSERRAT_10 0 +-#define LV_FONT_MONTSERRAT_12 0 ++#define LV_FONT_MONTSERRAT_8 1 ++#define LV_FONT_MONTSERRAT_10 1 ++#define LV_FONT_MONTSERRAT_12 1 + #define LV_FONT_MONTSERRAT_14 1 +-#define LV_FONT_MONTSERRAT_16 0 +-#define LV_FONT_MONTSERRAT_18 0 +-#define LV_FONT_MONTSERRAT_20 0 ++#define LV_FONT_MONTSERRAT_16 1 ++#define LV_FONT_MONTSERRAT_18 1 ++#define LV_FONT_MONTSERRAT_20 1 + #define LV_FONT_MONTSERRAT_22 0 + #define LV_FONT_MONTSERRAT_24 0 + #define LV_FONT_MONTSERRAT_26 0 -- Gitblit v1.9.1