You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1189 lines
68 KiB
HTML
1189 lines
68 KiB
HTML
<!-- HTML header for doxygen 1.8.7-->
|
|
<!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.6.3"/>
|
|
<!--BEGIN PROJECT_NAME--><title>avr-libc: avr-libc: <time.h>: Time</title><!--END PROJECT_NAME-->
|
|
<!--BEGIN !PROJECT_NAME--><title>avr-libc: <time.h>: Time</title><!--END !PROJECT_NAME-->
|
|
<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="$relpath^jquery.js"></script>
|
|
<script type="text/javascript" src="$relpath^dynsections.js"></script>
|
|
$treeview
|
|
$search
|
|
$mathjax
|
|
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
|
|
$extrastylesheet
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
|
|
<!--BEGIN TITLEAREA-->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<!--BEGIN PROJECT_LOGO-->
|
|
<td id="projectlogo"><img alt="Logo" src="$relpath^$projectlogo"/></td>
|
|
<!--END PROJECT_LOGO-->
|
|
<!--BEGIN PROJECT_NAME-->
|
|
<td style="padding-left: 0.5em;">
|
|
<div id="projectname">avr-libc
|
|
<!--BEGIN PROJECT_NUMBER--> <span id="projectnumber">2.0.0</span><!--END PROJECT_NUMBER-->
|
|
</div>
|
|
<!--BEGIN PROJECT_BRIEF--><div id="projectbrief">$projectbrief</div><!--END PROJECT_BRIEF-->
|
|
</td>
|
|
<!--END PROJECT_NAME-->
|
|
<!--BEGIN !PROJECT_NAME-->
|
|
<!--BEGIN PROJECT_BRIEF-->
|
|
<td style="padding-left: 0.5em;">
|
|
<div id="projectbrief">$projectbrief</div>
|
|
</td>
|
|
<!--END PROJECT_BRIEF-->
|
|
<!--END !PROJECT_NAME-->
|
|
<!--BEGIN DISABLE_INDEX-->
|
|
<!--BEGIN SEARCHENGINE-->
|
|
<td>$searchbox</td>
|
|
<!--END SEARCHENGINE-->
|
|
<!--END DISABLE_INDEX-->
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table>
|
|
<tr>
|
|
<td align="left"><a href="http://www.nongnu.org/avr-libc/"><h2>AVR Libc Home Page</h2></a></td>
|
|
<td align="center" colspan=4><img src="avrs.png" alt="AVRs" align="middle" border="0"></td>
|
|
<td align="right"><a href="https://savannah.nongnu.org/projects/avr-libc/"><h2>AVR Libc Development Pages</h2></a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" width="20%"><a href="index.html"><h2>Main Page</h2></a></td>
|
|
<td align="center" width="20%"><a href="pages.html"><h2>User Manual</h2></a></td>
|
|
<td align="center" width="20%"><a href="modules.html"><h2>Library Reference</h2></a></td>
|
|
<td align="center" width="20%"><a href="FAQ.html"><h2>FAQ</h2></a></td>
|
|
<td align="center" width="20%"><a href="group__demos.html"><h2>Example Projects</h2></a></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<!--END TITLEAREA-->
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.6.3 -->
|
|
<script type="text/javascript"><!--
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|
--></script>
|
|
<div class="contents">
|
|
<h1><time.h>: Time</h1><table border="0" cellpadding="0" cellspacing="0">
|
|
<tr><td colspan="2"><h2>Data Structures</h2></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structtm.html">tm</a></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structweek__date.html">week_date</a></td></tr>
|
|
<tr><td colspan="2"><h2>Defines</h2></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#gae8dbeb3eda9f88f8f222adea789ec63d">ONE_HOUR</a> 3600</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#ga33af778316d8cac3769692c311825a52">ONE_DEGREE</a> 3600</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#ga44eb26d33eb6c5e235c6cbfa377f60ae">ONE_DAY</a> 86400</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#ga0643a5b723dde6420363401dffc2e67e">UNIX_OFFSET</a> 946684800</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#gaa7c3e93bff90674e9e74de6bdec85613">NTP_OFFSET</a> 3155673600</td></tr>
|
|
<tr><td colspan="2"><h2>Typedefs</h2></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="group__avr__stdint.html#ga33594304e786b158f3fb30289278f5af">uint32_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a></td></tr>
|
|
<tr><td colspan="2"><h2>Enumerations</h2></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#gae6535271b8e2884a9ed9fe92ecfd87e1">_WEEK_DAYS_</a> { <br/>
|
|
<b>SUNDAY</b>,
|
|
<b>MONDAY</b>,
|
|
<b>TUESDAY</b>,
|
|
<b>WEDNESDAY</b>,
|
|
<br/>
|
|
<b>THURSDAY</b>,
|
|
<b>FRIDAY</b>,
|
|
<b>SATURDAY</b>
|
|
<br/>
|
|
}</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#ga9ea260b185fe2c5bb23c64f5954c28aa">_MONTHS_</a> { <br/>
|
|
<b>JANUARY</b>,
|
|
<b>FEBRUARY</b>,
|
|
<b>MARCH</b>,
|
|
<b>APRIL</b>,
|
|
<br/>
|
|
<b>MAY</b>,
|
|
<b>JUNE</b>,
|
|
<b>JULY</b>,
|
|
<b>AUGUST</b>,
|
|
<br/>
|
|
<b>SEPTEMBER</b>,
|
|
<b>OCTOBER</b>,
|
|
<b>NOVEMBER</b>,
|
|
<b>DECEMBER</b>
|
|
<br/>
|
|
}</td></tr>
|
|
<tr><td colspan="2"><h2>Functions</h2></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#ga26c7d1dbf93fa8c23c5effbacec91f8c">time</a> (<a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> *timer)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__avr__stdint.html#gadb828ef50c2dbb783109824e94cf6c47">int32_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#ga1732c46d47837951d399755899af5240">difftime</a> (<a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> time1, <a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> time0)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#gae114b9ba0fce4e2d6297e0e66768bb75">mktime</a> (struct <a class="el" href="structtm.html">tm</a> *timeptr)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#gab687d0e66f0c74b9723ff9c718ea57da">mk_gmtime</a> (const struct <a class="el" href="structtm.html">tm</a> *timeptr)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structtm.html">tm</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#gae76343d6a51c93b9318ac0ced05225cd">gmtime</a> (const <a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> *timer)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#ga7cb461118a6aeebeaacd48ee127b952a">gmtime_r</a> (const <a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> *timer, struct <a class="el" href="structtm.html">tm</a> *timeptr)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structtm.html">tm</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#gaa9336f97d394e8e02d97b9ff4fb0aca2">localtime</a> (const <a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> *timer)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#gacd9715002deaf28b432a8f2b54dd9aa5">localtime_r</a> (const <a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> *timer, struct <a class="el" href="structtm.html">tm</a> *timeptr)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#ga68a0e9d22417dfcf9c0be64261352e64">asctime</a> (const struct <a class="el" href="structtm.html">tm</a> *timeptr)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#gaa1128e048925e3b208213febb8573b88">asctime_r</a> (const struct <a class="el" href="structtm.html">tm</a> *timeptr, char *buf)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#ga72a5383fadfbaa033ac36e9e45b0bd6d">ctime</a> (const <a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> *timer)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#ga34fa7766f6b0a8a74a41683693eabad9">ctime_r</a> (const <a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> *timer, char *buf)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#ga1a85cae701479294885ec9f3c6b2fade">isotime</a> (const struct <a class="el" href="structtm.html">tm</a> *tmptr)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#gae200cfc8cc7309d0ce5fef3ee490dc47">isotime_r</a> (const struct <a class="el" href="structtm.html">tm</a> *, char *)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#gaa0344a18cbf5cfc45ffdf43890eac51c">strftime</a> (char *s, size_t maxsize, const char *format, const struct <a class="el" href="structtm.html">tm</a> *timeptr)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#ga3b0c7666163850cc95f0f231f388eb2c">set_dst</a> (int(*)(const <a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> *, <a class="el" href="group__avr__stdint.html#gadb828ef50c2dbb783109824e94cf6c47">int32_t</a> *))</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#gab4c127c1405b775b6d25a610d3fc26c3">set_zone</a> (<a class="el" href="group__avr__stdint.html#gadb828ef50c2dbb783109824e94cf6c47">int32_t</a>)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#ga02663b926feab893c0e0ec1f29b3c315">set_system_time</a> (<a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> timestamp)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#ga15aea81a8985a4c3cc9c8b00a06f5d31">system_tick</a> (void)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__avr__stdint.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#ga70762b48818b0b5bfde86973cbdd6c86">is_leap_year</a> (<a class="el" href="group__avr__stdint.html#ga932e6ccc3d54c58f761c1aead83bd6d7">int16_t</a> year)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__avr__stdint.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#gaa743162fd5cbcbaf67371785e812436a">month_length</a> (<a class="el" href="group__avr__stdint.html#ga932e6ccc3d54c58f761c1aead83bd6d7">int16_t</a> year, <a class="el" href="group__avr__stdint.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> month)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__avr__stdint.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#ga6e351ab03dbd6cb078dd48d1f40b9133">week_of_year</a> (const struct <a class="el" href="structtm.html">tm</a> *timeptr, <a class="el" href="group__avr__stdint.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> start)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__avr__stdint.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#ga53e37af6d547a0afa624fc2230c8db7a">week_of_month</a> (const struct <a class="el" href="structtm.html">tm</a> *timeptr, <a class="el" href="group__avr__stdint.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> start)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structweek__date.html">week_date</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#gafe4b12d1be1149c088d61c7cddc945e5">iso_week_date</a> (int year, int yday)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#ga8a4fd6a03c19f96f656316eba80b9c9a">iso_week_date_r</a> (int year, int yday, struct <a class="el" href="structweek__date.html">week_date</a> *)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__avr__stdint.html#ga33594304e786b158f3fb30289278f5af">uint32_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#ga0e2cda2d867a784b4dfc938ad56bb94f">fatfs_time</a> (const struct <a class="el" href="structtm.html">tm</a> *timeptr)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#ga90f87ccc97456fe3dcd867ccf71538ee">set_position</a> (<a class="el" href="group__avr__stdint.html#gadb828ef50c2dbb783109824e94cf6c47">int32_t</a> latitude, <a class="el" href="group__avr__stdint.html#gadb828ef50c2dbb783109824e94cf6c47">int32_t</a> longitude)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__avr__stdint.html#ga932e6ccc3d54c58f761c1aead83bd6d7">int16_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#ga633438d79d5dd6f946c8b6ca4ee32111">equation_of_time</a> (const <a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> *timer)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__avr__stdint.html#gadb828ef50c2dbb783109824e94cf6c47">int32_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#ga71762e360eaab527a334d9114f68aa21">daylight_seconds</a> (const <a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> *timer)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#ga35cf3a10ed003c844c54b7185fdb5b8a">solar_noon</a> (const <a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> *timer)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#ga21a491a92bce972d041e2194b4577943">sun_rise</a> (const <a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> *timer)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#ga0865e7b9f075981fafaabd0964de2d7f">sun_set</a> (const <a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> *timer)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#ga34ba5295b14e45cef7f99c386fff0230">solar_declination</a> (const <a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> *timer)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__avr__stdint.html#gaef44329758059c91c76d334e8fc09700">int8_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#ga6a79f1da4cd50f398a05679cddc3fede">moon_phase</a> (const <a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> *timer)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">unsigned long </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#gaae725f7944578bf948bb5c44588b7b7c">gm_sidereal</a> (const <a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> *timer)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">unsigned long </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__time.html#ga9136313e476a6277cb6ca759542b83e3">lm_sidereal</a> (const <a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> *timer)</td></tr>
|
|
</table>
|
|
<hr/><a name="_details"></a><h2>Detailed Description</h2>
|
|
<div class="fragment"><pre class="fragment"><span class="preprocessor"> #include <<a class="code" href="time_8h.html">time.h</a>></span>
|
|
</pre></div> <h3>Introduction to the Time functions</h3>
|
|
<p>This file declares the time functions implemented in <code>avr-libc</code>.</p>
|
|
<p>The implementation aspires to conform with ISO/IEC 9899 (C90). However, due to limitations of the target processor and the nature of its development environment, a practical implementation must of necessity deviate from the standard.</p>
|
|
<p>Section 7.23.2.1 clock() The type clock_t, the macro CLOCKS_PER_SEC, and the function clock() are not implemented. We consider these items belong to operating system code, or to application code when no operating system is present.</p>
|
|
<p>Section 7.23.2.3 <a class="el" href="group__avr__time.html#gae114b9ba0fce4e2d6297e0e66768bb75">mktime()</a> The standard specifies that <a class="el" href="group__avr__time.html#gae114b9ba0fce4e2d6297e0e66768bb75">mktime()</a> should return (time_t) -1, if the time cannot be represented. This implementation always returns a 'best effort' representation.</p>
|
|
<p>Section 7.23.2.4 <a class="el" href="group__avr__time.html#ga26c7d1dbf93fa8c23c5effbacec91f8c">time()</a> The standard specifies that <a class="el" href="group__avr__time.html#ga26c7d1dbf93fa8c23c5effbacec91f8c">time()</a> should return (time_t) -1, if the time is not available. Since the application must initialize the time system, this functionality is not implemented.</p>
|
|
<p>Section 7.23.2.2, <a class="el" href="group__avr__time.html#ga1732c46d47837951d399755899af5240">difftime()</a> Due to the lack of a 64 bit double, the function <a class="el" href="group__avr__time.html#ga1732c46d47837951d399755899af5240">difftime()</a> returns a long integer. In most cases this change will be invisible to the user, handled automatically by the compiler.</p>
|
|
<p>Section 7.23.1.4 struct tm Per the standard, struct tm->tm_isdst is greater than zero when Daylight Saving time is in effect. This implementation further specifies that, when positive, the value of tm_isdst represents the amount time is advanced during Daylight Saving time.</p>
|
|
<p>Section 7.23.3.5 <a class="el" href="group__avr__time.html#gaa0344a18cbf5cfc45ffdf43890eac51c">strftime()</a> Only the 'C' locale is supported, therefore the modifiers 'E' and 'O' are ignored. The 'Z' conversion is also ignored, due to the lack of time zone name.</p>
|
|
<p>In addition to the above departures from the standard, there are some behaviors which are different from what is often expected, though allowed under the standard.</p>
|
|
<p>There is no 'platform standard' method to obtain the current time, time zone, or daylight savings 'rules' in the AVR environment. Therefore the application must initialize the time system with this information. The functions <a class="el" href="group__avr__time.html#gab4c127c1405b775b6d25a610d3fc26c3">set_zone()</a>, <a class="el" href="group__avr__time.html#ga3b0c7666163850cc95f0f231f388eb2c">set_dst()</a>, and <a class="el" href="group__avr__time.html#ga02663b926feab893c0e0ec1f29b3c315">set_system_time()</a> are provided for initialization. Once initialized, system time is maintained by calling the function <a class="el" href="group__avr__time.html#ga15aea81a8985a4c3cc9c8b00a06f5d31">system_tick()</a> at one second intervals.</p>
|
|
<p>Though not specified in the standard, it is often expected that time_t is a signed integer representing an offset in seconds from Midnight Jan 1 1970... i.e. 'Unix time'. This implementation uses an unsigned 32 bit integer offset from Midnight Jan 1 2000. The use of this 'epoch' helps to simplify the conversion functions, while the 32 bit value allows time to be properly represented until Tue Feb 7 06:28:15 2136 UTC. The macros UNIX_OFFSET and NTP_OFFSET are defined to assist in converting to and from Unix and NTP time stamps.</p>
|
|
<p>Unlike desktop counterparts, it is impractical to implement or maintain the 'zoneinfo' database. Therefore no attempt is made to account for time zone, daylight saving, or leap seconds in past dates. All calculations are made according to the currently configured time zone and daylight saving 'rule'.</p>
|
|
<p>In addition to C standard functions, re-entrant versions of <a class="el" href="group__avr__time.html#ga72a5383fadfbaa033ac36e9e45b0bd6d">ctime()</a>, <a class="el" href="group__avr__time.html#ga68a0e9d22417dfcf9c0be64261352e64">asctime()</a>, <a class="el" href="group__avr__time.html#gae76343d6a51c93b9318ac0ced05225cd">gmtime()</a> and <a class="el" href="group__avr__time.html#gaa9336f97d394e8e02d97b9ff4fb0aca2">localtime()</a> are provided which, in addition to being re-entrant, have the property of claiming less permanent storage in RAM. An additional time conversion, <a class="el" href="group__avr__time.html#ga1a85cae701479294885ec9f3c6b2fade">isotime()</a> and its re-entrant version, uses far less storage than either <a class="el" href="group__avr__time.html#ga72a5383fadfbaa033ac36e9e45b0bd6d">ctime()</a> or <a class="el" href="group__avr__time.html#ga68a0e9d22417dfcf9c0be64261352e64">asctime()</a>.</p>
|
|
<p>Along with the usual smattering of utility functions, such as <a class="el" href="group__avr__time.html#ga70762b48818b0b5bfde86973cbdd6c86">is_leap_year()</a>, this library includes a set of functions related the sun and moon, as well as sidereal time functions. </p>
|
|
<hr/><h2>Define Documentation</h2>
|
|
<a class="anchor" id="gaa7c3e93bff90674e9e74de6bdec85613"></a><!-- doxytag: member="time.h::NTP_OFFSET" ref="gaa7c3e93bff90674e9e74de6bdec85613" args="" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">#define NTP_OFFSET 3155673600</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>Difference between the Y2K and the NTP epochs, in seconds. To convert a Y2K timestamp to NTP... </p>
|
|
<div class="fragment"><pre class="fragment"> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> ntp;
|
|
<a class="code" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> y2k;
|
|
|
|
y2k = <a class="code" href="group__avr__time.html#ga26c7d1dbf93fa8c23c5effbacec91f8c">time</a>(NULL);
|
|
ntp = y2k + <a class="code" href="group__avr__time.html#gaa7c3e93bff90674e9e74de6bdec85613">NTP_OFFSET</a>;
|
|
</pre></div>
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga44eb26d33eb6c5e235c6cbfa377f60ae"></a><!-- doxytag: member="time.h::ONE_DAY" ref="ga44eb26d33eb6c5e235c6cbfa377f60ae" args="" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">#define ONE_DAY 86400</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>One day, expressed in seconds </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga33af778316d8cac3769692c311825a52"></a><!-- doxytag: member="time.h::ONE_DEGREE" ref="ga33af778316d8cac3769692c311825a52" args="" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">#define ONE_DEGREE 3600</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>Angular degree, expressed in arc seconds </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="gae8dbeb3eda9f88f8f222adea789ec63d"></a><!-- doxytag: member="time.h::ONE_HOUR" ref="gae8dbeb3eda9f88f8f222adea789ec63d" args="" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">#define ONE_HOUR 3600</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>One hour, expressed in seconds </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga0643a5b723dde6420363401dffc2e67e"></a><!-- doxytag: member="time.h::UNIX_OFFSET" ref="ga0643a5b723dde6420363401dffc2e67e" args="" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">#define UNIX_OFFSET 946684800</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>Difference between the Y2K and the UNIX epochs, in seconds. To convert a Y2K timestamp to UNIX... </p>
|
|
<div class="fragment"><pre class="fragment"> <span class="keywordtype">long</span> unix;
|
|
<a class="code" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> y2k;
|
|
|
|
y2k = <a class="code" href="group__avr__time.html#ga26c7d1dbf93fa8c23c5effbacec91f8c">time</a>(NULL);
|
|
unix = y2k + <a class="code" href="group__avr__time.html#ga0643a5b723dde6420363401dffc2e67e">UNIX_OFFSET</a>;
|
|
</pre></div>
|
|
</div>
|
|
</div>
|
|
<hr/><h2>Typedef Documentation</h2>
|
|
<a class="anchor" id="ga3346b04b0420b32ccf6b706551b70762"></a><!-- doxytag: member="time.h::time_t" ref="ga3346b04b0420b32ccf6b706551b70762" args="" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">typedef <a class="el" href="group__avr__stdint.html#ga33594304e786b158f3fb30289278f5af">uint32_t</a> <a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>time_t represents seconds elapsed from Midnight, Jan 1 2000 UTC (the Y2K 'epoch'). Its range allows this implementation to represent time up to Tue Feb 7 06:28:15 2136 UTC. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<hr/><h2>Enumeration Type Documentation</h2>
|
|
<a class="anchor" id="ga9ea260b185fe2c5bb23c64f5954c28aa"></a><!-- doxytag: member="time.h::_MONTHS_" ref="ga9ea260b185fe2c5bb23c64f5954c28aa" args="" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">enum <a class="el" href="group__avr__time.html#ga9ea260b185fe2c5bb23c64f5954c28aa">_MONTHS_</a></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>Enumerated labels for the months. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="gae6535271b8e2884a9ed9fe92ecfd87e1"></a><!-- doxytag: member="time.h::_WEEK_DAYS_" ref="gae6535271b8e2884a9ed9fe92ecfd87e1" args="" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">enum <a class="el" href="group__avr__time.html#gae6535271b8e2884a9ed9fe92ecfd87e1">_WEEK_DAYS_</a></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>Enumerated labels for the days of the week. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<hr/><h2>Function Documentation</h2>
|
|
<a class="anchor" id="ga68a0e9d22417dfcf9c0be64261352e64"></a><!-- doxytag: member="time.h::asctime" ref="ga68a0e9d22417dfcf9c0be64261352e64" args="(const struct tm *timeptr)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">char* asctime </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const struct <a class="el" href="structtm.html">tm</a> * </td>
|
|
<td class="paramname"> <em>timeptr</em></td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>The asctime function converts the broken-down time of timeptr, into an ascii string in the form</p>
|
|
<p>Sun Mar 23 01:03:52 2013 </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="gaa1128e048925e3b208213febb8573b88"></a><!-- doxytag: member="time.h::asctime_r" ref="gaa1128e048925e3b208213febb8573b88" args="(const struct tm *timeptr, char *buf)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void asctime_r </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const struct <a class="el" href="structtm.html">tm</a> * </td>
|
|
<td class="paramname"> <em>timeptr</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">char * </td>
|
|
<td class="paramname"> <em>buf</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>Re entrant version of <a class="el" href="group__avr__time.html#ga68a0e9d22417dfcf9c0be64261352e64">asctime()</a>. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga72a5383fadfbaa033ac36e9e45b0bd6d"></a><!-- doxytag: member="time.h::ctime" ref="ga72a5383fadfbaa033ac36e9e45b0bd6d" args="(const time_t *timer)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">char* ctime </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> * </td>
|
|
<td class="paramname"> <em>timer</em></td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>The ctime function is equivalent to asctime(localtime(timer)) </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga34fa7766f6b0a8a74a41683693eabad9"></a><!-- doxytag: member="time.h::ctime_r" ref="ga34fa7766f6b0a8a74a41683693eabad9" args="(const time_t *timer, char *buf)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void ctime_r </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> * </td>
|
|
<td class="paramname"> <em>timer</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">char * </td>
|
|
<td class="paramname"> <em>buf</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>Re entrant version of <a class="el" href="group__avr__time.html#ga72a5383fadfbaa033ac36e9e45b0bd6d">ctime()</a>. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga71762e360eaab527a334d9114f68aa21"></a><!-- doxytag: member="time.h::daylight_seconds" ref="ga71762e360eaab527a334d9114f68aa21" args="(const time_t *timer)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="group__avr__stdint.html#gadb828ef50c2dbb783109824e94cf6c47">int32_t</a> daylight_seconds </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> * </td>
|
|
<td class="paramname"> <em>timer</em></td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>Computes the amount of time the sun is above the horizon, at the location of the observer.</p>
|
|
<p>NOTE: At observer locations inside a polar circle, this value can be zero during the winter, and can exceed ONE_DAY during the summer.</p>
|
|
<p>The returned value is in seconds. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga1732c46d47837951d399755899af5240"></a><!-- doxytag: member="time.h::difftime" ref="ga1732c46d47837951d399755899af5240" args="(time_t time1, time_t time0)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="group__avr__stdint.html#gadb828ef50c2dbb783109824e94cf6c47">int32_t</a> difftime </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> </td>
|
|
<td class="paramname"> <em>time1</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype"><a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> </td>
|
|
<td class="paramname"> <em>time0</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>The difftime function returns the difference between two binary time stamps, time1 - time0. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga633438d79d5dd6f946c8b6ca4ee32111"></a><!-- doxytag: member="time.h::equation_of_time" ref="ga633438d79d5dd6f946c8b6ca4ee32111" args="(const time_t *timer)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="group__avr__stdint.html#ga932e6ccc3d54c58f761c1aead83bd6d7">int16_t</a> equation_of_time </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> * </td>
|
|
<td class="paramname"> <em>timer</em></td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>Computes the difference between apparent solar time and mean solar time. The returned value is in seconds. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga0e2cda2d867a784b4dfc938ad56bb94f"></a><!-- doxytag: member="time.h::fatfs_time" ref="ga0e2cda2d867a784b4dfc938ad56bb94f" args="(const struct tm *timeptr)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="group__avr__stdint.html#ga33594304e786b158f3fb30289278f5af">uint32_t</a> fatfs_time </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const struct <a class="el" href="structtm.html">tm</a> * </td>
|
|
<td class="paramname"> <em>timeptr</em></td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>Convert a Y2K time stamp into a FAT file system time stamp. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="gaae725f7944578bf948bb5c44588b7b7c"></a><!-- doxytag: member="time.h::gm_sidereal" ref="gaae725f7944578bf948bb5c44588b7b7c" args="(const time_t *timer)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">unsigned long gm_sidereal </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> * </td>
|
|
<td class="paramname"> <em>timer</em></td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>Returns Greenwich Mean Sidereal Time, as seconds into the sidereal day. The returned value will range from 0 through 86399 seconds. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="gae76343d6a51c93b9318ac0ced05225cd"></a><!-- doxytag: member="time.h::gmtime" ref="gae76343d6a51c93b9318ac0ced05225cd" args="(const time_t *timer)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">struct <a class="el" href="structtm.html">tm</a>* gmtime </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> * </td>
|
|
<td class="paramname"> <em>timer</em></td>
|
|
<td> ) </td>
|
|
<td><code> [read]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>The gmtime function converts the time stamp pointed to by timer into broken-down time, expressed as UTC. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga7cb461118a6aeebeaacd48ee127b952a"></a><!-- doxytag: member="time.h::gmtime_r" ref="ga7cb461118a6aeebeaacd48ee127b952a" args="(const time_t *timer, struct tm *timeptr)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void gmtime_r </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> * </td>
|
|
<td class="paramname"> <em>timer</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">struct <a class="el" href="structtm.html">tm</a> * </td>
|
|
<td class="paramname"> <em>timeptr</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>Re entrant version of <a class="el" href="group__avr__time.html#gae76343d6a51c93b9318ac0ced05225cd">gmtime()</a>. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga70762b48818b0b5bfde86973cbdd6c86"></a><!-- doxytag: member="time.h::is_leap_year" ref="ga70762b48818b0b5bfde86973cbdd6c86" args="(int16_t year)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="group__avr__stdint.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> is_leap_year </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="group__avr__stdint.html#ga932e6ccc3d54c58f761c1aead83bd6d7">int16_t</a> </td>
|
|
<td class="paramname"> <em>year</em></td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>Return 1 if year is a leap year, zero if it is not. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="gafe4b12d1be1149c088d61c7cddc945e5"></a><!-- doxytag: member="time.h::iso_week_date" ref="gafe4b12d1be1149c088d61c7cddc945e5" args="(int year, int yday)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">struct <a class="el" href="structweek__date.html">week_date</a>* iso_week_date </td>
|
|
<td>(</td>
|
|
<td class="paramtype">int </td>
|
|
<td class="paramname"> <em>year</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">int </td>
|
|
<td class="paramname"> <em>yday</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td><code> [read]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>Return a <a class="el" href="structweek__date.html">week_date</a> structure with the ISO_8601 week based date corresponding to the given year and day of year. See <a href="http://en.wikipedia.org/wiki/ISO_week_date">http://en.wikipedia.org/wiki/ISO_week_date</a> for more information. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga8a4fd6a03c19f96f656316eba80b9c9a"></a><!-- doxytag: member="time.h::iso_week_date_r" ref="ga8a4fd6a03c19f96f656316eba80b9c9a" args="(int year, int yday, struct week_date *)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void iso_week_date_r </td>
|
|
<td>(</td>
|
|
<td class="paramtype">int </td>
|
|
<td class="paramname"> <em>year</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">int </td>
|
|
<td class="paramname"> <em>yday</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">struct <a class="el" href="structweek__date.html">week_date</a> * </td>
|
|
<td class="paramname"></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>Re-entrant version of iso-week_date. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga1a85cae701479294885ec9f3c6b2fade"></a><!-- doxytag: member="time.h::isotime" ref="ga1a85cae701479294885ec9f3c6b2fade" args="(const struct tm *tmptr)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">char* isotime </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const struct <a class="el" href="structtm.html">tm</a> * </td>
|
|
<td class="paramname"> <em>tmptr</em></td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>The isotime function constructs an ascii string in the form </p>
|
|
<div class="fragment"><pre class="fragment"> 2013-03-23 01:03:52
|
|
</pre></div>
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="gae200cfc8cc7309d0ce5fef3ee490dc47"></a><!-- doxytag: member="time.h::isotime_r" ref="gae200cfc8cc7309d0ce5fef3ee490dc47" args="(const struct tm *, char *)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void isotime_r </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const struct <a class="el" href="structtm.html">tm</a> * </td>
|
|
<td class="paramname">, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">char * </td>
|
|
<td class="paramname"></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>Re entrant version of <a class="el" href="group__avr__time.html#ga1a85cae701479294885ec9f3c6b2fade">isotime()</a> </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga9136313e476a6277cb6ca759542b83e3"></a><!-- doxytag: member="time.h::lm_sidereal" ref="ga9136313e476a6277cb6ca759542b83e3" args="(const time_t *timer)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">unsigned long lm_sidereal </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> * </td>
|
|
<td class="paramname"> <em>timer</em></td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>Returns Local Mean Sidereal Time, as seconds into the sidereal day. The returned value will range from 0 through 86399 seconds. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="gaa9336f97d394e8e02d97b9ff4fb0aca2"></a><!-- doxytag: member="time.h::localtime" ref="gaa9336f97d394e8e02d97b9ff4fb0aca2" args="(const time_t *timer)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">struct <a class="el" href="structtm.html">tm</a>* localtime </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> * </td>
|
|
<td class="paramname"> <em>timer</em></td>
|
|
<td> ) </td>
|
|
<td><code> [read]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>The localtime function converts the time stamp pointed to by timer into broken-down time, expressed as Local time. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="gacd9715002deaf28b432a8f2b54dd9aa5"></a><!-- doxytag: member="time.h::localtime_r" ref="gacd9715002deaf28b432a8f2b54dd9aa5" args="(const time_t *timer, struct tm *timeptr)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void localtime_r </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> * </td>
|
|
<td class="paramname"> <em>timer</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">struct <a class="el" href="structtm.html">tm</a> * </td>
|
|
<td class="paramname"> <em>timeptr</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>Re entrant version of <a class="el" href="group__avr__time.html#gaa9336f97d394e8e02d97b9ff4fb0aca2">localtime()</a>. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="gab687d0e66f0c74b9723ff9c718ea57da"></a><!-- doxytag: member="time.h::mk_gmtime" ref="gab687d0e66f0c74b9723ff9c718ea57da" args="(const struct tm *timeptr)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> mk_gmtime </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const struct <a class="el" href="structtm.html">tm</a> * </td>
|
|
<td class="paramname"> <em>timeptr</em></td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>This function 'compiles' the elements of a broken-down time structure, returning a binary time stamp. The elements of timeptr are interpreted as representing UTC.</p>
|
|
<p>The original values of the tm_wday and tm_yday elements of the structure are ignored, and the original values of the other elements are not restricted to the ranges stated for struct tm.</p>
|
|
<p>Unlike <a class="el" href="group__avr__time.html#gae114b9ba0fce4e2d6297e0e66768bb75">mktime()</a>, this function DOES NOT modify the elements of timeptr. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="gae114b9ba0fce4e2d6297e0e66768bb75"></a><!-- doxytag: member="time.h::mktime" ref="gae114b9ba0fce4e2d6297e0e66768bb75" args="(struct tm *timeptr)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> mktime </td>
|
|
<td>(</td>
|
|
<td class="paramtype">struct <a class="el" href="structtm.html">tm</a> * </td>
|
|
<td class="paramname"> <em>timeptr</em></td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>This function 'compiles' the elements of a broken-down time structure, returning a binary time stamp. The elements of timeptr are interpreted as representing Local Time.</p>
|
|
<p>The original values of the tm_wday and tm_yday elements of the structure are ignored, and the original values of the other elements are not restricted to the ranges stated for struct tm.</p>
|
|
<p>On successful completion, the values of all elements of timeptr are set to the appropriate range. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="gaa743162fd5cbcbaf67371785e812436a"></a><!-- doxytag: member="time.h::month_length" ref="gaa743162fd5cbcbaf67371785e812436a" args="(int16_t year, uint8_t month)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="group__avr__stdint.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> month_length </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="group__avr__stdint.html#ga932e6ccc3d54c58f761c1aead83bd6d7">int16_t</a> </td>
|
|
<td class="paramname"> <em>year</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype"><a class="el" href="group__avr__stdint.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> </td>
|
|
<td class="paramname"> <em>month</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>Return the length of month, given the year and month, where month is in the range 1 to 12. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga6a79f1da4cd50f398a05679cddc3fede"></a><!-- doxytag: member="time.h::moon_phase" ref="ga6a79f1da4cd50f398a05679cddc3fede" args="(const time_t *timer)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="group__avr__stdint.html#gaef44329758059c91c76d334e8fc09700">int8_t</a> moon_phase </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> * </td>
|
|
<td class="paramname"> <em>timer</em></td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>Returns an approximation to the phase of the moon. The sign of the returned value indicates a waning or waxing phase. The magnitude of the returned value indicates the percentage illumination. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga3b0c7666163850cc95f0f231f388eb2c"></a><!-- doxytag: member="time.h::set_dst" ref="ga3b0c7666163850cc95f0f231f388eb2c" args="(int(*)(const time_t *, int32_t *))" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void set_dst </td>
|
|
<td>(</td>
|
|
<td class="paramtype">int(*)(const <a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> *, <a class="el" href="group__avr__stdint.html#gadb828ef50c2dbb783109824e94cf6c47">int32_t</a> *) </td>
|
|
<td class="paramname"></td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>Specify the Daylight Saving function.</p>
|
|
<p>The Daylight Saving function should examine its parameters to determine whether Daylight Saving is in effect, and return a value appropriate for tm_isdst.</p>
|
|
<p>Working examples for the USA and the EU are available..</p>
|
|
<div class="fragment"><pre class="fragment"><span class="preprocessor"> #include <util/eu_dst.h></span>
|
|
</pre></div><p> for the European Union, and </p>
|
|
<div class="fragment"><pre class="fragment"><span class="preprocessor"> #include <util/usa_dst.h></span>
|
|
</pre></div><p> for the United States</p>
|
|
<p>If a Daylight Saving function is not specified, the system will ignore Daylight Saving. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga90f87ccc97456fe3dcd867ccf71538ee"></a><!-- doxytag: member="time.h::set_position" ref="ga90f87ccc97456fe3dcd867ccf71538ee" args="(int32_t latitude, int32_t longitude)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void set_position </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="group__avr__stdint.html#gadb828ef50c2dbb783109824e94cf6c47">int32_t</a> </td>
|
|
<td class="paramname"> <em>latitude</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype"><a class="el" href="group__avr__stdint.html#gadb828ef50c2dbb783109824e94cf6c47">int32_t</a> </td>
|
|
<td class="paramname"> <em>longitude</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>Set the geographic coordinates of the 'observer', for use with several of the following functions. Parameters are passed as seconds of North Latitude, and seconds of East Longitude.</p>
|
|
<p>For New York City... </p>
|
|
<div class="fragment"><pre class="fragment"> <a class="code" href="group__avr__time.html#ga90f87ccc97456fe3dcd867ccf71538ee">set_position</a>( 40.7142 * <a class="code" href="group__avr__time.html#ga33af778316d8cac3769692c311825a52">ONE_DEGREE</a>, -74.0064 * <a class="code" href="group__avr__time.html#ga33af778316d8cac3769692c311825a52">ONE_DEGREE</a>);
|
|
</pre></div>
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga02663b926feab893c0e0ec1f29b3c315"></a><!-- doxytag: member="time.h::set_system_time" ref="ga02663b926feab893c0e0ec1f29b3c315" args="(time_t timestamp)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void set_system_time </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> </td>
|
|
<td class="paramname"> <em>timestamp</em></td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>Initialize the system time. Examples are...</p>
|
|
<p>From a Clock / Calendar type RTC: </p>
|
|
<div class="fragment"><pre class="fragment"> <span class="keyword">struct </span><a class="code" href="structtm.html">tm</a> rtc_time;
|
|
|
|
read_rtc(&rtc_time);
|
|
rtc_time.tm_isdst = 0;
|
|
<a class="code" href="group__avr__time.html#ga02663b926feab893c0e0ec1f29b3c315">set_system_time</a>( <a class="code" href="group__avr__time.html#gae114b9ba0fce4e2d6297e0e66768bb75">mktime</a>(&rtc_time) );
|
|
</pre></div><p>From a Network Time Protocol time stamp: </p>
|
|
<div class="fragment"><pre class="fragment"> <a class="code" href="group__avr__time.html#ga02663b926feab893c0e0ec1f29b3c315">set_system_time</a>(ntp_timestamp - NTP_OFFSET);
|
|
</pre></div><p>From a UNIX time stamp: </p>
|
|
<div class="fragment"><pre class="fragment"> <a class="code" href="group__avr__time.html#ga02663b926feab893c0e0ec1f29b3c315">set_system_time</a>(unix_timestamp - UNIX_OFFSET);
|
|
</pre></div>
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="gab4c127c1405b775b6d25a610d3fc26c3"></a><!-- doxytag: member="time.h::set_zone" ref="gab4c127c1405b775b6d25a610d3fc26c3" args="(int32_t)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void set_zone </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="group__avr__stdint.html#gadb828ef50c2dbb783109824e94cf6c47">int32_t</a> </td>
|
|
<td class="paramname"></td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>Set the 'time zone'. The parameter is given in seconds East of the Prime Meridian. Example for New York City: </p>
|
|
<div class="fragment"><pre class="fragment"> <a class="code" href="group__avr__time.html#gab4c127c1405b775b6d25a610d3fc26c3">set_zone</a>(-5 * <a class="code" href="group__avr__time.html#gae8dbeb3eda9f88f8f222adea789ec63d">ONE_HOUR</a>);
|
|
</pre></div><p>If the time zone is not set, the time system will operate in UTC only. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga34ba5295b14e45cef7f99c386fff0230"></a><!-- doxytag: member="time.h::solar_declination" ref="ga34ba5295b14e45cef7f99c386fff0230" args="(const time_t *timer)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">double solar_declination </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> * </td>
|
|
<td class="paramname"> <em>timer</em></td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>Returns the declination of the sun in radians. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga35cf3a10ed003c844c54b7185fdb5b8a"></a><!-- doxytag: member="time.h::solar_noon" ref="ga35cf3a10ed003c844c54b7185fdb5b8a" args="(const time_t *timer)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> solar_noon </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> * </td>
|
|
<td class="paramname"> <em>timer</em></td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>Computes the time of solar noon, at the location of the observer. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="gaa0344a18cbf5cfc45ffdf43890eac51c"></a><!-- doxytag: member="time.h::strftime" ref="gaa0344a18cbf5cfc45ffdf43890eac51c" args="(char *s, size_t maxsize, const char *format, const struct tm *timeptr)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">size_t strftime </td>
|
|
<td>(</td>
|
|
<td class="paramtype">char * </td>
|
|
<td class="paramname"> <em>s</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">size_t </td>
|
|
<td class="paramname"> <em>maxsize</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const char * </td>
|
|
<td class="paramname"> <em>format</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const struct <a class="el" href="structtm.html">tm</a> * </td>
|
|
<td class="paramname"> <em>timeptr</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>A complete description of <a class="el" href="group__avr__time.html#gaa0344a18cbf5cfc45ffdf43890eac51c">strftime()</a> is beyond the pale of this document. Refer to ISO/IEC document 9899 for details.</p>
|
|
<p>All conversions are made using the 'C Locale', ignoring the E or O modifiers. Due to the lack of a time zone 'name', the 'Z' conversion is also ignored. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga21a491a92bce972d041e2194b4577943"></a><!-- doxytag: member="time.h::sun_rise" ref="ga21a491a92bce972d041e2194b4577943" args="(const time_t *timer)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> sun_rise </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> * </td>
|
|
<td class="paramname"> <em>timer</em></td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>Return the time of sunrise, at the location of the observer. See the note about <a class="el" href="group__avr__time.html#ga71762e360eaab527a334d9114f68aa21">daylight_seconds()</a>. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga0865e7b9f075981fafaabd0964de2d7f"></a><!-- doxytag: member="time.h::sun_set" ref="ga0865e7b9f075981fafaabd0964de2d7f" args="(const time_t *timer)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> sun_set </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> * </td>
|
|
<td class="paramname"> <em>timer</em></td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>Return the time of sunset, at the location of the observer. See the note about <a class="el" href="group__avr__time.html#ga71762e360eaab527a334d9114f68aa21">daylight_seconds()</a>. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga15aea81a8985a4c3cc9c8b00a06f5d31"></a><!-- doxytag: member="time.h::system_tick" ref="ga15aea81a8985a4c3cc9c8b00a06f5d31" args="(void)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void system_tick </td>
|
|
<td>(</td>
|
|
<td class="paramtype">void </td>
|
|
<td class="paramname"></td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>Maintain the system time by calling this function at a rate of 1 Hertz.</p>
|
|
<p>It is anticipated that this function will typically be called from within an Interrupt Service Routine, (though that is not required). It therefore includes code which makes it simple to use from within a 'Naked' ISR, avoiding the cost of saving and restoring all the cpu registers.</p>
|
|
<p>Such an ISR may resemble the following example... </p>
|
|
<div class="fragment"><pre class="fragment"> <a class="code" href="group__avr__interrupts.html#gad28590624d422cdf30d626e0a506255f">ISR</a>(RTC_OVF_vect, <a class="code" href="group__avr__interrupts.html#ga8b4c7e44627db0a60d676213add42d64">ISR_NAKED</a>)
|
|
{
|
|
<a class="code" href="group__avr__time.html#ga15aea81a8985a4c3cc9c8b00a06f5d31">system_tick</a>();
|
|
<a class="code" href="group__avr__interrupts.html#ga3b991e8168db8fc866e31f9a6d10533b">reti</a>();
|
|
}
|
|
</pre></div>
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga26c7d1dbf93fa8c23c5effbacec91f8c"></a><!-- doxytag: member="time.h::time" ref="ga26c7d1dbf93fa8c23c5effbacec91f8c" args="(time_t *timer)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> time </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="group__avr__time.html#ga3346b04b0420b32ccf6b706551b70762">time_t</a> * </td>
|
|
<td class="paramname"> <em>timer</em></td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>The time function returns the systems current time stamp. If timer is not a null pointer, the return value is also assigned to the object it points to. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga53e37af6d547a0afa624fc2230c8db7a"></a><!-- doxytag: member="time.h::week_of_month" ref="ga53e37af6d547a0afa624fc2230c8db7a" args="(const struct tm *timeptr, uint8_t start)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="group__avr__stdint.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> week_of_month </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const struct <a class="el" href="structtm.html">tm</a> * </td>
|
|
<td class="paramname"> <em>timeptr</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype"><a class="el" href="group__avr__stdint.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> </td>
|
|
<td class="paramname"> <em>start</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>Return the calendar week of month, where the first week is considered to begin on the day of week specified by 'start'. The returned value may range from zero to 5. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga6e351ab03dbd6cb078dd48d1f40b9133"></a><!-- doxytag: member="time.h::week_of_year" ref="ga6e351ab03dbd6cb078dd48d1f40b9133" args="(const struct tm *timeptr, uint8_t start)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="group__avr__stdint.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> week_of_year </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const struct <a class="el" href="structtm.html">tm</a> * </td>
|
|
<td class="paramname"> <em>timeptr</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype"><a class="el" href="group__avr__stdint.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> </td>
|
|
<td class="paramname"> <em>start</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>Return the calendar week of year, where week 1 is considered to begin on the day of week specified by 'start'. The returned value may range from zero to 52. </p>
|
|
|
|
</div>
|
|
</div>
|
|
</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"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Defines</a></div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<!-- HTML footer for doxygen 1.8.7-->
|
|
<!-- start footer part -->
|
|
<!--BEGIN GENERATE_TREEVIEW-->
|
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
|
<ul>
|
|
$navpath
|
|
<li class="footer">$generatedby
|
|
<a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="$relpath^doxygen.png" alt="doxygen"/></a> 1.6.3 </li>
|
|
</ul>
|
|
</div>
|
|
<!--END GENERATE_TREEVIEW-->
|
|
<!--BEGIN !GENERATE_TREEVIEW-->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
$generatedby  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="$relpath^doxygen.png" alt="doxygen"/>
|
|
</a> 1.6.3
|
|
</small></address>
|
|
<!--END !GENERATE_TREEVIEW-->
|
|
</body>
|
|
</html>
|