一个名为 LVGL for Visual Studio 的项目
这是一个名为 LVGL for Visual Studio 的项目,用于在 Windows PC 上尝试和开发 LVGL(Light and Versatile Graphics Library)图形用户界面库。这是一个预配置的 Visual Studio 项目,仅依赖 Win32 API、C Runtime 和 C++ STL,无需额外依赖即可编译。
核心项目文件夹
- LvglWindows/ - 核心库项目
- 包含 LVGL 核心库和 Windows 平台的适配层
- 提供静态库(LvglWindowsStatic)供其他项目使用
- LvglWindowsSimulator/ - 模拟器项目
- 主要的演示和测试程序
- 用于模拟 LVGL 在嵌入式设备上的显示效果
- 包含多个演示程序(widgets、benchmark、music 等)
- LvglWindowsDesktopApplication/ - 桌面应用项目
- 用于开发真实的 Windows 桌面应用程序
- 支持窗口大小调整,DPI 动态变化
问题1
我发现有两个cpp 一个是LvglWindowsDesktopApplication.cpp 另一个是LvglWindowsSimulator.cpp 我要怎么在vs中分别编译这两个文件 或者是这个想法是不对的
在vs中有一个启动项目的概念
- 打开解决方案文件:
LVGL.sln - 选择启动项目:
- 运行模拟器:右键点击 LvglWindowsSimulator 项目 → "设为启动项目"
- 运行桌面应用:右键点击 LvglWindowsDesktopApplication 项目 → "设为启动项目"
- 编译并运行:
- 按 F5 或点击"本地 Windows 调试器"按钮
两种模式的区别
| 特性 | 模拟器模式 | 桌面应用模式 |
|---|---|---|
| 窗口行为 | 固定分辨率,模拟嵌入式设备 | 可调整大小,响应DPI变化 |
| 用途 | 开发测试UI原型 | 开发实际的Windows应用 |
| 输入方法 | 控制台输出支持 | 标准GUI应用 |
问题2
那我发现启动项目不止这两个 还有LvglWindows、LvglWindowsStatic这两个是什么意思
编译输出路径 lv_port_pc_visual_studio\Output\Binaries\Debug\x64

