📄 group__fat16.html
字号:
<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>dd</em> </td><td>The descriptor of the parent directory from which to read the entry. </td></tr> <tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>dir_entry</em> </td><td>Pointer to a buffer into which to write the directory entry information. </td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>0 on failure, 1 on success. </dd></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__fat16.html#gaed63addc9b9a3d5137f3b552abb42d8">fat16_reset_dir</a> </dd></dl> </td> </tr></table><a class="anchor" name="g0af2ef3d690626a5640a334cefbb27a6"></a><!-- doxytag: member="fat16.h::fat16_read_file" ref="g0af2ef3d690626a5640a334cefbb27a6" args="(struct fat16_file_struct *fd, uint8_t *buffer, uint16_t buffer_len)" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">int16_t fat16_read_file </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">struct fat16_file_struct * </td> <td class="mdname" nowrap> <em>fd</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>uint8_t * </td> <td class="mdname" nowrap> <em>buffer</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>uint16_t </td> <td class="mdname" nowrap> <em>buffer_len</em></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Reads data from a file. <p>The data requested is read from the current file location.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>fd</em> </td><td>The file handle of the file from which to read. </td></tr> <tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>buffer</em> </td><td>The buffer into which to write. </td></tr> <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>buffer_len</em> </td><td>The amount of data to read. </td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>The number of bytes read, 0 on end of file, or -1 on failure. </dd></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__fat16.html#g4f0c785a47b1cf070839b5edec2c6f65">fat16_write_file</a> </dd></dl> </td> </tr></table><a class="anchor" name="gaed63addc9b9a3d5137f3b552abb42d8"></a><!-- doxytag: member="fat16.h::fat16_reset_dir" ref="gaed63addc9b9a3d5137f3b552abb42d8" args="(struct fat16_dir_struct *dd)" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">uint8_t fat16_reset_dir </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">struct fat16_dir_struct * </td> <td class="mdname1" valign="top" nowrap> <em>dd</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Resets a directory handle. <p>Resets the directory handle such that reading restarts with the first directory entry.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>dd</em> </td><td>The directory handle to reset. </td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>0 on failure, 1 on success. </dd></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__fat16.html#g73c8f0598e8224736b09644c48cf2970">fat16_read_dir</a> </dd></dl> </td> </tr></table><a class="anchor" name="g23740742fa60ca148ef098caac7085c0"></a><!-- doxytag: member="fat16.h::fat16_resize_file" ref="g23740742fa60ca148ef098caac7085c0" args="(struct fat16_file_struct *fd, uint32_t size)" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">uint8_t fat16_resize_file </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">struct fat16_file_struct * </td> <td class="mdname" nowrap> <em>fd</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>uint32_t </td> <td class="mdname" nowrap> <em>size</em></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Resizes a file to have a specific size. <p>Enlarges or shrinks the file pointed to by the file descriptor to have exactly the specified size.<p>If the file is truncated, all bytes having an equal or larger offset than the given size are lost. If the file is expanded, the additional bytes are allocated, but they keep their values.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>fd</em> </td><td>The file decriptor of the file which to resize. </td></tr> <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>size</em> </td><td>The new size of the file. </td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>0 on failure, 1 on success. </dd></dl> </td> </tr></table><a class="anchor" name="gf1511fd1a5419d0828265566dc5d33e4"></a><!-- doxytag: member="fat16.h::fat16_seek_file" ref="gf1511fd1a5419d0828265566dc5d33e4" args="(struct fat16_file_struct *fd, int32_t *offset, uint8_t whence)" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">uint8_t fat16_seek_file </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">struct fat16_file_struct * </td> <td class="mdname" nowrap> <em>fd</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>int32_t * </td> <td class="mdname" nowrap> <em>offset</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>uint8_t </td> <td class="mdname" nowrap> <em>whence</em></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Repositions the read/write file offset. <p>Changes the file offset where the next call to <a class="el" href="group__fat16__file.html#g0af2ef3d690626a5640a334cefbb27a6">fat16_read_file()</a> or <a class="el" href="group__fat16__file.html#g4f0c785a47b1cf070839b5edec2c6f65">fat16_write_file()</a> starts reading/writing.<p>If the new offset is beyond the end of the file, <a class="el" href="group__fat16__file.html#g23740742fa60ca148ef098caac7085c0">fat16_resize_file()</a> is implicitly called, i.e. the file is expanded.<p>The new offset can be given in different ways determined by the <code>whence</code> parameter:<ul><li><b>FAT16_SEEK_SET:</b> <code>*offset</code> is relative to the beginning of the file.</li><li><b>FAT16_SEEK_CUR:</b> <code>*offset</code> is relative to the current file position.</li><li><b>FAT16_SEEK_END:</b> <code>*offset</code> is relative to the end of the file.</li></ul><p>The resulting absolute offset is written to the location the <code>offset</code> parameter points to.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>fd</em> </td><td>The file decriptor of the file on which to seek. </td></tr> <tr><td valign="top"><tt>[in,out]</tt> </td><td valign="top"><em>offset</em> </td><td>A pointer to the new offset, as affected by the <code>whence</code> parameter. The function writes the new absolute offset to this location before it returns. </td></tr> <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>whence</em> </td><td>Affects the way <code>offset</code> is interpreted, see above. </td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>0 on failure, 1 on success. </dd></dl> </td> </tr></table><a class="anchor" name="g4f0c785a47b1cf070839b5edec2c6f65"></a><!-- doxytag: member="fat16.h::fat16_write_file" ref="g4f0c785a47b1cf070839b5edec2c6f65" args="(struct fat16_file_struct *fd, const uint8_t *buffer, uint16_t buffer_len)" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">int16_t fat16_write_file </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">struct fat16_file_struct * </td> <td class="mdname" nowrap> <em>fd</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>const uint8_t * </td> <td class="mdname" nowrap> <em>buffer</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>uint16_t </td> <td class="mdname" nowrap> <em>buffer_len</em></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Writes data to a file. <p>The data is written to the current file location.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>fd</em> </td><td>The file handle of the file to which to write. </td></tr> <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>buffer</em> </td><td>The buffer from which to read the data to be written. </td></tr> <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>buffer_len</em> </td><td>The amount of data to write. </td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>The number of bytes written, 0 on disk full, or -1 on failure. </dd></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__fat16.html#g0af2ef3d690626a5640a334cefbb27a6">fat16_read_file</a> </dd></dl> </td> </tr></table><hr size="1"><address style="align: right;"><small>Generated on Thu Mar 16 13:43:58 2006 for sd-reader by <a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.6 </small></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -