Mount microSD on VSPI and show type, format, and capacity on the CYD screen. Co-authored-by: Cursor <cursoragent@cursor.com>
22 lines
551 B
C
22 lines
551 B
C
#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);
|