35#if defined(FT9XX_PLATFORM) || defined(RP2040_PLATFORM)
43#if defined(RP2040_PLATFORM)
45SDHOST_STATUS sdhost_card_detect(
void) {
53 return SDHOST_CARD_REMOVED;
56 return SDHOST_CARD_INSERTED;
59void sdhost_init(
void) {
72 printf(
"Type is FAT12\n");
75 printf(
"Type is FAT16\n");
78 printf(
"Type is FAT32\n");
81 printf(
"Type is EXFAT\n");
84 printf(
"Type is unknown\n");
102 SDHOST_STATUS status = sdhost_card_detect();
103 if (status == SDHOST_CARD_INSERTED)
107 printf(
"FatFS SD card mount failed\n");
111 printf(
"FatFS SD card mounted successfully\n");
117 printf(
"SD card not detected\n");
174 if (fResult ==
FR_OK)
176 filesize =
f_size(&InfSrc);
180 filesize -= blocklen;
232 if (fResult ==
FR_OK)
236 filesize =
f_size(&InfSrc);
240 filesize -= blocklen;
298 if (fResult ==
FR_OK)
303 filesize =
f_size(&InfSrc);
307 filesize -= blocklen;
359 if (fResult ==
FR_OK)
361 filesize =
f_size(&InfSrc);
365 filesize -= blocklen;
371 *transfered += blocklen;
405#ifndef RP2040_PLATFORM
413 if (fResult ==
FR_OK)
435#if EVE_ENABLE_FATFS && defined(EVE_SUPPORT_MEDIAFIFO)
471 if (fResult ==
FR_OK)
496 if (fResult !=
FR_OK)
507 filesize -= blocklen;
515 *transfered += transferedPart;
516 if (transferedPart < blocklen)
518 long offset = (long)transferedPart - (
long)blocklen;
557#if defined(EVE_SUPPORT_MEDIAFIFO)
EVE_HAL_EXPORT bool EVE_Cmd_wrMem(EVE_HalContext *phost, const uint8_t *buffer, uint32_t size)
Write buffer to Coprocessor's comand fifo.
EVE_HAL_EXPORT bool EVE_Cmd_wr32(EVE_HalContext *phost, uint32_t value)
Write 4 bytes to Coprocessor's command fifo.
EVE_HAL_EXPORT uint32_t EVE_Hal_rd32(EVE_HalContext *phost, uint32_t addr)
Read 4 bytes from Coprocessor's memory.
EVE_HAL_EXPORT void EVE_Hal_wrMem(EVE_HalContext *phost, uint32_t addr, const uint8_t *buffer, uint32_t size)
Write a buffer to Coprocessor's memory.
Eve_Hal framework APIs for loading file.
bool EVE_Util_loadRawFile(EVE_HalContext *phost, uint32_t address, const char *filename)
Load a raw file into RAM_G.
static bool s_FatFSLoaded
bool EVE_Util_loadSdCard(EVE_HalContext *phost)
Mount the SDcard.
void EVE_Util_closeFile(EVE_HalContext *phost)
bool EVE_Util_loadCmdFile(EVE_HalContext *phost, const char *filename, uint32_t *transfered)
bool EVE_Util_loadInflateFile(EVE_HalContext *phost, uint32_t address, const char *filename)
Load file into RAM_G by CMD_INFLATE.
bool EVE_Util_loadImageFile(EVE_HalContext *phost, uint32_t address, const char *filename, uint32_t *format)
Load image into RAM_G.
size_t EVE_Util_readFile(EVE_HalContext *phost, uint8_t *buffer, size_t size, const char *filename)
bool EVE_Util_loadMediaFile(EVE_HalContext *phost, const char *filename, uint32_t *transfered)
EVE_HAL_EXPORT bool EVE_Util_sdCardReady(EVE_HalContext *phost)
static ft_uint32_t ft_uint8_t * buffer
void EVE_Cmd_waitFlush(EVE_HalContext *host)
FRESULT f_mount(FATFS *fs, const TCHAR *path, BYTE opt)
FRESULT f_lseek(FIL *fp, FSIZE_t ofs)
FRESULT f_read(FIL *fp, void *buff, UINT btr, UINT *br)
FRESULT f_open(FIL *fp, const TCHAR *path, BYTE mode)
ptrdiff_t LoadFileRemaining