This commit is contained in:
joeycastillo
2024-02-07 19:02:57 +00:00
parent cd62140803
commit 849ae6e1c4
103 changed files with 1303 additions and 985 deletions

View File

@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.5"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Sensor Watch: Flash Storage</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
@@ -30,7 +30,7 @@
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.5 -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
@@ -81,23 +81,23 @@ $(function() {
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gae11f49f5d9adee2ee89ec92c8026ca49"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__storage.html#gae11f49f5d9adee2ee89ec92c8026ca49">watch_storage_read</a> (uint32_t row, uint32_t offset, uint8_t *buffer, uint32_t size)</td></tr>
<tr class="memdesc:gae11f49f5d9adee2ee89ec92c8026ca49"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads a range of bytes from the storage area. <a href="group__storage.html#gae11f49f5d9adee2ee89ec92c8026ca49">More...</a><br /></td></tr>
<tr class="memitem:gae11f49f5d9adee2ee89ec92c8026ca49" id="r_gae11f49f5d9adee2ee89ec92c8026ca49"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__storage.html#gae11f49f5d9adee2ee89ec92c8026ca49">watch_storage_read</a> (uint32_t row, uint32_t offset, uint8_t *buffer, uint32_t size)</td></tr>
<tr class="memdesc:gae11f49f5d9adee2ee89ec92c8026ca49"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads a range of bytes from the storage area. <br /></td></tr>
<tr class="separator:gae11f49f5d9adee2ee89ec92c8026ca49"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad0fd4b333d95a0e50ac8e9a23620b861"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__storage.html#gad0fd4b333d95a0e50ac8e9a23620b861">watch_storage_write</a> (uint32_t row, uint32_t offset, const uint8_t *buffer, uint32_t size)</td></tr>
<tr class="memdesc:gad0fd4b333d95a0e50ac8e9a23620b861"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes bytes to a page in the storage area. Note that the row should already be erased before writing. <a href="group__storage.html#gad0fd4b333d95a0e50ac8e9a23620b861">More...</a><br /></td></tr>
<tr class="memitem:gad0fd4b333d95a0e50ac8e9a23620b861" id="r_gad0fd4b333d95a0e50ac8e9a23620b861"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__storage.html#gad0fd4b333d95a0e50ac8e9a23620b861">watch_storage_write</a> (uint32_t row, uint32_t offset, const uint8_t *buffer, uint32_t size)</td></tr>
<tr class="memdesc:gad0fd4b333d95a0e50ac8e9a23620b861"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes bytes to a page in the storage area. Note that the row should already be erased before writing. <br /></td></tr>
<tr class="separator:gad0fd4b333d95a0e50ac8e9a23620b861"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5e27f4d34bd3b602988af59c6068bd0c"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__storage.html#ga5e27f4d34bd3b602988af59c6068bd0c">watch_storage_erase</a> (uint32_t row)</td></tr>
<tr class="memdesc:ga5e27f4d34bd3b602988af59c6068bd0c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Erases a row in the storage area, setting all its bytes to 0xFF. <a href="group__storage.html#ga5e27f4d34bd3b602988af59c6068bd0c">More...</a><br /></td></tr>
<tr class="memitem:ga5e27f4d34bd3b602988af59c6068bd0c" id="r_ga5e27f4d34bd3b602988af59c6068bd0c"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__storage.html#ga5e27f4d34bd3b602988af59c6068bd0c">watch_storage_erase</a> (uint32_t row)</td></tr>
<tr class="memdesc:ga5e27f4d34bd3b602988af59c6068bd0c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Erases a row in the storage area, setting all its bytes to 0xFF. <br /></td></tr>
<tr class="separator:ga5e27f4d34bd3b602988af59c6068bd0c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6531bfebac4e4f81fd37168fdaa98904"><td class="memItemLeft" align="right" valign="top"><a id="ga6531bfebac4e4f81fd37168fdaa98904" name="ga6531bfebac4e4f81fd37168fdaa98904"></a>
<tr class="memitem:ga6531bfebac4e4f81fd37168fdaa98904" id="r_ga6531bfebac4e4f81fd37168fdaa98904"><td class="memItemLeft" align="right" valign="top"><a id="ga6531bfebac4e4f81fd37168fdaa98904" name="ga6531bfebac4e4f81fd37168fdaa98904"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>watch_storage_sync</b> (void)</td></tr>
<tr class="memdesc:ga6531bfebac4e4f81fd37168fdaa98904"><td class="mdescLeft">&#160;</td><td class="mdescRight">Waits for any pending writes to complete. <br /></td></tr>
<tr class="separator:ga6531bfebac4e4f81fd37168fdaa98904"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p >This section covers functions related to the SAM L22's 8 kilobyte EEPROM emulation area. </p>
<p >The SAM L22 inside Sensor Watch has a 256 kilobyte Flash memory array that can be programmed with whatever data we want. We use most of it to store the bootloader and the application code that runs on your wrist. The bootloader region is read-only, and the main application area is only writable by the bootloader (when you drag new code onto the WATCHBOOT drive). However! there's also a special 8 kilobyte region at the end of the Flash memory called the EEPROM Emulation Area. This EEPROM emulation area can be written or erased while the main Flash array is being read. This makes it super easy to work with, and useful for storing a small amount of non-volatile data that persists across reboots, even when power is lost. The functions in this section are very basic, and only cover reading and writing data in this area. The region is laid out as 32 rows consisting of 4 pages of 64 bytes. 32*4*64 = 8192 bytes. The area can be written one page at a time, but it can only be erased one row at a time. You can read at arbitrary word-aligned offsets within a row. </p><pre class="fragment"> ┌──────────────┬──────────────┬──────────────┬──────────────┐
<p>This section covers functions related to the SAM L22's 8 kilobyte EEPROM emulation area. </p>
<p>The SAM L22 inside Sensor Watch has a 256 kilobyte Flash memory array that can be programmed with whatever data we want. We use most of it to store the bootloader and the application code that runs on your wrist. The bootloader region is read-only, and the main application area is only writable by the bootloader (when you drag new code onto the WATCHBOOT drive). However! there's also a special 8 kilobyte region at the end of the Flash memory called the EEPROM Emulation Area. This EEPROM emulation area can be written or erased while the main Flash array is being read. This makes it super easy to work with, and useful for storing a small amount of non-volatile data that persists across reboots, even when power is lost. The functions in this section are very basic, and only cover reading and writing data in this area. The region is laid out as 32 rows consisting of 4 pages of 64 bytes. 32*4*64 = 8192 bytes. The area can be written one page at a time, but it can only be erased one row at a time. You can read at arbitrary word-aligned offsets within a row. </p><pre class="fragment"> ┌──────────────┬──────────────┬──────────────┬──────────────┐
</pre><p> Row 0 │ 64 bytes │ 64 bytes │ 64 bytes │ 64 bytes │ ├──────────────┼──────────────┼──────────────┼──────────────┤ Row 1 │ 64 bytes │ 64 bytes │ 64 bytes │ 64 bytes │ ├──────────────┼──────────────┼──────────────┼──────────────┤ ... │ │ │ │ │ ├──────────────┼──────────────┼──────────────┼──────────────┤ Row 31 │ 64 bytes │ 64 bytes │ 64 bytes │ 64 bytes │ └──────────────┴──────────────┴──────────────┴──────────────┘ </p>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga5e27f4d34bd3b602988af59c6068bd0c" name="ga5e27f4d34bd3b602988af59c6068bd0c"></a>
@@ -231,7 +231,7 @@ bool&#160;</td><td class="memItemRight" valign="bottom"><b>watch_storage_sync</b
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.5
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
</small></address>
</body>
</html>