⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 group__fat16__file.html

📁 采用fat格式对sd卡进行操作
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<div class="memdoc"><p>Returns the modification time of a file. <p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>dir_entry</em>&nbsp;</td><td>The directory entry of which to return the modification time. </td></tr>    <tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>hour</em>&nbsp;</td><td>The hour the file was last modified. </td></tr>    <tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>min</em>&nbsp;</td><td>The min the file was last modified. </td></tr>    <tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>sec</em>&nbsp;</td><td>The sec the file was last modified. </td></tr>  </table></dl></div></div><p><a class="anchor" name="g3a43c9943251749978645ad8e3f16757"></a><!-- doxytag: member="fat16.c::fat16_open_file" ref="g3a43c9943251749978645ad8e3f16757" args="(struct fat16_fs_struct *fs, const struct fat16_dir_entry_struct *dir_entry)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">struct fat16_file_struct* fat16_open_file           </td>          <td>(</td>          <td class="paramtype">struct fat16_fs_struct *&nbsp;</td>          <td class="paramname"> <em>fs</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">const struct <a class="el" href="structfat16__dir__entry__struct.html">fat16_dir_entry_struct</a> *&nbsp;</td>          <td class="paramname"> <em>dir_entry</em></td><td>&nbsp;</td>        </tr>        <tr>          <td></td>          <td>)</td>          <td></td><td></td><td width="100%"><code> [read]</code></td>        </tr>      </table></div><div class="memdoc"><p>Opens a file on a FAT16 filesystem. <p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>fs</em>&nbsp;</td><td>The filesystem on which the file to open lies. </td></tr>    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>dir_entry</em>&nbsp;</td><td>The directory entry of the file to open. </td></tr>  </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>The file handle, or 0 on failure. </dd></dl><dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__fat16.html#g2b2812041f489bc7913bfa5cbcf0172b" title="Closes a file.">fat16_close_file</a> </dd></dl></div></div><p><a class="anchor" name="g0af2ef3d690626a5640a334cefbb27a6"></a><!-- doxytag: member="fat16.c::fat16_read_file" ref="g0af2ef3d690626a5640a334cefbb27a6" args="(struct fat16_file_struct *fd, uint8_t *buffer, uint16_t buffer_len)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">int16_t fat16_read_file           </td>          <td>(</td>          <td class="paramtype">struct fat16_file_struct *&nbsp;</td>          <td class="paramname"> <em>fd</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">uint8_t *&nbsp;</td>          <td class="paramname"> <em>buffer</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">uint16_t&nbsp;</td>          <td class="paramname"> <em>buffer_len</em></td><td>&nbsp;</td>        </tr>        <tr>          <td></td>          <td>)</td>          <td></td><td></td><td width="100%"></td>        </tr>      </table></div><div class="memdoc"><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>&nbsp;</td><td valign="top"><em>fd</em>&nbsp;</td><td>The file handle of the file from which to read. </td></tr>    <tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>buffer</em>&nbsp;</td><td>The buffer into which to write. </td></tr>    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>buffer_len</em>&nbsp;</td><td>The amount of data to read. </td></tr>  </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>The number of bytes read, 0 on end of file, or -1 on failure. </dd></dl><dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__fat16.html#g4f0c785a47b1cf070839b5edec2c6f65" title="Writes data to a file.">fat16_write_file</a> </dd></dl></div></div><p><a class="anchor" name="g23740742fa60ca148ef098caac7085c0"></a><!-- doxytag: member="fat16.c::fat16_resize_file" ref="g23740742fa60ca148ef098caac7085c0" args="(struct fat16_file_struct *fd, uint32_t size)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">uint8_t fat16_resize_file           </td>          <td>(</td>          <td class="paramtype">struct fat16_file_struct *&nbsp;</td>          <td class="paramname"> <em>fd</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">uint32_t&nbsp;</td>          <td class="paramname"> <em>size</em></td><td>&nbsp;</td>        </tr>        <tr>          <td></td>          <td>)</td>          <td></td><td></td><td width="100%"></td>        </tr>      </table></div><div class="memdoc"><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.<p><dl class="note" compact><dt><b>Note:</b></dt><dd>Please be aware that this function just allocates or deallocates disk space, it does not explicitely clear it. To avoid data leakage, this must be done manually.</dd></dl><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>fd</em>&nbsp;</td><td>The file decriptor of the file which to resize. </td></tr>    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>size</em>&nbsp;</td><td>The new size of the file. </td></tr>  </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on failure, 1 on success. </dd></dl></div></div><p><a class="anchor" name="gf1511fd1a5419d0828265566dc5d33e4"></a><!-- doxytag: member="fat16.c::fat16_seek_file" ref="gf1511fd1a5419d0828265566dc5d33e4" args="(struct fat16_file_struct *fd, int32_t *offset, uint8_t whence)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">uint8_t fat16_seek_file           </td>          <td>(</td>          <td class="paramtype">struct fat16_file_struct *&nbsp;</td>          <td class="paramname"> <em>fd</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">int32_t *&nbsp;</td>          <td class="paramname"> <em>offset</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">uint8_t&nbsp;</td>          <td class="paramname"> <em>whence</em></td><td>&nbsp;</td>        </tr>        <tr>          <td></td>          <td>)</td>          <td></td><td></td><td width="100%"></td>        </tr>      </table></div><div class="memdoc"><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" title="Reads data from a file.">fat16_read_file()</a> or <a class="el" href="group__fat16__file.html#g4f0c785a47b1cf070839b5edec2c6f65" title="Writes data to a file.">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" title="Resizes a file to have a specific size.">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>&nbsp;</td><td valign="top"><em>fd</em>&nbsp;</td><td>The file decriptor of the file on which to seek. </td></tr>    <tr><td valign="top"><tt>[in,out]</tt>&nbsp;</td><td valign="top"><em>offset</em>&nbsp;</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>&nbsp;</td><td valign="top"><em>whence</em>&nbsp;</td><td>Affects the way <code>offset</code> is interpreted, see above. </td></tr>  </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on failure, 1 on success. </dd></dl></div></div><p><a class="anchor" name="g4f0c785a47b1cf070839b5edec2c6f65"></a><!-- doxytag: member="fat16.c::fat16_write_file" ref="g4f0c785a47b1cf070839b5edec2c6f65" args="(struct fat16_file_struct *fd, const uint8_t *buffer, uint16_t buffer_len)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">int16_t fat16_write_file           </td>          <td>(</td>          <td class="paramtype">struct fat16_file_struct *&nbsp;</td>          <td class="paramname"> <em>fd</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">const uint8_t *&nbsp;</td>          <td class="paramname"> <em>buffer</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">uint16_t&nbsp;</td>          <td class="paramname"> <em>buffer_len</em></td><td>&nbsp;</td>        </tr>        <tr>          <td></td>          <td>)</td>          <td></td><td></td><td width="100%"></td>        </tr>      </table></div><div class="memdoc"><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>&nbsp;</td><td valign="top"><em>fd</em>&nbsp;</td><td>The file handle of the file to which to write. </td></tr>    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>buffer</em>&nbsp;</td><td>The buffer from which to read the data to be written. </td></tr>    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>buffer_len</em>&nbsp;</td><td>The amount of data to write. </td></tr>  </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>The number of bytes written, 0 on disk full, or -1 on failure. </dd></dl><dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__fat16.html#g0af2ef3d690626a5640a334cefbb27a6" title="Reads data from a file.">fat16_read_file</a> </dd></dl></div></div><p></div><hr size="1"><address style="text-align: right;"><small>Generated on Sun Jun 8 10:23:35 2008 for sd-reader by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -