fatfs v0.09b Jan 23,2013:
- Added f_getlabel() and f_setlabel(). (_USE_LABEL == 1)
This commit is contained in:
1 parent
030f12c942
commit
750225eb33
112 files changed
+1847
-1043
No files matched your search
+12
-12
@@ -16,10 +16,10 @@
|
||||
<p>The disk_read function reads sector(s) from the disk drive.</p>
|
||||
<pre>
|
||||
DRESULT disk_read (
|
||||
BYTE <em>Drive</em>, <span class="c">/* Physical drive number */</span>
|
||||
BYTE* <em>Buffer</em>, <span class="c">/* Pointer to the read data buffer */</span>
|
||||
DWORD <em>SectorNumber</em>, <span class="c">/* Start sector number */</span>
|
||||
BYTE <em>SectorCount</em> <span class="c">/* Number of sectros to read */</span>
|
||||
BYTE <span class="arg">pdrv</span>, <span class="c">/* [IN] Physical drive number */</span>
|
||||
BYTE* <span class="arg">buff</span>, <span class="c">/* [OUT] Pointer to the read data buffer */</span>
|
||||
DWORD <span class="arg">sector</span>, <span class="c">/* [IN] Start sector number */</span>
|
||||
BYTE <span class="arg">count</span> <span class="c">/* [IN] Number of sectros to read */</span>
|
||||
);
|
||||
</pre>
|
||||
</div>
|
||||
@@ -27,13 +27,13 @@ DRESULT disk_read (
|
||||
<div class="para arg">
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>Drive</dt>
|
||||
<dt>pdrv</dt>
|
||||
<dd>Specifies the physical drive number.</dd>
|
||||
<dt>Buffer</dt>
|
||||
<dt>buff</dt>
|
||||
<dd>Pointer to the <em>byte array</em> to store the read data. The size of buffer must be in sector size * sector count.</dd>
|
||||
<dt>SectorNumber</dt>
|
||||
<dt>sector</dt>
|
||||
<dd>Specifies the start sector number in logical block address (LBA).</dd>
|
||||
<dt>SectorCount</dt>
|
||||
<dt>count</dt>
|
||||
<dd>Specifies number of sectors to read. The value can be 1 to 128. Generally, a multiple sector transfer request must not be split into single sector transactions to the device, or you may not get good read performance.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
@@ -56,11 +56,11 @@ DRESULT disk_read (
|
||||
|
||||
<div class="para desc">
|
||||
<h4>Description</h4>
|
||||
<p>The specified memory address is not that always aligned to word boundary because the type of pointer is defined as BYTE. The misaligned read/write request can occure at <a href="appnote.html#fs1">direct transfer</a>. If the bus architecture, especially DMA controller, does not allow misaligned memory access, it should be solved in this function. There are some workarounds below to avoid this problem.</p>
|
||||
<p>The memory address specified by <tt class="arg">buff</tt> is not that always aligned to word boundary because the type of argument is defined as <tt>BYTE*</tt>. The misaligned read/write request can occure at <a href="appnote.html#fs1">direct transfer</a>. If the bus architecture, especially DMA controller, does not allow misaligned memory access, it should be solved in this function. There are some workarounds described below to avoid this issue.</p>
|
||||
<ul>
|
||||
<li>In this function, convert word transfer to byte transfer. - Recommended.</li>
|
||||
<li>On f_read(), avoid long read request that includes a whole of sector. - Direct transfer will never occure.</li>
|
||||
<li>On f_read(), make sure that the lower two bits of start address is equal to the lower two bits of file read/write pointer. - Word aligned direct transfer is guaranteed.</li>
|
||||
<li>Convert word transfer to byte transfer in this function. - Recommended.</li>
|
||||
<li>For <tt>f_read()</tt>, avoid long read request that includes a whole of sector. - Direct transfer will never occure.</li>
|
||||
<li>For <tt>f_read(fp, buff, btr, &br)</tt>, make sure that <tt>(((UINT)buff & 3) == (f_tell(fp) & 3))</tt> is true. - Word aligned direct transfer is guaranteed.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in new issue
Block a user