]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - fatfs/documents/doc/dread.html
Merge branch 'chan-fatfs' into fatfs-integration
[z180-stamp.git] / fatfs / documents / doc / dread.html
similarity index 59%
rename from fatfs/doc/en/dread.html
rename to fatfs/documents/doc/dread.html
index e7c2d7d9764986a6360829ae4a96f4eb01b116b3..75b52c051504c5926dcc57feb8383d62efa25f9a 100644 (file)
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
 <html lang="en">\r
 <head>\r
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">\r
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">\r
 <meta http-equiv="Content-Style-Type" content="text/css">\r
 <link rel="up" title="FatFs" href="../00index_e.html">\r
 <link rel="alternate" hreflang="ja" title="Japanese" href="../ja/dread.html">\r
@@ -13,7 +13,7 @@
 \r
 <div class="para func">\r
 <h2>disk_read</h2>\r
-<p>The disk_read function reads sector(s) from the storage device.</p>\r
+<p>The disk_read function is called to read data from the sector(s) of storage device.</p>\r
 <pre>\r
 DRESULT disk_read (\r
   BYTE <span class="arg">pdrv</span>,     <span class="c">/* [IN] Physical drive number */</span>\r
@@ -30,7 +30,7 @@ DRESULT disk_read (
 <dt>pdrv</dt>\r
 <dd>Physical drive number to identify the target device.</dd>\r
 <dt>buff</dt>\r
-<dd>Pointer to the first item of the <em>byte array</em> to store read data.</dd>\r
+<dd>Pointer to the first item of the <em>byte array</em> to store read data. Size of read data will be the sector size * <tt class="arg">count</tt> bytes.</dd>\r
 <dt>sector</dt>\r
 <dd>Start sector number in 32-bit LBA.</dd>\r
 <dt>count</dt>\r
@@ -45,7 +45,7 @@ DRESULT disk_read (
 <dt>RES_OK (0)</dt>\r
 <dd>The function succeeded.</dd>\r
 <dt>RES_ERROR</dt>\r
-<dd>Any hard error occured during the read operation and could not recover it.</dd>\r
+<dd>An unrecoverable hard error occured during the read operation.</dd>\r
 <dt>RES_PARERR</dt>\r
 <dd>Invalid parameter.</dd>\r
 <dt>RES_NOTRDY</dt>\r
@@ -56,14 +56,14 @@ DRESULT disk_read (
 \r
 <div class="para desc">\r
 <h4>Description</h4>\r
-<p>The data read/write operation to the storage devices is done in unit of <em>sector</em>. FatFs supports the sector size in range of from 512 to 4096 bytes. When FatFs is configured to fixed sector size (<tt>_MIN_SS == MAX_SS</tt>, this will be the most case), the read/write function must work at that sector size. When FatFs is configured to variable sector size (<tt>_MIN_SS != MAX_SS</tt>), sector size is inquired with <tt>disk_ioctl</tt> function following <tt>disk_initialize</tt> function.</p>\r
+<p>Read/write operation to the generic storage devices, such as memory card, hadddisk and optical disk, is done in unit of block of data bytes called <em>sector</em>. FatFs supports the sector size in range of 512 to 4096 bytes. When FatFs is configured for fixed sector size (<tt>FF_MIN_SS == FF_MAX_SS</tt>, this is the most case), the read/write function must work at that sector size. When FatFs is configured for variable sector size (<tt>FF_MIN_SS &lt; FF_MAX_SS</tt>), the sector size of medium is inquired with <tt>disk_ioctl</tt> function immediately following <tt>disk_initialize</tt> function succeeded.</p>\r
 <p>The memory address specified by <tt class="arg">buff</tt> is not that always aligned to word boundary because the argument is defined as <tt>BYTE*</tt>. The unaligned read/write request can occure at <a href="appnote.html#fs1">direct transfer</a>. If the bus architecture, especially DMA controller, does not allow unaligned memory access, it should be solved in this function. There are some workarounds described below to avoid this issue.</p>\r
 <ul>\r
 <li>Convert word transfer to byte transfer in this function if needed. - Recommended.</li>\r
-<li>On the <tt>f_read</tt> calls, avoid long read request that includes a whole of sector. - Any direct transfer never occures.</li>\r
-<li>On the <tt>f_read</tt> calls, make sure that <tt>(((UINT)data &amp; 3) == (f_tell(fp) &amp; 3))</tt> is true. - Word alignment of <tt>buff</tt> is guaranteed.</li>\r
+<li>On the <tt>f_read()</tt> calls, avoid long read request that includes a whole of sector. - Any direct transfer never occures.</li>\r
+<li>On the <tt>f_read(fp, dat, btw, bw)</tt> calls, make sure that <tt>(((UINT)dat &amp; 3) == (f_tell(fp) &amp; 3))</tt> is true. - Word alignment of <tt class="arg">buff</tt> is guaranteed no matter dat is not word aligned.</li>\r
 </ul>\r
-<p>Generally, a multiple sector transfer request must not be split into single sector transactions to the storage device, or you will not get good read throughput.</p>\r
+<p>Generally, a multiple sector read request must not be split into single sector transactions to the storage device, or read throughput gets worse.</p>\r
 </div>\r
 \r
 \r