This repository has been archived on 2020-09-09. You can view files and clone it, but cannot push or open issues or pull requests.
arduino_universal_serial_ad.../Libraries/SdFat/html/class_sd_volume.html

437 lines
22 KiB
HTML
Raw Permalink Normal View History

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>SdFat: SdVolume Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.4 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">SdFat</div>
</td>
</tr>
</tbody>
</table>
</div>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#friends">Friends</a> </div>
<div class="headertitle">
<div class="title">SdVolume Class Reference</div> </div>
</div>
<div class="contents">
<!-- doxytag: class="SdVolume" -->
<p>Access FAT16 and FAT32 volumes on SD and SDHC cards.
<a href="class_sd_volume.html#details">More...</a></p>
<p><code>#include &lt;SdVolume.h&gt;</code></p>
<div class="dynheader">
Collaboration diagram for SdVolume:</div>
<div class="dyncontent">
<div class="center"><img src="class_sd_volume__coll__graph.png" border="0" usemap="#_sd_volume_coll__map" alt="Collaboration graph"/></div>
<map name="_sd_volume_coll__map" id="_sd_volume_coll__map">
<area shape="rect" id="node2" href="unioncache__t.html" title="Cache for an SD data block." alt="" coords="247,187,313,213"/> <area shape="rect" id="node4" href="structdirectory_entry.html" title="FAT short directory entry." alt="" coords="5,96,107,123"/> <area shape="rect" id="node6" href="structfat32__fsinfo.html" title="FSINFO sector for a FAT32 volume." alt="" coords="131,96,220,123"/> <area shape="rect" id="node8" href="structfat__boot.html" title="Boot sector for a FAT12/FAT16 volume." alt="" coords="245,96,315,123"/> <area shape="rect" id="node10" href="structmaster_boot_record.html" title="Master Boot Record." alt="" coords="339,96,465,123"/> <area shape="rect" id="node12" href="structpartition_table.html" title="MBR partition table entry." alt="" coords="352,5,453,32"/> <area shape="rect" id="node14" href="structfat32__boot.html" title="Boot sector for a FAT32 volume." alt="" coords="491,96,573,123"/> <area shape="rect" id="node16" href="class_sd2_card.html" title="Raw access to SD and SDHC flash memory cards." alt="" coords="350,187,420,213"/> </map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<p><a href="class_sd_volume-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_volume.html#affab4c57c98e41ee55b21c87f814804b">blocksPerCluster</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_volume.html#a87ed6542db9642ffa106def897a368c6">blocksPerFat</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="unioncache__t.html">cache_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_volume.html#adaecef65fdf94d323597a461eb641f5e">cacheClear</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_volume.html#a323adfb5ac395b769f30c31ce2618f22">clusterCount</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_volume.html#a50c8e198feb63b0ca26737f91bd3e139">clusterSizeShift</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_volume.html#a99ca71035785948c42ade0863f91c9ab">dataStartBlock</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_volume.html#a4dbcb7b34a83468b1c6f8c4556393526">dbgFat</a> (uint32_t n, uint32_t *v)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_volume.html#a5d4307584ef14e4a2fef85b4954b1aa2">fatCount</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_volume.html#a9032ec5d3323ee67477c6bbf39821415">fatStartBlock</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_volume.html#a3f7b12db1e9ec4b847cd41fbe46b7baf">fatType</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_volume.html#a162efe707ab46847202300cb38739629">freeClusterCount</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_volume.html#ae820ee8d9ea7ed01ce72ae3508a63cbf">init</a> (<a class="el" href="class_sd2_card.html">Sd2Card</a> *dev, uint8_t part)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_volume.html#a0ac221eda119ddccae8ac6bc20a4b12d">init</a> (<a class="el" href="class_sd2_card.html">Sd2Card</a> *dev)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_volume.html#a8573884a8056ab7c4c0d6e442f676cc4">rootDirEntryCount</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_volume.html#aa1479f90c53bc9eac379664c5233d399">rootDirStart</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_sd2_card.html">Sd2Card</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_volume.html#afe76a9f7c181458995518dc8530a1fad">sdCard</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_volume.html#a30d4489087fbdce20b8fe1a624dbe658">SdVolume</a> ()</td></tr>
<tr><td colspan="2"><h2><a name="friends"></a>
Friends</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a05e466c179d34fec11c4406677fe0533"></a><!-- doxytag: member="SdVolume::SdBaseFile" ref="a05e466c179d34fec11c4406677fe0533" args="" -->
class&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_volume.html#a05e466c179d34fec11c4406677fe0533">SdBaseFile</a></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Access FAT16 and FAT32 volumes on SD and SDHC cards. </p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a30d4489087fbdce20b8fe1a624dbe658"></a><!-- doxytag: member="SdVolume::SdVolume" ref="a30d4489087fbdce20b8fe1a624dbe658" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">SdVolume::SdVolume </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Create an instance of <a class="el" href="class_sd_volume.html" title="Access FAT16 and FAT32 volumes on SD and SDHC cards.">SdVolume</a> </p>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="affab4c57c98e41ee55b21c87f814804b"></a><!-- doxytag: member="SdVolume::blocksPerCluster" ref="affab4c57c98e41ee55b21c87f814804b" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint8_t SdVolume::blocksPerCluster </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<dl class="return"><dt><b>Returns:</b></dt><dd>The volume's cluster size in blocks. </dd></dl>
</div>
</div>
<a class="anchor" id="a87ed6542db9642ffa106def897a368c6"></a><!-- doxytag: member="SdVolume::blocksPerFat" ref="a87ed6542db9642ffa106def897a368c6" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint32_t SdVolume::blocksPerFat </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<dl class="return"><dt><b>Returns:</b></dt><dd>The number of blocks in one FAT. </dd></dl>
</div>
</div>
<a class="anchor" id="adaecef65fdf94d323597a461eb641f5e"></a><!-- doxytag: member="SdVolume::cacheClear" ref="adaecef65fdf94d323597a461eb641f5e" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="unioncache__t.html">cache_t</a>* SdVolume::cacheClear </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Clear the cache and returns a pointer to the cache. Used by the WaveRP recorder to do raw write to the SD card. Not for normal apps. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>A pointer to the cache buffer or zero if an error occurs. </dd></dl>
</div>
</div>
<a class="anchor" id="a323adfb5ac395b769f30c31ce2618f22"></a><!-- doxytag: member="SdVolume::clusterCount" ref="a323adfb5ac395b769f30c31ce2618f22" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint32_t SdVolume::clusterCount </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<dl class="return"><dt><b>Returns:</b></dt><dd>The total number of clusters in the volume. </dd></dl>
</div>
</div>
<a class="anchor" id="a50c8e198feb63b0ca26737f91bd3e139"></a><!-- doxytag: member="SdVolume::clusterSizeShift" ref="a50c8e198feb63b0ca26737f91bd3e139" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint8_t SdVolume::clusterSizeShift </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<dl class="return"><dt><b>Returns:</b></dt><dd>The shift count required to multiply by blocksPerCluster. </dd></dl>
</div>
</div>
<a class="anchor" id="a99ca71035785948c42ade0863f91c9ab"></a><!-- doxytag: member="SdVolume::dataStartBlock" ref="a99ca71035785948c42ade0863f91c9ab" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint32_t SdVolume::dataStartBlock </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<dl class="return"><dt><b>Returns:</b></dt><dd>The logical block number for the start of file data. </dd></dl>
</div>
</div>
<a class="anchor" id="a4dbcb7b34a83468b1c6f8c4556393526"></a><!-- doxytag: member="SdVolume::dbgFat" ref="a4dbcb7b34a83468b1c6f8c4556393526" args="(uint32_t n, uint32_t *v)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool SdVolume::dbgFat </td>
<td>(</td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>n</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint32_t *&#160;</td>
<td class="paramname"><em>v</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Debug access to FAT table</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">n</td><td>cluster number. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">v</td><td>value of entry </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true for success or false for failure </dd></dl>
</div>
</div>
<a class="anchor" id="a5d4307584ef14e4a2fef85b4954b1aa2"></a><!-- doxytag: member="SdVolume::fatCount" ref="a5d4307584ef14e4a2fef85b4954b1aa2" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint8_t SdVolume::fatCount </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<dl class="return"><dt><b>Returns:</b></dt><dd>The number of FAT structures on the volume. </dd></dl>
</div>
</div>
<a class="anchor" id="a9032ec5d3323ee67477c6bbf39821415"></a><!-- doxytag: member="SdVolume::fatStartBlock" ref="a9032ec5d3323ee67477c6bbf39821415" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint32_t SdVolume::fatStartBlock </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<dl class="return"><dt><b>Returns:</b></dt><dd>The logical block number for the start of the first FAT. </dd></dl>
</div>
</div>
<a class="anchor" id="a3f7b12db1e9ec4b847cd41fbe46b7baf"></a><!-- doxytag: member="SdVolume::fatType" ref="a3f7b12db1e9ec4b847cd41fbe46b7baf" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint8_t SdVolume::fatType </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<dl class="return"><dt><b>Returns:</b></dt><dd>The FAT type of the volume. Values are 12, 16 or 32. </dd></dl>
</div>
</div>
<a class="anchor" id="a162efe707ab46847202300cb38739629"></a><!-- doxytag: member="SdVolume::freeClusterCount" ref="a162efe707ab46847202300cb38739629" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t SdVolume::freeClusterCount </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Volume free space in clusters.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Count of free clusters for success or -1 if an error occurs. </dd></dl>
</div>
</div>
<a class="anchor" id="a0ac221eda119ddccae8ac6bc20a4b12d"></a><!-- doxytag: member="SdVolume::init" ref="a0ac221eda119ddccae8ac6bc20a4b12d" args="(Sd2Card *dev)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool SdVolume::init </td>
<td>(</td>
<td class="paramtype"><a class="el" href="class_sd2_card.html">Sd2Card</a> *&#160;</td>
<td class="paramname"><em>dev</em></td><td>)</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Initialize a FAT volume. Try partition one first then try super floppy format.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">dev</td><td>The <a class="el" href="class_sd2_card.html" title="Raw access to SD and SDHC flash memory cards.">Sd2Card</a> where the volume is located.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. Reasons for failure include not finding a valid partition, not finding a valid FAT file system or an I/O error. </dd></dl>
</div>
</div>
<a class="anchor" id="ae820ee8d9ea7ed01ce72ae3508a63cbf"></a><!-- doxytag: member="SdVolume::init" ref="ae820ee8d9ea7ed01ce72ae3508a63cbf" args="(Sd2Card *dev, uint8_t part)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool SdVolume::init </td>
<td>(</td>
<td class="paramtype"><a class="el" href="class_sd2_card.html">Sd2Card</a> *&#160;</td>
<td class="paramname"><em>dev</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>part</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Initialize a FAT volume.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">dev</td><td>The SD card where the volume is located.</td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">part</td><td>The partition to be used. Legal values for <em>part</em> are 1-4 to use the corresponding partition on a device formatted with a MBR, Master Boot Record, or zero if the device is formatted as a super floppy with the FAT boot sector in block zero.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. Reasons for failure include not finding a valid partition, not finding a valid FAT file system in the specified partition or an I/O error. </dd></dl>
</div>
</div>
<a class="anchor" id="a8573884a8056ab7c4c0d6e442f676cc4"></a><!-- doxytag: member="SdVolume::rootDirEntryCount" ref="a8573884a8056ab7c4c0d6e442f676cc4" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint32_t SdVolume::rootDirEntryCount </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<dl class="return"><dt><b>Returns:</b></dt><dd>The number of entries in the root directory for FAT16 volumes. </dd></dl>
</div>
</div>
<a class="anchor" id="aa1479f90c53bc9eac379664c5233d399"></a><!-- doxytag: member="SdVolume::rootDirStart" ref="aa1479f90c53bc9eac379664c5233d399" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint32_t SdVolume::rootDirStart </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<dl class="return"><dt><b>Returns:</b></dt><dd>The logical block number for the start of the root directory on FAT16 volumes or the first cluster number on FAT32 volumes. </dd></dl>
</div>
</div>
<a class="anchor" id="afe76a9f7c181458995518dc8530a1fad"></a><!-- doxytag: member="SdVolume::sdCard" ref="afe76a9f7c181458995518dc8530a1fad" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="class_sd2_card.html">Sd2Card</a>* SdVolume::sdCard </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="class_sd2_card.html" title="Raw access to SD and SDHC flash memory cards.">Sd2Card</a> object for this volume </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>pointer to <a class="el" href="class_sd2_card.html" title="Raw access to SD and SDHC flash memory cards.">Sd2Card</a> object. </dd></dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>Arduino/libraries/SdFat/<a class="el" href="_sd_volume_8h.html">SdVolume.h</a></li>
<li>Arduino/libraries/SdFat/SdVolume.cpp</li>
</ul>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Thu Feb 7 2013 12:51:22 for SdFat by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>