From a6163888f3c56123b1db313743c6147ba498732c Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Fri, 8 Aug 2014 14:42:07 +0300 Subject: Add third_party libs --- third_party/fatfs/doc/en/getfree.html | 91 +++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 third_party/fatfs/doc/en/getfree.html (limited to 'third_party/fatfs/doc/en/getfree.html') diff --git a/third_party/fatfs/doc/en/getfree.html b/third_party/fatfs/doc/en/getfree.html new file mode 100644 index 0000000..e81de0a --- /dev/null +++ b/third_party/fatfs/doc/en/getfree.html @@ -0,0 +1,91 @@ + + + + + + + +FatFs - f_getfree + + + + +
+

f_getfree

+

The f_getfree function gets number of the free clusters.

+
+FRESULT f_getfree (
+  const char* Path,         /* Root directory of the drive */
+  DWORD* Clusters,          /* Pointer to the variable to store number of free clusters */
+  FATFS** FileSystemObject  /* Pointer to pointer to file system object */
+);
+
+
+ +
+

Parameters

+
+
Path
+
Pinter to the null-terminated string that specifies the root directory of the logical drive. Always specify a null-string for Tiny-FatFs.
+
Clusters
+
Pointer to the DWORD variable to store number of free clusters.
+
FileSystemObject
+
Pointer to the pointer that to be stored the pointer to corresponding file system object.
+
+
+ + +
+

Return Values

+
+
FR_OK (0)
+
The function succeeded. The *Clusters havs number of free clusters and *FileSystemObject points the file system object.
+
FR_INVALID_DRIVE
+
The drive number is invalid.
+
FR_NOT_READY
+
The disk drive cannot work due to no medium in the drive or any other reason.
+
FR_RW_ERROR
+
The function failed due to a disk error or an internal error.
+
FR_NOT_ENABLED
+
The logical drive has no work area.
+
FR_NO_FILESYSTEM
+
There is no valid FAT partition on the disk.
+
+
+ + +
+

Descriptions

+

The f_getfree function gets number of free clusters on the drive. The sects_clust member in the file system object refreting number of sectors per cluster, so that the free space in unit of sector can be calcurated with this. When _USE_FSINFO option is enabled, this function can return inaccurate free cluster count on FAT32 volume. When _USE_FSINFO option is disabled, this function will take a time on FAT32 volume.

+

This function is not supported in read-only configuration and minimization level of >= 1.

+
+ + +
+

Samples Code

+
+    FATFS *fs;
+    DWORD clust;
+
+
+    // Get free clusters
+    res = f_getfree("", &clust, &fs);
+    if (res) die(res);
+
+    // Get free space
+    printf("%lu KB total disk space.\n"
+           "%lu KB available on the disk.\n",
+           (DWORD)(fs->max_clust - 2) * fs->sects_clust / 2,
+           clust * fs->sects_clust / 2);
+
+
+ + +
+

References

+

FATFS

+
+ +

Return

+ + -- cgit v1.3.1