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>
This commit is contained in:
2026-10-17 17:29:51 +08:00
commit 23956897fa
11 changed files with 1650 additions and 0 deletions

21
include/sd_info.h Normal file
View File

@@ -0,0 +1,21 @@
#pragma once
#include <Arduino.h>
struct SdCardInfo {
bool mounted;
bool present;
const char *type; // MMC / SDSC / SDHC / UNKNOWN / NONE
const char *filesystem; // FAT12 / FAT16 / FAT32 / exFAT / FAT / —
uint64_t card_bytes; // 卡物理容量
uint64_t total_bytes; // 分区总容量
uint64_t used_bytes;
uint64_t free_bytes;
uint32_t root_files; // 根目录条目数
String error; // 失败原因
};
bool sd_init();
void sd_deinit();
SdCardInfo sd_read_info();
String format_bytes(uint64_t bytes);