阶段1: 将 dzbj 项目的 LVGL 8.3.11 LCD 显示集成到 AI小智 主项目, 开机显示 ScreenHome 界面,同时优化配网模式下的内存使用, 确保 WiFi+BLE+LVGL 三者共存运行。 ## 新增功能 ### dzbj 显示模块集成 - 新增 main/dzbj/ 目录,移植 LCD 驱动(ST77916 QSPI)、触摸驱动(CST816S)、 LVGL 初始化和 SquareLine Studio UI 界面 - I2C 总线共享:dzbj 触摸控制器复用主项目的 I2C_NUM_1 总线 - GPIO 冲突解决:LED(GPIO21)、Touch1(GPIO1)、Touch4(GPIO7) 改为 NC, 电池 ADC 从 GPIO6 改为 GPIO3 - 添加 LVGL、esp_lcd_st77916、esp_lcd_touch_cst816s 等组件依赖 - managed_components 纳入版本管理 ### 配网模式轻量化启动 - BoxAudioCodec: 新增 output_only 模式,仅创建 I2S TX 通道(省 ~13KB DMA) 跳过 ES7210 ADC 初始化(省 ~2-4KB) - AudioCodec: 新增 StartOutputOnly() 方法,仅启用扬声器输出 - Application: 配网模式跳过 Opus 编码器、输入重采样器、协议初始化、 天气位置检测等网络业务 - 板级构造函数: 配网模式跳过电池检测、IMU传感器、PowerSaveTimer ### WifiBoard 配网流程修复 - NeedsProvisioning() 静态方法: 读取 NVS force_ap 和 SSID 列表, 用于提前判断配网模式 - force_ap 竞态修复: 构造函数不再清零 force_ap,改在 StartNetwork() 清零, 确保 NeedsProvisioning() 能正确读到 force_ap=1 - Application 缓存 provisioning_mode_ 成员变量,避免重复读 NVS ### BLE 配网重启修复 - 配网成功后用 esp_timer 延迟重启替代 xTaskCreate, 避免内存紧张时任务创建失败导致设备不重启 - 注释掉 WiFi 连接成功后的 MAC 地址发送步骤 ### sdkconfig 内存优化 - BT_ALLOCATION_FROM_SPIRAM_FIRST=y (BLE 动态分配优先 PSRAM) - SPIRAM_MALLOC_RESERVE_INTERNAL=32768 - NVS_ALLOCATE_CACHE_IN_SPIRAM=y - WiFi 静态缓冲区数量优化 (RX=10, TX=8) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2.5 KiB
File System Interfaces
LVGL has a File system module to provide an abstraction layer for various file system drivers. You still need to provide the drivers and libraries, this extension provides only the bridge between FATFS, LittleFS, STDIO, POSIX, WIN32 and LVGL.
Built in wrappers
FATFS
Bridge for FatFS. FatFS itself is not part of LVGL, but can be added and initialized externally.
LittleFS
Though lv_fs_littlefs uses LittleFS API, the LittleFS library needs other external libraries that handle the mounting of partitions and low-level accesses, according to the given architecture. The functions for the latter are given to the lfs_t structure as pointers by an external low-level library.
There's a convenience function called lv_fs_littlefs_set_driver(LV_FS_LITTLEFS_LETTER, my_lfs), specific to lv_fs_littlefs, to attach a lfs_t object's pointer to a registered driver-letter. See its comments for more info.
esp_littlefs is a wrapper for LittleFS to be used in Espressif ESP-devices. It handles the mounting and has the low-level littlefs_api functions to read/write/erase blocks that LittleFS library needs. On mounting by esp_littlefs the lfs_t structures are created. You need to get a handle to these to use ESP with lv_fs_littlefs, as all functions use that lfs_t in LittleFS to identify the mounted partition.
In case you don't find a special function in the lv_fs_littlefs wrapper, you can look for it in the esp_littlefs API and use it directly, as lv_fs_littlefs and the esp_littlefs APIs can be used side-by-side.
STDIO
Bride to C standard functions on Linux and Windows. For example fopen, fread, etc.
POSIX
Bride to POSIX functions on Linux and Windows. For example open, read, etc.
WIN32
Bride to Win32 API function. For example CreateFileA, ReadFile, etc.
Usage
In lv_conf.h enable LV_USE_FS_... and assign an upper cased letter to LV_FS_..._LETTER (e.g. 'S').
After that you can access files using that driver letter. E.g. "S:path/to/file.txt".
The work directory can be set with LV_FS_..._PATH. E.g. "/home/joe/projects/" The actual file/directory paths will be appended to it.
Cached reading is also supported if LV_FS_..._CACHE_SIZE is set to not 0 value. lv_fs_read caches this size of data to lower the number of actual reads from the storage.