]> cloudbase.mooo.com Git - z180-stamp.git/blame - fatfs/doc/en/mount.html
Merge branch 'chan-fatfs' into fatfs-integration
[z180-stamp.git] / fatfs / doc / en / mount.html
CommitLineData
53668523
L
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
2<html lang="en">\r
3<head>\r
4<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">\r
5<meta http-equiv="Content-Style-Type" content="text/css">\r
6<link rel="up" title="FatFs" href="../00index_e.html">\r
7<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/mount.html">\r
8<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">\r
9<title>FatFs - f_mount</title>\r
10</head>\r
11\r
12<body>\r
13\r
14<div class="para func">\r
15<h2>f_mount</h2>\r
16<p>The f_mount fucntion registers/unregisters file system object to the FatFs module.</p>\r
17<pre>\r
18FRESULT f_mount (\r
19 FATFS* <span class="arg">fs</span>, <span class="c">/* [IN] File system object */</span>\r
20 const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] Logical drive number */</span>\r
21 BYTE <span class="arg">opt</span> <span class="c">/* [IN] Initialization option */</span>\r
22);\r
23</pre>\r
24</div>\r
25\r
26<div class="para arg">\r
27<h4>Parameters</h4>\r
28<dl class="par">\r
29<dt>fs</dt>\r
70702af1 30<dd>Pointer to the file system object to be registered and cleared. Null pointer unregisters the registered file system object.</dd>\r
53668523 31<dt>path</dt>\r
70702af1 32<dd>Pointer to the null-terminated string that specifies the <a href="filename.html">logical drive</a>. The string without drive number means the default drive.</dd>\r
53668523 33<dt>opt</dt>\r
70702af1 34<dd>Mounting option. 0: Do not mount now (to be mounted on the first access to the volume), 1: Force mounted the volume to check if it is ready to work.</dd>\r
53668523
L
35</dl>\r
36</div>\r
37\r
38<div class="para ret">\r
39<h4>Return Values</h4>\r
40<p>\r
41<a href="rc.html#ok">FR_OK</a>,\r
42<a href="rc.html#id">FR_INVALID_DRIVE</a>,\r
43<a href="rc.html#de">FR_DISK_ERR</a>,\r
44<a href="rc.html#nr">FR_NOT_READY</a>,\r
45<a href="rc.html#ns">FR_NO_FILESYSTEM</a>\r
46</p>\r
47</div>\r
48\r
49\r
50<div class="para desc">\r
51<h4>Description</h4>\r
70702af1 52<p>The <tt>f_mount</tt> function registers/unregisters a file system object used for the volume (logical drive) to the FatFs module as follows:</p>\r
53668523
L
53<ol>\r
54<li>Determines the logical drive which specified by <tt class="arg">path</tt>.</li>\r
70702af1 55<li>Clears and unregisters the regsitered work area of the drive if exist.</li>\r
53668523 56<li>Clears and registers the new work area to the drive if <tt class="arg">fs</tt> is not NULL.</li>\r
70702af1 57<li>Performs volume mount process to the drive if forced mounting is specified.</li>\r
53668523 58</ol>\r
70702af1
L
59<p>The file system object is the work area needed for each logical drive. It must be given to the logical drive with this function prior to use any API functions except for <tt>f_mkfs/f_fdisk</tt> function to the logical drive.</p>\r
60<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. To unregister the work area, specify a NULL to the <tt class="arg">fs</tt>, and then the work area can be discarded. The volume mount processes, initialize the corresponding physical drive, find the FAT volume in it and initialize the work area, is performed in the subsequent file access functions when either or both of following condition is true.</p>\r
53668523 61<ul>\r
70702af1 62<li>File system object has not been initialized. It is de-initialized by <tt>f_mount</tt> function.</li>\r
53668523
L
63<li>Physical drive is not initialized. It is de-initialized by system reset or media removal.</li>\r
64</ul>\r
70702af1
L
65<p>If the function with forced mounting (<tt>opt = 1</tt>) failed, it means that the file system object has been registered successfully but the volume is currently not ready to work. The volume mount process will be attempted at subsequent file access functions if the file system object is not initialized. (delayed mounting)</p>\r
66<p>If implementation of the disk I/O layer lacks media change detection, application program needs to perform a <tt>f_mount</tt> function after each media change to force cleared the file system object.</p>\r
53668523
L
67</div>\r
68\r
69\r
70<div class="para comp">\r
71<h4>QuickInfo</h4>\r
72<p>Always available.</p>\r
73</div>\r
74\r
75\r
76<div class="para ref">\r
77<h4>See Also</h4>\r
78<p><tt><a href="open.html">f_open</a></tt>, <tt><a href="sfatfs.html">FATFS</a></tt></p>\r
79</div>\r
80\r
81<p class="foot"><a href="../00index_e.html">Return</a></p>\r
82</body>\r
83</html>\r