What MCU/Processor/Board and compiler are you using?
I’m using ESP32S3 and controlling a parallel eink display with an open-source project called epdiy. I’ve designed a custom board that adds touch and front-light LED driver so I can fully control a Kindle display.
What LVGL version are you using?
Using 9.1 with a fork that adds RGB332 since I was missing that Color Format
What do you want to achieve?
I would like to understand how I can connect the existing File Explorer to a FS template where I can fill the Open, Read, Write and directory functions with those of a Espressif MMC SD. I read the examples and understand how it works on Windows or Linux but I don’t get what is the way to add hooks so it can be used in any embedded development.
What have you tried so far?
I’ve tried starting the File Explorer and it does in fact render something but that was all.
#define LV_USE_FS_FATFS 1
#if LV_USE_FS_FATFS
#define LV_FS_FATFS_LETTER 'A' /* Important! Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
#define LV_FS_FATFS_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
#endif
// Assuming there is only one drive and drive is available
lv_fs_open() // lvgl\src\misc\lv_fs.c
lv_fs_drv_t * drv = lv_fs_get_drv(letter); // The role of letter
drv->open_cb // https://github.com/lvgl/lvgl/blob/release/v9.1/src/libs/fsdrv/lv_fs_fatfs.c#L72
f_open(); // FATFS interface
By understanding the meaning of LVGL Filesystem interface parameters in this way, you can quickly use them.
lvgl/src/libs/fsdrv/lv_fs_fatfs.c:228:32: error: ‘DIR’ undeclared (first use in this function); did you mean ‘DDR’?
228 | DIR * d = lv_malloc(sizeof(DIR));
@100ask If you have a working example with this I would like to see it. At this point it looks like a shorter road to change all FAT references or even use the List widget and make a custom File explorer that implementing this since it seems so far no-one tried it fully with an Espressif MCU.
If yes then I would like to check a full example please.