FatFS R0.10b, released May 19, 2014
This commit is contained in:
+18
-10
@@ -13,12 +13,12 @@
|
||||
|
||||
<div class="para func">
|
||||
<h2>disk_write</h2>
|
||||
<p>The disk_write writes sector(s) to the disk.</p>
|
||||
<p>The disk_write writes sector(s) to the storage device.</p>
|
||||
<pre>
|
||||
DRESULT disk_write (
|
||||
BYTE <span class="arg">drv</span>, <span class="c">/* [IN] Physical drive number */</span>
|
||||
const BYTE* <span class="arg">buff</span>, <span class="c">/* [IN] Write data (may be non aligned) */</span>
|
||||
DWORD <span class="arg">sector</span>, <span class="c">/* [IN] Sector number to write */</span>
|
||||
const BYTE* <span class="arg">buff</span>, <span class="c">/* [IN] Pointer to the data to be written */</span>
|
||||
DWORD <span class="arg">sector</span>, <span class="c">/* [IN] Sector number to write from */</span>
|
||||
UINT <span class="arg">count</span> <span class="c">/* [IN] Number of sectors to write */</span>
|
||||
);
|
||||
</pre>
|
||||
@@ -28,13 +28,13 @@ DRESULT disk_write (
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>pdrv</dt>
|
||||
<dd>Specifies the physical drive number.</dd>
|
||||
<dd>Physical drive number to identify the target device.</dd>
|
||||
<dt>buff</dt>
|
||||
<dd>Pointer to the <em>byte array</em> to be written.</dd>
|
||||
<dd>Pointer to the <em>byte array</em> to be written. The size of data to be written is sector size * <tt class="arg">count</tt> bytes.</dd>
|
||||
<dt>sector</dt>
|
||||
<dd>Specifies the start sector number in logical block address (LBA).</dd>
|
||||
<dd>Start sector number in logical block address (LBA).</dd>
|
||||
<dt>count</dt>
|
||||
<dd>Specifies the number of sectors to write. FatFs specifis 1 to 128. Generally, a multiple sector transfer request must not be split into single sector transactions to the device, or you will never get good write performance.</dd>
|
||||
<dd>Number of sectors to write. FatFs specifis it in range of from 1 to 128.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
@@ -51,15 +51,23 @@ DRESULT disk_write (
|
||||
<dt>RES_PARERR</dt>
|
||||
<dd>Invalid parameter.</dd>
|
||||
<dt>RES_NOTRDY</dt>
|
||||
<dd>The disk drive has not been initialized.</dd>
|
||||
<dd>The device has not been initialized.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para desc">
|
||||
<h4>Description</h4>
|
||||
<p>This function is not required in read only configuration. The specified memory address is not that always aligned to word boundary because the type of pointer is defined as <tt>BYTE</tt>. For more information, read <a href="dread.html">description in disk_read function</a>.</p>
|
||||
<p><em>Application program MUST NOT call this function while FatFs is in use, or FAT structure on the volume can be corrapted.</em></p>
|
||||
<p>The specified memory address is not that always aligned to word boundary because the type of pointer is defined as <tt>BYTE*</tt>. For more information, refer to the description of <a href="dread.html"><tt>disk_read()</tt></a> function.</p>
|
||||
<p>Generally, a multiple sector transfer request must not be split into single sector transactions to the storage device, or you will never get good write throughput.</p>
|
||||
<p>FatFs expects delayed write feature of the disk functions. The write operation to the media need not to be completed due to write operation is in progress or only stored it into the cache buffer when return from this function. But data on the <tt class="arg">buff</tt> is invalid after return from this function. The write completion request is done by <tt>CTRL_SYNC</tt> command of <tt><a href="dioctl.html">disk_ioctl()</a></tt> function. Therefore, if delayed write feature is implemented, the write throughput may be improved.</p>
|
||||
<p><em>Application program MUST NOT call this function, or FAT structure on the volume can be collapsed.</em></p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="para comp">
|
||||
<h4>QuickInfo</h4>
|
||||
<p>This function is not needed when <tt>_FS_READONLY == 1</tt>.</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user