Lines Matching refs:to

7 LVGL has a "File system" abstraction module that enables you to attach
10 ``'S'``, a file can be reached using ``"S:/path/to/file.txt"``. See details
15 If you want to skip the drive-letter prefix in Unix-like paths, you can use the
20 Ready-to-use drivers
35 This identifier is merely a way for the LVGL File System abtraction logic to look up
44 Later, when using paths to files on your file system, you prefix the path with that
54 then the path strings you pass to ``lv_fs_...()`` functions would look like this::
59 | +-- This part gets passed to the OS-level file-system functions.
61 +-- This part LVGL strips from path string, and uses it to find the appropriate
62 driver (i.e. set of functions) that apply to that file system.
66 way to set the default directory.
78 - "Z:/Users/me/wip/proposal.txt" (if the default drive is known to be C:)
82 Reminder: Note carefully that the prefixed "Z:" has nothing to do with the "C:" and
84 "Z:" is used to look up the driver for that file system in the list of all file-system
97 To add a driver, a :cpp:type:`lv_fs_drv_t` object needs to be initialized and
98 registered in a way similar to the code below. The :cpp:type:`lv_fs_drv_t` variable
99 needs to be static, global or dynamically allocated and not a local variable, since
100 its contents need to remain valid as long as the driver is in use.
104 static lv_fs_drv_t drv; /* Needs to be static or global */
107 drv.letter = 'S'; /* An uppercase letter to identify the drive */
108 drv.cache_size = my_cache_size; /* Cache size for reading in bytes. 0 to not cache. */
110 drv.ready_cb = my_ready_cb; /* Callback to tell if the drive is ready to use */
111 drv.open_cb = my_open_cb; /* Callback to open a file */
112 drv.close_cb = my_close_cb; /* Callback to close a file */
113 drv.read_cb = my_read_cb; /* Callback to read a file */
114 drv.write_cb = my_write_cb; /* Callback to write a file */
115 drv.seek_cb = my_seek_cb; /* Callback to seek in a file (Move cursor) */
116 drv.tell_cb = my_tell_cb; /* Callback to tell the cursor position */
118 drv.dir_open_cb = my_dir_open_cb; /* Callback to open directory to read its content */
119 drv.dir_read_cb = my_dir_read_cb; /* Callback to read a directory's content */
120 drv.dir_close_cb = my_dir_close_cb; /* Callback to close a directory */
126 Any of the callbacks can be ``NULL`` to indicate that operation is not
141 ``path`` is the path after the drive letter (e.g. "S:path/to/file.txt" -> "path/to/file.txt").
142 ``mode`` can be :cpp:enumerator:`LV_FS_MODE_WR` or :cpp:enumerator:`LV_FS_MODE_RD` to open for writ…
144 The return value is a pointer to a *file object* that describes the
146 found). The returned file object will be passed to other file system
160 the data to write, ``btw`` is the number of "bytes to write", ``bw`` is the number of
161 "bytes written" (written to during the function call).
172 by setting one or more of the following macros to a non-zero value in ``lv_conf.h``.
197 you will have a ``LV_FS_xxx_PATH`` macro available to you in ``lv_conf.h`` that you
198 can use to provide a path that gets dynamically prefixed to the ``path_to_file``
199 portion of of the path strings provided to ``lv_fs_...()`` functions when files and
200 directories are opened. This can be useful to limit directory access (e.g. when a
201 portion of a path can be typed by an end user), or simply to reduce the length of the
202 path strings provided to ``lv_fs_...()`` functions.
204 Do this by filling in the full path to the directory you wish his access to be
205 limited to in the applicable ``LV_FS_xxx_PATH`` macro in ``lv_conf.h``. Do not
221 Then in both cases, path strings passed to ``lv_fs_...()`` functions in the
222 application get reduced to:
231 The example below shows how to read from a file:
247 The mode in :cpp:func:`lv_fs_open` can be :cpp:enumerator:`LV_FS_MODE_WR` to open for
251 This example shows how to read a directory's content. It's up to the
252 driver how to mark directories in the result but it can be a good
253 practice to insert a ``'/'`` in front of each directory name.
270 /* fn is empty if there are no more files to read. */
304 config option is set to a value greater than zero. Each open file will
305 buffer up to that many bytes to reduce the number of FS driver calls.
310 It has the potential to call the driver's ``read`` fewer
316 is if the file contents are expected to change by an external factor like with special OS files.
319 to other driver FS functions when the cache is enabled. i.e., ``lv_fs_read`` may call the driver's …
320 so the driver needs to implement more callbacks when the cache is enabled.
336 the cache to the destination
342 --> G["seek the real file to the end
347 from the real file to the
350 to fill the whole cache
354 to the destination buffer"]
355 B -->|no| K["seek the real file to
360 L -->|yes| M["read the real file to
363 to fill the whole cache
367 to the destination buffer"]
373 will be updated to reflect the written content.
380 to determine where the end of the file is.