Skip to content
프로젝트

소개

LVGL 임베디드 GUI 라이브러리의 예제, 튜토리얼 및 애플리케이션

학습 및 교육

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

lv_demos

Extended demo applications for LVGL (Light and Versatile Graphics Library). This repository contains niche and specialized demo applications that showcase advanced LVGL features and use cases.

Overview

This repository contains additional standalone demo applications beyond the core LVGL demos. Each demo is self-contained and demonstrates specific features or real-world applications. Demos can be easily integrated into LVGL-based projects through CMake and FetchContent.

Repository Structure

lv_demos/
├── src/
│   ├── ebike/               # eBike demo
│   │   ├── *.c              # Demo source files
│   │   └── *.h              # Demo header files
│   ├── smartwatch/          # Stress test demo
│   │   ├── *.c
│   │   └── *.h
│   └── lv_demos.h           # Main header with feature guards
├── CMakeLists.txt           # Build configuration
├── lv_demos_ext.h           # Public API header
└── README.md                # This file

Demo Features

Each demo is conditionally compiled based on LV_USE_DEMO_* defines set in lv_conf.h. This allows you to include only the demos you need in your project, keeping the binary size minimal.

Available Demos

Refer to src/lv_demos.h for the complete list of available demos and their corresponding LV_USE_DEMO_* flags.

Building

The easiest way to try one of the demos is to add this repository to your application and build the source files by globbing them.

TODO: Document this approach

CMake

You can also use CMake to integrate these demos into your application

Prerequisites

  • CMake 3.11 or higher
  • C compiler (GCC, Clang, MSVC, etc.)
  • LVGL library (as a dependency)

Integration with FetchContent

The recommended way to use lv_demos_ext is to add it to your project's main CMakeLists.txt after LVGL:

cmake_minimum_required(VERSION 3.16)
project(my_app)

# 1. Add LVGL first via subdirectory or fetchcontent
add_subdirectory(lvgl)

# 2. Fetch and add lv_demos_ext
include(FetchContent)
FetchContent_Declare(
    lv_demos_ext
    GIT_REPOSITORY https://github.com/lvgl/lv_demos
    GIT_TAG master
)
FetchContent_MakeAvailable(lv_demos_ext)

# 3. Link lv_demos_ext with LVGL
target_link_libraries(lvgl PUBLIC lv_demos_ext)

# 4. Link LVGL to your application
add_executable(my_app src/main.c)
target_link_libraries(my_app PRIVATE lvgl)

Important: LVGL must be added before lv_demos_ext, as lv_demos_ext depends on LVGL being available.

CMake Integration

For comprehensive CMake integration guidance, refer to the LVGL CMake documentation.

Using with lv_port_linux

The lv_port_linux repository can automatically fetch and integrate lv_demos_ext. Simply enable one of the demos in your lv_port_linux configuration, and the build system will automatically include lv_demos_ext.

Usage

Once integrated, enable the desired demos by defining their corresponding LV_USE_DEMO_* flags in your lv_conf.h:

#define LV_USE_DEMO_EBIKE 1
#define LV_USE_DEMO_STRESS 1
// Add other demo defines as needed

Then include and call the demo in your application:

#include "lv_demos_ext.h"

int main(void) {
    lv_init();
    
    /* Display a demo */
    lv_demo_ebike();
    
    /* Your event loop */
    while(1) {
        uint32_t sleep_ms = lv_timer_handler();
        lv_sleep_ms(sleep_ms);
    }
    
    return 0;
}

Dependencies

  • LVGL: Light and Versatile Graphics Library - required for all demos

Contributing

Contributions are welcome! Please submit pull requests with:

  • Clear descriptions of changes
  • Any new demos should follow the existing code structure
  • Proper documentation for new functionality

Support

For questions regarding LVGL, visit: LVGL Documentation

For issues specific to this repository, please open an issue on Github.

관련 프로젝트 살펴보기

불러오는 중…