1
0
mirror of https://github.com/taigrr/arduinolibs synced 2025-01-18 04:33:12 -08:00
arduinolibs/classEEPROM24.html
Rhys Weatherley c6206e4216 Update docs
2015-03-12 19:03:15 +10:00

440 lines
26 KiB
HTML

<!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.6"/>
<title>ArduinoLibs: EEPROM24 Class Reference</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/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</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 style="padding-left: 0.5em;">
<div id="projectname">ArduinoLibs
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</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>
<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 id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Pages</a></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><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classEEPROM24-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">EEPROM24 Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Reading and writing EEPROM's from the 24LCXX family.
<a href="classEEPROM24.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="EEPROM24_8h_source.html">EEPROM24.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ae8547f6ff7711496e1959ee24a142995"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEEPROM24.html#ae8547f6ff7711496e1959ee24a142995">EEPROM24</a> (<a class="el" href="classI2CMaster.html">I2CMaster</a> &amp;bus, unsigned long type, uint8_t bank=0)</td></tr>
<tr class="memdesc:ae8547f6ff7711496e1959ee24a142995"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a new EEPROM access object on <em>bus</em> for an EEPROM of the specified <em>type</em>. <a href="#ae8547f6ff7711496e1959ee24a142995">More...</a><br/></td></tr>
<tr class="separator:ae8547f6ff7711496e1959ee24a142995"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa544875cef9bd05bf71d6c19be06cf7c"><td class="memItemLeft" align="right" valign="top">unsigned long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEEPROM24.html#aa544875cef9bd05bf71d6c19be06cf7c">size</a> () const </td></tr>
<tr class="memdesc:aa544875cef9bd05bf71d6c19be06cf7c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the size of the EEPROM in bytes. <a href="#aa544875cef9bd05bf71d6c19be06cf7c">More...</a><br/></td></tr>
<tr class="separator:aa544875cef9bd05bf71d6c19be06cf7c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af33b23e2614f3966bbaf2554890c032a"><td class="memItemLeft" align="right" valign="top">unsigned long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEEPROM24.html#af33b23e2614f3966bbaf2554890c032a">pageSize</a> () const </td></tr>
<tr class="memdesc:af33b23e2614f3966bbaf2554890c032a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the size of a single EEPROM page in bytes. <a href="#af33b23e2614f3966bbaf2554890c032a">More...</a><br/></td></tr>
<tr class="separator:af33b23e2614f3966bbaf2554890c032a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af8b70971d882b06de3fc6644a8ece3cf"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEEPROM24.html#af8b70971d882b06de3fc6644a8ece3cf">available</a> ()</td></tr>
<tr class="memdesc:af8b70971d882b06de3fc6644a8ece3cf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the EEPROM is available on the I2C bus; false otherwise. <a href="#af8b70971d882b06de3fc6644a8ece3cf">More...</a><br/></td></tr>
<tr class="separator:af8b70971d882b06de3fc6644a8ece3cf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a960971377d4decb122ff38d12603e586"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEEPROM24.html#a960971377d4decb122ff38d12603e586">read</a> (unsigned long address)</td></tr>
<tr class="memdesc:a960971377d4decb122ff38d12603e586"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads a single byte from the EEPROM at <em>address</em>. <a href="#a960971377d4decb122ff38d12603e586">More...</a><br/></td></tr>
<tr class="separator:a960971377d4decb122ff38d12603e586"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a63e23dc014415f947975359ac09f627e"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEEPROM24.html#a63e23dc014415f947975359ac09f627e">read</a> (unsigned long address, void *data, size_t length)</td></tr>
<tr class="memdesc:a63e23dc014415f947975359ac09f627e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads a block of <em>length</em> bytes from the EEPROM at <em>address</em> into the specified <em>data</em> buffer. <a href="#a63e23dc014415f947975359ac09f627e">More...</a><br/></td></tr>
<tr class="separator:a63e23dc014415f947975359ac09f627e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9e017772e3459ee4ab987e27d78937f8"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEEPROM24.html#a9e017772e3459ee4ab987e27d78937f8">write</a> (unsigned long address, uint8_t value)</td></tr>
<tr class="memdesc:a9e017772e3459ee4ab987e27d78937f8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes a byte <em>value</em> to <em>address</em> in the EEPROM. <a href="#a9e017772e3459ee4ab987e27d78937f8">More...</a><br/></td></tr>
<tr class="separator:a9e017772e3459ee4ab987e27d78937f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3d918ed34da7ca6d21a776c0614eebf3"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEEPROM24.html#a3d918ed34da7ca6d21a776c0614eebf3">write</a> (unsigned long address, const void *data, size_t length)</td></tr>
<tr class="memdesc:a3d918ed34da7ca6d21a776c0614eebf3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes <em>length</em> bytes from a <em>data</em> buffer to <em>address</em> in the EEPROM. <a href="#a3d918ed34da7ca6d21a776c0614eebf3">More...</a><br/></td></tr>
<tr class="separator:a3d918ed34da7ca6d21a776c0614eebf3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Reading and writing EEPROM's from the 24LCXX family. </p>
<p>The 24LCXX family of EEPROM's provide a variety of memory sizes from 16 bytes up to 128 kBytes that can be accessed via the I2C protocol. These chips can be used to augment the 1 kByte or so of builtin EEPROM memory that is typical on Arduino boards. The EEPROM should be wired to an Arduino Uno as follows:</p>
<div class="image">
<img src="eeprom_circuit.png" alt="eeprom_circuit.png"/>
</div>
<p>Access to a 24LCXX chip is initialized as follows:</p>
<div class="fragment"><div class="line"><a class="code" href="classSoftI2C.html">SoftI2C</a> i2c(A4, A5);</div>
<div class="line"><a class="code" href="classEEPROM24.html">EEPROM24</a> eeprom(i2c, EEPROM_24LC256);</div>
</div><!-- fragment --><p>Once initialized, <a class="el" href="classEEPROM24.html#a960971377d4decb122ff38d12603e586" title="Reads a single byte from the EEPROM at address. ">read()</a> and <a class="el" href="classEEPROM24.html#a9e017772e3459ee4ab987e27d78937f8" title="Writes a byte value to address in the EEPROM. ">write()</a> can be used to manipulate the contents of the EEPROM's memory.</p>
<p>The following EEPROM types are supported by this class:</p>
<table class="doxtable">
<tr>
<td>Chip</td><td>Type</td><td>Size </td></tr>
<tr>
<td>24lc00</td><td><code>EEPROM_24LC00</code> </td><td>16 bytes </td></tr>
<tr>
<td>24lc01</td><td><code>EEPROM_24LC01</code> </td><td>128 bytes </td></tr>
<tr>
<td>24lc014</td><td><code>EEPROM_24LC014</code> </td><td>128 bytes </td></tr>
<tr>
<td>24lc02</td><td><code>EEPROM_24LC02</code> </td><td>256 bytes </td></tr>
<tr>
<td>24lc024</td><td><code>EEPROM_24LC024</code> </td><td>256 bytes </td></tr>
<tr>
<td>24lc025</td><td><code>EEPROM_24LC025</code> </td><td>256 bytes </td></tr>
<tr>
<td>24lc04</td><td><code>EEPROM_24LC04</code> </td><td>512 bytes </td></tr>
<tr>
<td>24lc08</td><td><code>EEPROM_24LC08</code> </td><td>1 kByte </td></tr>
<tr>
<td>24lc16</td><td><code>EEPROM_24LC16</code> </td><td>2 kBytes </td></tr>
<tr>
<td>24lc32</td><td><code>EEPROM_24LC32</code> </td><td>4 kBytes </td></tr>
<tr>
<td>24lc64</td><td><code>EEPROM_24LC64</code> </td><td>8 kBytes </td></tr>
<tr>
<td>24lc128</td><td><code>EEPROM_24LC128</code> </td><td>16 kBytes </td></tr>
<tr>
<td>24lc256</td><td><code>EEPROM_24LC256</code> </td><td>32 kBytes </td></tr>
<tr>
<td>24lc512</td><td><code>EEPROM_24LC512</code> </td><td>64 kBytes </td></tr>
<tr>
<td>24lc1025</td><td><code>EEPROM_24LC1025</code> </td><td>128 kBytes </td></tr>
<tr>
<td>24lc1026</td><td><code>EEPROM_24LC1026</code> </td><td>128 kBytes </td></tr>
</table>
<p>There can be multiple 24LCXX chips on the same I2C bus, as long as their A0, A1, and A2 address pins are set to different values. For example, two 24LC256 chips can be used to provide the same memory capacity as a single 24LC512 chip. The optional <em>bank</em> parameter to the constructor is used to assign different bank addresses to each chip:</p>
<div class="fragment"><div class="line"><a class="code" href="classSoftI2C.html">SoftI2C</a> i2c(A4, A5);</div>
<div class="line"><a class="code" href="classEEPROM24.html">EEPROM24</a> eeprom0(i2c, EEPROM_24LC256, 0);</div>
<div class="line"><a class="code" href="classEEPROM24.html">EEPROM24</a> eeprom1(i2c, EEPROM_24LC256, 1);</div>
</div><!-- fragment --><dl class="section see"><dt>See Also</dt><dd><a class="el" href="classI2CMaster.html" title="Abstract base class for I2C master implementations. ">I2CMaster</a> </dd></dl>
<p>Definition at line <a class="el" href="EEPROM24_8h_source.html#l00060">60</a> of file <a class="el" href="EEPROM24_8h_source.html">EEPROM24.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="ae8547f6ff7711496e1959ee24a142995"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">EEPROM24::EEPROM24 </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classI2CMaster.html">I2CMaster</a> &amp;&#160;</td>
<td class="paramname"><em>bus</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned long&#160;</td>
<td class="paramname"><em>type</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>bank</em> = <code>0</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Constructs a new EEPROM access object on <em>bus</em> for an EEPROM of the specified <em>type</em>. </p>
<p>The <em>bank</em> can be used to choose between multiple EEPROM's on <em>bus</em> of the specified <em>type</em>. The <em>bank</em> corresponds to the value that is set on the EEPROM's A0, A1, and A2 address pins. Note that some EEPROM's have less than 3 address pins; consult the datasheet for more information. </p>
<p>Definition at line <a class="el" href="EEPROM24_8cpp_source.html#l00095">95</a> of file <a class="el" href="EEPROM24_8cpp_source.html">EEPROM24.cpp</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="af8b70971d882b06de3fc6644a8ece3cf"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool EEPROM24::available </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns true if the EEPROM is available on the I2C bus; false otherwise. </p>
<p>This function can be used to probe the I2C bus to determine if the EEPROM is present or not.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classEEPROM24.html#a960971377d4decb122ff38d12603e586" title="Reads a single byte from the EEPROM at address. ">read()</a>, <a class="el" href="classEEPROM24.html#a9e017772e3459ee4ab987e27d78937f8" title="Writes a byte value to address in the EEPROM. ">write()</a> </dd></dl>
<p>Definition at line <a class="el" href="EEPROM24_8cpp_source.html#l00152">152</a> of file <a class="el" href="EEPROM24_8cpp_source.html">EEPROM24.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="af33b23e2614f3966bbaf2554890c032a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">unsigned long EEPROM24::pageSize </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the size of a single EEPROM page in bytes. </p>
<p>Writes that are a multiple of the page size and aligned on a page boundary will typically be more efficient than non-aligned writes.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classEEPROM24.html#aa544875cef9bd05bf71d6c19be06cf7c" title="Returns the size of the EEPROM in bytes. ">size()</a> </dd></dl>
<p>Definition at line <a class="el" href="EEPROM24_8h_source.html#l00066">66</a> of file <a class="el" href="EEPROM24_8h_source.html">EEPROM24.h</a>.</p>
</div>
</div>
<a class="anchor" id="a960971377d4decb122ff38d12603e586"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint8_t EEPROM24::read </td>
<td>(</td>
<td class="paramtype">unsigned long&#160;</td>
<td class="paramname"><em>address</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Reads a single byte from the EEPROM at <em>address</em>. </p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classEEPROM24.html#a9e017772e3459ee4ab987e27d78937f8" title="Writes a byte value to address in the EEPROM. ">write()</a> </dd></dl>
<p>Definition at line <a class="el" href="EEPROM24_8cpp_source.html#l00167">167</a> of file <a class="el" href="EEPROM24_8cpp_source.html">EEPROM24.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a63e23dc014415f947975359ac09f627e"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t EEPROM24::read </td>
<td>(</td>
<td class="paramtype">unsigned long&#160;</td>
<td class="paramname"><em>address</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *&#160;</td>
<td class="paramname"><em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&#160;</td>
<td class="paramname"><em>length</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Reads a block of <em>length</em> bytes from the EEPROM at <em>address</em> into the specified <em>data</em> buffer. </p>
<p>Returns the number of bytes that were read, which may be short if <em>address</em> + <em>length</em> is greater than <a class="el" href="classEEPROM24.html#aa544875cef9bd05bf71d6c19be06cf7c" title="Returns the size of the EEPROM in bytes. ">size()</a> or the EEPROM is not available on the I2C bus.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classEEPROM24.html#a9e017772e3459ee4ab987e27d78937f8" title="Writes a byte value to address in the EEPROM. ">write()</a>, <a class="el" href="classEEPROM24.html#af8b70971d882b06de3fc6644a8ece3cf" title="Returns true if the EEPROM is available on the I2C bus; false otherwise. ">available()</a> </dd></dl>
<p>Definition at line <a class="el" href="EEPROM24_8cpp_source.html#l00187">187</a> of file <a class="el" href="EEPROM24_8cpp_source.html">EEPROM24.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aa544875cef9bd05bf71d6c19be06cf7c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">unsigned long EEPROM24::size </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the size of the EEPROM in bytes. </p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classEEPROM24.html#af33b23e2614f3966bbaf2554890c032a" title="Returns the size of a single EEPROM page in bytes. ">pageSize()</a> </dd></dl>
<p>Definition at line <a class="el" href="EEPROM24_8h_source.html#l00065">65</a> of file <a class="el" href="EEPROM24_8h_source.html">EEPROM24.h</a>.</p>
</div>
</div>
<a class="anchor" id="a9e017772e3459ee4ab987e27d78937f8"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool EEPROM24::write </td>
<td>(</td>
<td class="paramtype">unsigned long&#160;</td>
<td class="paramname"><em>address</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>value</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Writes a byte <em>value</em> to <em>address</em> in the EEPROM. </p>
<p>Returns true if the byte was written successfully, or false if <em>address</em> is out of range or the EEPROM is not available on the I2C bus.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classEEPROM24.html#a960971377d4decb122ff38d12603e586" title="Reads a single byte from the EEPROM at address. ">read()</a>, <a class="el" href="classEEPROM24.html#af8b70971d882b06de3fc6644a8ece3cf" title="Returns true if the EEPROM is available on the I2C bus; false otherwise. ">available()</a> </dd></dl>
<p>Definition at line <a class="el" href="EEPROM24_8cpp_source.html#l00213">213</a> of file <a class="el" href="EEPROM24_8cpp_source.html">EEPROM24.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a3d918ed34da7ca6d21a776c0614eebf3"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t EEPROM24::write </td>
<td>(</td>
<td class="paramtype">unsigned long&#160;</td>
<td class="paramname"><em>address</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const void *&#160;</td>
<td class="paramname"><em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&#160;</td>
<td class="paramname"><em>length</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Writes <em>length</em> bytes from a <em>data</em> buffer to <em>address</em> in the EEPROM. </p>
<p>Returns the number of bytes that were written, which may be short if <em>address</em> + <em>length</em> is greater than <a class="el" href="classEEPROM24.html#aa544875cef9bd05bf71d6c19be06cf7c" title="Returns the size of the EEPROM in bytes. ">size()</a> or the EEPROM is not available on the I2C bus.</p>
<p>Best performance will be achieved if <em>address</em> and <em>length</em> are a multiple of <a class="el" href="classEEPROM24.html#af33b23e2614f3966bbaf2554890c032a" title="Returns the size of a single EEPROM page in bytes. ">pageSize()</a>.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classEEPROM24.html#a960971377d4decb122ff38d12603e586" title="Reads a single byte from the EEPROM at address. ">read()</a>, <a class="el" href="classEEPROM24.html#af8b70971d882b06de3fc6644a8ece3cf" title="Returns true if the EEPROM is available on the I2C bus; false otherwise. ">available()</a>, <a class="el" href="classEEPROM24.html#af33b23e2614f3966bbaf2554890c032a" title="Returns the size of a single EEPROM page in bytes. ">pageSize()</a> </dd></dl>
<p>Definition at line <a class="el" href="EEPROM24_8cpp_source.html#l00235">235</a> of file <a class="el" href="EEPROM24_8cpp_source.html">EEPROM24.cpp</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="EEPROM24_8h_source.html">EEPROM24.h</a></li>
<li><a class="el" href="EEPROM24_8cpp_source.html">EEPROM24.cpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Mar 12 2015 19:02:05 for ArduinoLibs by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.6
</small></address>
</body>
</html>