1 |
606 |
jeremybenn |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
2 |
|
|
<html lang="en">
|
3 |
|
|
<head>
|
4 |
|
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
5 |
|
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
6 |
|
|
<link rel="up" title="FatFs" href="../00index_e.html">
|
7 |
|
|
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
8 |
|
|
<title>FatFs - disk_ioctl</title>
|
9 |
|
|
</head>
|
10 |
|
|
|
11 |
|
|
<body>
|
12 |
|
|
|
13 |
|
|
<div class="para">
|
14 |
|
|
<h2>disk_ioctl</h2>
|
15 |
|
|
<p>The disk_ioctl function cntrols device specified features and miscellaneous functions other than disk read/write.</p>
|
16 |
|
|
<pre>
|
17 |
|
|
DRESULT disk_ioctl (
|
18 |
|
|
BYTE <em>Drive</em>, /* Drive number */
|
19 |
|
|
BYTE <em>Command</em>, /* Control command code */
|
20 |
|
|
void* <em>Buffer</em> /* Data transfer buffer */
|
21 |
|
|
);
|
22 |
|
|
</pre>
|
23 |
|
|
</div>
|
24 |
|
|
|
25 |
|
|
<div class="para">
|
26 |
|
|
<h4>Parameters</h4>
|
27 |
|
|
<dl class="par">
|
28 |
|
|
<dt>Drive</dt>
|
29 |
|
|
<dd>Specifies the drive number (0-9).</dd>
|
30 |
|
|
<dt>Command</dt>
|
31 |
|
|
<dd>Specifies the command code.</dd>
|
32 |
|
|
<dt>Buffer</dt>
|
33 |
|
|
<dd>Pointer to the parameter buffer depends on the command code. When it is not used, specify a NULL pointer.</dd>
|
34 |
|
|
</dl>
|
35 |
|
|
</div>
|
36 |
|
|
|
37 |
|
|
|
38 |
|
|
<div class="para">
|
39 |
|
|
<h4>Return Value</h4>
|
40 |
|
|
<dl class="ret">
|
41 |
|
|
<dt>RES_OK (0)</dt>
|
42 |
|
|
<dd>The function succeeded.</dd>
|
43 |
|
|
<dt>RES_ERROR</dt>
|
44 |
|
|
<dd>Any error occured.</dd>
|
45 |
|
|
<dt>RES_PARERR</dt>
|
46 |
|
|
<dd>Invalid command code.</dd>
|
47 |
|
|
<dt>RES_NOTRDY</dt>
|
48 |
|
|
<dd>The disk drive has not been initialized.</dd>
|
49 |
|
|
</dl>
|
50 |
|
|
</div>
|
51 |
|
|
|
52 |
|
|
|
53 |
|
|
<div class="para">
|
54 |
|
|
<h4>Description</h4>
|
55 |
|
|
<p>The FatFs module uses only device independent commands described below. Any device dependent function is not used.</p>
|
56 |
|
|
<table class="lst">
|
57 |
|
|
<tr><th>Command</th><th>Description</th></tr>
|
58 |
|
|
<tr><td>CTRL_SYNC</td><td>Make sure that the disk drive has finished pending write process. When the disk I/O module has a write back cache, flush the dirty sector immediately. This command is not required in read-only configuration.</p>
|
59 |
|
|
</td></tr>
|
60 |
|
|
<tr><td>GET_SECTOR_SIZE</td><td>Returns sector size of the drive into the WORD variable pointed by Buffer. This command is not required in single sector size configuration, _MAX_SS is 512.</td></tr>
|
61 |
|
|
<tr><td>GET_SECTOR_COUNT</td><td>Returns total sectors on the drive into the DWORD variable pointed by Buffer. This command is used in only f_mkfs function.</td></tr>
|
62 |
|
|
<tr><td>GET_BLOCK_SIZE</td><td>Returns erase block size of the memory array in unit of sector into the DWORD variable pointed by Buffer. When the erase block size is unknown or magnetic disk device, return 1. This command is used in only f_mkfs function.</td></tr>
|
63 |
|
|
</table>
|
64 |
|
|
</div>
|
65 |
|
|
|
66 |
|
|
<p class="foot"><a href="../00index_e.html">Return</a></p>
|
67 |
|
|
</body>
|
68 |
|
|
</html>
|