mirror of
https://github.com/jialexd/sdk-ameba-v4.0c_180328.git
synced 2024-11-23 06:24:19 +00:00
380 lines
17 KiB
HTML
Executable file
380 lines
17 KiB
HTML
Executable file
<!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.11"/>
|
|
<title>SDK3.5: RTC</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">SDK3.5
|
|
</div>
|
|
<div id="projectbrief">This document shows Ameba SDK 3.5 APIs</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.8.11 -->
|
|
<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 Page</span></a></li>
|
|
<li class="current"><a href="modules.html"><span>Modules</span></a></li>
|
|
<li><a href="annotated.html"><span>Data Structures</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="summary">
|
|
<a href="#nested-classes">Data Structures</a> |
|
|
<a href="#var-members">Variables</a> </div>
|
|
<div class="headertitle">
|
|
<div class="title">RTC<div class="ingroups"><a class="el" href="group__sdk.html">Ameba SDK</a> » <a class="el" href="group__hal.html">HAL</a></div></div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
|
|
<p>rtc functions
|
|
<a href="#details">More...</a></p>
|
|
<table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
|
|
Data Structures</h2></td></tr>
|
|
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structalarm__s.html">alarm_s</a></td></tr>
|
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
|
|
Variables</h2></td></tr>
|
|
<tr class="memitem:gab7630657f7ee8887c7ccc55db6a73960"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gab7630657f7ee8887c7ccc55db6a73960"></a>
|
|
uint32_t </td><td class="memItemRight" valign="bottom"><b>yday</b></td></tr>
|
|
<tr class="separator:gab7630657f7ee8887c7ccc55db6a73960"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga26d5bae76d83086900174b266fd2cd82"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga26d5bae76d83086900174b266fd2cd82"></a>
|
|
uint32_t </td><td class="memItemRight" valign="bottom"><b>hour</b></td></tr>
|
|
<tr class="separator:ga26d5bae76d83086900174b266fd2cd82"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga0de4531998c77245b8866f2ba909d0fa"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga0de4531998c77245b8866f2ba909d0fa"></a>
|
|
uint32_t </td><td class="memItemRight" valign="bottom"><b>min</b></td></tr>
|
|
<tr class="separator:ga0de4531998c77245b8866f2ba909d0fa"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:gaaf5f5a3fa5d596a9136b4331f2b54bfc"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaaf5f5a3fa5d596a9136b4331f2b54bfc"></a>
|
|
uint32_t </td><td class="memItemRight" valign="bottom"><b>sec</b></td></tr>
|
|
<tr class="separator:gaaf5f5a3fa5d596a9136b4331f2b54bfc"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="member-group"></a>
|
|
AmebaZ Only</h2></td></tr>
|
|
<tr class="memitem:ga3cfaf4fb7016e51e1e760e3f0197dce7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga3cfaf4fb7016e51e1e760e3f0197dce7"></a>
|
|
typedef void(* </td><td class="memItemRight" valign="bottom"><b>alarm_irq_handler</b>) (void)</td></tr>
|
|
<tr class="separator:ga3cfaf4fb7016e51e1e760e3f0197dce7"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:gabb5d0c4995b9b00eb1159f92613ef98b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gabb5d0c4995b9b00eb1159f92613ef98b"></a>
|
|
typedef struct <a class="el" href="structalarm__s.html">alarm_s</a> </td><td class="memItemRight" valign="bottom"><b>alarm_t</b></td></tr>
|
|
<tr class="separator:gabb5d0c4995b9b00eb1159f92613ef98b"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:gaceaa01d3f109ffbda1a81c48081cf6f9"><td class="memItemLeft" align="right" valign="top">u32 </td><td class="memItemRight" valign="bottom"><a class="el" href="group__rtc.html#gaceaa01d3f109ffbda1a81c48081cf6f9">rtc_set_alarm</a> (<a class="el" href="structalarm__s.html">alarm_t</a> *alrm, alarm_irq_handler alarmHandler)</td></tr>
|
|
<tr class="memdesc:gaceaa01d3f109ffbda1a81c48081cf6f9"><td class="mdescLeft"> </td><td class="mdescRight">Set the specified RTC Alarm and interrupt. <a href="#gaceaa01d3f109ffbda1a81c48081cf6f9">More...</a><br /></td></tr>
|
|
<tr class="separator:gaceaa01d3f109ffbda1a81c48081cf6f9"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga718b866eab2ba73221d37f7d15ba9737"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__rtc.html#ga718b866eab2ba73221d37f7d15ba9737">rtc_disable_alarm</a> (void)</td></tr>
|
|
<tr class="memdesc:ga718b866eab2ba73221d37f7d15ba9737"><td class="mdescLeft"> </td><td class="mdescRight">Disable RTC Alarm and function. <a href="#ga718b866eab2ba73221d37f7d15ba9737">More...</a><br /></td></tr>
|
|
<tr class="separator:ga718b866eab2ba73221d37f7d15ba9737"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="member-group"></a>
|
|
Ameba Common</h2></td></tr>
|
|
<tr class="memitem:gacf9024748b942a7ae375cf75951afa9c"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__rtc.html#gacf9024748b942a7ae375cf75951afa9c">rtc_init</a> (void)</td></tr>
|
|
<tr class="memdesc:gacf9024748b942a7ae375cf75951afa9c"><td class="mdescLeft"> </td><td class="mdescRight">Initializes the RTC device, include clock, RTC registers and function. <a href="#gacf9024748b942a7ae375cf75951afa9c">More...</a><br /></td></tr>
|
|
<tr class="separator:gacf9024748b942a7ae375cf75951afa9c"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:gaff89a06474197687978319e11ccfbd8a"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__rtc.html#gaff89a06474197687978319e11ccfbd8a">rtc_free</a> (void)</td></tr>
|
|
<tr class="memdesc:gaff89a06474197687978319e11ccfbd8a"><td class="mdescLeft"> </td><td class="mdescRight">Deinitializes the RTC device. <a href="#gaff89a06474197687978319e11ccfbd8a">More...</a><br /></td></tr>
|
|
<tr class="separator:gaff89a06474197687978319e11ccfbd8a"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga8d49d48e7cc7804e34305a99f34aa450"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__rtc.html#ga8d49d48e7cc7804e34305a99f34aa450">rtc_isenabled</a> (void)</td></tr>
|
|
<tr class="memdesc:ga8d49d48e7cc7804e34305a99f34aa450"><td class="mdescLeft"> </td><td class="mdescRight">This function tells whether RTC is enabled or not. <a href="#ga8d49d48e7cc7804e34305a99f34aa450">More...</a><br /></td></tr>
|
|
<tr class="separator:ga8d49d48e7cc7804e34305a99f34aa450"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga8c6e23c64ed14aa23f4d524720350228"><td class="memItemLeft" align="right" valign="top">time_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__rtc.html#ga8c6e23c64ed14aa23f4d524720350228">rtc_read</a> (void)</td></tr>
|
|
<tr class="memdesc:ga8c6e23c64ed14aa23f4d524720350228"><td class="mdescLeft"> </td><td class="mdescRight">Get current timestamp in seconds from RTC. <a href="#ga8c6e23c64ed14aa23f4d524720350228">More...</a><br /></td></tr>
|
|
<tr class="separator:ga8c6e23c64ed14aa23f4d524720350228"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:gaa3c98f2c275d1ecbafcdba6b6c6032e7"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__rtc.html#gaa3c98f2c275d1ecbafcdba6b6c6032e7">rtc_write</a> (time_t t)</td></tr>
|
|
<tr class="memdesc:gaa3c98f2c275d1ecbafcdba6b6c6032e7"><td class="mdescLeft"> </td><td class="mdescRight">Set the specified timestamp in seconds to RTC. <a href="#gaa3c98f2c275d1ecbafcdba6b6c6032e7">More...</a><br /></td></tr>
|
|
<tr class="separator:gaa3c98f2c275d1ecbafcdba6b6c6032e7"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<p>rtc functions </p>
|
|
<h2 class="groupheader">Function Documentation</h2>
|
|
<a class="anchor" id="ga718b866eab2ba73221d37f7d15ba9737"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void rtc_disable_alarm </td>
|
|
<td>(</td>
|
|
<td class="paramtype">void </td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Disable RTC Alarm and function. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">none</td><td></td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="retval"><dt>Return values</dt><dd>
|
|
<table class="retval">
|
|
<tr><td class="paramname">none</td><td></td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="gaff89a06474197687978319e11ccfbd8a"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void rtc_free </td>
|
|
<td>(</td>
|
|
<td class="paramtype">void </td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Deinitializes the RTC device. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">none</td><td></td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="retval"><dt>Return values</dt><dd>
|
|
<table class="retval">
|
|
<tr><td class="paramname">none</td><td></td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="gacf9024748b942a7ae375cf75951afa9c"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void rtc_init </td>
|
|
<td>(</td>
|
|
<td class="paramtype">void </td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Initializes the RTC device, include clock, RTC registers and function. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">none</td><td></td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="retval"><dt>Return values</dt><dd>
|
|
<table class="retval">
|
|
<tr><td class="paramname">none</td><td></td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga8d49d48e7cc7804e34305a99f34aa450"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">int rtc_isenabled </td>
|
|
<td>(</td>
|
|
<td class="paramtype">void </td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>This function tells whether RTC is enabled or not. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">none</td><td></td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="retval"><dt>Return values</dt><dd>
|
|
<table class="retval">
|
|
<tr><td class="paramname">1</td><td>RTC is enable. </td></tr>
|
|
<tr><td class="paramname">0</td><td>RTC is disable. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga8c6e23c64ed14aa23f4d524720350228"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">time_t rtc_read </td>
|
|
<td>(</td>
|
|
<td class="paramtype">void </td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get current timestamp in seconds from RTC. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">none</td><td></td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="retval"><dt>Return values</dt><dd>
|
|
<table class="retval">
|
|
<tr><td class="paramname"></td><td>The current timestamp in seconds which is calculated from 1970.1.1 00:00:00. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="gaceaa01d3f109ffbda1a81c48081cf6f9"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">u32 rtc_set_alarm </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="structalarm__s.html">alarm_t</a> * </td>
|
|
<td class="paramname"><em>alrm</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">alarm_irq_handler </td>
|
|
<td class="paramname"><em>alarmHandler</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Set the specified RTC Alarm and interrupt. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">alarm</td><td>alarm object define in application software. </td></tr>
|
|
<tr><td class="paramname">alarmHandler</td><td>alarm interrupt callback function. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="retval"><dt>Return values</dt><dd>
|
|
<table class="retval">
|
|
<tr><td class="paramname">status</td><td><ul>
|
|
<li>1: success</li>
|
|
<li>Others: failure </li>
|
|
</ul>
|
|
</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="gaa3c98f2c275d1ecbafcdba6b6c6032e7"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void rtc_write </td>
|
|
<td>(</td>
|
|
<td class="paramtype">time_t </td>
|
|
<td class="paramname"><em>t</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Set the specified timestamp in seconds to RTC. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">t</td><td>Seconds from 1970.1.1 00:00:00 to specified data and time which is to be set. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="retval"><dt>Return values</dt><dd>
|
|
<table class="retval">
|
|
<tr><td class="paramname">none</td><td></td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
</div><!-- contents -->
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated by  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
|
</a> 1.8.11
|
|
</small></address>
|
|
</body>
|
|
</html>
|