Files
tftest/README.md
DESKTOP-PUHFO60\dsx2016 23956897fa Initial CYD TF card info display with LVGL.
Mount microSD on VSPI and show type, format, and capacity on the CYD screen.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-17 17:29:51 +08:00

44 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# CYD TF 卡信息显示(LVGL)
在 **ESP32-2432S028(CYD)** 上挂载 TF/microSD,用 LVGL 显示卡类型、文件系统、容量、已用/可用空间等。
## 硬件
| 功能 | GPIO |
|------|------|
| TFT MOSI / MISO / SCLK | 13 / 12 / 14 |
| TFT CS / DC / BL | 15 / 2 / 21 |
| **SD MOSI / MISO / SCK / CS** | **23 / 19 / 18 / 5** |
TF 卡使用独立 VSPI;显示使用 TFT_eSPI(HSPI)。本工程未启用触摸,避免与 SD 争用总线。
## 屏幕显示内容
- Status:是否挂载成功
- Type:MMC / SDSC / SDHC
- Format:FAT16 / FAT32 等(按分区容量推断)
- Capacity:卡物理容量
- Partition / Used / Free:分区总容量、已用、剩余
- Root files:根目录条目数
- 进度条:已用百分比
每 3 秒自动刷新;串口 115200 同步打印同样信息。
## 编译烧录
1. VS Code / Cursor 安装 **PlatformIO** 扩展
2. 打开本目录,连接 CYD(通常 USB 转串口 CH340)
3. 执行:
```bash
pio run -t upload
pio device monitor
```
## 注意事项
- TF 卡需为 **FAT/FAT32**(Arduino `SD` 库);exFAT 通常无法挂载。
- 首次使用建议先在电脑上格式化为 FAT32。
- 若花屏,可在 `platformio.ini` 把 `ILI9341_2_DRIVER` 换成 `ILI9341_DRIVER` 再试。
- 若只要竖屏,在 `main.cpp` 去掉或改 `lv_display_set_rotation`。