四个项目的类型和作用
| 项目名称 | 项目类型 | 作用 | 是否可启动 |
|---|---|---|---|
| LvglWindowsStatic | 静态库 (.lib) | 包含 LVGL 核心功能 + Windows 平台适配 | ❌ 不可启动 |
| LvglWindows | 动态库 (.dll) | Windows 平台的 LVGL 封装库 | ❌ 不可启动 |
| LvglWindowsSimulator | 控制台应用 (.exe) | LVGL 模拟器程序 | ✅ 可启动 |
| LvglWindowsDesktopApplication | Windows 应用 (.exe) | LVGL 桌面应用程序 | ✅ 可启动 |
编译顺序理解
Visual Studio 会自动处理依赖关系,编译顺序为:
- LvglWindowsStatic → 生成 .lib 文件
- LvglWindows → 链接 .lib,生成 .dll 和 .lib
- 应用程序 → 链接动态库的 .lib,生成 .exe
总结:这种分层设计是企业级软件的标准做法,虽然看起来复杂,但提供了良好的模块化和可维护性。对于日常使用,您只需要关
注两个可启动项目即可。
先了解一下mian.c吧
/*
* LVGL Windows 模拟器主程序
*
* 功能说明:
* 1. 创建 LVGL 显示环境,模拟嵌入式设备的显示效果
* 2. 提供鼠标、键盘和编码器输入支持
* 3. 运行 LVGL 应用程序进行测试和开发
*
* 适用于嵌入式 LVGL 开发的前期测试和原型设计
*/
#include <Windows.h> // Windows API 头文件
#include <LvglWindowsIconResource.h> // LVGL Windows 图标资源
#include "lvgl/lvgl.h" // LVGL 核心库
#include "lvgl/examples/lv_examples.h" // LVGL 示例程序
#include "lvgl/demos/lv_demos.h" // LVGL 演示程序
int main()
{
// ========== LVGL 初始化阶段 ==========
// 初始化 LVGL 库,必须在所有 LVGL 操作之前调用
lv_init();
/*
* UTF-8 控制台输出设置(可选)
*
* 作用:使控制台能够正确显示 UTF-8 编码的中文和特殊字符
* 适用场景:当需要在控制台输出调试信息包含中文时
* 注意:嵌入式设备通常没有控制台,此功能主要用于 PC 端调试
*/
#if LV_TXT_ENC == LV_TXT_ENC_UTF8
SetConsoleCP(CP_UTF8); // 设置控制台输入编码为 UTF-8
SetConsoleOutputCP(CP_UTF8); // 设置控制台输出编码为 UTF-8
#endif
// ========== 显示器创建和配置 ==========
// 显示器配置参数
int32_t zoom_level = 100; // 缩放级别:100% = 原始大小
// 嵌入式思维:目标设备分辨率固定,不需要考虑 DPI 缩放
bool allow_dpi_override = false; // 是否允许 DPI 覆盖
// false = 使用系统 DPI 设置
// true = 强制使用指定缩放级别
bool simulator_mode = true; // 模拟器模式开关
// true = 模拟器模式:固定分辨率,模拟嵌入式设备
// false = 应用模式:可调整窗口大小,响应 DPI 变化
/*
* 创建 Windows 显示器设备
*
* 参数说明:
* - "LVGL Windows Simulator Display 1": 窗口标题
* - 800, 480: 显示器分辨率(宽度 x 高度)
* 嵌入式思维:这应该是您的目标设备分辨率
* 常见嵌入式分辨率:320x240, 480x272, 800x480, 1024x600
* - zoom_level: 缩放级别(100 = 100%)
* - allow_dpi_override: DPI 覆盖权限
* - simulator_mode: 模拟器模式标志
*/
lv_display_t* display = lv_windows_create_display(
L"LVGL Windows Simulator Display 1", // 窗口标题
800, // 宽度:模拟常见的 7 寸屏分辨率
480, // 高度:适合大多数嵌入式应用
zoom_level,
allow_dpi_override,
simulator_mode);
// 错误处理:显示器创建失败
if (!display)
{
return -1; // 嵌入式思维:系统资源不足,无法分配显示器
}
// ========== 窗口图标设置 ==========
// 获取显示器窗口句柄(用于设置窗口属性)
HWND window_handle = lv_windows_get_display_window_handle(display);
if (!window_handle)
{
return -1; // 错误:无法获取窗口句柄
}
// 加载并设置窗口图标
HICON icon_handle = LoadIconW(
GetModuleHandleW(NULL), // 获取当前模块句柄
MAKEINTRESOURCE(IDI_LVGL_WINDOWS)); // LVGL 图标资源 ID
if (icon_handle)
{
// 设置大图标(任务栏、Alt+Tab 视图)
SendMessageW(
window_handle,
WM_SETICON, // Windows 消息:设置图标
TRUE, // TRUE = 大图标 (32x32)
(LPARAM)icon_handle); // 图标句柄
// 设置小图标(窗口标题栏)
SendMessageW(
window_handle,
WM_SETICON, // Windows 消息:设置图标
FALSE, // FALSE = 小图标 (16x16)
(LPARAM)icon_handle); // 图标句柄
}
// 嵌入式思维:嵌入式设备通常不需要窗口图标,这是 Windows 平台特有的功能
// ========== 输入设备初始化 ==========
// LVGL 支持多种输入设备类型,这里初始化三种常用输入设备
// 1. 指针输入设备(鼠标、触摸屏)
// 用途:点击、拖拽、滑动等触摸操作
// 嵌入式对应:电阻触摸屏、电容触摸屏
lv_indev_t* pointer_indev = lv_windows_acquire_pointer_indev(display);
if (!pointer_indev)
{
return -1; // 错误:无法初始化指针输入设备
}
// 2. 键盘输入设备
// 用途:文字输入、快捷键、方向键导航
// 嵌入式对应:物理按键、USB 键盘
lv_indev_t* keypad_indev = lv_windows_acquire_keypad_indev(display);
if (!keypad_indev)
{
return -1; // 错误:无法初始化键盘输入设备
}
// 3. 编码器输入设备
// 用途:旋钮编码器输入,支持按下、旋转、长按等操作
// 嵌入式对应:物理编码器旋钮(常用于音频设备、工业控制面板)
lv_indev_t* encoder_indev = lv_windows_acquire_encoder_indev(display);
if (!encoder_indev)
{
return -1; // 错误:无法初始化编码器输入设备
}
// ========== LVGL 应用程序创建 ==========
// 获取当前活动屏幕对象
// 嵌入式思维:嵌入式设备通常只有一个屏幕,所以使用默认屏幕
lv_obj_t* scr = lv_scr_act();
/*
* 自定义界面示例(当前被注释)
*
* 这是创建简单 LVGL 界面的基本步骤:
* 1. 创建标签对象
* 2. 设置标签文本
* 3. 设置对象位置和对齐方式
*
lv_obj_t* label = lv_label_create(scr); // 在屏幕上创建标签
lv_label_set_text(label, "Hello Embedded World!"); // 设置标签文本
lv_obj_align(label, LV_ALIGN_CENTER, 0, 0); // 居中对齐
*/
// ========== 演示程序选择 ==========
// LVGL 提供了多个演示程序,您可以根据需要选择:
// lv_demo_widgets(); // 基础控件演示:按钮、滑块、图表等
// // 适合学习 LVGL 基础组件
// lv_demo_benchmark(); // 性能基准测试:测试渲染性能和内存使用
// // 适合评估目标设备性能
// 嵌入式开发建议:
// - 初期:使用 lv_demo_widgets() 学习基础组件
// - 中期:使用 lv_demo_benchmark() 测试性能
// - 后期:参考 lv_demo_music() 实现复杂应用
// ========== LVGL 主事件循环 ==========
// 这是 LVGL 的核心循环,处理所有定时任务和界面刷新
while (1) // 无限循环:嵌入式设备的典型结构
{
/*
* LVGL 定时器处理器
*
* 作用:
* 1. 处理所有注册的定时器(动画、刷新任务等)
* 2. 处理输入事件(触摸、按键等)
* 3. 更新界面显示
* 4. 执行垃圾回收和内存管理
*
* 返回值:距离下次定时器触发的毫秒数
*/
uint32_t time_till_next = lv_timer_handler();
/*
* 延迟等待
*
* 作用:
* - 让出 CPU 时间,降低 CPU 使用率
* - 等待直到下一次需要处理定时器的时间
* - 在嵌入式设备上,这是重要的节能措施
*
* 嵌入式思维:
* - 不要使用 busy-wait(空循环等待)
* - 合理的延迟可以显著降低功耗
* - 在实时系统中,这里可能需要处理其他任务
*/
lv_delay_ms(time_till_next);
}
return 0; // 理论上不会执行到这里,因为 while(1) 是无限循环
}
配置文件也很重要(lv_conf.h)
/**
* @file lv_conf.h
* LVGL v9.3.0-dev 配置文件
*
* ===============================================================================
* 重要说明 - 嵌入式开发者必读
* ===============================================================================
*
* 本文件包含 LVGL 的所有配置选项,对于嵌入式开发尤其重要:
*
* 1. 内存配置 (LV_MEM_SIZE) - 直接影响能否在目标设备上运行
* 2. 颜色深度 (LV_COLOR_DEPTH) - 影响显示效果和内存占用
* 3. 性能监控 (LV_USE_PERF_MONITOR) - 开发调试必备工具
* 4. 组件开关 - 控制代码大小和功能
*
* 嵌入式配置建议:
* - 内存受限设备:LV_MEM_SIZE ≤ 32KB,LV_COLOR_DEPTH = 16
* - 性能优先设备:LV_MEM_SIZE ≥ 64KB,启用复杂渲染
* - 极简设备:禁用动画、禁用复杂组件
*/
/*
* 配置文件使用说明:
*
* 方法1:将此文件复制为 `lv_conf.h` 并放置在 `lvgl` 文件夹旁边
* 方法2:放置在其他位置,然后:
* - 定义 `LV_CONF_INCLUDE_SIMPLE` 宏
* - 将文件路径添加到包含路径中
*
* 嵌入式项目建议使用方法1,便于管理
*/
/* clang-format off */
#if 1 /* Set this to "1" to enable content - 启用配置内容,设为"0"可禁用所有配置 */
#ifndef LV_CONF_H
#define LV_CONF_H
/* If you need to include anything here, do it inside the `__ASSEMBLY__` guard */
#if 0 && defined(__ASSEMBLY__)
#include "my_include.h"
#endif
/*====================
颜色设置 (COLOR SETTINGS)
*====================*/
/*
* 颜色深度配置 - 嵌入式开发关键配置
*
* 可选值:
* - 1 (I1): 1位单色,适用于极简显示(电子墨水屏、OLED单色屏)
* - 8 (L8): 8位灰度,适用于单色显示屏(256级灰度)
* - 16 (RGB565): 16位彩色,嵌入式最常用(65536色)
* - 24 (RGB888): 24位真彩色,适用于高端显示屏(1677万色)
* - 32 (XRGB8888): 32位真彩色(带透明通道),PC开发常用
*
* 嵌入式选择建议:
* - STM32F1系列:16位 (RGB565),平衡性能和质量
* - STM32F4/F7系列:可考虑24位,如性能允许
* - 资源极简设备:8位或1位,功能优先
* - PC模拟器:32位,便于开发调试
*
* 注意事项:
* - 颜色深度直接影响内存占用:16位 = 2字节/像素,32位 = 4字节/像素
* - 更高的颜色深度需要更多RAM和更快的MCU
* - 确保与您的显示屏控制器支持的颜色深度匹配
*/
#define LV_COLOR_DEPTH 32
/*=========================
标准库封装设置 (STDLIB WRAPPER SETTINGS)
*=========================*/
/*
* 内存分配器选择 - 嵌入式开发重要配置
*
* 可选值:
* - LV_STDLIB_BUILTIN: LVGL 内置内存管理器
* 优点:内存使用可预测,支持碎片整理
* 缺点:代码体积较大
* 适用:资源充足,追求稳定性的项目
*
* - LV_STDLIB_CLIB: 标准 C 库函数 (malloc/free)
* 优点:代码体积小,使用系统内存管理
* 缺点:可能产生内存碎片,难以调试
* 适用:资源受限,使用 RTOS 的项目
*
* - LV_STDLIB_MICROPYTHON: MicroPython 内存管理
* - LV_STDLIB_RTTHREAD: RT-Thread 内存管理
* - LV_STDLIB_CUSTOM: 自定义内存管理实现
*
* 嵌入式选择建议:
* - FreeRTOS项目:LV_STDLIB_CLIB (使用 heap_4.c)
* - 裸机项目:LV_STDLIB_BUILTIN (更好的内存管理)
* - 内存极紧张:LV_STDLIB_CUSTOM (实现内存池)
*/
#define LV_USE_STDLIB_MALLOC LV_STDLIB_CLIB
/*
* 字符串函数库选择
*
* 嵌入式建议:通常使用 LV_STDLIB_CLIB,除非有特殊需求
*/
#define LV_USE_STDLIB_STRING LV_STDLIB_CLIB
/*
* 格式化输出函数库选择
*
* 嵌入式建议:
* - 使用 LV_STDLIB_CLIB 时注意:sprintf 可能消耗较多栈空间
* - 内存紧张时可考虑 LV_STDLIB_BUILTIN 的简化实现
*/
#define LV_USE_STDLIB_SPRINTF LV_STDLIB_CLIB
#define LV_STDINT_INCLUDE <stdint.h>
#define LV_STDDEF_INCLUDE <stddef.h>
#define LV_STDBOOL_INCLUDE <stdbool.h>
#define LV_INTTYPES_INCLUDE <inttypes.h>
#define LV_LIMITS_INCLUDE <limits.h>
#define LV_STDARG_INCLUDE <stdarg.h>
#if LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN
/*
* LVGL 内存池大小 - 嵌入式开发最关键配置 ⚠️
*
* 当前设置:256KB (256 * 1024 字节)
*
* 嵌入式设备内存配置指南:
*
* [极简设备] - STM32F103C8T6 (64KB RAM)
* #define LV_MEM_SIZE (8 * 1024U) // 8KB - 仅基础功能
* #define LV_MEM_SIZE (16 * 1024U) // 16KB - 简单界面
*
* [中等设备] - STM32F407VGT6 (192KB RAM)
* #define LV_MEM_SIZE (32 * 1024U) // 32KB - 标准应用
* #define LV_MEM_SIZE (64 * 1024U) // 64KB - 复杂界面
*
* [高端设备] - STM32F767IGT (320KB RAM)
* #define LV_MEM_SIZE (128 * 1024U) // 128KB - 高级应用
*
* 内存需求评估:
* - 基础标签和按钮:每个对象约 100-500 字节
* - 图像和图标:取决于分辨率和颜色深度
* - 缓冲区:屏幕缓冲区 = 宽度 × 高度 × 颜色深度字节
* - 动画和特效:需要额外 20-50% 内存
*
* 调试建议:
* 1. 从小值开始,逐步增加直到程序稳定运行
* 2. 启用内存监控器观察实际使用情况
* 3. 预留 20-30% 缓冲区应对内存碎片
*
* PC 模拟器:256KB 便于开发测试
* 嵌入式设备:根据实际 RAM 调整,建议不超过总 RAM 的 30%
*/
#define LV_MEM_SIZE (256 * 1024U) /**< [bytes] - 当前:256KB */
/*
* 内存池扩展大小
*
* 当内存池耗尽时的扩展大小,0 表示不扩展
* 嵌入式设备建议设为 0,避免动态内存分配
*/
#define LV_MEM_POOL_EXPAND_SIZE 0
/*
* 自定义内存池地址 - 高级配置
*
* 使用场景:
* - 指定外部 SRAM 地址
* - 指定特定内存区域
* - 内存映射设备
*
* 嵌入式应用示例:
* #define LV_MEM_ADR 0x68000000 // 外部 SDRAM 起始地址
*
* 0 表示使用默认数组分配
*/
#define LV_MEM_ADR 0 /**< 0: 使用默认分配,非0: 指定内存地址 */
/* 自定义内存池分配器 - 当 LV_MEM_ADR != 0 时使用 */
#if LV_MEM_ADR == 0
#undef LV_MEM_POOL_INCLUDE // 取消注释以包含自定义头文件
#undef LV_MEM_POOL_ALLOC // 取消注释以使用自定义分配函数
#endif
#endif /*LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN*/
/*====================
硬件抽象层设置 (HAL SETTINGS)
*====================*/
/*
* 默认刷新周期 - 嵌入式显示性能关键参数 🖥️
*
* 作用:控制显示屏刷新、输入设备读取和动画步进的周期
* 单位:毫秒 (ms)
*
* 嵌入式配置建议:
* - 10ms (100Hz): 高性能设备,流畅动画体验
* - 16ms (60Hz): 标准配置,平衡性能和功耗
* - 20ms (50Hz): 低功耗设备,基础交互需求
* - 33ms (30Hz): 极低功耗,简单显示应用
*
* 性能影响:
* - 较短周期:更流畅的动画,但更高CPU占用率
* - 较长周期:节省CPU资源,但可能影响动画流畅度
*
* 硬件参考:
* - STM32F1系列:建议16-20ms
* - STM32F4系列:建议10-16ms
* - STM32F7/H7系列:可设置8-10ms
*
* 注意事项:
* - 实际刷新率受显示屏硬件限制
* - 建议设置为显示屏刷新率的整数倍分之一
*/
#define LV_DEF_REFR_PERIOD 10 /**< [ms] - 当前:10ms (100Hz刷新率) */
/*
* 默认DPI设置 - 界面尺寸基准 📏
*
* 作用:定义默认的每英寸点数,影响控件的默认大小和间距
* 用途:初始化控件尺寸、样式内边距等基准值
*
* 常见DPI值:
* - 80-120: 小尺寸显示屏(2-4寸工业屏)
* - 130-160: 中等尺寸显示屏(5-7寸触摸屏)
* - 160-240: 大尺寸显示屏(10寸以上平板)
* - 300+: 高分辨率显示屏(智能手机、平板)
*
* 嵌入式设备选择建议:
* - 320x240分辨率:建议DPI = 120
* - 480x272分辨率:建议DPI = 130 (当前设置)
* - 800x480分辨率:建议DPI = 160
* - 1024x600分辨率:建议DPI = 170
*
* 调整原则:
* - DPI过低:控件显得太小,不易触摸操作
* - DPI过高:控件显得过大,屏幕利用率低
* - 工业应用:通常使用较低DPI,确保操作可靠性
*/
#define LV_DPI_DEF 130 /**< [px/inch] - 当前:130,适合5-7寸显示屏 */
/*=================
* 操作系统配置 (OPERATING SYSTEM)
*=================*/
/*
* 操作系统选择 - 嵌入式架构重要决策 ⚙️
*
* 可选操作系统及其适用场景:
*
* LV_OS_NONE:
* 裸机运行,无操作系统支持
* 适用:简单MCU项目,资源极度受限
* 优点:最小资源占用,最简单架构
* 缺点:无任务调度,无系统调用支持
*
* LV_OS_FREERTOS:
* FreeRTOS实时操作系统
* 适用:大多数嵌入式项目,工业控制
* 优点:成熟稳定,资料丰富,社区活跃
* 硬件:STM32、ESP32、NXP等主流MCU
*
* LV_OS_CMSIS_RTOS2:
* ARM CMSIS-RTOS2标准接口
* 适用:ARM Cortex-M系列MCU
* 优点:标准化接口,可切换不同RTOS实现
* 支持:Keil RTX5、FreeRTOS、ThreadX等
*
* LV_OS_PTHREAD:
* POSIX线程支持
* 适用:Linux嵌入式系统,嵌入式Linux
* 优点:标准POSIX接口,便于移植
*
* LV_OS_RTTHREAD:
* RT-Thread国产操作系统
* 适用:国产化项目,IoT设备
* 优点:国产自主,组件丰富,中文支持好
*
* LV_OS_WINDOWS:
* Windows操作系统 (当前设置)
* 适用:PC端开发测试,模拟器环境
* 优点:开发调试方便,工具链完善
*
* 嵌入式选择建议:
* - 学习阶段:LV_OS_NONE (裸机) 或 LV_OS_FREERTOS
* - 产品开发:LV_OS_FREERTOS (推荐) 或 LV_OS_CMSIS_RTOS2
* - 国产化项目:LV_OS_RTTHREAD
* - 复杂应用:考虑嵌入式Linux (LV_OS_PTHREAD)
*
* 注意事项:
* - 选择RTOS会增加内存占用和代码大小
* - 不同操作系统对硬件要求不同
* - 需要相应的BSP和驱动支持
*/
#define LV_USE_OS LV_OS_WINDOWS /**< 当前:Windows,适合PC开发环境 */
#if LV_USE_OS == LV_OS_CUSTOM
#define LV_OS_CUSTOM_INCLUDE <stdint.h>
#endif
#if LV_USE_OS == LV_OS_FREERTOS
/*
* Unblocking an RTOS task with a direct notification is 45% faster and uses less RAM
* than unblocking a task using an intermediary object such as a binary semaphore.
* RTOS task notifications can only be used when there is only one task that can be the recipient of the event.
*/
#define LV_USE_FREERTOS_TASK_NOTIFY 1
#endif
/*========================
* 渲染配置 (RENDERING CONFIGURATION)
*========================*/
/*
* 绘制缓冲区步长对齐 - 内存访问优化 ⚡
*
* 作用:强制所有图层和图像的行首地址按指定字节数对齐
* 目的:提高内存访问效率,优化DMA传输性能
*
* 嵌入式配置建议:
* - 1字节:无对齐要求,最大兼容性
* - 2字节:16位对齐,适合16位颜色深度
* - 4字节:32位对齐,适合32位颜色深度,推荐用于Cortex-M
* - 8字节:64位对齐,适合高性能处理器
*
* 性能影响:
* - 正确对齐:显著提高内存访问速度,减少CPU等待周期
* - 错误对齐:可能导致性能下降,部分MCU甚至触发硬件异常
*
* 硬件考虑:
* - Cortex-M0/M0+:建议4字节对齐
* - Cortex-M3/M4/M7:建议4-8字节对齐
* - DMA传输:需要根据DMA控制器要求设置
*/
#define LV_DRAW_BUF_STRIDE_ALIGN 1 /**< 当前:1字节对齐,最大兼容性 */
/*
* 绘制缓冲区地址对齐 - 内存访问优化 🎯
*
* 作用:强制绘制缓冲区起始地址按指定字节数对齐
* 目的:优化内存访问,提高缓存命中率
*
* 嵌入式配置建议:
* - 4字节:标准32位对齐,适合大多数ARM Cortex-M处理器
* - 8字节:64位对齐,适合Cortex-M7等高性能处理器
* - 16字节:缓存行对齐,适合有缓存的高性能MCU
*
* 性能优势:
* - 提高内存访问效率
* - 减少内存总线冲突
* - 优化DMA传输性能
* - 提高缓存利用率
*
* 注意事项:
* - 对齐要求越高,内存浪费可能越多
* - 需要确保内存池支持相应的对齐要求
*/
#define LV_DRAW_BUF_ALIGN 4 /**< 当前:4字节对齐,适合ARM Cortex-M */
/*
* 矩阵变换支持 - 高级图形功能 🔄
*
* 功能:启用3x3变换矩阵支持,实现复杂图形变换
* 应用:旋转、缩放、倾斜、透视等高级图形效果
*
* 前提条件:
* - 需要启用 LV_USE_MATRIX = 1
* - 渲染引擎需要支持3x3矩阵变换
*
* 嵌入式应用场景:
* - 仪表盘指针旋转
* - 图标动画缩放
* - 特殊UI效果(倾斜、透视)
* - 游戏界面元素变换
*
* 资源消耗:
* - CPU:需要浮点运算能力,建议使用带FPU的MCU
* - 内存:需要额外内存存储变换矩阵和中间结果
* - 代码:增加代码体积
*
* 性能考虑:
* - 不使用变换功能时建议禁用,节省资源
* - 低性能MCU上可能导致动画卡顿
* - 建议在Cortex-M4F/M7等高性能MCU上启用
*/
#define LV_DRAW_TRANSFORM_USE_MATRIX 0 /**< 当前:禁用,节省资源 */
/*
* 简单图层缓冲区大小 - 渲染性能优化 🎨
*
* 背景知识:
* 当控件具有透明度或非标准混合模式时,LVGL会先将其渲染到
* 临时缓冲区(图层),然后再合成到主屏幕
*
* 作用:设置简单图层分块渲染的目标缓冲区大小
* 目的:平衡内存使用和渲染性能
*
* 嵌入式配置建议:
* - 内存紧张设备:8-16KB,减少内存占用
* - 标准应用:24KB (当前设置),平衡性能和内存
* - 高性能设备:32-64KB,提升渲染性能
*
* 性能权衡:
* - 较小缓冲区:节省内存,但可能需要更多分块渲染
* - 较大缓冲区:提升渲染性能,但增加内存消耗
*
* 计算参考:
* - 800x480屏幕,32位色:全屏需要1.5MB
* - 24KB可渲染约 80x120 像素区域
* - 根据实际控件大小调整此值
*/
#define LV_DRAW_LAYER_SIMPLE_BUF_SIZE (24 * 1024) /**< [bytes] - 当前:24KB */
/*
* 图层最大内存限制 - 内存保护机制 🛡️
*
* 作用:限制简单图层和变换图层的最大内存分配
* 目的:防止复杂界面消耗过多内存,保护系统稳定性
*
* 配置建议:
* - 0:无限制 (当前设置),适合开发阶段
* - 32KB:适合简单应用,内存受限设备
* - 64KB:适合标准应用,平衡性能和内存
* - 128KB+:适合复杂应用,高性能设备
*
* 最小值要求:
* - 至少应 >= LV_DRAW_LAYER_SIMPLE_BUF_SIZE
* - 使用变换图层时,应能容纳最大控件
* - 计算公式:最大宽度 × 最大高度 × 颜色深度字节数
*
* 嵌入式应用:
* - 产品发布:建议设置合理限制,提高稳定性
* - 开发调试:可设置为0,观察实际内存使用
* - 内存保护:防止内存泄漏导致系统崩溃
*/
#define LV_DRAW_LAYER_MAX_MEMORY 0 /**< 当前:无限制,便于开发调试 */
/*
* 绘制线程栈大小 - 多线程渲染配置 🧵
*
* 作用:设置专用绘制线程的栈大小
* 适用:启用多线程渲染时的线程栈配置
*
* 配置建议:
* - 基础应用:4-8KB (当前设置)
* - 标准应用:8-16KB
* - 复杂应用:16-32KB
* - 启用FreeType/ThorVG:建议32KB+
*
* 栈空间用途:
* - 函数调用栈
* - 局部变量存储
* - 渲染过程中的临时数据
* - 字体渲染缓冲区
*
* 注意事项:
* - 栈太小可能导致栈溢出,系统崩溃
* - 栈太大浪费内存资源
* - 建议通过实际测试确定最佳值
* - 可使用栈分析工具监控栈使用情况
*
* 调试技巧:
* - 启用栈溢出检测
* - 在栈末尾填充魔数,检测溢出
* - 使用RTOS的栈监控功能
*/
#define LV_DRAW_THREAD_STACK_SIZE (8 * 1024) /**< [bytes] - 当前:8KB,适合标准应用 */
#define LV_USE_DRAW_SW 1
#if LV_USE_DRAW_SW == 1
/*
* 选择性禁用颜色格式支持以减少代码大小 🎨
*
* 注意:某些功能内部会使用特定的颜色格式,例如:
* - 渐变效果使用 RGB888 格式
* - 带透明度的位图可能使用 ARGB8888 格式
*
* 嵌入式优化建议:
* - 根据实际需求禁用不用的颜色格式,减少代码体积
* - 如果不使用渐变,可禁用 RGB888
* - 如果不使用透明度,可禁用 ARGB8888
*/
#define LV_DRAW_SW_SUPPORT_RGB565 1 // 16位RGB565格式 - 嵌入式最常用
#define LV_DRAW_SW_SUPPORT_RGB565A8 1 // RGB565 + 8位Alpha通道
#define LV_DRAW_SW_SUPPORT_RGB888 1 // 24位真彩色格式
#define LV_DRAW_SW_SUPPORT_XRGB8888 1 // 32位XRGB格式 (X表示保留位)
#define LV_DRAW_SW_SUPPORT_ARGB8888 1 // 32位ARGB格式 (带透明通道)
#define LV_DRAW_SW_SUPPORT_L8 1 // 8位灰度格式
#define LV_DRAW_SW_SUPPORT_AL88 1 // 8位Alpha + 8位亮度
#define LV_DRAW_SW_SUPPORT_A8 1 // 8位Alpha通道
#define LV_DRAW_SW_SUPPORT_I1 1 // 1位索引颜色格式
/*
* 索引颜色格式的亮度阈值 - 单色显示优化 ⚫
*
* 作用:在1位索引颜色格式中,将像素视为"激活"状态的亮度阈值
* 范围:0-255,默认127 (50%亮度)
*
* 应用场景:
* - 电子墨水屏显示优化
* - 单色OLED显示效果调整
* - 阈值分割算法
*
* 调整建议:
* - 阈值低:更多像素显示为"激活",显示效果更亮
* - 阈值高:更少像素显示为"激活",显示效果更暗
*/
#define LV_DRAW_SW_I1_LUM_THRESHOLD 127
/*
* 绘制单元数量 - 多线程渲染配置 🔄
*
* 作用:设置并行渲染的绘制单元数量
*
* 配置说明:
* - 1:单线程渲染,兼容性最好 (当前设置)
* - >1:多线程渲染,需要启用操作系统支持 (LV_USE_OS)
*
* 嵌入式应用:
* - 单核MCU:设置为1,避免线程切换开销
* - 双核MCU:可设置为2,利用多核性能
* - 高性能多核:可设置更高值
*
* 性能考虑:
* - 多线程可能提升渲染性能,但增加内存占用
* - 线程间同步可能有开销
* - 建议通过实际测试确定最佳值
*/
#define LV_DRAW_SW_DRAW_UNIT_CNT 1 /**< 当前:单线程渲染 */
/*
* Arm-2D硬件加速支持 - ARM处理器专用 🚀
*
* 功能:使用Arm-2D库加速软件渲染
* 适用:ARM Cortex-M系列处理器
*
* Arm-2D优势:
* - 优化的2D图形算法
* - 利用ARM处理器特性
* - 减少CPU占用率
* - 提升渲染性能
*
* 系统要求:
* - ARM Cortex-M23/M33/M55/M85等处理器
* - 需要Arm-2D库支持
* - 可能需要特定的编译器支持
*
* 使用建议:
* - 目标硬件支持Arm-2D时启用
* - 不支持时保持禁用,避免编译错误
*/
#define LV_USE_DRAW_ARM2D_SYNC 0 /**< 当前:禁用,需要Arm-2D支持 */
/*
* 原生Helium汇编支持 - ARM处理器高级优化 ⚡
*
* 功能:启用ARM Helium技术的原生汇编代码编译
* 适用:支持Helium技术的ARM处理器
*
* Helium技术优势:
* - ARM的M-Profile向量扩展
* - 优化的DSP和机器学习指令
* - 显著提升计算密集型任务性能
* - 特别适合图形处理和信号处理
*
* 支持的处理器:
* - ARM Cortex-M55 (第一款支持Helium的处理器)
* - ARM Cortex-M85
* - 后续支持Helium的Cortex-M处理器
*
* 使用注意:
* - 需要支持Helium的ARM处理器
* - 需要特定的工具链支持
* - 不支持的处理器启用可能导致编译错误
*/
#define LV_USE_NATIVE_HELIUM_ASM 0 /**< 当前:禁用,需要Helium支持 */
/*
* 复杂渲染器支持 - 高级图形效果开关 ✨
*
* 渲染器类型选择:
* - 0:简单渲染器 (基础功能)
* 支持功能:简单矩形、渐变、图像、文本、直线
* 资源占用:少,性能好
* 适用:基础UI界面,嵌入式设备
*
* - 1:复杂渲染器 (高级功能) - 当前设置
* 支持功能:圆角、阴影、斜线、圆弧、复杂形状
* 资源占用:较多,功能丰富
* 适用:现代UI设计,复杂界面效果
*
* 嵌入式选择建议:
* - 资源受限设备:选择简单渲染器 (0)
* - 标准应用:选择复杂渲染器 (1)
* - 性能优先:根据目标MCU性能选择
*
* 性能影响:
* - 复杂渲染器会增加CPU和内存开销
* - 圆角、阴影等效果需要更多计算资源
* - 建议在实际硬件上测试性能表现
*/
#define LV_DRAW_SW_COMPLEX 1 /**< 当前:启用复杂渲染器 */
#if LV_DRAW_SW_COMPLEX == 1
/*
* 阴影计算缓存 - 渲染性能优化 🌑
*
* 功能:缓存阴影计算结果,避免重复计算
* 阴影尺寸计算:shadow_width + radius (阴影宽度 + 模糊半径)
* 内存消耗:缓存大小的平方 (LV_DRAW_SW_SHADOW_CACHE_SIZE^2) 字节
*
* 配置建议:
* - 0:禁用缓存,节省内存,每次实时计算 (当前设置)
* - 1-4:小缓存,适合简单阴影效果
* - 5-8:中等缓存,适合一般应用
* - 9+:大缓存,适合复杂阴影效果
*
* 性能权衡:
* - 缓存大小:影响内存占用和缓存命中率
* - 内存消耗:呈平方增长,需谨慎设置
* - 性能提升:显著减少重复计算
*
* 嵌入式应用:
* - 内存受限:设置为0,禁用缓存
* - 一般应用:设置2-4,平衡性能和内存
* - 高性能要求:设置更大值,但需要充足内存
*/
#define LV_DRAW_SW_SHADOW_CACHE_SIZE 0 /**< 当前:禁用缓存,节省内存 */
/*
* 圆形数据缓存 - 抗锯齿性能优化 ⭕
*
* 功能:缓存1/4圆周的像素数据用于抗锯齿渲染
* 内存消耗:每个圆半径使用 radius * 4 字节
* 缓存策略:保存最常使用的圆半径数据
*
* 配置说明:
* - 0:禁用缓存,节省内存,但渲染速度慢
* - 1-2:最小缓存,适合简单界面
* - 3-4:小缓存,适合一般应用 (当前设置)
* - 5-8:中等缓存,适合复杂界面
* - 9+:大缓存,适合图形密集应用
*
* 应用场景:
* - 圆角按钮和容器
* - 圆形进度条
* - 圆形图标和指示器
* - 仪表盘界面
*
* 性能影响:
* - 缓存可以显著提升圆形元素渲染速度
* - 特别是需要重复渲染相同半径圆形的场景
* - 建议根据界面中圆形元素的半径范围设置
*/
#define LV_DRAW_SW_CIRCLE_CACHE_SIZE 4 /**< 当前:缓存4个常用半径 */
#endif
/*
* 软件绘制汇编优化 - 处理器特定加速 ⚡
*
* 作用:启用特定处理器的汇编优化代码,提升软件渲染性能
*
* 可选优化级别:
* - LV_DRAW_SW_ASM_NONE:不使用汇编优化 (当前设置)
* - LV_DRAW_SW_ASM_NEON:ARM NEON SIMD指令集优化
* - LV_DRAW_SW_ASM_CUSTOM:自定义汇编优化
*
* ARM NEON优化:
* - 适用:ARM Cortex-A系列处理器,部分Cortex-M处理器
* - 优势:并行处理多个像素,显著提升渲染性能
* - 应用:图像处理、颜色转换、像素操作
*
* 嵌入式选择建议:
* - ARM Cortex-M:通常使用LV_DRAW_SW_ASM_NONE
* - ARM Cortex-A:考虑使用NEON优化
* - 自定义平台:使用LV_DRAW_SW_ASM_CUSTOM
*
* 注意事项:
* - 需要处理器支持相应的指令集
* - 需要编译器支持相应的汇编语法
* - 不支持的指令集可能导致运行时错误
*/
#define LV_USE_DRAW_SW_ASM LV_DRAW_SW_ASM_NONE /**< 当前:不使用汇编优化 */
#if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_CUSTOM
/*
* 自定义汇编优化头文件 - 高级用户配置 🔧
*
* 作用:指定包含自定义汇编优化实现的头文件路径
* 适用场景:特定平台的优化实现,第三方优化库
*/
#define LV_DRAW_SW_ASM_CUSTOM_INCLUDE "" /**< 空字符串表示无自定义包含 */
#endif
/*
* 复杂渐变支持 - 高级视觉效果 🌈
*
* 功能:在软件渲染中启用复杂渐变效果
*
* 支持的渐变类型:
* - 线性渐变(任意角度):支持任意角度的颜色线性过渡
* - 径向渐变:从中心向外的圆形渐变
* - 锥形渐变:围绕中心的扇形渐变
*
* 应用场景:
* - 现代化UI背景设计
* - 按钮和控件的立体效果
* - 进度条的动态效果
* - 仪表盘和指示器
*
* 性能考虑:
* - 复杂渐变需要大量计算,影响渲染性能
* - 内存消耗:渐变计算需要额外缓冲区
* - CPU占用:特别是在低端MCU上可能明显
*
* 嵌入式配置建议:
* - 基础应用:禁用 (0),节省资源
* - 现代UI:启用 (1),提升视觉效果
* - 性能优先:根据目标硬件性能决定
* - 移动设备:建议启用,提升用户体验
*/
#define LV_USE_DRAW_SW_COMPLEX_GRADIENTS 0 /**< 当前:禁用,节省性能 */
#endif
/*
* TSi (Think Silicon) NemaGFX GPU 硬件加速 🚀
*
* 功能:启用Think Silicon公司的NemaGFX图形处理单元加速
* 适用:集成NemaGFX GPU的嵌入式平台
*
* NemaGFX优势:
* - 专为嵌入式设计的低功耗GPU
* - 优化的2D图形处理性能
* - 支持复杂的图形效果
* - 显著减轻CPU负担
*
* 应用场景:
* - 高端嵌入式设备
* - 可穿戴设备
* - 工业控制面板
* - 汽车电子
*
* 注意:需要相应硬件平台支持
*/
#define LV_USE_NEMA_GFX 0 /**< 当前:禁用,需要NemaGFX硬件 */
#if LV_USE_NEMA_GFX
/*
* NemaGFX HAL选择 - 硬件抽象层配置 🔧
*
* 可选HAL实现:
* - LV_NEMA_HAL_CUSTOM:自定义HAL实现
* - LV_NEMA_HAL_STM32 */
#define LV_USE_NEMA_HAL LV_NEMA_HAL_CUSTOM
#if LV_USE_NEMA_HAL == LV_NEMA_HAL_STM32
#define LV_NEMA_STM32_HAL_INCLUDE <stm32u5xx_hal.h>
#endif
/*
* 向量图形操作 - NemaVG支持 ✏️
*
* 功能:启用NemaVG库的向量图形处理能力
* 前提:需要NemaVG库支持
*
* 向量图形优势:
* - 无损缩放:任意大小下保持清晰
* - 内存效率:相比位图占用更少存储
* - 动画效果:平滑的缩放和旋转
* - 现代UI:支持现代扁平化设计
*
* 应用场景:
* - SVG图标显示
* - 可缩放的UI元素
* - 动态图形效果
* - 高分辨率显示
*/
#define LV_USE_NEMA_VG 0 /**< 当前:禁用,需要NemaVG库 */
#if LV_USE_NEMA_VG
/*
* VG相关缓冲区分配的分辨率定义 📐
*
* 作用:定义VG操作所需缓冲区的最大分辨率
* 影响:直接影响内存分配大小
*
* 内存计算:
* - 内存占用与分辨率成正比
* - 需要考虑颜色深度影响
* - 预留额外空间避免溢出
*
* 配置建议:
* - 根据实际显示屏分辨率设置
* - 考虑未来可能的分辨率升级
* - 预留20-30%缓冲空间
*/
#define LV_NEMA_GFX_MAX_RESX 800 /**< 最大X轴分辨率 - 适合大多数嵌入式屏 */
#define LV_NEMA_GFX_MAX_RESY 600 /**< 最大Y轴分辨率 - 7寸屏标准 */
#endif
#endif
/*
* NXP VG-Lite GPU硬件加速 - i.MX RT平台专用 🎨
*
* 功能:启用NXP公司的VG-Lite图形处理单元
* 适用:NXP i.MX RT系列处理器
*
* VG-Lite特性:
* - 2D图形加速硬件
* - OpenVG API支持
* - 低功耗设计
* - 优化的图形管线
*
* 支持的平台:
* - i.MX RT500系列
* - i.MX RT600系列
* - 其他支持VG-Lite的i.MX RT处理器
*
* 性能优势:
* - 显著提升2D图形性能
* - 减轻CPU负担
* - 支持复杂图形效果
* - 适合GUI密集应用
*/
#define LV_USE_DRAW_VGLITE 0 /**< 当前:禁用,需要VG-Lite硬件 */
#if LV_USE_DRAW_VGLITE
/*
* VG-Lite blit质量降级解决方案 🔧
*
* 作用:启用针对大尺寸屏幕的blit质量降级解决方案
* 适用:屏幕尺寸 > 352像素的情况
*
* 问题描述:
* 在大尺寸屏幕上,VG-Lite的blit操作可能出现质量问题
* 这是VG-Lite硬件的已知限制
*
* 解决方案:
* 将大的blit操作分割为多个小块操作
* 虽然会增加一些开销,但能保证质量
*
* 使用建议:
* - 屏幕尺寸 > 352像素时建议启用
* - 小尺寸屏幕可以禁用以提升性能
*/
#define LV_USE_VGLITE_BLIT_SPLIT 0 /**< 当前:禁用,根据屏幕大小决定 */
#if LV_USE_OS
/*
* VG-Lite专用绘制线程 - 多线程优化 🧵
*
* 功能:为VG-Lite处理创建专用的绘制线程
* 前提:需要启用操作系统支持 (LV_USE_OS)
*
* 多线程优势:
* - 并行处理,提升整体性能
* - 主线程不被图形操作阻塞
* - 更好的响应性
* - 充分利用多核处理器
*
* 系统要求:
* - 支持多线程的操作系统
* - 足够的内存空间
* - 合理的线程优先级配置
*/
#define LV_USE_VGLITE_DRAW_THREAD 1 /**< 当前:启用,多线程处理 */
#if LV_USE_VGLITE_DRAW_THREAD
/*
* VG-Lite异步绘制 - 高级性能优化 ⚡
*
* 功能:启用VG-Lite的异步绘制模式
* 原理:将多个绘制任务排队,一次性提交给GPU
*
* 异步绘制优势:
* - 减少GPU-CPU通信次数
* - 提升整体渲染效率
* - 更好的GPU利用率
* - 降低系统延迟
*
* 性能考虑:
* - 适合批量绘制操作
* - 可以显著提升复杂界面的性能
* - 需要合理的任务队列管理
*/
#define LV_USE_VGLITE_DRAW_ASYNC 1 /**< 当前:启用,异步处理提升性能 */
#endif
#endif
/*
* VG-Lite断言检查 - 调试支持 🐛
*
* 功能:启用VG-Lite的断言检查
* 作用:开发阶段帮助发现VG-Lite相关问题
*
* 使用建议:
* - 开发调试阶段:启用 (1),便于问题定位
* - 性能测试阶段:可选择启用
* - 产品发布阶段:禁用 (0),减少开销
*
* 调试价值:
* - 检测VG-Lite API调用错误
* - 验证参数有效性
* - 提供详细的错误信息
*/
#define LV_USE_VGLITE_ASSERT 0 /**< 当前:禁用,减少运行时开销 */
#endif
/*
* NXP PXP硬件加速 - i.MX RT平台专用 🖼️
*
* 功能:启用NXP公司的PXP (Pixel Pipeline) 图像处理引擎
* 适用:NXP i.MX RT系列处理器
*
* PXP特性:
* - 硬件图像处理管道
* - 支持图像缩放、旋转、色彩空间转换
* - Alpha混合支持
* - 低功耗设计
*
* 支持的操作:
* - 图像blit(块传输)
* - 色彩空间转换
* - 图像缩放
* - 旋转操作
* - Alpha混合
*/
#define LV_USE_PXP 0 /**< 当前:禁用,需要PXP硬件 */
#if LV_USE_PXP
/*
* PXP绘制支持 - 基础绘制功能 ✏️
*
* 功能:使用PXP进行基础绘制操作
* 作用:将绘制任务从CPU转移到PXP硬件
*
* 性能优势:
* - 减轻CPU负担
* - 提升绘制性能
* - 支持硬件加速的图像操作
* - 并行处理能力
*/
#define LV_USE_DRAW_PXP 1 /**< 当前:启用PXP绘制 */
/*
* PXP显示旋转 - 硬件旋转功能 🔄
*
* 功能:使用PXP硬件进行显示旋转
* 优势:相比软件旋转,性能显著提升
*
* 支持的旋转角度:
* - 0度:正常显示
* - 90度:顺时针旋转90度
* - 180度:旋转180度
* - 270度:顺时针旋转270度
*
* 应用场景:
* - 横屏/竖屏切换
* - 适应不同安装方向
* - 优化显示屏布局
*
* 性能考虑:
* - 硬件旋转比软件旋转快很多
* - 但会占用PXP资源
* - 需要考虑与其他PXP操作的协调
*/
#define LV_USE_ROTATE_PXP 0 /**< 当前:禁用,根据需求启用 */
#if LV_USE_DRAW_PXP && LV_USE_OS
/*
* PXP专用绘制线程 - 多线程优化 🧵
*
* 功能:为PXP处理创建专用的绘制线程
* 前提:需要启用PXP绘制支持和操作系统
*
* 多线程优势:
* - 并行处理,不阻塞主线程
* - 更好的系统响应性
* - 充分利用硬件资源
* - 适合复杂图形应用
*/
#define LV_USE_PXP_DRAW_THREAD 1 /**< 当前:启用,多线程处理 */
#endif
/*
* PXP断言检查 - 调试支持 🐛
*
* 功能:启用PXP的断言检查
* 作用:开发阶段帮助发现PXP相关问题
*
* 使用建议:
* - 开发阶段:启用,便于调试
* - 测试阶段:根据需要启用
* - 发布阶段:禁用,减少开销
*/
#define LV_USE_PXP_ASSERT 0 /**< 当前:禁用,减少运行时开销 */
#endif
/** Use NXP's G2D on MPU platforms. */
#define LV_USE_DRAW_G2D 0
#if LV_USE_DRAW_G2D
/** Maximum number of buffers that can be stored for G2D draw unit.
* Includes the frame buffers and assets. */
#define LV_G2D_HASH_TABLE_SIZE 50
#if LV_USE_OS
/** Use additional draw thread for G2D processing.*/
#define LV_USE_G2D_DRAW_THREAD 1
#endif
/** Enable G2D asserts. */
#define LV_USE_G2D_ASSERT 0
#endif
/** Use Renesas Dave2D on RA platforms. */
#define LV_USE_DRAW_DAVE2D 0
/** Draw using cached SDL textures*/
#define LV_USE_DRAW_SDL 0
/** Use VG-Lite GPU. */
#define LV_USE_DRAW_VG_LITE 0
#if LV_USE_DRAW_VG_LITE
/** Enable VG-Lite custom external 'gpu_init()' function */
#define LV_VG_LITE_USE_GPU_INIT 0
/** Enable VG-Lite assert. */
#define LV_VG_LITE_USE_ASSERT 0
/** VG-Lite flush commit trigger threshold. GPU will try to batch these many draw tasks. */
#define LV_VG_LITE_FLUSH_MAX_COUNT 8
/** Enable border to simulate shadow.
* NOTE: which usually improves performance,
* but does not guarantee the same rendering quality as the software. */
#define LV_VG_LITE_USE_BOX_SHADOW 0
/** VG-Lite gradient maximum cache number.
* @note The memory usage of a single gradient image is 4K bytes. */
#define LV_VG_LITE_GRAD_CACHE_CNT 32
/** VG-Lite stroke maximum cache number. */
#define LV_VG_LITE_STROKE_CACHE_CNT 32
#endif
/** Accelerate blends, fills, etc. with STM32 DMA2D */
#define LV_USE_DRAW_DMA2D 0
#if LV_USE_DRAW_DMA2D
#define LV_DRAW_DMA2D_HAL_INCLUDE "stm32h7xx_hal.h"
/* if enabled, the user is required to call `lv_draw_dma2d_transfer_complete_interrupt_handler`
* upon receiving the DMA2D global interrupt
*/
#define LV_USE_DRAW_DMA2D_INTERRUPT 0
#endif
/** Draw using cached OpenGLES textures */
#define LV_USE_DRAW_OPENGLES 0
/*=======================
* FEATURE CONFIGURATION
*=======================*/
/*-------------
* Logging
*-----------*/
/** Enable log module */
#define LV_USE_LOG 1
#if LV_USE_LOG
/** Set value to one of the following levels of logging detail:
* - LV_LOG_LEVEL_TRACE Log 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 Log only critical issues, when system may fail.
* - LV_LOG_LEVEL_USER Log only custom log messages added by the user.
* - LV_LOG_LEVEL_NONE Do not log anything. */
#define LV_LOG_LEVEL LV_LOG_LEVEL_WARN
/** - 1: Print log with 'printf';
* - 0: User needs to register a callback with `lv_log_register_print_cb()`. */
#define LV_LOG_PRINTF 1
/** Set callback to print logs.
* E.g `my_print`. The prototype should be `void my_print(lv_log_level_t level, const char * buf)`.
* Can be overwritten by `lv_log_register_print_cb`. */
//#define LV_LOG_PRINT_CB
/** - 1: Enable printing timestamp;
* - 0: Disable printing timestamp. */
#define LV_LOG_USE_TIMESTAMP 1
/** - 1: Print file and line number of the log;
* - 0: Do not print file and line number of the log. */
#define LV_LOG_USE_FILE_LINE 1
/* Enable/disable LV_LOG_TRACE in modules that produces a huge number of logs. */
#define LV_LOG_TRACE_MEM 1 /**< Enable/disable trace logs in memory operations. */
#define LV_LOG_TRACE_TIMER 1 /**< Enable/disable trace logs in timer operations. */
#define LV_LOG_TRACE_INDEV 1 /**< Enable/disable trace logs in input device operations. */
#define LV_LOG_TRACE_DISP_REFR 1 /**< Enable/disable trace logs in display re-draw operations. */
#define LV_LOG_TRACE_EVENT 1 /**< Enable/disable trace logs in event dispatch logic. */
#define LV_LOG_TRACE_OBJ_CREATE 1 /**< Enable/disable trace logs in object creation (core `obj` creation plus every widget). */
#define LV_LOG_TRACE_LAYOUT 1 /**< Enable/disable trace logs in flex- and grid-layout operations. */
#define LV_LOG_TRACE_ANIM 1 /**< Enable/disable trace logs in animation logic. */
#define LV_LOG_TRACE_CACHE 1 /**< Enable/disable trace logs in cache operations. */
#endif /*LV_USE_LOG*/
/*-------------
* Asserts
*-----------*/
/* Enable assertion failures if an operation fails or 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 MCU. */
#define LV_ASSERT_HANDLER_INCLUDE <stdint.h>
#define LV_ASSERT_HANDLER while(1); /**< Halt by default */
/*-------------
* Debug
*-----------*/
/** 1: Draw random colored rectangles over the redrawn areas. */
#define LV_USE_REFR_DEBUG 0
/** 1: Draw a red overlay for ARGB layers and a green overlay for RGB layers*/
#define LV_USE_LAYER_DEBUG 0
/** 1: Adds the following behaviors for debugging:
* - Draw overlays with different colors for each draw_unit's tasks.
* - Draw index number of draw unit on white background.
* - For layers, draws index number of draw unit on black background. */
#define LV_USE_PARALLEL_DRAW_DEBUG 0
/*-------------
* Others
*-----------*/
#define LV_ENABLE_GLOBAL_CUSTOM 0
#if LV_ENABLE_GLOBAL_CUSTOM
/** Header to include for custom 'lv_global' function" */
#define LV_GLOBAL_CUSTOM_INCLUDE <stdint.h>
#endif
/** Default cache size in bytes.
* Used by image decoders such as `lv_lodepng` to keep the decoded image in memory.
* If size is not set to 0, the decoder will fail to decode when the cache is full.
* If size is 0, the cache function is not enabled and the decoded memory will be
* released immediately after use. */
#define LV_CACHE_DEF_SIZE 0
/** Default number of image header cache entries. The cache is used to store the headers of images
* The main logic is like `LV_CACHE_DEF_SIZE` but for image headers. */
#define LV_IMAGE_HEADER_CACHE_DEF_CNT 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
/** 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
/** Add 2 x 32-bit variables to each `lv_obj_t` to speed up getting style properties */
#define LV_OBJ_STYLE_CACHE 0
/** Add `id` field to `lv_obj_t` */
#define LV_USE_OBJ_ID 0
/** Enable support widget names*/
#define LV_USE_OBJ_NAME 0
/** Automatically assign an ID when obj is created */
#define LV_OBJ_ID_AUTO_ASSIGN LV_USE_OBJ_ID
/** Use builtin obj ID handler functions:
* - lv_obj_assign_id: Called when a widget is created. Use a separate counter for each widget class as an ID.
* - lv_obj_id_compare: Compare the ID to decide if it matches with a requested value.
* - lv_obj_stringify_id: Return string-ified identifier, e.g. "button3".
* - lv_obj_free_id: Does nothing, as there is no memory allocation for the ID.
* When disabled these functions needs to be implemented by the user.*/
#define LV_USE_OBJ_ID_BUILTIN 1
/** Use obj property set/get API. */
#define LV_USE_OBJ_PROPERTY 0
/** Enable property name support. */
#define LV_USE_OBJ_PROPERTY_NAME 1
/* Use VG-Lite Simulator.
* - Requires: LV_USE_THORVG_INTERNAL or LV_USE_THORVG_EXTERNAL */
#define LV_USE_VG_LITE_THORVG 0
#if LV_USE_VG_LITE_THORVG
/** Enable LVGL's blend mode support */
#define LV_VG_LITE_THORVG_LVGL_BLEND_SUPPORT 0
/** Enable YUV color format support */
#define LV_VG_LITE_THORVG_YUV_SUPPORT 0
/** Enable Linear gradient extension support */
#define LV_VG_LITE_THORVG_LINEAR_GRADIENT_EXT_SUPPORT 0
/** Enable alignment on 16 pixels */
#define LV_VG_LITE_THORVG_16PIXELS_ALIGN 1
/** Buffer address alignment */
#define LV_VG_LITE_THORVG_BUF_ADDR_ALIGN 64
/** Enable multi-thread render */
#define LV_VG_LITE_THORVG_THREAD_RENDER 0
#endif
/* Enable the multi-touch gesture recognition feature */
/* Gesture recognition requires the use of floats */
#define LV_USE_GESTURE_RECOGNITION 0
/*=====================
* COMPILER SETTINGS
*====================*/
/** For big endian systems set to 1 */
#define LV_BIG_ENDIAN_SYSTEM 0
/** Define a custom attribute for `lv_tick_inc` function */
#define LV_ATTRIBUTE_TICK_INC
/** Define a custom attribute for `lv_timer_handler` function */
#define LV_ATTRIBUTE_TIMER_HANDLER
/** Define a custom attribute for `lv_display_flush_ready` function */
#define LV_ATTRIBUTE_FLUSH_READY
/** Align VG_LITE buffers on this number of bytes.
* @note vglite_src_buf_aligned() uses this value to validate alignment of passed buffer pointers. */
#define LV_ATTRIBUTE_MEM_ALIGN_SIZE 1
/** Will be added where memory 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 to mark large constant arrays, for example for font bitmaps */
#define LV_ATTRIBUTE_LARGE_CONST
/** Compiler prefix for a large 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
/** 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 */
/** Prefix all global extern data with this */
#define LV_ATTRIBUTE_EXTERN_DATA
/** Use `float` as `lv_value_precise_t` */
#define LV_USE_FLOAT 0
/** Enable matrix support
* - Requires `LV_USE_FLOAT = 1` */
#define LV_USE_MATRIX 0
/** Include `lvgl_private.h` in `lvgl.h` to access internal data and functions by default */
#define LV_USE_PRIVATE_API 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 1
#define LV_FONT_MONTSERRAT_22 0
#define LV_FONT_MONTSERRAT_24 1
#define LV_FONT_MONTSERRAT_26 1
#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_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_14_CJK 0 /**< 1000 most common CJK radicals */
#define LV_FONT_SIMSUN_16_CJK 0 /**< 1000 most common CJK radicals */
/** Pixel perfect monospaced fonts */
#define LV_FONT_UNSCII_8 0
#define LV_FONT_UNSCII_16 0
/** Optionally declare custom fonts here.
*
* You can use any of these fonts as the default font too and they will be available
* globally. Example:
*
* @code
* #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) LV_FONT_DECLARE(my_font_2)
* @endcode
*/
#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.
* A 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 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
/** While rendering text strings, break (wrap) text 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
/** Support bidirectional text. Allows mixing Left-to-Right and Right-to-Left text.
* 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 text 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 another form based on their position in the text */
#define LV_USE_ARABIC_PERSIAN_CHARS 0
/*The control character to use for signaling text recoloring*/
#define LV_TXT_COLOR_CMD "#"
/*==================
* WIDGETS
*================*/
/* Documentation for widgets can be found here: https://docs.lvgl.io/master/details/widgets/index.html . */
/** 1: Causes these widgets to be given default values at creation time.
* - lv_buttonmatrix_t: Get default maps: {"Btn1", "Btn2", "Btn3", "\n", "Btn4", "Btn5", ""}, else map not set.
* - lv_checkbox_t : String label set to "Check box", else set to empty string.
* - lv_dropdown_t : Options set to "Option 1", "Option 2", "Option 3", else no values are set.
* - lv_roller_t : Options set to "Option 1", "Option 2", "Option 3", "Option 4", "Option 5", else no values are set.
* - lv_label_t : Text set to "Text", else empty string.
* */
#define LV_WIDGETS_HAS_DEFAULT_VALUE 1
#define LV_USE_ANIMIMG 1
#define LV_USE_ARC 1
#define LV_USE_BAR 1
#define LV_USE_BUTTON 1
#define LV_USE_BUTTONMATRIX 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
#define LV_USE_CALENDAR_CHINESE 0
#endif /*LV_USE_CALENDAR*/
#define LV_USE_CANVAS 1
#define LV_USE_CHART 1
#define LV_USE_CHECKBOX 1
#define LV_USE_DROPDOWN 1 /**< Requires: lv_label */
#define LV_USE_IMAGE 1 /**< Requires: lv_label */
#define LV_USE_IMAGEBUTTON 1
#define LV_USE_KEYBOARD 1
#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 text */
#define LV_LABEL_WAIT_CHAR_COUNT 3 /**< The count of wait chart */
#endif
#define LV_USE_LED 1
#define LV_USE_LINE 1
#define LV_USE_LIST 1
#define LV_USE_LOTTIE 0 /**< Requires: lv_canvas, thorvg */
#define LV_USE_MENU 1
#define LV_USE_MSGBOX 1
#define LV_USE_ROLLER 1 /**< Requires: lv_label */
#define LV_USE_SCALE 1
#define LV_USE_SLIDER 1 /**< Requires: lv_bar */
#define LV_USE_SPAN 1
#if LV_USE_SPAN
/** A line of text can contain this maximum number of span descriptors. */
#define LV_SPAN_SNIPPET_STACK_SIZE 64
#endif
#define LV_USE_SPINBOX 1
#define LV_USE_SPINNER 1
#define LV_USE_SWITCH 1
#define LV_USE_TABLE 1
#define LV_USE_TABVIEW 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_TILEVIEW 1
#define LV_USE_WIN 1
/*==================
* THEMES
*==================*/
/* Documentation for themes can be found here: https://docs.lvgl.io/master/details/common-widget-features/styles/style.html#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_SIMPLE 1
/** A theme designed for monochrome displays */
#define LV_USE_THEME_MONO 1
/*==================
* LAYOUTS
*==================*/
/* Documentation for layouts can be found here: https://docs.lvgl.io/master/details/common-widget-features/layouts/index.html . */
/** A layout similar to Flexbox in CSS. */
#define LV_USE_FLEX 1
/** A layout similar to Grid in CSS. */
#define LV_USE_GRID 1
/*====================
* 3RD PARTS LIBRARIES
*====================*/
/* Documentation for libraries can be found here: https://docs.lvgl.io/master/details/libs/index.html . */
/* File system interfaces for common APIs */
/** Setting a default driver letter allows skipping the driver prefix in filepaths.
* Documentation about how to use the below driver-identifier letters can be found at
* https://docs.lvgl.io/master/details/main-modules/fs.html#lv-fs-identifier-letters . */
#define LV_FS_DEFAULT_DRIVER_LETTER '\0'
/** API for fopen, fread, etc. */
#define LV_USE_FS_STDIO 0
#if LV_USE_FS_STDIO
#define LV_FS_STDIO_LETTER '\0' /**< Set an upper-case driver-identifier letter for this driver (e.g. 'A'). */
#define LV_FS_STDIO_PATH "" /**< Set the working directory. File/directory paths will be appended to it. */
#define LV_FS_STDIO_CACHE_SIZE 0 /**< >0 to cache this number of bytes in lv_fs_read() */
#endif
/** API for open, read, etc. */
#define LV_USE_FS_POSIX 0
#if LV_USE_FS_POSIX
#define LV_FS_POSIX_LETTER '\0' /**< Set an upper-case driver-identifier letter for this driver (e.g. 'A'). */
#define LV_FS_POSIX_PATH "" /**< Set the working directory. File/directory paths will be appended to it. */
#define LV_FS_POSIX_CACHE_SIZE 0 /**< >0 to cache this number of bytes in lv_fs_read() */
#endif
/** API for CreateFile, ReadFile, etc. */
#define LV_USE_FS_WIN32 1
#if LV_USE_FS_WIN32
#define LV_FS_WIN32_LETTER 'C' /**< Set an upper-case driver-identifier letter for this driver (e.g. 'A'). */
#define LV_FS_WIN32_PATH "" /**< Set the working directory. File/directory paths will be appended to it. */
#define LV_FS_WIN32_CACHE_SIZE 0 /**< >0 to cache this number of bytes in lv_fs_read() */
#endif
/** API for FATFS (needs to be added separately). Uses f_open, f_read, etc. */
#define LV_USE_FS_FATFS 0
#if LV_USE_FS_FATFS
#define LV_FS_FATFS_LETTER '\0' /**< Set an upper-case driver-identifier letter for this driver (e.g. 'A'). */
#define LV_FS_FATFS_PATH "" /**< Set the working directory. File/directory paths will be appended to it. */
#define LV_FS_FATFS_CACHE_SIZE 0 /**< >0 to cache this number of bytes in lv_fs_read() */
#endif
/** API for memory-mapped file access. */
#define LV_USE_FS_MEMFS 0
#if LV_USE_FS_MEMFS
#define LV_FS_MEMFS_LETTER '\0' /**< Set an upper-case driver-identifier letter for this driver (e.g. 'A'). */
#endif
/** API for LittleFs. */
#define LV_USE_FS_LITTLEFS 0
#if LV_USE_FS_LITTLEFS
#define LV_FS_LITTLEFS_LETTER '\0' /**< Set an upper-case driver-identifier letter for this driver (e.g. 'A'). */
#define LV_FS_LITTLEFS_PATH "" /**< Set the working directory. File/directory paths will be appended to it. */
#endif
/** API for Arduino LittleFs. */
#define LV_USE_FS_ARDUINO_ESP_LITTLEFS 0
#if LV_USE_FS_ARDUINO_ESP_LITTLEFS
#define LV_FS_ARDUINO_ESP_LITTLEFS_LETTER '\0' /**< Set an upper-case driver-identifier letter for this driver (e.g. 'A'). */
#define LV_FS_ARDUINO_ESP_LITTLEFS_PATH "" /**< Set the working directory. File/directory paths will be appended to it. */
#endif
/** API for Arduino Sd. */
#define LV_USE_FS_ARDUINO_SD 0
#if LV_USE_FS_ARDUINO_SD
#define LV_FS_ARDUINO_SD_LETTER '\0' /**< Set an upper-case driver-identifier letter for this driver (e.g. 'A'). */
#define LV_FS_ARDUINO_SD_PATH "" /**< Set the working directory. File/directory paths will be appended to it. */
#endif
/** API for UEFI */
#define LV_USE_FS_UEFI 0
#if LV_USE_FS_UEFI
#define LV_FS_UEFI_LETTER '\0' /**< Set an upper-case driver-identifier letter for this driver (e.g. 'A'). */
#endif
/** LODEPNG decoder library */
#define LV_USE_LODEPNG 0
/** PNG decoder(libpng) library */
#define LV_USE_LIBPNG 0
/** BMP decoder library */
#define LV_USE_BMP 0
/** JPG + split JPG decoder library.
* Split JPG is a custom format optimized for embedded systems. */
#define LV_USE_TJPGD 0
/** libjpeg-turbo decoder library.
* - Supports complete JPEG specifications and high-performance JPEG decoding. */
#define LV_USE_LIBJPEG_TURBO 0
/** GIF decoder library */
#define LV_USE_GIF 0
#if LV_USE_GIF
/** GIF decoder accelerate */
#define LV_GIF_CACHE_DECODE_DATA 0
#endif
/** Decode bin images to RAM */
#define LV_BIN_DECODER_RAM_LOAD 0
/** RLE decompress library */
#define LV_USE_RLE 0
/** QR code library */
#define LV_USE_QRCODE 0
/** Barcode code library */
#define LV_USE_BARCODE 0
/** FreeType library */
#define LV_USE_FREETYPE 0
#if LV_USE_FREETYPE
/** Let FreeType use LVGL memory and file porting */
#define LV_FREETYPE_USE_LVGL_PORT 0
/** Cache count of glyphs in FreeType, i.e. number of glyphs that can be cached.
* The higher the value, the more memory will be used. */
#define LV_FREETYPE_CACHE_FT_GLYPH_CNT 256
#endif
/** Built-in TTF decoder */
#define LV_USE_TINY_TTF 0
#if LV_USE_TINY_TTF
/* Enable loading TTF data from files */
#define LV_TINY_TTF_FILE_SUPPORT 0
#define LV_TINY_TTF_CACHE_GLYPH_CNT 256
#endif
/** Rlottie library */
#define LV_USE_RLOTTIE 0
/** Enable Vector Graphic APIs
* - Requires `LV_USE_MATRIX = 1` */
#define LV_USE_VECTOR_GRAPHIC 0
/** Enable ThorVG (vector graphics library) from the src/libs folder */
#define LV_USE_THORVG_INTERNAL 0
/** Enable ThorVG by assuming that its installed and linked to the project */
#define LV_USE_THORVG_EXTERNAL 0
/** Use lvgl built-in LZ4 lib */
#define LV_USE_LZ4_INTERNAL 0
/** Use external LZ4 library */
#define LV_USE_LZ4_EXTERNAL 0
/*SVG library
* - Requires `LV_USE_VECTOR_GRAPHIC = 1` */
#define LV_USE_SVG 0
#define LV_USE_SVG_ANIMATION 0
#define LV_USE_SVG_DEBUG 0
/** FFmpeg library for image decoding and playing videos.
* Supports all major image formats so do not enable other image decoder with it. */
#define LV_USE_FFMPEG 0
#if LV_USE_FFMPEG
/** Dump input information to stderr */
#define LV_FFMPEG_DUMP_FORMAT 0
/** Use lvgl file path in FFmpeg Player widget
* You won't be able to open URLs after enabling this feature.
* Note that FFmpeg image decoder will always use lvgl file system. */
#define LV_FFMPEG_PLAYER_USE_LV_FS 0
#endif
/*==================
* OTHERS
*==================*/
/* Documentation for several of the below items can be found here: https://docs.lvgl.io/master/details/auxiliary-modules/index.html . */
/** 1: Enable API to take snapshot for object */
#define LV_USE_SNAPSHOT 0
/** 1: Enable system monitor component */
#define LV_USE_SYSMON 1
#if LV_USE_SYSMON
/** Get the idle percentage. E.g. uint32_t my_get_idle(void); */
#define LV_SYSMON_GET_IDLE lv_os_get_idle_percent
/*
* 性能监控器 - 嵌入式开发调试必备工具 🔧
*
* 功能:
* - 实时显示 CPU 使用率百分比
* - 实时显示 FPS (每秒帧数)
* - 显示渲染时间统计
* - 内存使用情况监控
*
* 嵌入式开发价值:
* 1. 性能瓶颈识别:发现哪些界面元素消耗过多资源
* 2. 内存泄漏检测:监控内存使用趋势
* 3. 帧率优化:确保动画流畅度符合要求
* 4. 资源规划:为实际硬件配置提供数据支持
*
* 使用建议:
* - 开发阶段:启用 (1),便于性能调试
* - 产品发布:禁用 (0),减少资源消耗
* - PC 模拟器:建议启用,了解性能表现
* - 嵌入式设备:如果内存允许,建议保留用于现场调试
*
* 位置选项:
* - LV_ALIGN_TOP_LEFT: 左上角
* - LV_ALIGN_TOP_RIGHT: 右上角
* - LV_ALIGN_BOTTOM_LEFT: 左下角
* - LV_ALIGN_BOTTOM_RIGHT: 右下角 (推荐)
* - LV_ALIGN_CENTER: 屏幕中央
*
* 注意:需要 LV_USE_SYSMON = 1 支持
*/
#define LV_USE_PERF_MONITOR 1
#if LV_USE_PERF_MONITOR
/* 性能监控器显示位置 - 推荐右下角,避免遮挡重要内容 */
#define LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT
/** 0: Displays performance data on the screen; 1: Prints performance data using log. */
#define LV_USE_PERF_MONITOR_LOG_MODE 0
#endif
/*
* 内存监控器 - 嵌入式开发内存管理必备工具 💾
*
* 功能:
* - 实时显示内存使用百分比
* - 显示已用内存和总内存大小
* - 内存碎片率统计
* - 内存分配/释放次数统计
*
* 嵌入式开发价值:
* 1. 内存泄漏检测:发现未释放的内存分配
* 2. 内存碎片监控:评估内存管理效率
* 3. 内存规划:为不同应用场景分配合理内存
* 4. 优化指导:识别内存消耗大户
*
* 使用条件:
* - 需要 LV_USE_STDLIB_MALLOC = LV_STDLIB_BUILTIN (使用内置内存管理器)
* - 需要 LV_USE_SYSMON = 1 (系统监控支持)
*
* 使用建议:
* - 开发调试:启用 (1),密切监控内存使用
* - 性能测试:启用,进行内存压力测试
* - 产品发布:可选禁用 (0),节省资源
* - 现场维护:建议保留,便于问题诊断
*
* 嵌入式内存调试技巧:
* 1. 观察内存使用趋势,避免逐渐增长
* 2. 注意内存碎片率,过高时考虑重启应用
* 3. 定期记录峰值内存使用,优化内存分配
* 4. 结合性能监控器,综合评估系统状态
*/
#define LV_USE_MEM_MONITOR 1
#if LV_USE_MEM_MONITOR
/* 内存监控器显示位置 - 推荐左下角,与性能监控器对称分布 */
#define LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_LEFT
#endif
#endif /*LV_USE_SYSMON*/
/** 1: Enable runtime performance profiler */
#define LV_USE_PROFILER 0
#if LV_USE_PROFILER
/** 1: Enable the built-in profiler */
#define LV_USE_PROFILER_BUILTIN 1
#if LV_USE_PROFILER_BUILTIN
/** Default profiler trace buffer size */
#define LV_PROFILER_BUILTIN_BUF_SIZE (16 * 1024) /**< [bytes] */
#endif
/** Header to include for profiler */
#define LV_PROFILER_INCLUDE "lvgl/src/misc/lv_profiler_builtin.h"
/** Profiler start point function */
#define LV_PROFILER_BEGIN LV_PROFILER_BUILTIN_BEGIN
/** Profiler end point function */
#define LV_PROFILER_END LV_PROFILER_BUILTIN_END
/** Profiler start point function with custom tag */
#define LV_PROFILER_BEGIN_TAG LV_PROFILER_BUILTIN_BEGIN_TAG
/** Profiler end point function with custom tag */
#define LV_PROFILER_END_TAG LV_PROFILER_BUILTIN_END_TAG
/*Enable layout profiler*/
#define LV_PROFILER_LAYOUT 1
/*Enable disp refr profiler*/
#define LV_PROFILER_REFR 1
/*Enable draw profiler*/
#define LV_PROFILER_DRAW 1
/*Enable indev profiler*/
#define LV_PROFILER_INDEV 1
/*Enable decoder profiler*/
#define LV_PROFILER_DECODER 1
/*Enable font profiler*/
#define LV_PROFILER_FONT 1
/*Enable fs profiler*/
#define LV_PROFILER_FS 1
/*Enable style profiler*/
#define LV_PROFILER_STYLE 0
/*Enable timer profiler*/
#define LV_PROFILER_TIMER 1
/*Enable cache profiler*/
#define LV_PROFILER_CACHE 1
/*Enable event profiler*/
#define LV_PROFILER_EVENT 1
#endif
/** 1: Enable Monkey test */
#define LV_USE_MONKEY 0
/** 1: Enable grid navigation */
#define LV_USE_GRIDNAV 0
/** 1: Enable `lv_obj` fragment logic */
#define LV_USE_FRAGMENT 0
/** 1: Support using images as font in label or span widgets */
#define LV_USE_IMGFONT 0
/** 1: Enable an observer pattern implementation */
#define LV_USE_OBSERVER 1
/** 1: Enable Pinyin input method
* - Requires: lv_keyboard */
#define LV_USE_IME_PINYIN 0
#if LV_USE_IME_PINYIN
/** 1: Use default thesaurus.
* @note If you do not use the default thesaurus, be sure to use `lv_ime_pinyin` after setting the thesaurus. */
#define LV_IME_PINYIN_USE_DEFAULT_DICT 1
/** Set maximum number of candidate panels that can be displayed.
* @note This needs to be adjusted according to size of 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
/** 1: Enable file explorer.
* - Requires: lv_table */
#define LV_USE_FILE_EXPLORER 0
#if LV_USE_FILE_EXPLORER
/** Maximum length of path */
#define LV_FILE_EXPLORER_PATH_MAX_LEN (128)
/** Quick access bar, 1:use, 0:do not use.
* - Requires: lv_list */
#define LV_FILE_EXPLORER_QUICK_ACCESS 1
#endif
/** 1: Enable freetype font manager
* - Requires: LV_USE_FREETYPE */
#define LV_USE_FONT_MANAGER 0
#if LV_USE_FONT_MANAGER
/**Font manager name max length*/
#define LV_FONT_MANAGER_NAME_MAX_LEN 32
#endif
/** Enable emulated input devices, time emulation, and screenshot compares. */
#define LV_USE_TEST 0
#if LV_USE_TEST
/** Enable `lv_test_screenshot_compare`.
* Requires libpng and a few MB of extra RAM. */
#define LV_USE_TEST_SCREENSHOT_COMPARE 0
#endif /*LV_USE_TEST*/
/** Enable loading XML UIs runtime */
#define LV_USE_XML 0
/*1: Enable color filter style*/
#define LV_USE_COLOR_FILTER 0
/*==================
* DEVICES
*==================*/
/** Use SDL to open window on PC and handle mouse and keyboard. */
#define LV_USE_SDL 0
#if LV_USE_SDL
#define LV_SDL_INCLUDE_PATH <SDL2/SDL.h>
#define LV_SDL_RENDER_MODE LV_DISPLAY_RENDER_MODE_DIRECT /**< LV_DISPLAY_RENDER_MODE_DIRECT is recommended for best performance */
#define LV_SDL_BUF_COUNT 1 /**< 1 or 2 */
#define LV_SDL_ACCELERATED 1 /**< 1: Use hardware acceleration*/
#define LV_SDL_FULLSCREEN 0 /**< 1: Make the window full screen by default */
#define LV_SDL_DIRECT_EXIT 1 /**< 1: Exit the application when all SDL windows are closed */
#define LV_SDL_MOUSEWHEEL_MODE LV_SDL_MOUSEWHEEL_MODE_ENCODER /*LV_SDL_MOUSEWHEEL_MODE_ENCODER/CROWN*/
#endif
/** Use X11 to open window on Linux desktop and handle mouse and keyboard */
#define LV_USE_X11 0
#if LV_USE_X11
#define LV_X11_DIRECT_EXIT 1 /**< Exit application when all X11 windows have been closed */
#define LV_X11_DOUBLE_BUFFER 1 /**< Use double buffers for rendering */
/* Select only 1 of the following render modes (LV_X11_RENDER_MODE_PARTIAL preferred!). */
#define LV_X11_RENDER_MODE_PARTIAL 1 /**< Partial render mode (preferred) */
#define LV_X11_RENDER_MODE_DIRECT 0 /**< Direct render mode */
#define LV_X11_RENDER_MODE_FULL 0 /**< Full render mode */
#endif
/** Use Wayland to open a window and handle input on Linux or BSD desktops */
#define LV_USE_WAYLAND 0
#if LV_USE_WAYLAND
#define LV_WAYLAND_WINDOW_DECORATIONS 0 /**< Draw client side window decorations only necessary on Mutter/GNOME */
#define LV_WAYLAND_WL_SHELL 0 /**< Use the legacy wl_shell protocol instead of the default XDG shell */
#endif
/** Driver for /dev/fb */
#define LV_USE_LINUX_FBDEV 0
#if LV_USE_LINUX_FBDEV
#define LV_LINUX_FBDEV_BSD 0
#define LV_LINUX_FBDEV_RENDER_MODE LV_DISPLAY_RENDER_MODE_PARTIAL
#define LV_LINUX_FBDEV_BUFFER_COUNT 0
#define LV_LINUX_FBDEV_BUFFER_SIZE 60
#endif
/** Use Nuttx to open window and handle touchscreen */
#define LV_USE_NUTTX 0
#if LV_USE_NUTTX
#define LV_USE_NUTTX_INDEPENDENT_IMAGE_HEAP 0
/** Use independent image heap for default draw buffer */
#define LV_NUTTX_DEFAULT_DRAW_BUF_USE_INDEPENDENT_IMAGE_HEAP 0
#define LV_USE_NUTTX_LIBUV 0
/** Use Nuttx custom init API to open window and handle touchscreen */
#define LV_USE_NUTTX_CUSTOM_INIT 0
/** Driver for /dev/lcd */
#define LV_USE_NUTTX_LCD 0
#if LV_USE_NUTTX_LCD
#define LV_NUTTX_LCD_BUFFER_COUNT 0
#define LV_NUTTX_LCD_BUFFER_SIZE 60
#endif
/** Driver for /dev/input */
#define LV_USE_NUTTX_TOUCHSCREEN 0
/*Touchscreen cursor size in pixels(<=0: disable cursor)*/
#define LV_NUTTX_TOUCHSCREEN_CURSOR_SIZE 0
#endif
/** Driver for /dev/dri/card */
#define LV_USE_LINUX_DRM 0
#if LV_USE_LINUX_DRM
/* Use the MESA GBM library to allocate DMA buffers that can be
* shared across sub-systems and libraries using the Linux DMA-BUF API.
* The GBM library aims to provide a platform independent memory management system
* it supports the major GPU vendors - This option requires linking with libgbm */
#define LV_LINUX_DRM_GBM_BUFFERS 0
#endif
/** Interface for TFT_eSPI */
#define LV_USE_TFT_ESPI 0
/** Driver for evdev input devices */
#define LV_USE_EVDEV 0
/** Driver for libinput input devices */
#define LV_USE_LIBINPUT 0
#if LV_USE_LIBINPUT
#define LV_LIBINPUT_BSD 0
/** Full keyboard support */
#define LV_LIBINPUT_XKB 0
#if LV_LIBINPUT_XKB
/** "setxkbmap -query" can help find the right values for your keyboard */
#define LV_LIBINPUT_XKB_KEY_MAP { .rules = NULL, .model = "pc101", .layout = "us", .variant = NULL, .options = NULL }
#endif
#endif
/* Drivers for LCD devices connected via SPI/parallel port */
#define LV_USE_ST7735 0
#define LV_USE_ST7789 0
#define LV_USE_ST7796 0
#define LV_USE_ILI9341 0
#define LV_USE_GENERIC_MIPI (LV_USE_ST7735 | LV_USE_ST7789 | LV_USE_ST7796 | LV_USE_ILI9341)
/** Driver for Renesas GLCD */
#define LV_USE_RENESAS_GLCDC 0
/** Driver for ST LTDC */
#define LV_USE_ST_LTDC 0
#if LV_USE_ST_LTDC
/* Only used for partial. */
#define LV_ST_LTDC_USE_DMA2D_FLUSH 0
#endif
/** LVGL Windows backend */
#define LV_USE_WINDOWS 1
/** LVGL UEFI backend */
#define LV_USE_UEFI 0
#if LV_USE_UEFI
#define LV_USE_UEFI_INCLUDE "myefi.h" /**< Header that hides the actual framework (EDK2, gnu-efi, ...) */
#define LV_UEFI_USE_MEMORY_SERVICES 0 /**< Use the memory functions from the boot services table */
#endif
/** Use OpenGL to open window on PC and handle mouse and keyboard */
#define LV_USE_OPENGLES 0
#if LV_USE_OPENGLES
#define LV_USE_OPENGLES_DEBUG 1 /**< Enable or disable debug for opengles */
#endif
/** QNX Screen display and input drivers */
#define LV_USE_QNX 0
#if LV_USE_QNX
#define LV_QNX_BUF_COUNT 1 /**< 1 or 2 */
#endif
/*==================
* EXAMPLES
*==================*/
/** Enable examples to be built with the library. */
#define LV_BUILD_EXAMPLES 1
/*===================
* 演示程序配置 (DEMO USAGE)
* ====================*/
/*
* 基础控件演示 - LVGL 入门必备 🎯
*
* 包含内容:
* - 按钮、滑块、开关、进度条等基础控件
* - 简单的布局示例
* - 基础交互演示
* - 样式和主题展示
*
* 嵌入式学习价值:
* 1. 了解 LVGL 基础组件的使用方法
* 2. 学习事件处理机制
* 3. 掌握布局和样式系统
* 4. 为实际项目开发提供参考
*
* 内存需求:通常需要 32-64KB 内存
* 适用场景:初学 LVGL、测试基础功能
*/
#define LV_USE_DEMO_WIDGETS 1
/*
* 键盘和编码器演示 - 输入设备专用 🎮
*
* 功能特点:
* - 物理按键输入处理
* - 编码器旋钮操作演示
* - 键盘导航和焦点管理
* - 适用于工业控制面板等场景
*
* 嵌入式应用场景:
* - 工业控制设备(旋钮+按键)
* - 音频设备(编码器调节音量)
* - 医疗设备(精确参数调节)
* - 汽车电子(旋钮控制)
*
* 注意事项:需要相应的硬件输入设备支持
*/
#define LV_USE_DEMO_KEYPAD_AND_ENCODER 0
/*
* 性能基准测试 - 系统性能评估工具 ⚡
*
* 测试内容:
* - 各种图形渲染性能测试
* - 内存分配速度测试
* - 动画性能测试
* - 综合性能评分
*
* 嵌入式开发价值:
* 1. 评估目标硬件性能是否满足需求
* 2. 识别性能瓶颈,针对性优化
* 3. 比较不同配置的性能差异
* 4. 为硬件选型提供数据支持
*
* 使用建议:
* - 硬件评估阶段:启用测试
* - 性能优化阶段:反复测试验证
* - 最终产品:禁用,节省资源
*
* 性能指标参考:
* - FPS > 30: 流畅动画体验
* - FPS > 20: 基本交互需求
* - FPS < 20: 需要优化界面
*/
#define LV_USE_DEMO_BENCHMARK 1
/** Render test for each primitive.
* - Requires at least 480x272 display. */
#define LV_USE_DEMO_RENDER 0
/** Stress test for LVGL */
#define LV_USE_DEMO_STRESS 0
/** Music player demo */
#define LV_USE_DEMO_MUSIC 0
#if LV_USE_DEMO_MUSIC
#define LV_DEMO_MUSIC_SQUARE 0
#define LV_DEMO_MUSIC_LANDSCAPE 0
#define LV_DEMO_MUSIC_ROUND 0
#define LV_DEMO_MUSIC_LARGE 0
#define LV_DEMO_MUSIC_AUTO_PLAY 0
#endif
/** Flex layout demo */
#define LV_USE_DEMO_FLEX_LAYOUT 0
/** Smart-phone like multi-language demo */
#define LV_USE_DEMO_MULTILANG 0
/** Widget transformation demo */
#define LV_USE_DEMO_TRANSFORM 0
/** Demonstrate scroll settings */
#define LV_USE_DEMO_SCROLL 0
/** Vector graphic demo */
#define LV_USE_DEMO_VECTOR_GRAPHIC 0
/*E-bike demo with Lottie animations (if LV_USE_LOTTIE is enabled)*/
#define LV_USE_DEMO_EBIKE 0
#if LV_USE_DEMO_EBIKE
#define LV_DEMO_EBIKE_PORTRAIT 0 /*0: for 480x270..480x320, 1: for 480x800..720x1280*/
#endif
/** High-resolution demo */
#define LV_USE_DEMO_HIGH_RES 0
/* Smart watch demo */
#define LV_USE_DEMO_SMARTWATCH 0
/*--END OF LV_CONF_H--*/
#endif /*LV_CONF_H*/
#endif /*End of "Content enable"*/



浙公网安备 33010602011771号