Files
2023-02-13 15:47:41 +08:00

136 lines
11 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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=11"/>
<meta name="generator" content="Doxygen 1.9.3"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Core2 for AWS IoT Kit BSP: BM8563</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>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="custom.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 id="projectrow">
<td id="projectlogo"><img alt="Logo" src="AWS_logo_RGB.png"/></td>
<td id="projectalign">
<div id="projectname">Core2 for AWS IoT Kit BSP<span id="projectnumber">&#160;1.5.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.3 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- 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><!-- top -->
<div><div class="header">
<div class="headertitle"><div class="title">BM8563 </div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p >The BM8563 library provides convenience functions to interact with the BM8563 Real-Time Clock (RTC). The initialization function configures the the Espressif I2C drivers and the real-time clock (RTC) with preset parameters.</p>
<p ><a class="anchor" id="rtc"></a></p>
<p ><a href="./block_diagram-bm8563.png"><img src="./block_diagram-bm8563.png" alt="Circuit Block Diagram for BM8563 Real-Time Clock" class="center" class="inline"/></a></p>
<p >To enable this feature using KConfig, use the command <code>pio run --environment core2foraws --target menuconfig</code> from within the root of the project directory in your <a href="/en/blinky-hello-world/prerequisites.html#open-the-platformio-cli-terminal-window">PlatformIO terminal window</a> and go to the menu <code>Component Config --&gt; Core2 for AWS features</code> to set the features you want to enable.</p>
<h1><a class="anchor" id="bm8563_example"></a>
Example</h1>
<p >The following example initializes the Core2 for AWS, which initializes the PMU for the battery and other user enabled hardware features — such as the BM8563. It then prints the current date time using the ESP logger.</p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;esp_log.h&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;<a class="code" href="core2for_a_w_s_8h.html">core2forAWS.h</a>&quot;</span></div>
<div class="line"> </div>
<div class="line"><span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code hl_define" href="i2c__device_8c.html#afc3d101f633a076cc1ca84b85b6224b2">TAG</a> = <span class="stringliteral">&quot;EXAMPLE&quot;</span>;</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">void</span> app_main(<span class="keywordtype">void</span>){</div>
<div class="line"> <a class="code hl_function" href="core2for_a_w_s_8c.html#a3d850a3f56bbe0685b60726d8b53bece">Core2ForAWS_Init</a>();</div>
<div class="line"> </div>
<div class="line"> <a class="code hl_struct" href="structrtc__date__t.html">rtc_date_t</a> date;</div>
<div class="line"> </div>
<div class="line"> <a class="code hl_function" href="bm8563_8c.html#a50be06a7af15505ce80bbb9b10c19f15">BM8563_GetTime</a>(&amp;date);</div>
<div class="line"> ESP_LOGI(<a class="code hl_define" href="i2c__device_8c.html#afc3d101f633a076cc1ca84b85b6224b2">TAG</a>, <span class="stringliteral">&quot;Date: %d-%02d-%02d Time: %02d:%02d:%02d&quot;</span>,</div>
<div class="line"> date.<a class="code hl_variable" href="structrtc__date__t.html#a320d5caea2fec2adc9fbd710b034f9e3">year</a>, date.<a class="code hl_variable" href="structrtc__date__t.html#afd04996b250949b3d0a0b95500b91b81">month</a>, date.<a class="code hl_variable" href="structrtc__date__t.html#aac2d1613473d4eb898c33c8243a90ef1">day</a>, date.<a class="code hl_variable" href="structrtc__date__t.html#ad794c994fa0363ef9905f517919b8498">hour</a>, date.<a class="code hl_variable" href="structrtc__date__t.html#a5699ba6d2509bf7cdd0775f7d0d4f8dd">minute</a>, date.<a class="code hl_variable" href="structrtc__date__t.html#a5689ab763359e4776390ea1a1be2a4ee">second</a>);</div>
<div class="line">}</div>
<div class="ttc" id="abm8563_8c_html_a50be06a7af15505ce80bbb9b10c19f15"><div class="ttname"><a href="bm8563_8c.html#a50be06a7af15505ce80bbb9b10c19f15">BM8563_GetTime</a></div><div class="ttdeci">void BM8563_GetTime(rtc_date_t *data)</div><div class="ttdoc">Retrieves the date and time on the BM8563.</div><div class="ttdef"><b>Definition:</b> bm8563.c:56</div></div>
<div class="ttc" id="acore2for_a_w_s_8c_html_a3d850a3f56bbe0685b60726d8b53bece"><div class="ttname"><a href="core2for_a_w_s_8c.html#a3d850a3f56bbe0685b60726d8b53bece">Core2ForAWS_Init</a></div><div class="ttdeci">void Core2ForAWS_Init(void)</div><div class="ttdoc">Initializes the power chip with default values, enables battery charging, and initializes all enabled...</div><div class="ttdef"><b>Definition:</b> core2forAWS.c:32</div></div>
<div class="ttc" id="acore2for_a_w_s_8h_html"><div class="ttname"><a href="core2for_a_w_s_8h.html">core2forAWS.h</a></div><div class="ttdoc">Functions to initialize and access Core2 for AWS IoT Kit hardware features.</div></div>
<div class="ttc" id="ai2c__device_8c_html_afc3d101f633a076cc1ca84b85b6224b2"><div class="ttname"><a href="i2c__device_8c.html#afc3d101f633a076cc1ca84b85b6224b2">TAG</a></div><div class="ttdeci">#define TAG</div><div class="ttdef"><b>Definition:</b> i2c_device.c:10</div></div>
<div class="ttc" id="astructrtc__date__t_html"><div class="ttname"><a href="structrtc__date__t.html">rtc_date_t</a></div><div class="ttdoc">The member defintions of the BM8563 RTC date.</div><div class="ttdef"><b>Definition:</b> bm8563.h:13</div></div>
<div class="ttc" id="astructrtc__date__t_html_a320d5caea2fec2adc9fbd710b034f9e3"><div class="ttname"><a href="structrtc__date__t.html#a320d5caea2fec2adc9fbd710b034f9e3">rtc_date_t::year</a></div><div class="ttdeci">uint16_t year</div><div class="ttdoc">Date year.</div><div class="ttdef"><b>Definition:</b> bm8563.h:15</div></div>
<div class="ttc" id="astructrtc__date__t_html_a5689ab763359e4776390ea1a1be2a4ee"><div class="ttname"><a href="structrtc__date__t.html#a5689ab763359e4776390ea1a1be2a4ee">rtc_date_t::second</a></div><div class="ttdeci">uint8_t second</div><div class="ttdoc">Time second.</div><div class="ttdef"><b>Definition:</b> bm8563.h:20</div></div>
<div class="ttc" id="astructrtc__date__t_html_a5699ba6d2509bf7cdd0775f7d0d4f8dd"><div class="ttname"><a href="structrtc__date__t.html#a5699ba6d2509bf7cdd0775f7d0d4f8dd">rtc_date_t::minute</a></div><div class="ttdeci">uint8_t minute</div><div class="ttdoc">Time minute.</div><div class="ttdef"><b>Definition:</b> bm8563.h:19</div></div>
<div class="ttc" id="astructrtc__date__t_html_aac2d1613473d4eb898c33c8243a90ef1"><div class="ttname"><a href="structrtc__date__t.html#aac2d1613473d4eb898c33c8243a90ef1">rtc_date_t::day</a></div><div class="ttdeci">uint8_t day</div><div class="ttdoc">Date day.</div><div class="ttdef"><b>Definition:</b> bm8563.h:17</div></div>
<div class="ttc" id="astructrtc__date__t_html_ad794c994fa0363ef9905f517919b8498"><div class="ttname"><a href="structrtc__date__t.html#ad794c994fa0363ef9905f517919b8498">rtc_date_t::hour</a></div><div class="ttdeci">uint8_t hour</div><div class="ttdoc">Time hour.</div><div class="ttdef"><b>Definition:</b> bm8563.h:18</div></div>
<div class="ttc" id="astructrtc__date__t_html_afd04996b250949b3d0a0b95500b91b81"><div class="ttname"><a href="structrtc__date__t.html#afd04996b250949b3d0a0b95500b91b81">rtc_date_t::month</a></div><div class="ttdeci">uint8_t month</div><div class="ttdoc">Date month.</div><div class="ttdef"><b>Definition:</b> bm8563.h:16</div></div>
</div><!-- fragment --><h1><a class="anchor" id="bm8563_structs"></a>
Structs</h1>
<ul>
<li><a class="el" href="bm8563_rtc_date_struct.html">rtc_date_t</a> <br />
</li>
</ul>
<h1><a class="anchor" id="bm8563_functions"></a>
Functions</h1>
<ul>
<li><a class="el" href="bm8563_init_function.html">BM8563_Init</a> <br />
</li>
<li><a class="el" href="bm8563_settime_function.html">BM8563_SetTime</a> <br />
</li>
<li><a class="el" href="bm8563_gettime_function.html">BM8563_GetTime</a> <br />
</li>
<li><a class="el" href="bm8563_setalarmirq_function.html">BM8563_SetAlarmIRQ</a> <br />
</li>
<li><a class="el" href="bm8563_settimerirq_function.html">BM8563_SetTimerIRQ</a> <br />
</li>
<li><a class="el" href="bm8563_gettimertime_function.html">BM8563_GetTimerTime</a> <br />
</li>
<li><a class="el" href="bm8563_getirq_function.html">BM8563_GetIRQ</a> <br />
</li>
<li><a class="el" href="bm8563_clearirq_function.html">BM8563_ClearIRQ</a> <br />
</li>
</ul>
</div></div><!-- contents -->
</div><!-- PageDoc -->
<!-- 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.3
</small></address>
</body>
</html>