2021-10-04 14:34:11 +02:00
# File System Interfaces
2022-01-17 14:10:23 +01:00
LVGL has a [File system ](https://docs.lvgl.io/master/overview/file-system.html ) module to provide an abstraction layer for various file system drivers.
2021-10-04 14:34:11 +02:00
2022-01-17 14:10:23 +01:00
LVG has built in support for:
2021-10-04 14:34:11 +02:00
- [FATFS ](http://elm-chan.org/fsw/ff/00index_e.html )
- STDIO (Linux and Windows using C standard function .e.g fopen, fread)
- POSIX (Linux and Windows using POSIX function .e.g open, read)
2021-10-20 17:35:11 +08:00
- WIN32 (Windows using Win32 API function .e.g CreateFileA, ReadFile)
2021-10-04 14:34:11 +02:00
2022-01-17 14:10:23 +01:00
You still need to provide the drivers and libraries, this extension provides only the bridge between FATFS, STDIO, POSIX, WIN32 and LVGL.
2021-10-04 14:34:11 +02:00
## Usage
2022-01-27 11:20:56 +01:00
In `lv_conf.h` enable `LV_USE_FS_...` and assign an upper cased letter to `LV_FS_..._LETTER` (e.g. `'S'` ).
After that you can access files using that driver letter. E.g. `"S:path/to/file.txt"` .
2022-03-21 18:25:51 +08:00
The work directory can be set with `LV_FS_..._PATH` . E.g. `"/home/joe/projects/"` The actual file/directory paths will be appended to it.
2022-01-27 11:20:56 +01:00
2022-03-21 18:25:51 +08:00
Cached reading is also supported if `LV_FS_..._CACHE_SIZE` is set to not `0` value. `lv_fs_read` caches this size of data to lower the number of actual reads from the storage.