diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-06-01 15:41:47 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-06-01 15:41:47 +1000 |
| commit | dd27c3530432ea0b09f01e604bf577f31d8ef841 (patch) | |
| tree | bbf86cf81a78f0ff0b07f31f1c390db473f26fd3 /lib/lvgl/env_support | |
| parent | 6fd588e970470b15936187980829916d0dbe77bb (diff) | |
| download | tangara-fw-dd27c3530432ea0b09f01e604bf577f31d8ef841.tar.gz | |
convert lvgl from submodule to a plain old directory
Diffstat (limited to 'lib/lvgl/env_support')
19 files changed, 2272 insertions, 0 deletions
diff --git a/lib/lvgl b/lib/lvgl deleted file mode 160000 -Subproject 0732400e7b564dd0e7dc4a924619d8e19c5b23a diff --git a/lib/lvgl/env_support/cmake/custom.cmake b/lib/lvgl/env_support/cmake/custom.cmake new file mode 100644 index 00000000..56169821 --- /dev/null +++ b/lib/lvgl/env_support/cmake/custom.cmake @@ -0,0 +1,79 @@ +# Option to define LV_LVGL_H_INCLUDE_SIMPLE, default: ON +option(LV_LVGL_H_INCLUDE_SIMPLE + "Use #include \"lvgl.h\" instead of #include \"../../lvgl.h\"" ON) + +# Option to define LV_CONF_INCLUDE_SIMPLE, default: ON +option(LV_CONF_INCLUDE_SIMPLE + "Simple include of \"lv_conf.h\" and \"lv_drv_conf.h\"" ON) + +# Option to set LV_CONF_PATH, if set parent path LV_CONF_DIR is added to +# includes +option(LV_CONF_PATH "Path defined for lv_conf.h") +get_filename_component(LV_CONF_DIR ${LV_CONF_PATH} DIRECTORY) + +# Option to build shared libraries (as opposed to static), default: OFF +option(BUILD_SHARED_LIBS "Build shared libraries" OFF) + +file(GLOB_RECURSE SOURCES ${LVGL_ROOT_DIR}/src/*.c) +file(GLOB_RECURSE EXAMPLE_SOURCES ${LVGL_ROOT_DIR}/examples/*.c) +file(GLOB_RECURSE DEMO_SOURCES ${LVGL_ROOT_DIR}/demos/*.c) + +if (BUILD_SHARED_LIBS) + add_library(lvgl SHARED ${SOURCES}) +else() + add_library(lvgl STATIC ${SOURCES}) +endif() + +add_library(lvgl::lvgl ALIAS lvgl) +add_library(lvgl_examples STATIC ${EXAMPLE_SOURCES}) +add_library(lvgl::examples ALIAS lvgl_examples) +add_library(lvgl_demos STATIC ${DEMO_SOURCES}) +add_library(lvgl::demos ALIAS lvgl_demos) + +target_compile_definitions( + lvgl PUBLIC $<$<BOOL:${LV_LVGL_H_INCLUDE_SIMPLE}>:LV_LVGL_H_INCLUDE_SIMPLE> + $<$<BOOL:${LV_CONF_INCLUDE_SIMPLE}>:LV_CONF_INCLUDE_SIMPLE>) + +# Include root and optional parent path of LV_CONF_PATH +target_include_directories(lvgl SYSTEM PUBLIC ${LVGL_ROOT_DIR} ${LV_CONF_DIR}) + +# Include /examples folder +target_include_directories(lvgl_examples SYSTEM + PUBLIC ${LVGL_ROOT_DIR}/examples) +target_include_directories(lvgl_demos SYSTEM + PUBLIC ${LVGL_ROOT_DIR}/demos) + +target_link_libraries(lvgl_examples PUBLIC lvgl) +target_link_libraries(lvgl_demos PUBLIC lvgl) + +# Lbrary and headers can be installed to system using make install +file(GLOB LVGL_PUBLIC_HEADERS "${CMAKE_SOURCE_DIR}/lv_conf.h" + "${CMAKE_SOURCE_DIR}/lvgl.h") + +if("${LIB_INSTALL_DIR}" STREQUAL "") + set(LIB_INSTALL_DIR "lib") +endif() +if("${INC_INSTALL_DIR}" STREQUAL "") + set(INC_INSTALL_DIR "include/lvgl") +endif() + +install( + DIRECTORY "${CMAKE_SOURCE_DIR}/src" + DESTINATION "${CMAKE_INSTALL_PREFIX}/${INC_INSTALL_DIR}/" + FILES_MATCHING + PATTERN "*.h") + +set_target_properties( + lvgl + PROPERTIES OUTPUT_NAME lvgl + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + PUBLIC_HEADER "${LVGL_PUBLIC_HEADERS}") + +install( + TARGETS lvgl + ARCHIVE DESTINATION "${LIB_INSTALL_DIR}" + LIBRARY DESTINATION "${LIB_INSTALL_DIR}" + RUNTIME DESTINATION "${LIB_INSTALL_DIR}" + PUBLIC_HEADER DESTINATION "${INC_INSTALL_DIR}") diff --git a/lib/lvgl/env_support/cmake/esp.cmake b/lib/lvgl/env_support/cmake/esp.cmake new file mode 100644 index 00000000..a8671da2 --- /dev/null +++ b/lib/lvgl/env_support/cmake/esp.cmake @@ -0,0 +1,33 @@ +file(GLOB_RECURSE SOURCES ${LVGL_ROOT_DIR}/src/*.c) + +idf_build_get_property(LV_MICROPYTHON LV_MICROPYTHON) + +if(LV_MICROPYTHON) + idf_component_register( + SRCS + ${SOURCES} + INCLUDE_DIRS + ${LVGL_ROOT_DIR} + ${LVGL_ROOT_DIR}/src + ${LVGL_ROOT_DIR}/../ + REQUIRES + main) + + target_compile_definitions(${COMPONENT_LIB} + INTERFACE "-DLV_CONF_INCLUDE_SIMPLE") + + if(CONFIG_LV_ATTRIBUTE_FAST_MEM_USE_IRAM) + target_compile_definitions(${COMPONENT_LIB} + INTERFACE "-DLV_ATTRIBUTE_FAST_MEM=IRAM_ATTR") + endif() +else() + idf_component_register(SRCS ${SOURCES} INCLUDE_DIRS ${LVGL_ROOT_DIR} + ${LVGL_ROOT_DIR}/src ${LVGL_ROOT_DIR}/../) + + target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_CONF_INCLUDE_SIMPLE") + + if(CONFIG_LV_ATTRIBUTE_FAST_MEM_USE_IRAM) + target_compile_definitions(${COMPONENT_LIB} + PUBLIC "-DLV_ATTRIBUTE_FAST_MEM=IRAM_ATTR") + endif() +endif() diff --git a/lib/lvgl/env_support/cmake/micropython.cmake b/lib/lvgl/env_support/cmake/micropython.cmake new file mode 100644 index 00000000..43ce7c4f --- /dev/null +++ b/lib/lvgl/env_support/cmake/micropython.cmake @@ -0,0 +1,18 @@ +file(GLOB_RECURSE SOURCES ${LVGL_ROOT_DIR}/src/*.c) +file(GLOB_RECURSE EXAMPLE_SOURCES ${LVGL_ROOT_DIR}/examples/*.c) + +# With micropython, build lvgl as interface library, link chain is: +# lvgl_interface [lvgl] → usermod_lvgl_bindings [lv_bindings] → usermod +# [micropython] → firmware [micropython] +add_library(lvgl_interface INTERFACE) +# ${SOURCES} must NOT be given to add_library directly for some reason (won't be +# built) +target_sources(lvgl_interface INTERFACE ${SOURCES}) +# Micropython builds with -Werror; we need to suppress some warnings, such as: +# +# /home/test/build/lv_micropython/ports/rp2/build-PICO/lv_mp.c:29316:16: error: +# 'lv_style_transition_dsc_t_path_xcb_callback' defined but not used +# [-Werror=unused-function] 29316 | STATIC int32_t +# lv_style_transition_dsc_t_path_xcb_callback(const struct _lv_anim_t * arg0) | +# ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +target_compile_options(lvgl_interface INTERFACE -Wno-unused-function) diff --git a/lib/lvgl/env_support/cmake/zephyr.cmake b/lib/lvgl/env_support/cmake/zephyr.cmake new file mode 100644 index 00000000..f9ae517e --- /dev/null +++ b/lib/lvgl/env_support/cmake/zephyr.cmake @@ -0,0 +1,14 @@ +if(CONFIG_LVGL) + + zephyr_include_directories(${ZEPHYR_BASE}/lib/gui/lvgl) + + target_include_directories(lvgl INTERFACE ${LVGL_ROOT_DIR}) + + zephyr_compile_definitions(LV_CONF_KCONFIG_EXTERNAL_INCLUDE=<autoconf.h>) + + zephyr_library() + + file(GLOB_RECURSE SOURCES ${LVGL_ROOT_DIR}/src/*.c) + zephyr_library_sources(${SOURCES}) + +endif(CONFIG_LVGL) diff --git a/lib/lvgl/env_support/cmsis-pack/LVGL.lvgl.1.0.6.pack b/lib/lvgl/env_support/cmsis-pack/LVGL.lvgl.1.0.6.pack Binary files differnew file mode 100644 index 00000000..049a44ea --- /dev/null +++ b/lib/lvgl/env_support/cmsis-pack/LVGL.lvgl.1.0.6.pack diff --git a/lib/lvgl/env_support/cmsis-pack/LVGL.lvgl.pdsc b/lib/lvgl/env_support/cmsis-pack/LVGL.lvgl.pdsc new file mode 100644 index 00000000..e5033f37 --- /dev/null +++ b/lib/lvgl/env_support/cmsis-pack/LVGL.lvgl.pdsc @@ -0,0 +1,692 @@ +<?xml version="1.0" encoding="utf-8"?> + +<!-- +/**************************************************************************** +* Copyright 2022 Gorgon Meducer (Email:embedded_zhuoran@hotmail.com) * +* * +* Licensed under the Apache License, Version 2.0 (the "License"); * +* you may not use this file except in compliance with the License. * +* You may obtain a copy of the License at * +* * +* http://www.apache.org/licenses/LICENSE-2.0 * +* * +* Unless required by applicable law or agreed to in writing, software * +* distributed under the License is distributed on an "AS IS" BASIS, * +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * +* See the License for the specific language governing permissions and * +* limitations under the License. * +* * +****************************************************************************/ +--> + + +<package schemaVersion="1.4" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="PACK.xsd"> + <vendor>LVGL</vendor> + <name>lvgl</name> + <description>LVGL (Light and Versatile Graphics Library) is a free and open-source graphics library providing everything you need to create an embedded GUI with easy-to-use graphical elements, beautiful visual effects and a low memory footprint.</description> + <url>https://raw.githubusercontent.com/lvgl/lvgl/master/env_support/cmsis-pack/</url> + <supportContact>https://github.com/lvgl/lvgl/issues/new/choose</supportContact> + <license>LICENCE.txt</license> + <!-- optional license file --> + <!-- + <license> + </license> + --> + + <repository type="git">https://github.com/lvgl/lvgl.git</repository> + + <releases> + <release date="2022-07-06" version="1.0.6" url="https://raw.githubusercontent.com/lvgl/lvgl/master/env_support/cmsis-pack/LVGL.lvgl.1.0.6.pack"> + - LVGL 8.3.0 release + - Apply patch for memory leaking issue + - Apply patch to speed up non normal blend mode + - Add 9-key input mode to pinyin + - Other minor changes + </release> + <release date="2022-06-29" version="1.0.5" url="https://github.com/GorgonMeducer/lvgl/raw/922108dbbe6d1c0be1069c342ca8693afee8c169/env_support/cmsis-pack/LVGL.lvgl.1.0.5.pack"> + - LVGL 8.3.0-dev + - Monthly update for June + - Add Pinyin as input method + - Update benchmark to support RGB565-A8 + - Update support for layers + </release> + <release date="2022-05-31" version="1.0.4" url="https://github.com/lvgl/lvgl/raw/ce0605182c31e43abc8137ba21f237ec442735bc/env_support/cmsis-pack/LVGL.lvgl.1.0.4.pack"> + - LVGL 8.3.0-dev + - Monthly update for May + - Update drawing service + - Update GPU support for Arm-2D library + - Update GPU support for NXP PXP/VGLite + - Improving the accuracy of benchmark. + - Add new colour support for RGB565A8 + </release> + <release date="2022-04-27" version="1.0.3" url="https://github.com/lvgl/lvgl/raw/b81437e96423826272cd42d5555373f15bfdf03a/env_support/cmsis-pack/LVGL.lvgl.1.0.3.pack"> + - LVGL 8.3.0-dev + - Monthly update for April + - Add GPU support for SWM341-DMA2D + </release> + <release date="2022-03-27" version="1.0.2" url="https://github.com/lvgl/lvgl/raw/a5b9a1c210821f122fb7582378a9f1819b1dc821/env_support/cmsis-pack/LVGL.lvgl.1.0.2.pack"> + - LVGL 8.3.0-dev + - Monthly update for March + - Add GPU support for Arm-2D library + </release> + <release date="2022-02-26" version="1.0.1" url="https://github.com/lvgl/lvgl/raw/44f6f752386617a8812228b9c1357f180e73e4ff/env_support/cmsis-pack/LVGL.lvgl.1.0.1.pack"> + - LVGL 8.3.0-dev + - Monthly update for February + </release> + <release date="2022-01-31" version="1.0.0" url="https://github.com/lvgl/lvgl/blob/d851fe0528fcb920fee86c944fe9dbbaf6fbb0c9/env_support/cmsis-pack/LVGL.lvgl.1.0.0.pack?raw=true"> + - LVGL 8.2.0 + - Enable LV_TICK_CUSTOM when perf_counter is detected. + - Celebrate Spring Festival + </release> + </releases> + + <keywords> + <!-- keywords for indexing --> + <keyword>Cortex-M</keyword> + <keyword>SysTick</keyword> + <keyword>Performance Analaysis</keyword> + </keywords> + + <conditions> + <!-- + <condition id="Arm Compiler"> + <description>Arm Compiler 5 (armcc) or Arm Compiler 6 (armclang).</description> + <accept Tcompiler="ARMCC" Toptions="AC6"/> + <accept Tcompiler="ARMCC" Toptions="AC6LTO"/> + <accept Tcompiler="ARMCC" Toptions="AC5"/> + </condition> + <condition id="Arm GCC"> + <description>GNU Tools for Arm Embedded Processors.</description> + <accept Tcompiler="GCC"/> + </condition> + <condition id="Cortex-M Processors"> + <description>Support All Cortex-M based processors</description> + <accept Dcore="Cortex-M0"/> + <accept Dcore="Cortex-M0+"/> + <accept Dcore="Cortex-M1"/> + <accept Dcore="Cortex-M3"/> + <accept Dcore="Cortex-M4"/> + <accept Dcore="Cortex-M7"/> + <accept Dcore="Cortex-M23"/> + <accept Dcore="Cortex-M33"/> + <accept Dcore="Cortex-M35P"/> + <accept Dcore="Cortex-M55"/> + <accept Dcore="SC000"/> + <accept Dcore="SC300"/> + <accept Dcore="ARMV8MBL"/> + <accept Dcore="ARMV8MML"/> + </condition> + + <condition id="CMSIS-CORE"> + <description>Require CMSIS-CORE Support</description> + <require Cclass="CMSIS" Cgroup="CORE"/> + </condition> + + + + <condition id="Cortex-M Arm GCC"> + <description>Compile Cortex-M Processors with GNU Tools for Arm Embedded Processors.</description> + <require condition="Arm GCC"/> + <require condition="Cortex-M Processors"/> + </condition> + <condition id="Cortex-M Arm Compiler"> + <description>Compile Cortex-M Processors with GNU Tools for Arm Embedded Processors.</description> + <require condition="Arm Compiler"/> + <require condition="Cortex-M Processors"/> + </condition> + + <condition id="Cortex-M Arm GCC CMSIS-CORE"> + <description>Compile Cortex-M Processors with GNU Tools for Arm Embedded Processors.</description> + <require condition="Arm GCC"/> + <require condition="Cortex-M Processors"/> + <require condition="CMSIS-CORE"/> + </condition> + <condition id="Cortex-M Arm Compiler CMSIS-CORE"> + <description>Compile Cortex-M Processors with GNU Tools for Arm Embedded Processors.</description> + <require condition="Arm Compiler"/> + <require condition="Cortex-M Processors"/> + <require condition="CMSIS-CORE"/> + </condition> + --> + + <condition id="LVGL-Essential"> + <description>Require LVGL Essential Service</description> + <require Cclass="LVGL" Cgroup="lvgl" Csub="Essential"/> + </condition> + + <condition id="Arm-2D"> + <description>Require Arm-2D Support</description> + <require Cclass="Acceleration" Cgroup="Arm-2D"/> + </condition> + + </conditions> + <!-- apis section (optional - for Application Programming Interface descriptions) --> + <!-- + <apis> + </apis> + --> + + <!-- boards section (mandatory for Board Support Packs) --> + <!-- + <boards> + </boards> + --> + + <!-- devices section (mandatory for Device Family Packs) --> + <!-- + <devices> + </devices> + --> + + <!-- examples section (optional for all Software Packs)--> + <!-- + <examples> + </examples> + --> + + <!-- conditions section (optional for all Software Packs)--> + <!-- + <conditions> + </conditions> + --> + + <components> + <bundle Cbundle="LVGL" Cclass="LVGL" Cversion="8.3.0"> + <description>LVGL (Light and Versatile Graphics Library) is a free and open-source graphics library providing everything you need to create an embedded GUI with easy-to-use graphical elements, beautiful visual effects and a low memory footprint.</description> + <doc></doc> + <component Cgroup="lvgl" Csub="Essential" > + <description>The Essential services of LVGL (without extra content)</description> + <files> + <!-- src/core --> + <file category="sourceC" name="src/core/lv_disp.c" /> + <file category="sourceC" name="src/core/lv_event.c" /> + <file category="sourceC" name="src/core/lv_group.c" /> + <file category="sourceC" name="src/core/lv_indev.c" /> + <file category="sourceC" name="src/core/lv_indev_scroll.c" /> + <file category="sourceC" name="src/core/lv_obj.c" /> + <file category="sourceC" name="src/core/lv_obj_class.c" /> + <file category="sourceC" name="src/core/lv_obj_draw.c" /> + <file category="sourceC" name="src/core/lv_obj_pos.c" /> + <file category="sourceC" name="src/core/lv_obj_scroll.c" /> + <file category="sourceC" name="src/core/lv_obj_style.c" /> + <file category="sourceC" name="src/core/lv_obj_style_gen.c" /> + <file category="sourceC" name="src/core/lv_obj_tree.c" /> + <file category="sourceC" name="src/core/lv_refr.c" /> + <file category="sourceC" name="src/core/lv_theme.c" /> + + <!-- src/draw --> + <file category="sourceC" name="src/draw/lv_draw.c" /> + <file category="sourceC" name="src/draw/lv_draw_arc.c" /> + <file category="sourceC" name="src/draw/lv_draw_img.c" /> + <file category="sourceC" name="src/draw/lv_draw_label.c" /> + <file category="sourceC" name="src/draw/lv_draw_layer.c" /> + <file category="sourceC" name="src/draw/lv_draw_line.c" /> + <file category="sourceC" name="src/draw/lv_draw_mask.c" /> + <file category="sourceC" name="src/draw/lv_draw_rect.c" /> + <file category="sourceC" name="src/draw/lv_draw_transform.c" /> + <file category="sourceC" name="src/draw/lv_draw_triangle.c" /> + <file category="sourceC" name="src/draw/lv_img_buf.c" /> + <file category="sourceC" name="src/draw/lv_img_cache.c" /> + <file category="sourceC" name="src/draw/lv_img_decoder.c" /> + + <!-- src/draw/sw --> + <file category="sourceC" name="src/draw/sw/lv_draw_sw.c" /> + <file category="sourceC" name="src/draw/sw/lv_draw_sw_arc.c" /> + <file category="sourceC" name="src/draw/sw/lv_draw_sw_blend.c" /> + <file category="sourceC" name="src/draw/sw/lv_draw_sw_dither.c" /> + <file category="sourceC" name="src/draw/sw/lv_draw_sw_gradient.c" /> + <file category="sourceC" name="src/draw/sw/lv_draw_sw_img.c" /> + <file category="sourceC" name="src/draw/sw/lv_draw_sw_layer.c" /> + <file category="sourceC" name="src/draw/sw/lv_draw_sw_letter.c" /> + <file category="sourceC" name="src/draw/sw/lv_draw_sw_line.c" /> + <file category="sourceC" name="src/draw/sw/lv_draw_sw_polygon.c" /> + <file category="sourceC" name="src/draw/sw/lv_draw_sw_rect.c" /> + <file category="sourceC" name="src/draw/sw/lv_draw_sw_transform.c" /> + + + <!-- src/font --> + <file category="sourceC" name="src/font/lv_font.c" /> + <file category="sourceC" name="src/font/lv_font_dejavu_16_persian_hebrew.c" /> + <file category="sourceC" name="src/font/lv_font_fmt_txt.c" /> + <file category="sourceC" name="src/font/lv_font_loader.c" /> + <file category="sourceC" name="src/font/lv_font_montserrat_8.c" /> + <file category="sourceC" name="src/font/lv_font_montserrat_10.c" /> + <file category="sourceC" name="src/font/lv_font_montserrat_12.c" /> + <file category="sourceC" name="src/font/lv_font_montserrat_12_subpx.c" /> + <file category="sourceC" name="src/font/lv_font_montserrat_14.c" /> + <file category="sourceC" name="src/font/lv_font_montserrat_16.c" /> + <file category="sourceC" name="src/font/lv_font_montserrat_18.c" /> + <file category="sourceC" name="src/font/lv_font_montserrat_20.c" /> + <file category="sourceC" name="src/font/lv_font_montserrat_22.c" /> + <file category="sourceC" name="src/font/lv_font_montserrat_24.c" /> + <file category="sourceC" name="src/font/lv_font_montserrat_26.c" /> + <file category="sourceC" name="src/font/lv_font_montserrat_28.c" /> + <file category="sourceC" name="src/font/lv_font_montserrat_28_compressed.c" /> + <file category="sourceC" name="src/font/lv_font_montserrat_30.c" /> + <file category="sourceC" name="src/font/lv_font_montserrat_32.c" /> + <file category="sourceC" name="src/font/lv_font_montserrat_34.c" /> + <file category="sourceC" name="src/font/lv_font_montserrat_36.c" /> + <file category="sourceC" name="src/font/lv_font_montserrat_38.c" /> + <file category="sourceC" name="src/font/lv_font_montserrat_40.c" /> + <file category="sourceC" name="src/font/lv_font_montserrat_42.c" /> + <file category="sourceC" name="src/font/lv_font_montserrat_44.c" /> + <file category="sourceC" name="src/font/lv_font_montserrat_46.c" /> + <file category="sourceC" name="src/font/lv_font_montserrat_48.c" /> + <file category="sourceC" name="src/font/lv_font_simsun_16_cjk.c" /> + <file category="sourceC" name="src/font/lv_font_unscii_8.c" /> + <file category="sourceC" name="src/font/lv_font_unscii_16.c" /> + + <!-- src/hal --> + <file category="sourceC" name="src/hal/lv_hal_disp.c" /> + <file category="sourceC" name="src/hal/lv_hal_indev.c" /> + <file category="sourceC" name="src/hal/lv_hal_tick.c" /> + + <!-- src/misc--> + <file category="sourceC" name="src/misc/lv_anim.c" /> + <file category="sourceC" name="src/misc/lv_anim_timeline.c" /> + <file category="sourceC" name="src/misc/lv_area.c" /> + <file category="sourceC" name="src/misc/lv_async.c" /> + <file category="sourceC" name="src/misc/lv_bidi.c" /> + <file category="sourceC" name="src/misc/lv_color.c" /> + <file category="sourceC" name="src/misc/lv_fs.c" /> + <file category="sourceC" name="src/misc/lv_gc.c" /> + <file category="sourceC" name="src/misc/lv_ll.c" /> + <file category="sourceC" name="src/misc/lv_log.c" /> + <file category="sourceC" name="src/misc/lv_lru.c" /> + <file category="sourceC" name="src/misc/lv_math.c" /> + <file category="sourceC" name="src/misc/lv_mem.c" /> + <file category="sourceC" name="src/misc/lv_printf.c" /> + <file category="sourceC" name="src/misc/lv_style.c" /> + <file category="sourceC" name="src/misc/lv_style_gen.c" /> + <file category="sourceC" name="src/misc/lv_templ.c" /> + <file category="sourceC" name="src/misc/lv_timer.c" /> + <file category="sourceC" name="src/misc/lv_tlsf.c" /> + <file category="sourceC" name="src/misc/lv_txt.c" /> + <file category="sourceC" name="src/misc/lv_txt_ap.c" /> + <file category="sourceC" name="src/misc/lv_utils.c" /> + + <!-- src/widgets --> + <file category="sourceC" name="src/widgets/lv_arc.c" /> + <file category="sourceC" name="src/widgets/lv_bar.c" /> + <file category="sourceC" name="src/widgets/lv_btn.c" /> + <file category="sourceC" name="src/widgets/lv_btnmatrix.c" /> + <file category="sourceC" name="src/widgets/lv_canvas.c" /> + <file category="sourceC" name="src/widgets/lv_checkbox.c" /> + <file category="sourceC" name="src/widgets/lv_dropdown.c" /> + <file category="sourceC" name="src/widgets/lv_img.c" /> + <file category="sourceC" name="src/widgets/lv_label.c" /> + <file category="sourceC" name="src/widgets/lv_line.c" /> + <file category="sourceC" name="src/widgets/lv_objx_templ.c" /> + <file category="sourceC" name="src/widgets/lv_roller.c" /> + <file category="sourceC" name="src/widgets/lv_slider.c" /> + <file category="sourceC" name="src/widgets/lv_switch.c" /> + <file category="sourceC" name="src/widgets/lv_table.c" /> + <file category="sourceC" name="src/widgets/lv_textarea.c" /> + + <!-- general --> + <file category="preIncludeGlobal" name="lv_conf_cmsis.h" attr="config" version="1.0.2" /> + <file category="sourceC" name="lv_cmsis_pack.c" attr="config" version="1.0.0" /> + <file category="header" name="lvgl.h" /> + <file category="doc" name="README.md"/> + + </files> + + <Pre_Include_Global_h> + +/*! \brief use lv_config_cmsis.h which will be pre-included */ +#define LV_CONF_SKIP +#define LV_LVGL_H_INCLUDE_SIMPLE 1 + </Pre_Include_Global_h> + + <RTE_Components_h> + +/*! \brief Enable LVGL */ +#define RTE_GRAPHICS_LVGL + </RTE_Components_h> + + </component> + + <component Cgroup="lvgl" Csub="Porting" condition="LVGL-Essential"> + <description>Porting Templates</description> + <files> + <file category="header" name="examples/porting/lv_port_disp_template.h" attr="config" version="1.0.1" /> + <file category="sourceC" name="examples/porting/lv_port_disp_template.c" attr="config" version="1.0.1" /> + + <file category="header" name="examples/porting/lv_port_indev_template.h" attr="config" version="1.0.0" /> + <file category="sourceC" name="examples/porting/lv_port_indev_template.c" attr="config" version="1.0.0" /> + + <file category="header" name="examples/porting/lv_port_fs_template.h" attr="config" version="1.0.0" /> + <file category="sourceC" name="examples/porting/lv_port_fs_template.c" attr="config" version="1.0.0" /> + </files> + </component> + + <component Cgroup="lvgl" Csub="GPU Arm-2D" condition="LVGL-Essential" Cversion="1.0.3"> + <description>A 2D image processing library from Arm (i.e. Arm-2D) for All Cortex-M processors including Cortex-M0</description> + <files> + <file category="sourceC" name="src/draw/arm2d/lv_gpu_arm2d.c" condition="Arm-2D"/> + </files> + + <RTE_Components_h> + +/*! \brief enable Arm-2D support*/ +#define LV_USE_GPU_ARM2D 1 + + </RTE_Components_h> + + </component> + + <component Cgroup="lvgl" Csub="GPU STM32-DMA2D" condition="LVGL-Essential"> + <description>An hardware acceleration from STM32-DMA2D</description> + <files> + <file category="sourceC" name="src/draw/stm32_dma2d/lv_gpu_stm32_dma2d.c" /> + </files> + + <RTE_Components_h> + +/*! \brief enable STM32 DMA2D */ +#define LV_USE_GPU_STM32_DMA2D 1 + </RTE_Components_h> + + </component> + + <component Cgroup="lvgl" Csub="GPU SWM341-DMA2D" condition="LVGL-Essential"> + <description>An hardware acceleration from SWM341-DMA2D</description> + <files> + <file category="sourceC" name="src/draw/swm341_dma2d/lv_gpu_swm341_dma2d.c" /> + </files> + + <RTE_Components_h> + +/*! \brief enable SWM341 DMA2D */ +#define LV_USE_GPU_SWM341_DMA2D 1 + </RTE_Components_h> + + </component> + + <component Cgroup="lvgl" Csub="GPU NXP-PXP" condition="LVGL-Essential"> + <description>An hardware acceleration from NXP-PXP</description> + <files> + <file category="sourceC" name="src/draw/nxp/lv_gpu_nxp.c" /> + <file category="sourceC" name="src/draw/nxp/pxp/lv_draw_pxp_blend.c" /> + <file category="sourceC" name="src/draw/nxp/pxp/lv_gpu_nxp_pxp.c" /> + <file category="sourceC" name="src/draw/nxp/pxp/lv_gpu_nxp_pxp_osa.c" /> + </files> + + <RTE_Components_h> + +/*! \brief enable NXP PXP */ +#define LV_USE_GPU_NXP_PXP 1 + </RTE_Components_h> + + </component> + + <component Cgroup="lvgl" Csub="GPU NXP-VGLite" condition="LVGL-Essential"> + <description>An hardware acceleration from NXP-VGLite</description> + <files> + <file category="sourceC" name="src/draw/nxp/lv_gpu_nxp.c" /> + <file category="sourceC" name="src/draw/nxp/vglite/lv_draw_vglite_arc.c" /> + <file category="sourceC" name="src/draw/nxp/vglite/lv_draw_vglite_blend.c" /> + <file category="sourceC" name="src/draw/nxp/vglite/lv_draw_vglite_rect.c" /> + <file category="sourceC" name="src/draw/nxp/vglite/lv_gpu_nxp_vglite.c" /> + </files> + + <RTE_Components_h> + +/*! \brief enable NXP VGLite */ +#define LV_USE_GPU_NXP_VG_LITE 1 + </RTE_Components_h> + + </component> + + <component Cgroup="lvgl" Csub="Extra Themes" condition="LVGL-Essential"> + <description>Extra Themes, Widgets and Layouts</description> + <files> + <file category="sourceC" name="src/extra/lv_extra.c" /> + + <!-- src/extra/themes --> + <file category="sourceC" name="src/extra/themes/default/lv_theme_default.c" /> + <file category="sourceC" name="src/extra/themes/basic/lv_theme_basic.c" /> + <file category="sourceC" name="src/extra/themes/mono/lv_theme_mono.c" /> + + <!-- src/extra/widgets --> + <file category="sourceC" name="src/extra/widgets/animimg/lv_animimg.c" /> + <file category="sourceC" name="src/extra/widgets/calendar/lv_calendar.c" /> + <file category="sourceC" name="src/extra/widgets/calendar/lv_calendar_header_arrow.c" /> + <file category="sourceC" name="src/extra/widgets/calendar/lv_calendar_header_dropdown.c" /> + <file category="sourceC" name="src/extra/widgets/chart/lv_chart.c" /> + <file category="sourceC" name="src/extra/widgets/colorwheel/lv_colorwheel.c" /> + <file category="sourceC" name="src/extra/widgets/imgbtn/lv_imgbtn.c" /> + <file category="sourceC" name="src/extra/widgets/keyboard/lv_keyboard.c" /> + <file category="sourceC" name="src/extra/widgets/led/lv_led.c" /> + <file category="sourceC" name="src/extra/widgets/list/lv_list.c" /> + <file category="sourceC" name="src/extra/widgets/menu/lv_menu.c" /> + <file category="sourceC" name="src/extra/widgets/meter/lv_meter.c" /> + <file category="sourceC" name="src/extra/widgets/msgbox/lv_msgbox.c" /> + <file category="sourceC" name="src/extra/widgets/span/lv_span.c" /> + <file category="sourceC" name="src/extra/widgets/spinbox/lv_spinbox.c" /> + <file category="sourceC" name="src/extra/widgets/spinner/lv_spinner.c" /> + <file category="sourceC" name="src/extra/widgets/tabview/lv_tabview.c" /> + <file category="sourceC" name="src/extra/widgets/tileview/lv_tileview.c" /> + <file category="sourceC" name="src/extra/widgets/win/lv_win.c" /> + + <!-- src/extra/layouts --> + <file category="sourceC" name="src/extra/layouts/flex/lv_flex.c" /> + <file category="sourceC" name="src/extra/layouts/grid/lv_grid.c" /> + </files> + + <RTE_Components_h> + +/*! \brief use extra themes, widgets and layouts */ +#define RTE_GRAPHICS_LVGL_USE_EXTRA_THEMES + </RTE_Components_h> + + </component> + + <component Cgroup="lvgl" Csub="Libs PNG" condition="LVGL-Essential"> + <description>Add PNG support</description> + <files> + <!-- src/extra/libs/png --> + <file category="sourceC" name="src/extra/libs/png/lodepng.c" /> + <file category="sourceC" name="src/extra/libs/png/lv_png.c" /> + </files> + + <RTE_Components_h> + +/*! \brief enable PNG support */ +#define LV_USE_PNG 1 + </RTE_Components_h> + + </component> + + <component Cgroup="lvgl" Csub="Libs BMP" condition="LVGL-Essential"> + <description>Add BMP support</description> + <files> + <!-- src/extra/libs/bmp --> + <file category="sourceC" name="src/extra/libs/bmp/lv_bmp.c" /> + </files> + + <RTE_Components_h> + +/*! \brief enable BMP support */ +#define LV_USE_BMP 1 + </RTE_Components_h> + + </component> + + <component Cgroup="lvgl" Csub="Libs freetype" condition="LVGL-Essential"> + <description>Add freetype support, an extra librbary is required.</description> + <files> + <!-- src/extra/libs/freetype --> + <file category="sourceC" name="src/extra/libs/freetype/lv_freetype.c" /> + </files> + + <RTE_Components_h> + +/*! \brief enable freetype support */ +#define LV_USE_FREETYPE 1 + </RTE_Components_h> + + </component> + + <component Cgroup="lvgl" Csub="Libs GIF" condition="LVGL-Essential"> + <description>Add GIF support</description> + <files> + <!-- src/extra/libs/gif --> + <file category="sourceC" name="src/extra/libs/gif/lv_gif.c" /> + <file category="sourceC" name="src/extra/libs/gif/gifdec.c" /> + </files> + + <RTE_Components_h> + +/*! \brief enable gif support */ +#define LV_USE_GIF 1 + </RTE_Components_h> + + </component> + + <component Cgroup="lvgl" Csub="Libs sJPG" condition="LVGL-Essential"> + <description>Add sJPG support</description> + <files> + <!-- src/extra/libs/sjpg --> + <file category="sourceC" name="src/extra/libs/sjpg/lv_sjpg.c" /> + <file category="sourceC" name="src/extra/libs/sjpg/tjpgd.c" /> + </files> + + <RTE_Components_h> + +/*! \brief enable sJPG support */ +#define LV_USE_SJPG 1 + </RTE_Components_h> + + </component> + + <component Cgroup="lvgl" Csub="Libs QRCode" condition="LVGL-Essential"> + <description>Add QRCode support</description> + <files> + <!-- src/extra/libs/qrcode --> + <file category="sourceC" name="src/extra/libs/qrcode/lv_qrcode.c" /> + <file category="sourceC" name="src/extra/libs/qrcode/qrcodegen.c" /> + </files> + + <RTE_Components_h> + +/*! \brief enable QRCode support */ +#define LV_USE_QRCODE 1 + </RTE_Components_h> + + </component> + + <component Cgroup="lvgl" Csub="Libs FileSystem" condition="LVGL-Essential"> + <description>Add FileSystem support</description> + <files> + <!-- src/extra/libs/fsdrv --> + <file category="sourceC" name="src/extra/libs/fsdrv/lv_fs_fatfs.c" /> + <file category="sourceC" name="src/extra/libs/fsdrv/lv_fs_posix.c" /> + <file category="sourceC" name="src/extra/libs/fsdrv/lv_fs_stdio.c" /> + </files> + + </component> + + <component Cgroup="lvgl" Csub="Libs RLOTTIE" condition="LVGL-Essential"> + <description>Add RLOTTIE support, an extra librbary is required.</description> + <files> + <!-- src/extra/libs/rlottie --> + <file category="sourceC" name="src/extra/libs/rlottie/lv_rlottie.c" /> + </files> + + <RTE_Components_h> + +/*! \brief enable RLOTTIE support */ +#define LV_USE_RLOTTIE 1 + </RTE_Components_h> + + </component> + + <component Cgroup="lvgl" Csub="Libs ffmpeg" condition="LVGL-Essential"> + <description>Add ffmpeg support, an extra librbary is required.</description> + <files> + <!-- src/extra/libs/ffmpeg --> + <file category="sourceC" name="src/extra/libs/ffmpeg/lv_ffmpeg.c" /> + </files> + + <RTE_Components_h> + +/*! \brief enable ffmpeg support */ +#define LV_USE_FFMPEG 1 + </RTE_Components_h> + + </component> + + <component Cgroup="lvgl" Csub="Pinyin" condition="LVGL-Essential"> + <description>Add Pinyin input method</description> + <files> + <!-- src/extra/others/ime --> + <file category="sourceC" name="src/extra/others/ime/lv_ime_pinyin.c" /> + </files> + + <RTE_Components_h> + +/*! \brief enable ffmpeg support */ +#define LV_USE_IME_PINYIN 1 + </RTE_Components_h> + + </component> + + <component Cgroup="lvgl" Csub="Benchmark" condition="LVGL-Essential"> + <description>Add the official benchmark.</description> + <files> + <!-- demos/benchmark --> + <file category="sourceC" name="demos/benchmark/lv_demo_benchmark.c" /> + <file category="header" name="demos/benchmark/lv_demo_benchmark.h" /> + + <file category="sourceC" name="demos/benchmark/assets/img_benchmark_cogwheel_alpha16.c" /> + <file category="sourceC" name="demos/benchmark/assets/img_benchmark_cogwheel_argb.c" /> + <file category="sourceC" name="demos/benchmark/assets/img_benchmark_cogwheel_chroma_keyed.c" /> + <file category="sourceC" name="demos/benchmark/assets/img_benchmark_cogwheel_indexed16.c" /> + <file category="sourceC" name="demos/benchmark/assets/img_benchmark_cogwheel_rgb.c" /> + <file category="sourceC" name="demos/benchmark/assets/img_benchmark_cogwheel_rgb565a8.c" /> + + <file category="sourceC" name="demos/benchmark/assets/lv_font_bechmark_montserrat_12_compr_az.c.c" /> + <file category="sourceC" name="demos/benchmark/assets/lv_font_bechmark_montserrat_16_compr_az.c.c" /> + <file category="sourceC" name="demos/benchmark/assets/lv_font_bechmark_montserrat_28_compr_az.c.c" /> + + <file category="doc" name="demos/benchmark/README.md" /> + </files> + + <RTE_Components_h> + +/*! \brief enable demo:bencharmk */ +#define LV_USE_DEMO_BENCHMARK 1 + </RTE_Components_h> + + </component> + + <component Cgroup="lvgl" Csub="Demo:Widgets" condition="LVGL-Essential"> + <description>Add the demo:widgets</description> + <files> + <!-- demos/widgets --> + <file category="sourceC" name="demos/widgets/lv_demo_widgets.c" /> + <file category="header" name="demos/widgets/lv_demo_widgets.h" /> + + <file category="sourceC" name="demos/widgets/assets/img_clothes.c" /> + <file category="sourceC" name="demos/widgets/assets/img_demo_widgets_avatar.c" /> + <file category="sourceC" name="demos/widgets/assets/img_lvgl_logo.c" /> + </files> + + <RTE_Components_h> + +/*! \brief enable demo:widgets support */ +#define LV_USE_DEMO_WIDGETS 1 + </RTE_Components_h> + + </component> + </bundle> + </components> + + <!-- optional taxonomy section for defining new component Class and Group names --> + <!-- + <taxonomy> + </taxonomy> + --> + +</package> diff --git a/lib/lvgl/env_support/cmsis-pack/LVGL.pidx b/lib/lvgl/env_support/cmsis-pack/LVGL.pidx new file mode 100644 index 00000000..ddfc0089 --- /dev/null +++ b/lib/lvgl/env_support/cmsis-pack/LVGL.pidx @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<index schemaVersion="1.0.0" xs:noNamespaceSchemaLocation="PackIndex.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"> + <vendor>LVGL</vendor> + <url>https://raw.githubusercontent.com/lvgl/lvgl/master/env_support/cmsis-pack/</url> + <timestamp>2022-07-06T00:09:27</timestamp> + <pindex> + <pdsc url="https://raw.githubusercontent.com/lvgl/lvgl/master/env_support/cmsis-pack/" vendor="LVGL" name="lvgl" version="1.0.6"/> + </pindex> +</index>
\ No newline at end of file diff --git a/lib/lvgl/env_support/cmsis-pack/README.md b/lib/lvgl/env_support/cmsis-pack/README.md new file mode 100644 index 00000000..5a73e4e6 --- /dev/null +++ b/lib/lvgl/env_support/cmsis-pack/README.md @@ -0,0 +1,159 @@ +# How to Create CMSIS-Pack + + + +## STEP 1 Update 'lv_conf_cmsis.h' + +1. Copy the **lv_conf_template.h** to '**cmsis-pack**' directory + +2. Set the macro protector to '1' + +```c +... +/* clang-format off */ +#if 1 /*Set it to "1" to enable content*/ +... +``` + +remove the misleading guide above this code segment. + +```c +/* + * Copy this file as `lv_conf.h` + * 1. simply next to the `lvgl` folder + * 2. or any other places and + * - define `LV_CONF_INCLUDE_SIMPLE` + * - add the path as include path + */ +``` + + +3. Add including for '**RTE_Components.h**' + +```c +#ifndef LV_CONF_H +#define LV_CONF_H + +#include <stdint.h> +#include "RTE_Components.h" +... +``` + +4. Remove macro definitions for + - LV_USE_GPU_STM32_DMA2D + - LV_USE_GPU_NXP_PXP + - LV_USE_GPU_NXP_VG_LITE + - LV_USE_GPU_SWM341_DMA2D + - LV_USE_GPU_ARM2D + - LV_USE_IME_PINYIN +5. Update macro `LV_ATTRIBUTE_MEM_ALIGN` and `LV_ATTRIBUTE_MEM_ALIGN_SIZE` to force a WORD alignment. +```c +#define LV_ATTRIBUTE_MEM_ALIGN_SIZE 4 +#define LV_ATTRIBUTE_MEM_ALIGN __attribute__((aligned(4))) +``` +Update macro `LV_MEM_SIZE` to `(64*1024U)`. +6. Update Theme related macros: + +```c +#ifdef RTE_GRAPHICS_LVGL_USE_EXTRA_THEMES + /*A simple, impressive and very complete theme*/ + #define LV_USE_THEME_DEFAULT 1 + #if LV_USE_THEME_DEFAULT + + /*0: Light mode; 1: Dark mode*/ + #define LV_THEME_DEFAULT_DARK 0 + + /*1: Enable grow on press*/ + #define LV_THEME_DEFAULT_GROW 1 + + /*Default transition time in [ms]*/ + #define LV_THEME_DEFAULT_TRANSITION_TIME 80 + #endif /*LV_USE_THEME_DEFAULT*/ + + /*A very simple theme that is a good starting point for a custom theme*/ + #define LV_USE_THEME_BASIC 1 + + /*A theme designed for monochrome displays*/ + #define LV_USE_THEME_MONO 1 +#else + #define LV_USE_THEME_DEFAULT 0 + #define LV_USE_THEME_BASIC 0 + #define LV_USE_THEME_MONO 0 +#endif +``` +7. Update `LV_TICK_CUSTOM` related macros: +```c +/*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()`)*/ +#ifdef __PERF_COUNTER__ + #define LV_TICK_CUSTOM 1 + #if LV_TICK_CUSTOM + extern uint32_t SystemCoreClock; + #define LV_TICK_CUSTOM_INCLUDE "perf_counter.h" + + #if __PER_COUNTER_VER__ < 10902ul + #define LV_TICK_CUSTOM_SYS_TIME_EXPR ((uint32_t)get_system_ticks() / (SystemCoreClock / 1000ul)) + #else + #define LV_TICK_CUSTOM_SYS_TIME_EXPR get_system_ms() + #endif + #endif /*LV_TICK_CUSTOM*/ +#else + #define LV_TICK_CUSTOM 0 + #if LV_TICK_CUSTOM + #define LV_TICK_CUSTOM_INCLUDE "Arduino.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*/ +#endif /*__PERF_COUNTER__*/ +``` +9. Thoroughly remove the `DEMO USAGE` section. +10. Thoroughly remove the '3rd party libraries' section. +10. rename '**lv_conf_template.h**' to '**lv_conf_cmsis.h**'. + + + +## STEP 2 Check, Update and Run the 'gen_pack.sh' + +```sh +if [ `uname -s` = "Linux" ] + then + CMSIS_PACK_PATH="/home/$USER/.arm/Packs/ARM/CMSIS/5.7.0/" + PATH_TO_ADD="$CMSIS_PACK_PATH/CMSIS/Utilities/Linux64/" +else + CMSIS_PACK_PATH="/C/Users/gabriel/AppData/Local/Arm/Packs/ARM/CMSIS/5.7.0" + PATH_TO_ADD="/C/Program Files (x86)/7-Zip/:$CMSIS_PACK_PATH/CMSIS/Utilities/Win32/:/C/xmllint/" +fi +[[ ":$PATH:" != *":$PATH_TO_ADD}:"* ]] && PATH="${PATH}:${PATH_TO_ADD}" +echo $PATH_TO_ADD appended to PATH +echo " " +``` + + + +### A. For Windows users + +Update the '**CMSIS_PACK_PATH**' accordingly (Usually just replace the name gabriel with your own windows account name is sufficient.). + +Update the '**PATH_TO_ADD**' to point to the installation folders of **7Zip** and **xmllint**. + +Launch the git-bash and go to the cmsis-pack folder. + +enter the following command: + +```sh +./gen_pack.sh +``` + + + +### B. For Linux Users + +Update '**PATH_TO_ADD**' if necessary. + +go to the **cmsis-pack** folder. + +enter the following command: + +```sh +./gen_pack.sh +``` + diff --git a/lib/lvgl/env_support/cmsis-pack/gen_pack.sh b/lib/lvgl/env_support/cmsis-pack/gen_pack.sh new file mode 100644 index 00000000..dedba347 --- /dev/null +++ b/lib/lvgl/env_support/cmsis-pack/gen_pack.sh @@ -0,0 +1,231 @@ +#!/bin/bash +# Version: 1.1 +# Date: 2022-01-11 +# This bash script generates a CMSIS Software Pack: +# +# Pre-requisites: +# - bash shell (for Windows: install git for Windows) +# - 7z in path (zip archiving utility) +# e.g. Ubuntu: sudo apt-get install p7zip-full p7zip-rar) +# - PackChk in path with execute permission +# (see CMSIS-Pack: CMSIS/Utilities/<os>/PackChk) +# - xmllint in path (XML schema validation) +# e.g. Ubuntu: sudo apt-get install libxml2-utils +# Windows: download from https://www.zlatkovic.com/pub/libxml/ + +############### EDIT BELOW ############### +# Extend Path environment variable locally +# +if [ `uname -s` = "Linux" ] + then + CMSIS_PACK_PATH="/home/$USER/.arm/Packs/ARM/CMSIS/5.7.0/" + PATH_TO_ADD="$CMSIS_PACK_PATH/CMSIS/Utilities/Linux64/" +else + CMSIS_PACK_PATH="/C/Users/gabriel/AppData/Local/Arm/Packs/ARM/CMSIS/5.7.0" + PATH_TO_ADD="/C/Program Files (x86)/7-Zip/:$CMSIS_PACK_PATH/CMSIS/Utilities/Win32/:/C/xmllint/" +fi +[[ ":$PATH:" != *":$PATH_TO_ADD}:"* ]] && PATH="${PATH}:${PATH_TO_ADD}" +echo $PATH_TO_ADD appended to PATH +echo " " + +# Pack warehouse directory - destination +PACK_WAREHOUSE=./ + +# Temporary pack build directory +PACK_BUILD=build/ + +# Specify directories included in pack relative to base directory +# All directories: +# PACK_DIRS=`ls -d */` +# Do not include the build directory if it is local +# PACK_DIRS=${PACK_DIRS//$PACK_BUILD/} +# PACK_DIRS=${PACK_DIRS//$PACK_WAREHOUSE/} + +# alternative: specify directory names to be added to pack base directory +PACK_DIRS=" + ../../src + ../../docs + ../../demos +" + + +# Specify file names to be added to pack base directory +PACK_BASE_FILES=" + ../../LICENCE.txt + ../../README.md + ../../README_zh.md + ../../lvgl.h + lv_conf_cmsis.h + lv_cmsis_pack.txt +" + +############ DO NOT EDIT BELOW ########### +echo Starting CMSIS-Pack Generation: `date` +# Zip utility check +ZIP=7z +type -a $ZIP +errorlevel=$? +if [ $errorlevel -gt 0 ] + then + echo "Error: No 7zip Utility found" + echo "Action: Add 7zip to your path" + echo " " + exit +fi + +# Pack checking utility check +PACKCHK=PackChk +type -a $PACKCHK +errorlevel=$? +if [ $errorlevel != 0 ] + then + echo "Error: No PackChk Utility found" + echo "Action: Add PackChk to your path" + echo "Hint: Included in CMSIS Pack:" + echo "<pack_root_dir>/ARM/CMSIS/<version>/CMSIS/Utilities/<os>/" + echo " " + exit +fi +echo " " + +# XML syntax checking utility check +XMLLINT=xmllint +type -a $XMLLINT +errorlevel=$? +if [ $errorlevel != 0 ] + then + echo "Error: No xmllint found" + echo "Action: Add xmllint to your path" + echo " " + exit +fi +echo " " + +# Locate Package Description file +# check whether there is more than one pdsc file +NUM_PDSCS=`ls -1 *.pdsc | wc -l` +PACK_DESCRIPTION_FILE=`ls *.pdsc` +if [ $NUM_PDSCS -lt 1 ] + then + echo "Error: No *.pdsc file found in current directory" + echo " " +elif [ $NUM_PDSCS -gt 1 ] + then + echo "Error: Only one PDSC file allowed in directory structure:" + echo "Found:" + echo "$PACK_DESCRIPTION_FILE" + echo "Action: Delete unused pdsc files" + echo " " + exit +fi + +SAVEIFS=$IFS +IFS=. +set $PACK_DESCRIPTION_FILE +# Pack Vendor +PACK_VENDOR=$1 +# Pack Name +PACK_NAME=$2 +echo Generating Pack Version: for $PACK_VENDOR.$PACK_NAME +echo " " +IFS=$SAVEIFS + +#if $PACK_BUILD directory does not exist, create it. +if [ ! -d $PACK_BUILD ]; then + mkdir -p $PACK_BUILD +fi + +mkdir -p ${PACK_BUILD}/examples +mkdir -p ${PACK_BUILD}/examples/porting + +# Copy files into build base directory: $PACK_BUILD +# pdsc file is mandatory in base directory: +cp -f ./$PACK_VENDOR.$PACK_NAME.pdsc ${PACK_BUILD} +cp -f ../../examples/porting/* ${PACK_BUILD}/examples/porting + + +# directories +echo Adding directories to pack: +echo $PACK_DIRS +echo " " +for d in ${PACK_DIRS} +do + cp -r "$d" ${PACK_BUILD} +done + +# files for base directory +echo Adding files to pack: +echo $PACK_BASE_FILES +echo " " +for f in $PACK_BASE_FILES +do + cp -f "$f" $PACK_BUILD/ +done + +mv "${PACK_BUILD}/lv_cmsis_pack.txt" "${PACK_BUILD}/lv_cmsis_pack.c" + +# Run Schema Check (for Linux only): +# sudo apt-get install libxml2-utils + +echo Running schema check for $PACK_VENDOR.$PACK_NAME.pdsc +$XMLLINT --noout --schema ${CMSIS_PACK_PATH}/CMSIS/Utilities/PACK.xsd $PACK_BUILD/$PACK_VENDOR.$PACK_NAME.pdsc +errorlevel=$? +if [ $errorlevel -ne 0 ]; then + echo "build aborted: Schema check of $PACK_VENDOR.$PACK_NAME.pdsc against PACK.xsd failed" + echo " " + exit +fi + +# Run Pack Check and generate PackName file with version +$PACKCHK $PACK_BUILD/$PACK_VENDOR.$PACK_NAME.pdsc -n PackName.txt -x M362 +errorlevel=$? +if [ $errorlevel -ne 0 ]; then + echo "build aborted: pack check failed" + echo " " + exit +fi + +PACKNAME=`cat PackName.txt` +rm -rf PackName.txt + +echo remove unrequired files and folders... +rm -rf $PACK_BUILD/demos/keypad_encoder +rm -rf $PACK_BUILD/demos/music +rm -rf $PACK_BUILD/demos/stress +rm -rf $PACK_BUILD/demos/widgets/screenshot1.gif + +# echo apply patches... +# rm -rf $PACK_BUILD/demos/lv_demos.h +# cp -f ./lv_demos.h $PACK_BUILD/demos/ + +# Archiving +# $ZIP a $PACKNAME +echo creating pack file $PACKNAME +#if $PACK_WAREHOUSE directory does not exist create it +if [ ! -d $PACK_WAREHOUSE ]; then + mkdir -p $PACK_WAREHOUSE +fi +pushd $PACK_WAREHOUSE +PACK_WAREHOUSE=`pwd` +popd +pushd $PACK_BUILD +"$ZIP" a $PACK_WAREHOUSE/$PACKNAME -tzip +popd +errorlevel=$? +if [ $errorlevel -ne 0 ]; then + echo "build aborted: archiving failed" + exit +fi + +# cp -f ./$PACK_VENDOR.$PACK_NAME.pdsc ${PACK_WAREHOUSE} + + +echo "build of pack succeeded" +# Clean up +echo "cleaning up ..." + +rm -rf $PACK_BUILD + +echo " " + +echo Completed CMSIS-Pack Generation: `date`
\ No newline at end of file diff --git a/lib/lvgl/env_support/cmsis-pack/lv_cmsis_pack.txt b/lib/lvgl/env_support/cmsis-pack/lv_cmsis_pack.txt new file mode 100644 index 00000000..e8d58e87 --- /dev/null +++ b/lib/lvgl/env_support/cmsis-pack/lv_cmsis_pack.txt @@ -0,0 +1,115 @@ +/**************************************************************************** +* Copyright 2022 Gorgon Meducer (Email:embedded_zhuoran@hotmail.com) * +* * +* Licensed under the Apache License, Version 2.0 (the "License"); * +* you may not use this file except in compliance with the License. * +* You may obtain a copy of the License at * +* * +* http://www.apache.org/licenses/LICENSE-2.0 * +* * +* Unless required by applicable law or agreed to in writing, software * +* distributed under the License is distributed on an "AS IS" BASIS, * +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * +* See the License for the specific language governing permissions and * +* limitations under the License. * +* * +****************************************************************************/ + +/** + * @file lv_cmsis_pack.c + * + * @brief This file will only be used by cmsis-pack. + */ + +/********************* + * INCLUDES + *********************/ +#include "RTE_Components.h" +#include <time.h> + + /********************* + * DEFINES + *********************/ + + /********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ + + /********************** + * STATIC VARIABLES + **********************/ + + /********************** + * MACROS + **********************/ + + /*! \name The macros to identify the compiler */ +/*! @{ */ + +/*! \note for IAR */ +#undef __IS_COMPILER_IAR__ +#if defined(__IAR_SYSTEMS_ICC__) +# define __IS_COMPILER_IAR__ 1 +#endif + +/*! \note for arm compiler 5 */ +#undef __IS_COMPILER_ARM_COMPILER_5__ +#if ((__ARMCC_VERSION >= 5000000) && (__ARMCC_VERSION < 6000000)) +# define __IS_COMPILER_ARM_COMPILER_5__ 1 +#endif +/*! @} */ + +/*! \note for arm compiler 6 */ + +#undef __IS_COMPILER_ARM_COMPILER_6__ +#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) +# define __IS_COMPILER_ARM_COMPILER_6__ 1 +#endif + +#undef __IS_COMPILER_ARM_COMPILER__ +#if defined(__IS_COMPILER_ARM_COMPILER_5__) && __IS_COMPILER_ARM_COMPILER_5__ \ +|| defined(__IS_COMPILER_ARM_COMPILER_6__) && __IS_COMPILER_ARM_COMPILER_6__ + +# define __IS_COMPILER_ARM_COMPILER__ 1 + +#endif + + +#undef __IS_COMPILER_LLVM__ +#if defined(__clang__) && !__IS_COMPILER_ARM_COMPILER_6__ +# define __IS_COMPILER_LLVM__ 1 +#else +/*! \note for gcc */ +# undef __IS_COMPILER_GCC__ +# if defined(__GNUC__) && !( defined(__IS_COMPILER_ARM_COMPILER__) \ + || defined(__IS_COMPILER_LLVM__)) +# define __IS_COMPILER_GCC__ 1 +# endif +/*! @} */ +#endif +/*! @} */ + + + /********************** + * GLOBAL FUNCTIONS + **********************/ + +/* only arm compilers will use microLib that doesn't implement time() */ +#if defined(__MICROLIB) +__attribute__((weak)) +_ARMABI time_t time(time_t * time) +{ + return (time_t)(-1); +} +#endif + +/* when people don't want to use src/extra */ +__attribute__((weak)) +void lv_extra_init(void) +{ +} + diff --git a/lib/lvgl/env_support/cmsis-pack/lv_conf_cmsis.h b/lib/lvgl/env_support/cmsis-pack/lv_conf_cmsis.h new file mode 100644 index 00000000..cec0fc8e --- /dev/null +++ b/lib/lvgl/env_support/cmsis-pack/lv_conf_cmsis.h @@ -0,0 +1,649 @@ +/** + * @file lv_conf.h + * Configuration file for v8.3.0 + */ + +/* clang-format off */ +#if 1 /*Set it to "1" to enable content*/ + +#ifndef LV_CONF_H +#define LV_CONF_H + +#include <stdint.h> +#include "RTE_Components.h" + +/*==================== + COLOR SETTINGS + *====================*/ + +/*Color depth: 1 (1 byte per pixel), 8 (RGB332), 16 (RGB565), 32 (ARGB8888)*/ +#define LV_COLOR_DEPTH 16 + +/*Swap the 2 bytes of RGB565 color. Useful if the display has an 8-bit interface (e.g. SPI)*/ +#define LV_COLOR_16_SWAP 0 + +/*Enable features to draw on transparent background. + *It's required if opa, and transform_* style properties are used. + *Can be also used if the UI is above another layer, e.g. an OSD menu or video player.*/ +#define LV_COLOR_SCREEN_TRANSP 0 + +/* Adjust color mix functions rounding. GPUs might calculate color mix (blending) differently. + * 0: round down, 64: round up from x.75, 128: round up from half, 192: round up from x.25, 254: round up */ +#define LV_COLOR_MIX_ROUND_OFS 0 + +/*Images pixels with this color will not be drawn if they are chroma keyed)*/ +#define LV_COLOR_CHROMA_KEY lv_color_hex(0x00ff00) /*pure green*/ + +/*========================= + MEMORY SETTINGS + *=========================*/ + +/*1: use custom malloc/free, 0: use the built-in `lv_mem_alloc()` and `lv_mem_free()`*/ +#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 (64U * 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*/ + /*Instead of an address give a memory allocator that will be called to get a memory pool for LVGL. E.g. my_malloc*/ + #if LV_MEM_ADR == 0 + #undef LV_MEM_POOL_INCLUDE + #undef LV_MEM_POOL_ALLOC + #endif + +#else /*LV_MEM_CUSTOM*/ + #define LV_MEM_CUSTOM_INCLUDE <stdlib.h> /*Header for the dynamic memory function*/ + #define LV_MEM_CUSTOM_ALLOC malloc + #define LV_MEM_CUSTOM_FREE free + #define LV_MEM_CUSTOM_REALLOC realloc +#endif /*LV_MEM_CUSTOM*/ + +/*Number of the intermediate memory buffer used during rendering and other internal processing mechanisms. + *You will see an error log message if there wasn't enough buffers. */ +#define LV_MEM_BUF_MAX_NUM 16 + +/*Use the standard `memcpy` and `memset` instead of LVGL's own functions. (Might or might not be faster).*/ +#define LV_MEMCPY_MEMSET_STD 0 + +/*==================== + HAL SETTINGS + *====================*/ + +/*Default display refresh period. LVG will redraw changed areas with this period time*/ +#define LV_DISP_DEF_REFR_PERIOD 30 /*[ms]*/ + +/*Input device read period in milliseconds*/ +#define LV_INDEV_DEF_READ_PERIOD 30 /*[ms]*/ + +/*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()`)*/ +#ifdef __PERF_COUNTER__ + #define LV_TICK_CUSTOM 1 + #if LV_TICK_CUSTOM + extern uint32_t SystemCoreClock; + #define LV_TICK_CUSTOM_INCLUDE "perf_counter.h" + + #if __PER_COUNTER_VER__ < 10902ul + #define LV_TICK_CUSTOM_SYS_TIME_EXPR ((uint32_t)get_system_ticks() / (SystemCoreClock / 1000ul)) + #else + #define LV_TICK_CUSTOM_SYS_TIME_EXPR get_system_ms() + #endif + #endif /*LV_TICK_CUSTOM*/ +#else + #define LV_TICK_CUSTOM 0 + #if LV_TICK_CUSTOM + #define LV_TICK_CUSTOM_INCLUDE "Arduino.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*/ +#endif /*__PERF_COUNTER__*/ + +/*Default Dot Per Inch. Used to initialize default sizes such as widgets sized, style paddings. + *(Not so important, you can adjust it to modify default sizes and spaces)*/ +#define LV_DPI_DEF 130 /*[px/inch]*/ + +/*======================= + * FEATURE CONFIGURATION + *=======================*/ + +/*------------- + * Drawing + *-----------*/ + +/*Enable complex draw engine. + *Required to draw shadow, gradient, rounded corners, circles, arc, skew lines, image transformations or any masks*/ +#define LV_DRAW_COMPLEX 1 +#if LV_DRAW_COMPLEX != 0 + + /*Allow buffering some shadow calculation. + *LV_SHADOW_CACHE_SIZE is the max. shadow size to buffer, where shadow size is `shadow_width + radius` + *Caching has LV_SHADOW_CACHE_SIZE^2 RAM cost*/ + #define LV_SHADOW_CACHE_SIZE 0 + + /* Set number of maximally cached circle data. + * The circumference of 1/4 circle are saved for anti-aliasing + * radius * 4 bytes are used per circle (the most often used radiuses are saved) + * 0: to disable caching */ + #define LV_CIRCLE_CACHE_SIZE 4 +#endif /*LV_DRAW_COMPLEX*/ + +/** + * "Simple layers" are used when a widget has `style_opa < 255` to buffer the widget into a layer + * and blend it as an image with the given opacity. + * Note that `bg_opa`, `text_opa` etc don't require buffering into layer) + * The widget can be buffered in smaller chunks to avoid using large buffers. + * + * - LV_LAYER_SIMPLE_BUF_SIZE: [bytes] the optimal target buffer size. LVGL will try to allocate it + * - LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE: [bytes] used if `LV_LAYER_SIMPLE_BUF_SIZE` couldn't be allocated. + * + * Both buffer sizes are in bytes. + * "Transformed layers" (where transform_angle/zoom properties are used) use larger buffers + * and can't be drawn in chunks. So these settings affects only widgets with opacity. + */ +#define LV_LAYER_SIMPLE_BUF_SIZE (24 * 1024) +#define LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE (3 * 1024) + +/*Default image cache size. Image caching keeps the images opened. + *If only the built-in image formats are used there is no real advantage of caching. (I.e. if no new image decoder is added) + *With complex image decoders (e.g. PNG or JPG) caching can save the continuous open/decode of images. + *However the opened images might consume additional RAM. + *0: to disable caching*/ +#define LV_IMG_CACHE_DEF_SIZE 0 + +/*Number of stops allowed per gradient. Increase this to allow more stops. + *This adds (sizeof(lv_color_t) + 1) bytes per additional stop*/ +#define LV_GRADIENT_MAX_STOPS 2 + +/*Default gradient buffer size. + *When LVGL calculates the gradient "maps" it can save them into a cache to avoid calculating them again. + *LV_GRAD_CACHE_DEF_SIZE sets the size of this cache in bytes. + *If the cache is too small the map will be allocated only while it's required for the drawing. + *0 mean no caching.*/ +#define LV_GRAD_CACHE_DEF_SIZE 0 + +/*Allow dithering the gradients (to achieve visual smooth color gradients on limited color depth display) + *LV_DITHER_GRADIENT implies allocating one or two more lines of the object's rendering surface + *The increase in memory consumption is (32 bits * object width) plus 24 bits * object width if using error diffusion */ +#define LV_DITHER_GRADIENT 0 +#if LV_DITHER_GRADIENT + /*Add support for error diffusion dithering. + *Error diffusion dithering gets a much better visual result, but implies more CPU consumption and memory when drawing. + *The increase in memory consumption is (24 bits * object's width)*/ + #define LV_DITHER_ERROR_DIFFUSION 0 +#endif + +/*Maximum buffer size to allocate for rotation. + *Only used if software rotation is enabled in the display driver.*/ +#define LV_DISP_ROT_MAX_BUF (10*1024) + +/*------------- + * GPU + *-----------*/ + +/*Use STM32's DMA2D (aka Chrom Art) GPU*/ +#if LV_USE_GPU_STM32_DMA2D + /*Must be defined to include path of CMSIS header of target processor + e.g. "stm32f769xx.h" or "stm32f429xx.h"*/ + #define LV_GPU_DMA2D_CMSIS_INCLUDE +#endif + +/*Use SWM341's DMA2D GPU*/ +#if LV_USE_GPU_SWM341_DMA2D + #define LV_GPU_SWM341_DMA2D_INCLUDE "SWM341.h" +#endif + +/*Use NXP's PXP GPU iMX RTxxx platforms*/ +#if LV_USE_GPU_NXP_PXP + /*1: Add default bare metal and FreeRTOS interrupt handling routines for PXP (lv_gpu_nxp_pxp_osa.c) + * and call lv_gpu_nxp_pxp_init() automatically during lv_init(). Note that symbol SDK_OS_FREE_RTOS + * has to be defined in order to use FreeRTOS OSA, otherwise bare-metal implementation is selected. + *0: lv_gpu_nxp_pxp_init() has to be called manually before lv_init() + */ + #define LV_USE_GPU_NXP_PXP_AUTO_INIT 0 +#endif + +/*Use SDL renderer API*/ +#define LV_USE_GPU_SDL 0 +#if LV_USE_GPU_SDL + #define LV_GPU_SDL_INCLUDE_PATH <SDL2/SDL.h> + /*Texture cache size, 8MB by default*/ + #define LV_GPU_SDL_LRU_SIZE (1024 * 1024 * 8) + /*Custom blend mode for mask drawing, disable if you need to link with older SDL2 lib*/ + #define LV_GPU_SDL_CUSTOM_BLEND_MODE (SDL_VERSION_ATLEAST(2, 0, 6)) +#endif + +/*------------- + * Logging + *-----------*/ + +/*Enable the log module*/ +#define LV_USE_LOG 0 +#if LV_USE_LOG + + /*How important log should be added: + *LV_LOG_LEVEL_TRACE A lot of logs to give detailed information + *LV_LOG_LEVEL_INFO Log important events + *LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem + *LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail + *LV_LOG_LEVEL_USER Only logs added by the user + *LV_LOG_LEVEL_NONE Do not log anything*/ + #define LV_LOG_LEVEL LV_LOG_LEVEL_WARN + + /*1: Print the log with 'printf'; + *0: User need to register a callback with `lv_log_register_print_cb()`*/ + #define LV_LOG_PRINTF 0 + + /*Enable/disable LV_LOG_TRACE in modules that produces a huge number of logs*/ + #define LV_LOG_TRACE_MEM 1 + #define LV_LOG_TRACE_TIMER 1 + #define LV_LOG_TRACE_INDEV 1 + #define LV_LOG_TRACE_DISP_REFR 1 + #define LV_LOG_TRACE_EVENT 1 + #define LV_LOG_TRACE_OBJ_CREATE 1 + #define LV_LOG_TRACE_LAYOUT 1 + #define LV_LOG_TRACE_ANIM 1 + +#endif /*LV_USE_LOG*/ + +/*------------- + * Asserts + *-----------*/ + +/*Enable asserts if an operation is failed or an invalid data is found. + *If LV_USE_LOG is enabled an error message will be printed on failure*/ +#define LV_USE_ASSERT_NULL 1 /*Check if the parameter is NULL. (Very fast, recommended)*/ +#define LV_USE_ASSERT_MALLOC 1 /*Checks is the memory is successfully allocated or no. (Very fast, recommended)*/ +#define LV_USE_ASSERT_STYLE 0 /*Check if the styles are properly initialized. (Very fast, recommended)*/ +#define LV_USE_ASSERT_MEM_INTEGRITY 0 /*Check the integrity of `lv_mem` after critical operations. (Slow)*/ +#define LV_USE_ASSERT_OBJ 0 /*Check the object's type and existence (e.g. not deleted). (Slow)*/ + +/*Add a custom handler when assert happens e.g. to restart the MCU*/ +#define LV_ASSERT_HANDLER_INCLUDE <stdint.h> +#define LV_ASSERT_HANDLER while(1); /*Halt by default*/ + +/*------------- + * Others + *-----------*/ + +/*1: Show CPU usage and FPS count*/ +#define LV_USE_PERF_MONITOR 0 +#if LV_USE_PERF_MONITOR + #define LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT +#endif + +/*1: Show the used memory and the memory fragmentation + * Requires LV_MEM_CUSTOM = 0*/ +#define LV_USE_MEM_MONITOR 0 +#if LV_USE_MEM_MONITOR + #define LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_LEFT +#endif + +/*1: Draw random colored rectangles over the redrawn areas*/ +#define LV_USE_REFR_DEBUG 0 + +/*Change the built in (v)snprintf functions*/ +#define LV_SPRINTF_CUSTOM 0 +#if LV_SPRINTF_CUSTOM + #define LV_SPRINTF_INCLUDE <stdio.h> + #define lv_snprintf snprintf + #define lv_vsnprintf vsnprintf +#else /*LV_SPRINTF_CUSTOM*/ + #define LV_SPRINTF_USE_FLOAT 0 +#endif /*LV_SPRINTF_CUSTOM*/ + +#define LV_USE_USER_DATA 1 + +/*Garbage Collector settings + *Used if lvgl is bound to higher level language and the memory is managed by that language*/ +#define LV_ENABLE_GC 0 +#if LV_ENABLE_GC != 0 + #define LV_GC_INCLUDE "gc.h" /*Include Garbage Collector related things*/ +#endif /*LV_ENABLE_GC*/ + +/*===================== + * COMPILER SETTINGS + *====================*/ + +/*For big endian systems set to 1*/ +#define LV_BIG_ENDIAN_SYSTEM 0 + +/*Define a custom attribute to `lv_tick_inc` function*/ +#define LV_ATTRIBUTE_TICK_INC + +/*Define a custom attribute to `lv_timer_handler` function*/ +#define LV_ATTRIBUTE_TIMER_HANDLER + +/*Define a custom attribute to `lv_disp_flush_ready` function*/ +#define LV_ATTRIBUTE_FLUSH_READY + +/*Required alignment size for buffers*/ +#define LV_ATTRIBUTE_MEM_ALIGN_SIZE 4 + +/*Will be added where memories needs to be aligned (with -Os data might not be aligned to boundary by default). + * E.g. __attribute__((aligned(4)))*/ +#define LV_ATTRIBUTE_MEM_ALIGN __attribute__((aligned(4))) + +/*Attribute to mark large constant arrays for example font's bitmaps*/ +#define LV_ATTRIBUTE_LARGE_CONST + +/*Compiler prefix for a big array declaration in RAM*/ +#define LV_ATTRIBUTE_LARGE_RAM_ARRAY + +/*Place performance critical functions into a faster memory (e.g RAM)*/ +#define LV_ATTRIBUTE_FAST_MEM + +/*Prefix variables that are used in GPU accelerated operations, often these need to be placed in RAM sections that are DMA accessible*/ +#define LV_ATTRIBUTE_DMA + +/*Export integer constant to binding. This macro is used with constants in the form of LV_<CONST> that + *should also appear on LVGL binding API such as Micropython.*/ +#define LV_EXPORT_CONST_INT(int_value) struct _silence_gcc_warning /*The default value just prevents GCC warning*/ + +/*Extend the default -32k..32k coordinate range to -4M..4M by using int32_t for coordinates instead of int16_t*/ +#define LV_USE_LARGE_COORD 0 + +/*================== + * FONT USAGE + *===================*/ + +/*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_14 1 +#define LV_FONT_MONTSERRAT_16 0 +#define LV_FONT_MONTSERRAT_18 0 +#define LV_FONT_MONTSERRAT_20 0 +#define LV_FONT_MONTSERRAT_22 0 +#define LV_FONT_MONTSERRAT_24 0 +#define LV_FONT_MONTSERRAT_26 0 +#define LV_FONT_MONTSERRAT_28 0 +#define LV_FONT_MONTSERRAT_30 0 +#define LV_FONT_MONTSERRAT_32 0 +#define LV_FONT_MONTSERRAT_34 0 +#define LV_FONT_MONTSERRAT_36 0 +#define LV_FONT_MONTSERRAT_38 0 +#define LV_FONT_MONTSERRAT_40 0 +#define LV_FONT_MONTSERRAT_42 0 +#define LV_FONT_MONTSERRAT_44 0 +#define LV_FONT_MONTSERRAT_46 0 +#define LV_FONT_MONTSERRAT_48 0 + +/*Demonstrate special features*/ +#define LV_FONT_MONTSERRAT_12_SUBPX 0 +#define LV_FONT_MONTSERRAT_28_COMPRESSED 0 /*bpp = 3*/ +#define LV_FONT_DEJAVU_16_PERSIAN_HEBREW 0 /*Hebrew, Arabic, Persian letters and all their forms*/ +#define LV_FONT_SIMSUN_16_CJK 0 /*1000 most common CJK radicals*/ + +/*Pixel perfect monospace fonts*/ +#define LV_FONT_UNSCII_8 0 +#define LV_FONT_UNSCII_16 0 + +/*Optionally declare custom fonts here. + *You can use these fonts as default font too and they will be available globally. + *E.g. #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) LV_FONT_DECLARE(my_font_2)*/ +#define LV_FONT_CUSTOM_DECLARE + +/*Always set a default font*/ +#define LV_FONT_DEFAULT &lv_font_montserrat_14 + +/*Enable handling large font and/or fonts with a lot of characters. + *The limit depends on the font size, font face and bpp. + *Compiler error will be triggered if a font needs it.*/ +#define LV_FONT_FMT_TXT_LARGE 0 + +/*Enables/disables support for compressed fonts.*/ +#define LV_USE_FONT_COMPRESSED 0 + +/*Enable subpixel rendering*/ +#define LV_USE_FONT_SUBPX 0 +#if LV_USE_FONT_SUBPX + /*Set the pixel order of the display. Physical order of RGB channels. Doesn't matter with "normal" fonts.*/ + #define LV_FONT_SUBPX_BGR 0 /*0: RGB; 1:BGR order*/ +#endif + +/*Enable drawing placeholders when glyph dsc is not found*/ +#define LV_USE_FONT_PLACEHOLDER 1 + +/*================= + * TEXT SETTINGS + *=================*/ + +/** + * Select a character encoding for strings. + * Your IDE or editor should have the same character encoding + * - LV_TXT_ENC_UTF8 + * - LV_TXT_ENC_ASCII + */ +#define LV_TXT_ENC LV_TXT_ENC_UTF8 + +/*Can break (wrap) texts on these chars*/ +#define LV_TXT_BREAK_CHARS " ,.;:-_" + +/*If a word is at least this long, will break wherever "prettiest" + *To disable, set to a value <= 0*/ +#define LV_TXT_LINE_BREAK_LONG_LEN 0 + +/*Minimum number of characters in a long word to put on a line before a break. + *Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/ +#define LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN 3 + +/*Minimum number of characters in a long word to put on a line after a break. + *Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/ +#define LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN 3 + +/*The control character to use for signalling text recoloring.*/ +#define LV_TXT_COLOR_CMD "#" + +/*Support bidirectional texts. Allows mixing Left-to-Right and Right-to-Left texts. + *The direction will be processed according to the Unicode Bidirectional Algorithm: + *https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/ +#define LV_USE_BIDI 0 +#if LV_USE_BIDI + /*Set the default direction. Supported values: + *`LV_BASE_DIR_LTR` Left-to-Right + *`LV_BASE_DIR_RTL` Right-to-Left + *`LV_BASE_DIR_AUTO` detect texts base direction*/ + #define LV_BIDI_BASE_DIR_DEF LV_BASE_DIR_AUTO +#endif + +/*Enable Arabic/Persian processing + *In these languages characters should be replaced with an other form based on their position in the text*/ +#define LV_USE_ARABIC_PERSIAN_CHARS 0 + +/*================== + * WIDGET USAGE + *================*/ + +/*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html*/ + +#define LV_USE_ARC 1 + +#define LV_USE_BAR 1 + +#define LV_USE_BTN 1 + +#define LV_USE_BTNMATRIX 1 + +#define LV_USE_CANVAS 1 + +#define LV_USE_CHECKBOX 1 + +#define LV_USE_DROPDOWN 1 /*Requires: lv_label*/ + +#define LV_USE_IMG 1 /*Requires: lv_label*/ + +#define LV_USE_LABEL 1 +#if LV_USE_LABEL + #define LV_LABEL_TEXT_SELECTION 1 /*Enable selecting text of the label*/ + #define LV_LABEL_LONG_TXT_HINT 1 /*Store some extra info in labels to speed up drawing of very long texts*/ +#endif + +#define LV_USE_LINE 1 + +#define LV_USE_ROLLER 1 /*Requires: lv_label*/ +#if LV_USE_ROLLER + #define LV_ROLLER_INF_PAGES 7 /*Number of extra "pages" when the roller is infinite*/ +#endif + +#define LV_USE_SLIDER 1 /*Requires: lv_bar*/ + +#define LV_USE_SWITCH 1 + +#define LV_USE_TEXTAREA 1 /*Requires: lv_label*/ +#if LV_USE_TEXTAREA != 0 + #define LV_TEXTAREA_DEF_PWD_SHOW_TIME 1500 /*ms*/ +#endif + +#define LV_USE_TABLE 1 + +/*================== + * EXTRA COMPONENTS + *==================*/ + +/*----------- + * Widgets + *----------*/ +#define LV_USE_ANIMIMG 1 + +#define LV_USE_CALENDAR 1 +#if LV_USE_CALENDAR + #define LV_CALENDAR_WEEK_STARTS_MONDAY 0 + #if LV_CALENDAR_WEEK_STARTS_MONDAY + #define LV_CALENDAR_DEFAULT_DAY_NAMES {"Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"} + #else + #define LV_CALENDAR_DEFAULT_DAY_NAMES {"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"} + #endif + + #define LV_CALENDAR_DEFAULT_MONTH_NAMES {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"} + #define LV_USE_CALENDAR_HEADER_ARROW 1 + #define LV_USE_CALENDAR_HEADER_DROPDOWN 1 +#endif /*LV_USE_CALENDAR*/ + +#define LV_USE_CHART 1 + +#define LV_USE_COLORWHEEL 1 + +#define LV_USE_IMGBTN 1 + +#define LV_USE_KEYBOARD 1 + +#define LV_USE_LED 1 + +#define LV_USE_LIST 1 + +#define LV_USE_MENU 1 + +#define LV_USE_METER 1 + +#define LV_USE_MSGBOX 1 + +#define LV_USE_SPAN 1 +#if LV_USE_SPAN + /*A line text can contain maximum num of span descriptor */ + #define LV_SPAN_SNIPPET_STACK_SIZE 64 +#endif + +#define LV_USE_SPINBOX 1 + +#define LV_USE_SPINNER 1 + +#define LV_USE_TABVIEW 1 + +#define LV_USE_TILEVIEW 1 + +#define LV_USE_WIN 1 + +/*----------- + * Themes + *----------*/ + +#ifdef RTE_GRAPHICS_LVGL_USE_EXTRA_THEMES + /*A simple, impressive and very complete theme*/ + #define LV_USE_THEME_DEFAULT 1 + #if LV_USE_THEME_DEFAULT + + /*0: Light mode; 1: Dark mode*/ + #define LV_THEME_DEFAULT_DARK 0 + + /*1: Enable grow on press*/ + #define LV_THEME_DEFAULT_GROW 1 + + /*Default transition time in [ms]*/ + #define LV_THEME_DEFAULT_TRANSITION_TIME 80 + #endif /*LV_USE_THEME_DEFAULT*/ + + /*A very simple theme that is a good starting point for a custom theme*/ + #define LV_USE_THEME_BASIC 1 + + /*A theme designed for monochrome displays*/ + #define LV_USE_THEME_MONO 1 +#else + #define LV_USE_THEME_DEFAULT 0 + #define LV_USE_THEME_BASIC 0 + #define LV_USE_THEME_MONO 0 +#endif + +/*----------- + * Layouts + *----------*/ + +/*A layout similar to Flexbox in CSS.*/ +#define LV_USE_FLEX 1 + +/*A layout similar to Grid in CSS.*/ +#define LV_USE_GRID 1 + +/*----------- + * Others + *----------*/ + +/*1: Enable API to take snapshot for object*/ +#define LV_USE_SNAPSHOT 0 + +/*1: Enable Monkey test*/ +#define LV_USE_MONKEY 0 + +/*1: Enable grid navigation*/ +#define LV_USE_GRIDNAV 0 + +/*1: Enable lv_obj fragment*/ +#define LV_USE_FRAGMENT 0 + +/*1: Support using images as font in label or span widgets */ +#define LV_USE_IMGFONT 0 + +/*1: Enable a published subscriber based messaging system */ +#define LV_USE_MSG 0 + +/*1: Enable Pinyin input method*/ +/*Requires: lv_keyboard*/ +#if LV_USE_IME_PINYIN + /*1: Use default thesaurus*/ + /*If you do not use the default thesaurus, be sure to use `lv_ime_pinyin` after setting the thesauruss*/ + #define LV_IME_PINYIN_USE_DEFAULT_DICT 1 + /*Set the maximum number of candidate panels that can be displayed*/ + /*This needs to be adjusted according to the size of the screen*/ + #define LV_IME_PINYIN_CAND_TEXT_NUM 6 + + /*Use 9 key input(k9)*/ + #define LV_IME_PINYIN_USE_K9_MODE 1 + #if LV_IME_PINYIN_USE_K9_MODE == 1 + #define LV_IME_PINYIN_K9_CAND_TEXT_NUM 3 + #endif // LV_IME_PINYIN_USE_K9_MODE +#endif + +/*================== +* EXAMPLES +*==================*/ + +/*Enable the examples to be built with the library*/ +#define LV_BUILD_EXAMPLES 1 + + +/*--END OF LV_CONF_H--*/ + +#endif /*LV_CONF_H*/ + +#endif /*End of "Content enable"*/ diff --git a/lib/lvgl/env_support/rt-thread/SConscript b/lib/lvgl/env_support/rt-thread/SConscript new file mode 100644 index 00000000..378c36f3 --- /dev/null +++ b/lib/lvgl/env_support/rt-thread/SConscript @@ -0,0 +1,69 @@ +from building import * +import rtconfig +import os + +src = [] +inc = [] +group = [] + +cwd = GetCurrentDir() # get current dir path + +port_src = Glob('*.c') +port_inc = [cwd] +group = group + DefineGroup('LVGL-port', port_src, depend = ['PKG_USING_LVGL'], CPPPATH = port_inc) + +# check if .h or .hpp files exsit +def check_h_hpp_exsit(path): + file_dirs = os.listdir(path) + for file_dir in file_dirs: + if os.path.splitext(file_dir)[1] in ['.h', '.hpp']: + return True + return False + +lvgl_cwd = cwd + '/../../' + +lvgl_src_cwd = lvgl_cwd + 'src/' +inc = inc + [lvgl_src_cwd] +for root, dirs, files in os.walk(lvgl_src_cwd): + for dir in dirs: + current_path = os.path.join(root, dir) + src = src + Glob(os.path.join(current_path,'*.c')) # add all .c files + if check_h_hpp_exsit(current_path): # add .h and .hpp path + inc = inc + [current_path] + + +if GetDepend('PKG_LVGL_USING_EXAMPLES'): + lvgl_src_cwd = lvgl_cwd + 'examples/' + inc = inc + [lvgl_src_cwd] + for root, dirs, files in os.walk(lvgl_src_cwd): + for dir in dirs: + current_path = os.path.join(root, dir) + src = src + Glob(os.path.join(current_path,'*.c')) + if check_h_hpp_exsit(current_path): + inc = inc + [current_path] + +if GetDepend('PKG_LVGL_USING_DEMOS'): + lvgl_src_cwd = lvgl_cwd + 'demos/' + inc = inc + [lvgl_src_cwd] + for root, dirs, files in os.walk(lvgl_src_cwd): + for dir in dirs: + current_path = os.path.join(root, dir) + src = src + Glob(os.path.join(current_path,'*.c')) + if check_h_hpp_exsit(current_path): + inc = inc + [current_path] + +LOCAL_CFLAGS = '' +if rtconfig.PLATFORM == 'gcc' or rtconfig.PLATFORM == 'armclang': # GCC or Keil AC6 + LOCAL_CFLAGS += ' -std=c99' +elif rtconfig.PLATFORM == 'armcc': # Keil AC5 + LOCAL_CFLAGS += ' --c99 --gnu' + +group = group + DefineGroup('LVGL', src, depend = ['PKG_USING_LVGL'], CPPPATH = inc, LOCAL_CFLAGS = LOCAL_CFLAGS) + +list = os.listdir(cwd) +for d in list: + path = os.path.join(cwd, d) + if os.path.isfile(os.path.join(path, 'SConscript')): + group = group + SConscript(os.path.join(d, 'SConscript')) + +Return('group') diff --git a/lib/lvgl/env_support/rt-thread/lv_rt_thread_conf.h b/lib/lvgl/env_support/rt-thread/lv_rt_thread_conf.h new file mode 100644 index 00000000..92da372d --- /dev/null +++ b/lib/lvgl/env_support/rt-thread/lv_rt_thread_conf.h @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2006-2021, RT-Thread Development Team + * + * SPDX-License-Identifier: MIT + * + * Change Logs: + * Date Author Notes + * 2021-10-15 Meco Man The first version + */ + +#ifndef LV_RT_THREAD_CONF_H +#define LV_RT_THREAD_CONF_H + +#ifdef __RTTHREAD__ + +#define LV_RTTHREAD_INCLUDE <rtthread.h> +#include LV_RTTHREAD_INCLUDE + +/*========================= + MEMORY SETTINGS + *=========================*/ + +#ifdef RT_USING_HEAP +# define LV_MEM_CUSTOM 1 +# define LV_MEM_CUSTOM_INCLUDE LV_RTTHREAD_INCLUDE +# define LV_MEM_CUSTOM_ALLOC rt_malloc +# define LV_MEM_CUSTOM_FREE rt_free +# define LV_MEM_CUSTOM_REALLOC rt_realloc +#endif + +/*==================== + HAL SETTINGS + *====================*/ + +#define LV_TICK_CUSTOM 1 +#define LV_TICK_CUSTOM_INCLUDE LV_RTTHREAD_INCLUDE +#define LV_TICK_CUSTOM_SYS_TIME_EXPR (rt_tick_get_millisecond()) /*Expression evaluating to current system time in ms*/ + +#ifdef PKG_LVGL_DISP_REFR_PERIOD +#define LV_DISP_DEF_REFR_PERIOD PKG_LVGL_DISP_REFR_PERIOD +#endif + +/*======================= + * FEATURE CONFIGURATION + *=======================*/ + +/*------------- + * Asserts + *-----------*/ + +#define LV_ASSERT_HANDLER_INCLUDE LV_RTTHREAD_INCLUDE +#define LV_ASSERT_HANDLER RT_ASSERT(0); + +/*------------- + * Others + *-----------*/ + +#define LV_SPRINTF_CUSTOM 1 +#define LV_SPRINTF_INCLUDE LV_RTTHREAD_INCLUDE +#define lv_snprintf rt_snprintf +#define lv_vsnprintf rt_vsnprintf +#define LV_SPRINTF_USE_FLOAT 0 + +/*===================== + * COMPILER SETTINGS + *====================*/ + +#ifdef ARCH_CPU_BIG_ENDIAN +# define LV_BIG_ENDIAN_SYSTEM 1 +#else +# define LV_BIG_ENDIAN_SYSTEM 0 +#endif + +#define LV_ATTRIBUTE_MEM_ALIGN ALIGN(4) + +/*================== +* EXAMPLES +*==================*/ + +#ifdef PKG_LVGL_USING_EXAMPLES +# define LV_BUILD_EXAMPLES 1 +#endif + +/*--END OF LV_RT_THREAD_CONF_H--*/ + +#endif /*__RTTHREAD__*/ + +#endif /*LV_CONF_H*/ diff --git a/lib/lvgl/env_support/rt-thread/lv_rt_thread_port.c b/lib/lvgl/env_support/rt-thread/lv_rt_thread_port.c new file mode 100644 index 00000000..98a1439b --- /dev/null +++ b/lib/lvgl/env_support/rt-thread/lv_rt_thread_port.c @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2006-2021, RT-Thread Development Team + * + * SPDX-License-Identifier: MIT + * + * Change Logs: + * Date Author Notes + * 2021-10-18 Meco Man the first version + * 2022-05-10 Meco Man improve rt-thread initialization process + */ + +#ifdef __RTTHREAD__ + +#include <lvgl.h> +#include <rtthread.h> + +#define DBG_TAG "LVGL" +#define DBG_LVL DBG_INFO +#include <rtdbg.h> + +#ifndef PKG_LVGL_THREAD_STACK_SIZE +#define PKG_LVGL_THREAD_STACK_SIZE 4096 +#endif /* PKG_LVGL_THREAD_STACK_SIZE */ + +#ifndef PKG_LVGL_THREAD_PRIO +#define PKG_LVGL_THREAD_PRIO (RT_THREAD_PRIORITY_MAX*2/3) +#endif /* PKG_LVGL_THREAD_PRIO */ + +extern void lv_port_disp_init(void); +extern void lv_port_indev_init(void); +extern void lv_user_gui_init(void); + +static struct rt_thread lvgl_thread; +static ALIGN(8) rt_uint8_t lvgl_thread_stack[PKG_LVGL_THREAD_STACK_SIZE]; + +#if LV_USE_LOG +static void lv_rt_log(const char *buf) +{ + LOG_I(buf); +} +#endif /* LV_USE_LOG */ + +static void lvgl_thread_entry(void *parameter) +{ +#if LV_USE_LOG + lv_log_register_print_cb(lv_rt_log); +#endif /* LV_USE_LOG */ + lv_init(); + lv_port_disp_init(); + lv_port_indev_init(); + lv_user_gui_init(); + + /* handle the tasks of LVGL */ + while(1) + { + lv_task_handler(); + rt_thread_mdelay(LV_DISP_DEF_REFR_PERIOD); + } +} + +static int lvgl_thread_init(void) +{ + rt_err_t err; + + err = rt_thread_init(&lvgl_thread, "LVGL", lvgl_thread_entry, RT_NULL, + &lvgl_thread_stack[0], sizeof(lvgl_thread_stack), PKG_LVGL_THREAD_PRIO, 0); + if(err != RT_EOK) + { + LOG_E("Failed to create LVGL thread"); + return -1; + } + rt_thread_startup(&lvgl_thread); + + return 0; +} +INIT_ENV_EXPORT(lvgl_thread_init); + +#endif /*__RTTHREAD__*/ diff --git a/lib/lvgl/env_support/rt-thread/squareline/README.md b/lib/lvgl/env_support/rt-thread/squareline/README.md new file mode 100644 index 00000000..e55796b6 --- /dev/null +++ b/lib/lvgl/env_support/rt-thread/squareline/README.md @@ -0,0 +1,4 @@ +This folder is for LVGL SquareLine Studio + +SquareLine Studio can automatically put the generated C files into `ui` folder, so that rt-thread will automatically detect them; or, as a user, you can move the generated C files into `ui` folder manually. + diff --git a/lib/lvgl/env_support/rt-thread/squareline/SConscript b/lib/lvgl/env_support/rt-thread/squareline/SConscript new file mode 100644 index 00000000..89a50997 --- /dev/null +++ b/lib/lvgl/env_support/rt-thread/squareline/SConscript @@ -0,0 +1,13 @@ +from building import * + +cwd = GetCurrentDir() +group = [] +src = [] +CPPPATH =[] + +src += Glob(cwd + '/ui/*.c') +CPPPATH += [cwd+'/ui'] + +group = group + DefineGroup('LVGL-SquareLine', src, depend = ['PKG_USING_LVGL_SQUARELINE'], CPPPATH = CPPPATH) + +Return('group') diff --git a/lib/lvgl/env_support/rt-thread/squareline/ui/lv_ui_entry.c b/lib/lvgl/env_support/rt-thread/squareline/ui/lv_ui_entry.c new file mode 100644 index 00000000..838b53c9 --- /dev/null +++ b/lib/lvgl/env_support/rt-thread/squareline/ui/lv_ui_entry.c @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2006-2022, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2022-05-13 Meco Man First version + */ + +#ifdef __RTTHREAD__ + +void lv_user_gui_init(void) +{ + extern void ui_init(void); + ui_init(); +} + +#endif /* __RTTHREAD__ */ diff --git a/lib/lvgl/env_support/zephyr/module.yml b/lib/lvgl/env_support/zephyr/module.yml new file mode 100644 index 00000000..eb317c3c --- /dev/null +++ b/lib/lvgl/env_support/zephyr/module.yml @@ -0,0 +1,2 @@ +build: + cmake: . |
