📄 group__fat.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"><title>sd-reader: FAT support</title><link href="doxygen.css" rel="stylesheet" type="text/css"><link href="tabs.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.5.6 --><div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div></div><div class="contents"><h1>FAT support</h1><hr><a name="_details"></a><h2>Detailed Description</h2>This module implements FAT16/FAT32 read and write access. <p>The following features are supported:<ul><li>File names up to 31 characters long.</li><li>Unlimited depth of subdirectories.</li><li>Short 8.3 and long filenames.</li><li>Creating and deleting files.</li><li>Reading and writing from and to files.</li><li>File resizing.</li><li>File sizes of up to 4 gigabytes. </li></ul><p><table border="0" cellpadding="0" cellspacing="0"><tr><td></td></tr><tr><td colspan="2"><br><h2>Files</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">file </td><td class="memItemRight" valign="bottom"><a class="el" href="fat_8c.html">fat.c</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">FAT implementation (license: GPLv2 or LGPLv2.1). <br></td></tr><p><tr><td class="memItemLeft" nowrap align="right" valign="top">file </td><td class="memItemRight" valign="bottom"><a class="el" href="fat_8h.html">fat.h</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">FAT header (license: GPLv2 or LGPLv2.1). <br></td></tr><p><tr><td class="memItemLeft" nowrap align="right" valign="top">file </td><td class="memItemRight" valign="bottom"><a class="el" href="fat__config_8h.html">fat_config.h</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">FAT configuration (license: GPLv2 or LGPLv2.1). <br></td></tr><p><tr><td colspan="2"><br><h2>Modules</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fat__config.html">FAT configuration</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Preprocessor defines to configure the FAT implementation. <br></td></tr><p><tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fat__fs.html">FAT access</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Basic functions for handling a FAT filesystem. <br></td></tr><p><tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fat__file.html">FAT file functions</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Functions for managing files. <br></td></tr><p><tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fat__dir.html">FAT directory functions</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Functions for managing directories. <br></td></tr><p><tr><td colspan="2"><br><h2>Data Structures</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structfat__dir__entry__struct.html">fat_dir_entry_struct</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Describes a directory entry. <a href="structfat__dir__entry__struct.html#_details">More...</a><br></td></tr><tr><td colspan="2"><br><h2>Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">struct fat_fs_struct * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fat.html#g5d726bac328b49abc2e6fb022d97092a">fat_open</a> (struct <a class="el" href="structpartition__struct.html">partition_struct</a> *partition)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Opens a FAT filesystem. <a href="#g5d726bac328b49abc2e6fb022d97092a"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fat.html#g057612824886e115b88bf5affcf76829">fat_close</a> (struct fat_fs_struct *fs)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Closes a FAT filesystem. <a href="#g057612824886e115b88bf5affcf76829"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">struct fat_file_struct * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fat.html#g76a0b06949525b578db04a56d67fbfc4">fat_open_file</a> (struct fat_fs_struct *fs, const struct <a class="el" href="structfat__dir__entry__struct.html">fat_dir_entry_struct</a> *dir_entry)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Opens a file on a FAT filesystem. <a href="#g76a0b06949525b578db04a56d67fbfc4"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fat.html#g70b082abb4ebc8d4e9956886901b55fc">fat_close_file</a> (struct fat_file_struct *fd)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Closes a file. <a href="#g70b082abb4ebc8d4e9956886901b55fc"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">intptr_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fat.html#g48e17b173bede64cb08cef05b88fd0ca">fat_read_file</a> (struct fat_file_struct *fd, uint8_t *buffer, uintptr_t buffer_len)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Reads data from a file. <a href="#g48e17b173bede64cb08cef05b88fd0ca"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">intptr_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fat.html#g6782ff80eb6fba9b6ed1a66f33dae60a">fat_write_file</a> (struct fat_file_struct *fd, const uint8_t *buffer, uintptr_t buffer_len)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Writes data to a file. <a href="#g6782ff80eb6fba9b6ed1a66f33dae60a"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">uint8_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fat.html#gd4c305cf004bae9bea48730ed20c87ec">fat_seek_file</a> (struct fat_file_struct *fd, int32_t *offset, uint8_t whence)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Repositions the read/write file offset. <a href="#gd4c305cf004bae9bea48730ed20c87ec"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">uint8_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fat.html#gce4858e7a145684f6c8cd14debe14255">fat_resize_file</a> (struct fat_file_struct *fd, uint32_t size)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Resizes a file to have a specific size. <a href="#gce4858e7a145684f6c8cd14debe14255"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">struct fat_dir_struct * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fat.html#gc7a5b4ad0b972759a965e1afd5bbc87c">fat_open_dir</a> (struct fat_fs_struct *fs, const struct <a class="el" href="structfat__dir__entry__struct.html">fat_dir_entry_struct</a> *dir_entry)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Opens a directory. <a href="#gc7a5b4ad0b972759a965e1afd5bbc87c"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fat.html#g2fed74d916370428e3dcf278e7050111">fat_close_dir</a> (struct fat_dir_struct *dd)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Closes a directory descriptor. <a href="#g2fed74d916370428e3dcf278e7050111"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">uint8_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fat.html#gb4bc79452dbf5ac2a2f3e1fccafd9534">fat_read_dir</a> (struct fat_dir_struct *dd, struct <a class="el" href="structfat__dir__entry__struct.html">fat_dir_entry_struct</a> *dir_entry)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Reads the next directory entry contained within a parent directory. <a href="#gb4bc79452dbf5ac2a2f3e1fccafd9534"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">uint8_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fat.html#g2d74af47cb9fd44f7c974834f810225f">fat_reset_dir</a> (struct fat_dir_struct *dd)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Resets a directory handle. <a href="#g2d74af47cb9fd44f7c974834f810225f"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">uint8_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fat.html#g9d17d09125359dfb440fc57eede40b4f">fat_create_file</a> (struct fat_dir_struct *parent, const char *file, struct <a class="el" href="structfat__dir__entry__struct.html">fat_dir_entry_struct</a> *dir_entry)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Creates a file. <a href="#g9d17d09125359dfb440fc57eede40b4f"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">uint8_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fat.html#g46055219b942eb8d57ffae9dc6447e7c">fat_delete_file</a> (struct fat_fs_struct *fs, struct <a class="el" href="structfat__dir__entry__struct.html">fat_dir_entry_struct</a> *dir_entry)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Deletes a file or directory. <a href="#g46055219b942eb8d57ffae9dc6447e7c"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">uint8_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fat.html#gff3b524066c9a937fae32771c80e7603">fat_create_dir</a> (struct fat_dir_struct *parent, const char *dir, struct <a class="el" href="structfat__dir__entry__struct.html">fat_dir_entry_struct</a> *dir_entry)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Creates a directory. <a href="#gff3b524066c9a937fae32771c80e7603"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fat.html#g24763fd73cbeb580ae5d19e975bde0d8">fat_get_file_modification_date</a> (const struct <a class="el" href="structfat__dir__entry__struct.html">fat_dir_entry_struct</a> *dir_entry, uint16_t *year, uint8_t *month, uint8_t *day)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the modification date of a file. <a href="#g24763fd73cbeb580ae5d19e975bde0d8"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fat.html#g74f840c317556b7dae766e199d87a6ef">fat_get_file_modification_time</a> (const struct <a class="el" href="structfat__dir__entry__struct.html">fat_dir_entry_struct</a> *dir_entry, uint8_t *hour, uint8_t *min, uint8_t *sec)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the modification time of a file. <a href="#g74f840c317556b7dae766e199d87a6ef"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">uint8_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fat.html#g033743a7d8878712e0add6d57b750525">fat_get_dir_entry_of_path</a> (struct fat_fs_struct *fs, const char *path, struct <a class="el" href="structfat__dir__entry__struct.html">fat_dir_entry_struct</a> *dir_entry)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Retrieves the directory entry of a path. <a href="#g033743a7d8878712e0add6d57b750525"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">offset_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fat.html#gab7768ca45847d5c4033a91984d65f1a">fat_get_fs_size</a> (const struct fat_fs_struct *fs)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the amount of total storage capacity of the filesystem in bytes. <a href="#gab7768ca45847d5c4033a91984d65f1a"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">offset_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fat.html#gcc43179721b97d82fefafaf5625350bb">fat_get_fs_free</a> (const struct fat_fs_struct *fs)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the amount of free storage capacity on the filesystem in bytes. <a href="#gcc43179721b97d82fefafaf5625350bb"></a><br></td></tr></table><hr><h2>Function Documentation</h2><a class="anchor" name="g057612824886e115b88bf5affcf76829"></a><!-- doxytag: member="fat.h::fat_close" ref="g057612824886e115b88bf5affcf76829" args="(struct fat_fs_struct *fs)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">void fat_close </td> <td>(</td> <td class="paramtype">struct fat_fs_struct * </td> <td class="paramname"> <em>fs</em> </td> <td> ) </td> <td></td> </tr> </table></div><div class="memdoc"><p>Closes a FAT filesystem. <p>When this function returns, the given filesystem descriptor will be invalid.<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>fs</em> </td><td>The filesystem to close. </td></tr> </table></dl><dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__fat.html#g5d726bac328b49abc2e6fb022d97092a" title="Opens a FAT filesystem.">fat_open</a> </dd></dl></div></div><p><a class="anchor" name="g2fed74d916370428e3dcf278e7050111"></a><!-- doxytag: member="fat.h::fat_close_dir" ref="g2fed74d916370428e3dcf278e7050111" args="(struct fat_dir_struct *dd)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">void fat_close_dir </td> <td>(</td> <td class="paramtype">struct fat_dir_struct * </td> <td class="paramname"> <em>dd</em> </td> <td> ) </td> <td></td> </tr> </table></div><div class="memdoc"><p>Closes a directory descriptor. <p>This function destroys a directory descriptor which was previously obtained by calling <a class="el" href="group__fat__dir.html#gc7a5b4ad0b972759a965e1afd5bbc87c" title="Opens a directory.">fat_open_dir()</a>. When this function returns, the given descriptor will be invalid.<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 descriptor to close. </td></tr> </table></dl><dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__fat.html#gc7a5b4ad0b972759a965e1afd5bbc87c" title="Opens a directory.">fat_open_dir</a> </dd></dl></div></div><p><a class="anchor" name="g70b082abb4ebc8d4e9956886901b55fc"></a><!-- doxytag: member="fat.h::fat_close_file" ref="g70b082abb4ebc8d4e9956886901b55fc" args="(struct fat_file_struct *fd)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">void fat_close_file </td> <td>(</td> <td class="paramtype">struct fat_file_struct * </td> <td class="paramname"> <em>fd</em> </td> <td> ) </td> <td></td> </tr> </table></div><div class="memdoc"><p>Closes 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> </td><td valign="top"><em>fd</em> </td><td>The file handle of the file to close. </td></tr> </table></dl><dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__fat.html#g76a0b06949525b578db04a56d67fbfc4" title="Opens a file on a FAT filesystem.">fat_open_file</a> </dd></dl></div></div><p><a class="anchor" name="gff3b524066c9a937fae32771c80e7603"></a><!-- doxytag: member="fat.h::fat_create_dir" ref="gff3b524066c9a937fae32771c80e7603" args="(struct fat_dir_struct *parent, const char *dir, struct fat_dir_entry_struct *dir_entry)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">uint8_t fat_create_dir </td> <td>(</td> <td class="paramtype">struct fat_dir_struct * </td> <td class="paramname"> <em>parent</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"> <em>dir</em>, </td> </tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -