You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
168 lines
11 KiB
168 lines
11 KiB
5 years ago
|
<!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"/>
|
||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||
|
<meta name="generator" content="Doxygen 1.8.10"/>
|
||
|
<title>SdFs: Arduino SdFs Library</title>
|
||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||
|
<script type="text/javascript" src="jquery.js"></script>
|
||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||
|
<script type="text/javascript" src="search/search.js"></script>
|
||
|
<script type="text/javascript">
|
||
|
$(document).ready(function() { init_search(); });
|
||
|
</script>
|
||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||
|
</head>
|
||
|
<body>
|
||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||
|
<div id="titlearea">
|
||
|
<table cellspacing="0" cellpadding="0">
|
||
|
<tbody>
|
||
|
<tr style="height: 56px;">
|
||
|
<td id="projectalign" style="padding-left: 0.5em;">
|
||
|
<div id="projectname">SdFs
|
||
|
</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
<!-- end header part -->
|
||
|
<!-- Generated by Doxygen 1.8.10 -->
|
||
|
<script type="text/javascript">
|
||
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||
|
</script>
|
||
|
<div id="navrow1" class="tabs">
|
||
|
<ul class="tablist">
|
||
|
<li class="current"><a href="index.html"><span>Main Page</span></a></li>
|
||
|
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
|
||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||
|
<li><a href="files.html"><span>Files</span></a></li>
|
||
|
<li>
|
||
|
<div id="MSearchBox" class="MSearchBoxInactive">
|
||
|
<span class="left">
|
||
|
<img id="MSearchSelect" src="search/mag_sel.png"
|
||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||
|
alt=""/>
|
||
|
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
||
|
onfocus="searchBox.OnSearchFieldFocus(true)"
|
||
|
onblur="searchBox.OnSearchFieldFocus(false)"
|
||
|
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
||
|
</span><span class="right">
|
||
|
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
||
|
</span>
|
||
|
</div>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
</div><!-- top -->
|
||
|
<!-- window showing the filter options -->
|
||
|
<div id="MSearchSelectWindow"
|
||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||
|
</div>
|
||
|
|
||
|
<!-- iframe showing the search results (closed by default) -->
|
||
|
<div id="MSearchResultsWindow">
|
||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||
|
name="MSearchResults" id="MSearchResults">
|
||
|
</iframe>
|
||
|
</div>
|
||
|
|
||
|
<div class="header">
|
||
|
<div class="headertitle">
|
||
|
<div class="title">Arduino SdFs Library </div> </div>
|
||
|
</div><!--header-->
|
||
|
<div class="contents">
|
||
|
<div class="textblock"><center>Copyright © 2012..2017 by William Greiman </center><h1><a class="anchor" id="Intro"></a>
|
||
|
Introduction</h1>
|
||
|
<p>The Arduino SdFs Library supports FAT16, FAT32, and exFAT file systems on Standard SD, SDHC, and SDXC cards.</p>
|
||
|
<p>The file system classes in SdFs are <a class="el" href="class_sd_fat.html" title="SD file system class for FAT volumes. ">SdFat</a>, <a class="el" href="class_sd_ex_fat.html" title="SD file system class for exFAT volumes. ">SdExFat</a>, and <a class="el" href="class_sd_fs.html" title="SD file system class for FAT16, FAT32, and exFAT volumes. ">SdFs</a>. <a class="el" href="class_sd_fat.html" title="SD file system class for FAT volumes. ">SdFat</a> supports FAT16 and FAT32. <a class="el" href="class_sd_ex_fat.html" title="SD file system class for exFAT volumes. ">SdExFat</a> supports exFAT, <a class="el" href="class_sd_fs.html" title="SD file system class for FAT16, FAT32, and exFAT volumes. ">SdFs</a> supports FAT16, FAT32, and exFAT.</p>
|
||
|
<p>The corresponding file classes are <a class="el" href="class_file.html" title="FAT16/FAT32 file with Arduino Stream. ">File</a>, <a class="el" href="class_ex_file.html" title="exFAT file with Arduino Stream. ">ExFile</a>, and <a class="el" href="class_fs_file.html" title="FsFile class. ">FsFile</a>.</p>
|
||
|
<p>Please read documentation under the above classses tab for more information.</p>
|
||
|
<p>A number of example are provided in the SdFs/examples folder. These were developed to test SdFs and illustrate its use.</p>
|
||
|
<h1><a class="anchor" id="exfat"></a>
|
||
|
exFAT Features</h1>
|
||
|
<p>exFAT has many features not available in FAT16/FAT32.</p>
|
||
|
<p>Files larger than 4GiB, 64-bit file size and file position.</p>
|
||
|
<p>Free space allocation performance improved by using a free space bitmap.</p>
|
||
|
<p>Removal of the physical "." and ".." directory entries that appear in FAT16/FAT32 subdirectories.</p>
|
||
|
<p>Better support for large flash pages with boundary alignment offsets for the FAT table and data region.</p>
|
||
|
<p>exFAT files have two separate 64-bit length fields. The DataLength field indicate how much space is allocate to the file. The ValidDataLength field indicates how much actual data has been written to the file.</p>
|
||
|
<p>An exFAT file can be contiguous with pre-allocate clusters and bypass the use of the FAT table. In this case the contiguous flag is set in the directory entry. This allows an entire file to be written as one large multi-block write.</p>
|
||
|
<h1><a class="anchor" id="SDPath"></a>
|
||
|
Paths and Working Directories</h1>
|
||
|
<p>Relative paths in SdFs are resolved in a manner similar to Windows.</p>
|
||
|
<p>Each instance of <a class="el" href="class_sd_fat.html" title="SD file system class for FAT volumes. ">SdFat</a>, <a class="el" href="class_sd_ex_fat.html" title="SD file system class for exFAT volumes. ">SdExFat</a>, and <a class="el" href="class_sd_fs.html" title="SD file system class for FAT16, FAT32, and exFAT volumes. ">SdFs</a> has a current directory. This directory is called the volume working directory, vwd. Initially this directory is the root directory for the volume.</p>
|
||
|
<p>The volume working directory is changed by calling the chdir(path).</p>
|
||
|
<p>The call sd.chdir("/2014") will change the volume working directory for sd to "/2014", assuming "/2014" exists.</p>
|
||
|
<p>Relative paths for member functions are resolved by starting at the volume working directory.</p>
|
||
|
<p>For example, the call sd.mkdir("April") will create the directory "/2014/April" assuming the volume working directory is "/2014".</p>
|
||
|
<p>There is current working directory, cwd, that is used to resolve paths for file.open() calls.</p>
|
||
|
<p>For a single SD card, the current working directory is always the volume working directory for that card.</p>
|
||
|
<p>For multiple SD cards the current working directory is set to the volume working directory of a card by calling the chvol() member function. The chvol() call is like the Windows <drive letter>: command.</p>
|
||
|
<p>The call sd2.chvol() will set the current working directory to the volume working directory for sd2.</p>
|
||
|
<p>If the volume working directory for sd2 is "/music" the call</p>
|
||
|
<p>file.open("BigBand.wav", O_READ);</p>
|
||
|
<p>will open "/music/BigBand.wav" on sd2.</p>
|
||
|
<h1><a class="anchor" id="Install"></a>
|
||
|
Installation</h1>
|
||
|
<p>You must manually install SdFs by copying the SdFs folder from the download package to the Arduino libraries folder in your sketch folder.</p>
|
||
|
<p>It will be necessary to unzip and rename the folder if you download a zip file from GitHub.</p>
|
||
|
<p>See the Manual installation section of this guide.</p>
|
||
|
<p><a href="http://arduino.cc/en/Guide/Libraries">http://arduino.cc/en/Guide/Libraries</a></p>
|
||
|
<h1><a class="anchor" id="SDconfig"></a>
|
||
|
SdFs Configuration</h1>
|
||
|
<p>Several configuration options may be changed by editing the SdFsConfig.h file in the SdFs folder.</p>
|
||
|
<p>Here are a few of the key options.</p>
|
||
|
<p>If the symbol ENABLE_DEDICATED_SPI is nonzero, multi-block SD I/O will be used for better performance. The SPI bus may not be shared with other devices in this mode.</p>
|
||
|
<p>Set USE_STANDARD_SPI_LIBRARY to use the standard Arduino SPI library.</p>
|
||
|
<p>To enable SD card CRC checking in SPI mode set USE_SD_CRC nonzero.</p>
|
||
|
<h1><a class="anchor" id="Hardware"></a>
|
||
|
Hardware Configuration</h1>
|
||
|
<p>The hardware interface to the SD card should not use a resistor based level shifter. Resistor based level shifters results in signal rise times that are too slow for many newer SD cards.</p>
|
||
|
<h1><a class="anchor" id="HowTo"></a>
|
||
|
How to format SD Cards as FAT Volumes</h1>
|
||
|
<p>The best way to restore an SD card's format on a PC or Mac is to use SDFormatter which can be downloaded from:</p>
|
||
|
<p><a href="http://www.sdcard.org/downloads">http://www.sdcard.org/downloads</a></p>
|
||
|
<p>A formatter program, SdFormatter.ino, is included in the SdFs/examples/SdFormatter directory. This program attempts to emulate SD Association's SDFormatter.</p>
|
||
|
<p>SDFormatter aligns flash erase boundaries with file system structures which reduces write latency and file system overhead.</p>
|
||
|
<p>The PC/Mac SDFormatter does not have an option for FAT type so it may format very small cards as FAT12. Use the SdFs formatter to force FAT16 formatting of small cards.</p>
|
||
|
<p>Do not format the SD card with an OS utility, OS utilities do not format SD cards in conformance with the SD standard.</p>
|
||
|
<p>You should use a freshly formatted SD card for best performance. FAT file systems become slower if many files have been created and deleted. This is because the directory entry for a deleted file is marked as deleted, but is not deleted. When a new file is created, these entries must be scanned before creating the file. Also files can become fragmented which causes reads and writes to be slower.</p>
|
||
|
<h1><a class="anchor" id="ExampleFiles"></a>
|
||
|
Examples</h1>
|
||
|
<p>A number of examples are provided in the SdFs/examples folder.</p>
|
||
|
<p>To access these examples from the Arduino development environment go to: File -> Examples -> SdFs -> <program Name></p>
|
||
|
<p>Compile, upload to your Arduino and click on Serial Monitor to run the example.</p>
|
||
|
<p>Here is a list:</p>
|
||
|
<p>AvrAdcLogger - Fast AVR ADC logger using Timer/ADC interrupts.</p>
|
||
|
<p>BackwardCompatibility - Demonstrate SD.h compatibility with SdFs.h.</p>
|
||
|
<p>bench - A read/write benchmark.</p>
|
||
|
<p>DirectoryFunctions - Use of chdir(), ls(), mkdir(), and rmdir().</p>
|
||
|
<p>ExFatFormatter - Produces optimal exFAT format for smaller SD cards.</p>
|
||
|
<p>ExFatLogger - A data-logger optimized for exFAT features.</p>
|
||
|
<p>ExFatUnicodeTest - Test program for Unicode file names.</p>
|
||
|
<p>OpenNext - Open all files in the root dir and print their filename.</p>
|
||
|
<p>ReadCsvFil - Function to read a CSV text file one field at a time.</p>
|
||
|
<p>RtcTimestampTest - Demonstration of timestamps with RTClib.</p>
|
||
|
<p>SdErrorCodes - Produce a list of error codes.</p>
|
||
|
<p>SdFormatter - This program will format an SD, SDHC, or SDXC card.</p>
|
||
|
<p>SdInfo - Initialize an SD card and analyze its structure for trouble shooting.</p>
|
||
|
<p>TeensyRtcTimestamp - File timestamps for Teensy3.</p>
|
||
|
<p>TeensySdioDemo - Demo of SDIO and SPI modes for the Teensy 3.5/3.6 built-in SD. </p>
|
||
|
</div></div><!-- contents -->
|
||
|
<!-- start footer part -->
|
||
|
<hr class="footer"/><address class="footer"><small>
|
||
|
Generated on Fri Sep 1 2017 03:20:54 for SdFs by  <a href="http://www.doxygen.org/index.html">
|
||
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
||
|
</a> 1.8.10
|
||
|
</small></address>
|
||
|
</body>
|
||
|
</html>
|