/wbudowane/mp3-wave/pff2/doc/pf/read.html

http://momus-projects.googlecode.com/ · HTML · 73 lines · 62 code · 11 blank · 0 comment · 0 complexity · af9df31869f7b54e9494f11ab9b1aaea MD5 · raw file

  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="Petit FatFs" href="../00index_p.html">
  7. <link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
  8. <link rel="stylesheet" href="../css_p.css" type="text/css" media="screen" title="ELM Default">
  9. <title>Petit FatFs - pf_read</title>
  10. </head>
  11. <body>
  12. <div class="para">
  13. <h2>pf_read</h2>
  14. <p>The pf_read function reads data from the file.</p>
  15. <pre>
  16. FRESULT pf_read (
  17. void* <em>Buffer</em>, /* Pointer to the read buffer */
  18. WORD <em>ByteToRead</em>, /* Number of bytes to read */
  19. WORD* <em>BytesRead</em> /* Pointer to the variable to return number of bytes read */
  20. );
  21. </pre>
  22. </div>
  23. <div class="para">
  24. <h4>Parameters</h4>
  25. <dl class="par">
  26. <dt>Buffer</dt>
  27. <dd>Pointer to the buffer to store the read data. A NULL specifies the destination is an outgoing stream.</dd>
  28. <dt>ByteToRead</dt>
  29. <dd>Number of bytes to read.</dd>
  30. <dt>BytesRead</dt>
  31. <dd>Pointer to the WORD variable to return number of bytes read.</dd>
  32. </dl>
  33. </div>
  34. <div class="para">
  35. <h4>Return Values</h4>
  36. <dl class="ret">
  37. <dt>FR_OK (0)</dt>
  38. <dd>The function succeeded.</dd>
  39. <dt>FR_DISK_ERR</dt>
  40. <dd>The function failed due to an error in the disk function, a wrong FAT structure or an internal error.</dd>
  41. <dt>FR_NOT_OPENED</dt>
  42. <dd>The file has not been opened.</dd>
  43. <dt>FR_NOT_ENABLED</dt>
  44. <dd>The volume has not been mounted.</dd>
  45. </dl>
  46. </div>
  47. <div class="para">
  48. <h4>Description</h4>
  49. <p>The read pointer in the file system object increases in number of bytes read. After the function succeeded, <tt>*BytesRead</tt> should be checked to detect end of file. In case of <tt>*BytesRead &lt; ByteToRead</tt>, it means the read pointer reached end of file during read operation.</p>
  50. <p>If a NULL is given to the Buffer, the read bytes will be forwarded to the outgoing stream instead of the memory. The streaming function will be typically built-in the low level disk read function.</p>
  51. </div>
  52. <div class="para">
  53. <h4>QuickInfo</h4>
  54. <p>Available when <tt>_USE_READ == 1</tt>.</p>
  55. </div>
  56. <div class="para">
  57. <h4>References</h4>
  58. <p><tt><a href="open.html">pf_open</a>, <a href="write.html">pf_write</a>, <a href="sfatfs.html">FATFS</a></tt></p>
  59. </div>
  60. <p class="foot"><a href="../00index_p.html">Return</a></p>
  61. </body>
  62. </html>