<p>The disk_read function reads sector(s) from the disk drive.</p>
16
<pre>
17
DRESULT disk_read (
18
BYTE <em>Drive</em>, /* Physical drive number */
19
BYTE* <em>Buffer</em>, /* Pointer to the read data buffer */
20
DWORD <em>SectorNumber</em>, /* Start sector number */
21
BYTE <em>SectorCount</em> /* Number of sectros to read */
22
);
23
</pre>
24
</div>
25
26
<div class="para">
27
<h4>Parameters</h4>
28
<dl class="par">
29
<dt>Drive</dt>
30
<dd>Specifies the physical drive number.</dd>
31
<dt>Buffer</dt>
32
<dd>Pointer to the byte array to store the read data. The buffer size of number of bytes to be read, sector size * sector count, is required. The memory address specified by upper layer may or may not be aligned to word boundary.</dd>
33
<dt>SectorNumber</dt>
34
<dd>Specifies the start sector number in logical block address (LBA).</dd>
35
<dt>SectorCount</dt>
36
<dd>Specifies number of sectors to read. The value can be 1 to 255.</dd>
37
</dl>
38
</div>
39
40
41
<div class="para">
42
<h4>Return Value</h4>
43
<dl class="ret">
44
<dt>RES_OK (0)</dt>
45
<dd>The function succeeded.</dd>
46
<dt>RES_ERROR</dt>
47
<dd>Any hard error occured during the read operation and could not recover it.</dd>