TB2026-YDS Firmware
Loading...
Searching...
No Matches
sdcard.c File Reference
#include "sdcard.h"
#include "spi_bus.h"
#include "board_pins.h"
#include "esp_vfs_fat.h"
#include "sdmmc_cmd.h"
#include "driver/sdspi_host.h"
#include "driver/gpio.h"
#include "esp_log.h"

Macros

#define SD_MAX_OPEN_FILES   5
#define SD_ALLOC_UNIT_SIZE   (16 * 1024)
#define SD_DETECT_PRESENT_LEVEL   0

Functions

esp_err_t sdcard_mount (void)
 Initialize SPI3, attach the card via sdspi, and mount the FAT volume.
esp_err_t sdcard_unmount (void)
 Unmount the FAT volume and detach the sdspi device.
int sdcard_freq_khz (void)
 Actual SPI clock negotiated with the card by the host, in kHz.
bool sdcard_present (void)
 Report whether a card is physically inserted (synchronous read of PIN_SD_DETECT).

Detailed Description

Note
Développé avec l'assistance de Claude Opus 4.8 (Anthropic), sous la direction de Y. Dos Santos : spécification, revue et validation sur cible par l'auteur.

Macro Definition Documentation

◆ SD_ALLOC_UNIT_SIZE

#define SD_ALLOC_UNIT_SIZE   (16 * 1024)

◆ SD_DETECT_PRESENT_LEVEL

#define SD_DETECT_PRESENT_LEVEL   0

◆ SD_MAX_OPEN_FILES

#define SD_MAX_OPEN_FILES   5