From 3061ecca3d0fdfb87dabbf5f63c9e06c2a30f53a Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Thu, 23 Aug 2018 17:08:59 +0200 Subject: o Initial import. --- .../external/fatfs/doc/en/getfree.html | 95 ++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/getfree.html (limited to 'thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/getfree.html') diff --git a/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/getfree.html b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/getfree.html new file mode 100644 index 0000000..ebbdf05 --- /dev/null +++ b/thirdparty/nRF5_SDK_15.0.0_a53641a/external/fatfs/doc/en/getfree.html @@ -0,0 +1,95 @@ + + + + + + + + +FatFs - f_getfree + + + + +
+

f_getfree

+

The f_getfree function gets number of the free clusters on the volume.

+
+FRESULT f_getfree (
+  const TCHAR* path,  /* [IN] Logical drive number */
+  DWORD* nclst,       /* [OUT] Number of free clusters */
+  FATFS** fatfs       /* [OUT] Corresponding file system object */
+);
+
+
+ +
+

Parameters

+
+
path
+
Pointer to the null-terminated string that specifies the logical drive. A null-string means the default drive.
+
nclst
+
Pointer to the DWORD variable to store number of free clusters.
+
fatfs
+
Pointer to pointer that to store a pointer to the corresponding file system object.
+
+
+ + +
+

Return Values

+

+FR_OK, +FR_DISK_ERR, +FR_INT_ERR, +FR_NOT_READY, +FR_INVALID_DRIVE, +FR_NOT_ENABLED, +FR_NO_FILESYSTEM, +FR_TIMEOUT +

+
+ + +
+

Descriptions

+

The f_getfree function gets number of free clusters on the volume. The member csize in the file system object indicates number of sectors per cluster, so that the free space in unit of sector can be calcurated with this information. When FSINFO structure on the FAT32 volume is not in sync, this function can return an incorrect free cluster count. To avoid this problem, FatFs can be forced full FAT scan by _FS_NOFSINFO option.

+
+ + +
+

QuickInfo

+

Available when _FS_READONLY == 0 and _FS_MINIMIZE == 0.

+
+ + +
+

Example

+
+    FATFS *fs;
+    DWORD fre_clust, fre_sect, tot_sect;
+
+
+    /* Get volume information and free clusters of drive 1 */
+    res = f_getfree("1:", &fre_clust, &fs);
+    if (res) die(res);
+
+    /* Get total sectors and free sectors */
+    tot_sect = (fs->n_fatent - 2) * fs->csize;
+    fre_sect = fre_clust * fs->csize;
+
+    /* Print the free space (assuming 512 bytes/sector) */
+    printf("%10lu KiB total drive space.\n%10lu KiB available.\n",
+           tot_sect / 2, fre_sect / 2);
+
+
+ + +
+

See Also

+

FATFS

+
+ +

Return

+ + -- cgit v1.2.3