Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for LittlevGL library #6826

Merged
merged 3 commits into from
Jan 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion drivers/display/ssd1673.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,8 @@ static void ssd1673_get_capabilities(const struct device *dev,
caps->current_pixel_format = PIXEL_FORMAT_MONO10;
caps->screen_info = SCREEN_INFO_MONO_VTILED |
SCREEN_INFO_MONO_MSB_FIRST |
SCREEN_INFO_EPD;
SCREEN_INFO_EPD |
SCREEN_INFO_DOUBLE_BUFFER;
}

static int ssd1673_set_orientation(const struct device *dev,
Expand Down
4 changes: 4 additions & 0 deletions include/display.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ enum display_screen_info {
* Electrophoretic Display.
*/
SCREEN_INFO_EPD = BIT(2),
/**
* Screen has two alternating ram buffers
*/
SCREEN_INFO_DOUBLE_BUFFER = BIT(3),
};

/**
Expand Down
1 change: 1 addition & 0 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ add_subdirectory_ifdef(CONFIG_POSIX_API posix)
add_subdirectory_ifdef(CONFIG_CMSIS_RTOS_V1 cmsis_rtos_v1)
add_subdirectory_ifdef(CONFIG_CMSIS_RTOS_V2 cmsis_rtos_v2)
add_subdirectory(rbtree)
add_subdirectory(gui)
3 changes: 3 additions & 0 deletions lib/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,7 @@ source "lib/posix/Kconfig"

source "lib/cmsis_rtos_v1/Kconfig"
source "lib/cmsis_rtos_v2/Kconfig"

source "lib/gui/Kconfig"

endmenu
1 change: 1 addition & 0 deletions lib/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add_subdirectory_if_kconfig(lvgl)
11 changes: 11 additions & 0 deletions lib/gui/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#
# Copyright (c) 2018 Jan Van Winkel <[email protected]>
#
# SPDX-License-Identifier: Apache-2.0
#

menu "Graphical user interface"

rsource "lvgl/Kconfig"

endmenu
175 changes: 175 additions & 0 deletions lib/gui/lvgl/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
include(FetchContent)

set(lv_name lvgl)

set(ep_base ${PROJECT_BINARY_DIR}/ext_proj)
set_property(DIRECTORY PROPERTY "EP_BASE" ${ep_base})

set(lv_SOURCE_DIR ${ep_base}/Source/${lv_name})
set(lv_SUBBUILD_DIR ${ep_base}/Subbuild/${lv_name})

FetchContent_Declare(
${lv_name}
GIT_REPOSITORY https://github.com/littlevgl/lvgl.git
GIT_TAG v5.2
SOURCE_DIR ${lv_SOURCE_DIR}
BINARY_DIR ${lv_SOURCE_DIR}
SUBBUILD_DIR ${lv_SUBBUILD_DIR}
)

FetchContent_GetProperties(${lv_name})
if(NOT ${lv_name}_POPULATED)
FetchContent_Populate(${lv_name})
endif()

zephyr_interface_library_named(lvgl)

set(LVGL_SOURCE_DIR ${${lv_name}_SOURCE_DIR})

target_include_directories(lvgl INTERFACE ${LVGL_SOURCE_DIR})
target_include_directories(lvgl INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})

zephyr_compile_definitions(LV_CONF_INCLUDE_SIMPLE=1)

zephyr_library()

zephyr_library_sources(

${LVGL_SOURCE_DIR}/lv_core/lv_group.c
${LVGL_SOURCE_DIR}/lv_core/lv_indev.c
${LVGL_SOURCE_DIR}/lv_core/lv_obj.c
${LVGL_SOURCE_DIR}/lv_core/lv_refr.c
${LVGL_SOURCE_DIR}/lv_core/lv_style.c
${LVGL_SOURCE_DIR}/lv_core/lv_vdb.c

${LVGL_SOURCE_DIR}/lv_draw/lv_draw.c
${LVGL_SOURCE_DIR}/lv_draw/lv_draw_arc.c
${LVGL_SOURCE_DIR}/lv_draw/lv_draw_img.c
${LVGL_SOURCE_DIR}/lv_draw/lv_draw_label.c
${LVGL_SOURCE_DIR}/lv_draw/lv_draw_line.c
${LVGL_SOURCE_DIR}/lv_draw/lv_draw_rbasic.c
${LVGL_SOURCE_DIR}/lv_draw/lv_draw_rect.c
${LVGL_SOURCE_DIR}/lv_draw/lv_draw_triangle.c
${LVGL_SOURCE_DIR}/lv_draw/lv_draw_vbasic.c

${LVGL_SOURCE_DIR}/lv_hal/lv_hal_disp.c
${LVGL_SOURCE_DIR}/lv_hal/lv_hal_indev.c
${LVGL_SOURCE_DIR}/lv_hal/lv_hal_tick.c

${LVGL_SOURCE_DIR}/lv_misc/lv_anim.c
${LVGL_SOURCE_DIR}/lv_misc/lv_area.c
${LVGL_SOURCE_DIR}/lv_misc/lv_circ.c
${LVGL_SOURCE_DIR}/lv_misc/lv_color.c
${LVGL_SOURCE_DIR}/lv_misc/lv_font.c
${LVGL_SOURCE_DIR}/lv_misc/lv_fs.c
${LVGL_SOURCE_DIR}/lv_misc/lv_ll.c
${LVGL_SOURCE_DIR}/lv_misc/lv_log.c
${LVGL_SOURCE_DIR}/lv_misc/lv_math.c
${LVGL_SOURCE_DIR}/lv_misc/lv_mem.c
${LVGL_SOURCE_DIR}/lv_misc/lv_task.c
${LVGL_SOURCE_DIR}/lv_misc/lv_templ.c
${LVGL_SOURCE_DIR}/lv_misc/lv_txt.c

${LVGL_SOURCE_DIR}/lv_objx/lv_arc.c
${LVGL_SOURCE_DIR}/lv_objx/lv_bar.c
${LVGL_SOURCE_DIR}/lv_objx/lv_btn.c
${LVGL_SOURCE_DIR}/lv_objx/lv_btnm.c
${LVGL_SOURCE_DIR}/lv_objx/lv_calendar.c
${LVGL_SOURCE_DIR}/lv_objx/lv_cb.c
${LVGL_SOURCE_DIR}/lv_objx/lv_chart.c
${LVGL_SOURCE_DIR}/lv_objx/lv_cont.c
${LVGL_SOURCE_DIR}/lv_objx/lv_ddlist.c
${LVGL_SOURCE_DIR}/lv_objx/lv_gauge.c
${LVGL_SOURCE_DIR}/lv_objx/lv_img.c
${LVGL_SOURCE_DIR}/lv_objx/lv_imgbtn.c
${LVGL_SOURCE_DIR}/lv_objx/lv_kb.c
${LVGL_SOURCE_DIR}/lv_objx/lv_label.c
${LVGL_SOURCE_DIR}/lv_objx/lv_led.c
${LVGL_SOURCE_DIR}/lv_objx/lv_line.c
${LVGL_SOURCE_DIR}/lv_objx/lv_list.c
${LVGL_SOURCE_DIR}/lv_objx/lv_lmeter.c
${LVGL_SOURCE_DIR}/lv_objx/lv_mbox.c
${LVGL_SOURCE_DIR}/lv_objx/lv_objx_templ.c
${LVGL_SOURCE_DIR}/lv_objx/lv_page.c
${LVGL_SOURCE_DIR}/lv_objx/lv_preload.c
${LVGL_SOURCE_DIR}/lv_objx/lv_roller.c
${LVGL_SOURCE_DIR}/lv_objx/lv_slider.c
${LVGL_SOURCE_DIR}/lv_objx/lv_sw.c
${LVGL_SOURCE_DIR}/lv_objx/lv_ta.c
${LVGL_SOURCE_DIR}/lv_objx/lv_tabview.c
${LVGL_SOURCE_DIR}/lv_objx/lv_win.c

${LVGL_SOURCE_DIR}/lv_themes/lv_theme.c
${LVGL_SOURCE_DIR}/lv_themes/lv_theme_alien.c
${LVGL_SOURCE_DIR}/lv_themes/lv_theme_default.c
${LVGL_SOURCE_DIR}/lv_themes/lv_theme_material.c
${LVGL_SOURCE_DIR}/lv_themes/lv_theme_mono.c
${LVGL_SOURCE_DIR}/lv_themes/lv_theme_nemo.c
${LVGL_SOURCE_DIR}/lv_themes/lv_theme_night.c
${LVGL_SOURCE_DIR}/lv_themes/lv_theme_templ.c
${LVGL_SOURCE_DIR}/lv_themes/lv_theme_zen.c

${LVGL_SOURCE_DIR}/lv_fonts/lv_font_builtin.c
)

zephyr_library_sources_ifdef( CONFIG_LVGL_BUILD_IN_FONT_10
${LVGL_SOURCE_DIR}/lv_fonts/lv_font_dejavu_10.c
${LVGL_SOURCE_DIR}/lv_fonts/lv_font_dejavu_10_cyrillic.c
${LVGL_SOURCE_DIR}/lv_fonts/lv_font_dejavu_10_latin_sup.c
${LVGL_SOURCE_DIR}/lv_fonts/lv_font_symbol_10.c
)

zephyr_library_sources_ifdef( CONFIG_LVGL_BUILD_IN_FONT_20
${LVGL_SOURCE_DIR}/lv_fonts/lv_font_dejavu_20.c
${LVGL_SOURCE_DIR}/lv_fonts/lv_font_dejavu_20_cyrillic.c
${LVGL_SOURCE_DIR}/lv_fonts/lv_font_dejavu_20_latin_sup.c
${LVGL_SOURCE_DIR}/lv_fonts/lv_font_symbol_20.c
)

zephyr_library_sources_ifdef( CONFIG_LVGL_BUILD_IN_FONT_30
${LVGL_SOURCE_DIR}/lv_fonts/lv_font_dejavu_30.c
${LVGL_SOURCE_DIR}/lv_fonts/lv_font_dejavu_30_cyrillic.c
${LVGL_SOURCE_DIR}/lv_fonts/lv_font_dejavu_30_latin_sup.c
${LVGL_SOURCE_DIR}/lv_fonts/lv_font_symbol_30.c
)

zephyr_library_sources_ifdef( CONFIG_LVGL_BUILD_IN_FONT_40
${LVGL_SOURCE_DIR}/lv_fonts/lv_font_dejavu_40.c
${LVGL_SOURCE_DIR}/lv_fonts/lv_font_dejavu_40_cyrillic.c
${LVGL_SOURCE_DIR}/lv_fonts/lv_font_dejavu_40_latin_sup.c
${LVGL_SOURCE_DIR}/lv_fonts/lv_font_symbol_40.c
)

zephyr_library_sources_ifdef( CONFIG_LVGL_BUILD_IN_FONT_MONOSPACE
${LVGL_SOURCE_DIR}/lv_fonts/lv_font_monospace_8.c
)

zephyr_library_sources_ifdef( CONFIG_LVGL_COLOR_DEPTH_32
lvgl_color_32.c
)

zephyr_library_sources_ifdef( CONFIG_LVGL_COLOR_DEPTH_16
lvgl_color_16.c
)

zephyr_library_sources_ifdef( CONFIG_LVGL_COLOR_DEPTH_8
lvgl_color_8.c
)

zephyr_library_sources_ifdef( CONFIG_LVGL_COLOR_DEPTH_1
lvgl_color_1.c
)

zephyr_library_sources_ifdef( CONFIG_LVGL_FILESYSTEM
lvgl_fs.c
)

zephyr_library_sources(lvgl.c)

zephyr_library_sources_ifdef( CONFIG_LVGL_MEM_POOL_USER lvgl_mem_user.c)

zephyr_library_sources_ifdef( CONFIG_LVGL_MEM_POOL_KERNEL lvgl_mem_kernel.c)

zephyr_library_link_libraries(lvgl)

target_link_libraries(lvgl INTERFACE zephyr_interface)
Loading