dwrite.html 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <!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_write</title>
  9. </head>
  10. <body>
  11. <div class="para">
  12. <h2>disk_write</h2>
  13. <p>The disk_write writes sector(s) to the disk.</p>
  14. <pre>
  15. DRESULT disk_write (
  16. BYTE <em>Drive</em>, /* Physical drive number */
  17. const BYTE* <em>Buffer</em>, /* Pointer to the write data */
  18. DWORD <em>SectorNumber</em>, /* Sector number to write */
  19. BYTE <em>SectorCount</em> /* Number of sectors to write */
  20. );
  21. </pre>
  22. </div>
  23. <div class="para">
  24. <h4>Parameters</h4>
  25. <dl class="par">
  26. <dt>Drive</dt>
  27. <dd>Specifies the physical drive number.</dd>
  28. <dt>Buffer</dt>
  29. <dd>Pointer to the data to be written.</dd>
  30. <dt>SectorNumber</dd>
  31. <dd>Specifies the start sector number in logical block address (LBA).</dd>
  32. <dt>SectorCount</dt>
  33. <dd>Specifies the number of sectors to write. The value can be 1 to 255.</dd>
  34. </dl>
  35. </div>
  36. <div class="para">
  37. <h4>Return Values</h4>
  38. <dl class="ret">
  39. <dt>RES_OK (0)</dt>
  40. <dd>The function succeeded.</dd>
  41. <dt>RES_ERROR</dt>
  42. <dd>Any hard error occured during the write operation and could not recover it.</dd>
  43. <dt>RES_WRPRT</dt>
  44. <dd>The disk is write protected.</dd>
  45. <dt>RES_PARERR</dt>
  46. <dd>Invalid parameter.</dd>
  47. <dt>RES_NOTRDY</dt>
  48. <dd>The disk drive has not been initialized.</dd>
  49. </dl>
  50. </div>
  51. <div class="para">
  52. <h4>Description</h4>
  53. <p>This function is not required in read only configuration.</p>
  54. </div>
  55. <p class="foot"><a href="../00index_e.html">Return</a></p>
  56. </body>
  57. </html>