Files
tftest/README.md
DESKTOP-PUHFO60\dsx2016 82e1ace24f Add GPIO26 speaker beep and melody test.
Play audio on boot and every 12s via the onboard amp; show status on the LVGL UI and document pins.

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

54 lines
1.6 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** |
| **Speaker(SC8002B → P4)** | **26** |
TF 卡使用独立 VSPI;显示使用 TFT_eSPI(HSPI)。喇叭接 CYD 的 **SPEAK / P4** 两针座(极性对调只会相位反,一般可出声)。
本工程未启用触摸,避免与 SD 争用总线。
## 屏幕显示内容
- Status:是否挂载成功
- Type:MMC / SDSC / SDHC
- Format:FAT16 / FAT32 等(按分区容量推断)
- Capacity / Partition / Used / Free:容量与空间
- Root files:根目录条目数
- **Speaker**:最近一次音频测试状态(GPIO26)
- 进度条:已用百分比
每 3 秒刷新 SD;串口 115200 同步打印。
## 喇叭测试
- **开机**:三声蜂鸣 + 一小段旋律
- **之后**:约每 12 秒再播一段三声蜂鸣
- 实现:`tone()` / `noTone()` 打在 GPIO26(经板载放大器)
听不到声时检查:P4 是否插紧、喇叭阻值(常见 8Ω)、音量是否过小。
## 编译烧录
```bash
pio run -t upload
pio device monitor
```
## 注意事项
- TF 卡需为 **FAT/FAT32**;exFAT 通常无法挂载。
- 若花屏,在 `platformio.ini` 把 `ILI9341_2_DRIVER` 换成 `ILI9341_DRIVER`。
- 变更请同步更新 `CHANGELOG.md` 并提交本地 git。
## 文档与版本
见 [CHANGELOG.md](CHANGELOG.md)。