sdcard.h
C source for Emulating a round-screen ESP32 board, 13 lines. Raw file
// sdcard.h - host-file-backed SD card in SPI mode (see sdcard.c).
#ifndef SDCARD_H
#define SDCARD_H
#include <stdint.h>
// Lazily opens/creates the backing image on first use. Processes ONE SPI byte:
// takes the MOSI byte the host clocked out, returns the MISO byte the card drives.
uint8_t sdcard_spi_byte(uint8_t mosi);
// True once the backing image is available (a card is "inserted").
int sdcard_present(void);
#endif