summaryrefslogtreecommitdiff
path: root/fatfs/documents/doc/mount.html
diff options
context:
space:
mode:
Diffstat (limited to 'fatfs/documents/doc/mount.html')
-rw-r--r--fatfs/documents/doc/mount.html15
1 files changed, 12 insertions, 3 deletions
diff --git a/fatfs/documents/doc/mount.html b/fatfs/documents/doc/mount.html
index 901ffc0..57f40be 100644
--- a/fatfs/documents/doc/mount.html
+++ b/fatfs/documents/doc/mount.html
@@ -13,7 +13,7 @@
<div class="para func">
<h2>f_mount</h2>
-<p>The f_mount fucntion registers/unregisters filesystem object to the FatFs module.</p>
+<p>The f_mount fucntion gives work area to the FatFs module.</p>
<pre>
FRESULT f_mount (
FATFS* <span class="arg">fs</span>, <span class="c">/* [IN] Filesystem object */</span>
@@ -21,6 +21,11 @@ FRESULT f_mount (
BYTE <span class="arg">opt</span> <span class="c">/* [IN] Initialization option */</span>
);
</pre>
+<pre>
+FRESULT f_unmount (
+ const TCHAR* <span class="arg">path</span> <span class="c">/* [IN] Logical drive number */</span>
+);
+</pre>
</div>
<div class="para arg">
@@ -50,7 +55,7 @@ FRESULT f_mount (
<div class="para desc">
<h4>Description</h4>
-<p>FatFs requires work area (<em>filesystem object</em>) for each logical drives (FAT volumes). Prior to perform file/directory operations, a filesystem object needs to be registered with <tt>f_mount</tt> function to the logical drive. The file/directory API functions get ready to work after this procedure. If there is any open object of file or directory on the logical drive, the object will be invalidated by this function.</p>
+<p>FatFs requires work area (<em>filesystem object</em>) for each logical drives (FAT volumes). Prior to perform any file/directory operations, a filesystem object needs to be registered with <tt>f_mount</tt> function for the logical drive. The file/directory API functions get ready to work after this procedure. Some volume management functions, <tt>f_mkfs</tt>, <tt>f_fdisk</tt> and <tt>f_setcp</tt>, do not want a filesystem object.</p>
<p>The <tt>f_mount</tt> function registers/unregisters a filesystem object to the FatFs module as follows:</p>
<ol>
<li>Determines the logical drive which specified by <tt class="arg">path</tt>.</li>
@@ -58,6 +63,7 @@ FRESULT f_mount (
<li>Clears and registers the new work area to the volume if <tt class="arg">fs</tt> is not NULL.</li>
<li>Performs volume mount process to the volume if forced mounting is specified.</li>
</ol>
+<p>If there is any open object of file or directory on the logical drive, the object will be invalidated by this function.</p>
<p>If forced mounting is not specified (<tt>opt = 0</tt>), this function always succeeds regardless of the physical drive status. It only clears (de-initializes) the given work area and registers its address to the internal table and no activity of the physical drive in this function. The volume mount process will be attempted on subsequent file/directroy function if the filesystem object is not initialized. (delayed mounting) The volume mount processes, initialize the corresponding physical drive, find the FAT volume in it and then initialize the work area, is performed in the subsequent file/directory functions when either of following conditions is true.</p>
<ul>
<li>Filesystem object has not been initialized. It is de-initialized by <tt>f_mount</tt> function.</li>
@@ -65,7 +71,10 @@ FRESULT f_mount (
</ul>
<p>If the function with forced mounting (<tt>opt = 1</tt>) failed with <tt>FR_NOT_READY</tt>, it means that the filesystem object has been registered successfully but the volume is currently not ready to work. The volume mount process will be attempted on subsequent file/directroy function.</p>
<p>If implementation of the disk I/O layer lacks asynchronous media change detection, application program needs to perform <tt>f_mount</tt> function after each media change to force cleared the filesystem object.</p>
-<p>To unregister the work area, specify a NULL to the <tt class="arg">fs</tt>, and then the work area can be discarded.</p>
+<p>To unregister the work area, specify a NULL to the <tt class="arg">fs</tt>, and then the work area can be discarded. <tt>f_unmount</tt> function is implemented as a macro.</p>
+<pre>
+#define <em>f_unmount</em>(path) f_mount(0, path, 0)
+</pre>
</div>