You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

namespace_fs_date_time.html 11KB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <meta name="generator" content="Doxygen 1.8.16"/>
  7. <meta name="viewport" content="width=device-width, initial-scale=1"/>
  8. <title>SdFat: FsDateTime Namespace Reference</title>
  9. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  10. <script type="text/javascript" src="jquery.js"></script>
  11. <script type="text/javascript" src="dynsections.js"></script>
  12. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  13. <script type="text/javascript" src="search/searchdata.js"></script>
  14. <script type="text/javascript" src="search/search.js"></script>
  15. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  16. </head>
  17. <body>
  18. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  19. <div id="titlearea">
  20. <table cellspacing="0" cellpadding="0">
  21. <tbody>
  22. <tr style="height: 56px;">
  23. <td id="projectalign" style="padding-left: 0.5em;">
  24. <div id="projectname">SdFat
  25. </div>
  26. </td>
  27. </tr>
  28. </tbody>
  29. </table>
  30. </div>
  31. <!-- end header part -->
  32. <!-- Generated by Doxygen 1.8.16 -->
  33. <script type="text/javascript">
  34. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  35. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  36. /* @license-end */
  37. </script>
  38. <script type="text/javascript" src="menudata.js"></script>
  39. <script type="text/javascript" src="menu.js"></script>
  40. <script type="text/javascript">
  41. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  42. $(function() {
  43. initMenu('',true,false,'search.php','Search');
  44. $(document).ready(function() { init_search(); });
  45. });
  46. /* @license-end */</script>
  47. <div id="main-nav"></div>
  48. <!-- window showing the filter options -->
  49. <div id="MSearchSelectWindow"
  50. onmouseover="return searchBox.OnSearchSelectShow()"
  51. onmouseout="return searchBox.OnSearchSelectHide()"
  52. onkeydown="return searchBox.OnSearchSelectKey(event)">
  53. </div>
  54. <!-- iframe showing the search results (closed by default) -->
  55. <div id="MSearchResultsWindow">
  56. <iframe src="javascript:void(0)" frameborder="0"
  57. name="MSearchResults" id="MSearchResults">
  58. </iframe>
  59. </div>
  60. </div><!-- top -->
  61. <div class="header">
  62. <div class="summary">
  63. <a href="#func-members">Functions</a> &#124;
  64. <a href="#var-members">Variables</a> </div>
  65. <div class="headertitle">
  66. <div class="title">FsDateTime Namespace Reference</div> </div>
  67. </div><!--header-->
  68. <div class="contents">
  69. <table class="memberdecls">
  70. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
  71. Functions</h2></td></tr>
  72. <tr class="memitem:af88a1ebd9c91a474c79a641e716729a0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_fs_date_time.html#af88a1ebd9c91a474c79a641e716729a0">clearCallback</a> ()</td></tr>
  73. <tr class="separator:af88a1ebd9c91a474c79a641e716729a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
  74. <tr class="memitem:afae6e23c2ed7d8194023d19d87fb1b62"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_fs_date_time.html#afae6e23c2ed7d8194023d19d87fb1b62">setCallback</a> (void(*dateTime)(uint16_t *date, uint16_t *time))</td></tr>
  75. <tr class="separator:afae6e23c2ed7d8194023d19d87fb1b62"><td class="memSeparator" colspan="2">&#160;</td></tr>
  76. <tr class="memitem:aa48bd625d32aae8fcfe67aba1d080be3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_fs_date_time.html#aa48bd625d32aae8fcfe67aba1d080be3">setCallback</a> (void(*dateTime)(uint16_t *date, uint16_t *time, uint8_t *ms10))</td></tr>
  77. <tr class="separator:aa48bd625d32aae8fcfe67aba1d080be3"><td class="memSeparator" colspan="2">&#160;</td></tr>
  78. </table><table class="memberdecls">
  79. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
  80. Variables</h2></td></tr>
  81. <tr class="memitem:ab4e1acabf30bc682af20e1cc93330a6a"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_fs_date_time.html#ab4e1acabf30bc682af20e1cc93330a6a">callback</a> )(uint16_t *date, uint16_t *time, uint8_t *ms10) = <a class="el" href="_stdio_stream_8h.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a></td></tr>
  82. <tr class="separator:ab4e1acabf30bc682af20e1cc93330a6a"><td class="memSeparator" colspan="2">&#160;</td></tr>
  83. <tr class="memitem:a1c19b53a8b6c93d38a4bb2f2981a4efa"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_fs_date_time.html#a1c19b53a8b6c93d38a4bb2f2981a4efa">callback2</a> )(uint16_t *date, uint16_t *time) = <a class="el" href="_stdio_stream_8h.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a></td></tr>
  84. <tr class="separator:a1c19b53a8b6c93d38a4bb2f2981a4efa"><td class="memSeparator" colspan="2">&#160;</td></tr>
  85. </table>
  86. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  87. <div class="textblock"><p>Date time callback.</p>
  88. <p>Date time callback </p>
  89. </div><h2 class="groupheader">Function Documentation</h2>
  90. <a id="af88a1ebd9c91a474c79a641e716729a0"></a>
  91. <h2 class="memtitle"><span class="permalink"><a href="#af88a1ebd9c91a474c79a641e716729a0">&#9670;&nbsp;</a></span>clearCallback()</h2>
  92. <div class="memitem">
  93. <div class="memproto">
  94. <table class="memname">
  95. <tr>
  96. <td class="memname">void FsDateTime::clearCallback </td>
  97. <td>(</td>
  98. <td class="paramname"></td><td>)</td>
  99. <td></td>
  100. </tr>
  101. </table>
  102. </div><div class="memdoc">
  103. <p>Cancel callback </p>
  104. </div>
  105. </div>
  106. <a id="afae6e23c2ed7d8194023d19d87fb1b62"></a>
  107. <h2 class="memtitle"><span class="permalink"><a href="#afae6e23c2ed7d8194023d19d87fb1b62">&#9670;&nbsp;</a></span>setCallback() <span class="overload">[1/2]</span></h2>
  108. <div class="memitem">
  109. <div class="memproto">
  110. <table class="memname">
  111. <tr>
  112. <td class="memname">void FsDateTime::setCallback </td>
  113. <td>(</td>
  114. <td class="paramtype">void(*)(uint16_t *date, uint16_t *time)&#160;</td>
  115. <td class="paramname"><em>dateTime</em></td><td>)</td>
  116. <td></td>
  117. </tr>
  118. </table>
  119. </div><div class="memdoc">
  120. <p>Set the date/time callback function</p>
  121. <dl class="params"><dt>Parameters</dt><dd>
  122. <table class="params">
  123. <tr><td class="paramdir">[in]</td><td class="paramname">dateTime</td><td>The user's call back function. The callback function is of the form:</td></tr>
  124. </table>
  125. </dd>
  126. </dl>
  127. <div class="fragment"><div class="line"><span class="keywordtype">void</span> dateTime(uint16_t* date, uint16_t* time) {</div>
  128. <div class="line"> uint16_t year;</div>
  129. <div class="line"> uint8_t month, day, hour, minute, second;</div>
  130. <div class="line"> </div>
  131. <div class="line"> <span class="comment">// User gets date and time from GPS or real-time clock here</span></div>
  132. <div class="line"> </div>
  133. <div class="line"> <span class="comment">// return date using FAT_DATE macro to format fields</span></div>
  134. <div class="line"> *date = FAT_DATE(year, month, day);</div>
  135. <div class="line"> </div>
  136. <div class="line"> <span class="comment">// return time using FAT_TIME macro to format fields</span></div>
  137. <div class="line"> *time = FAT_TIME(hour, minute, second);</div>
  138. <div class="line">}</div>
  139. </div><!-- fragment --><p>Sets the function that is called when a file is created or when a file's directory entry is modified by sync(). All timestamps, access, creation, and modify, are set when a file is created. sync() maintains the last access date and last modify date/time. </p>
  140. </div>
  141. </div>
  142. <a id="aa48bd625d32aae8fcfe67aba1d080be3"></a>
  143. <h2 class="memtitle"><span class="permalink"><a href="#aa48bd625d32aae8fcfe67aba1d080be3">&#9670;&nbsp;</a></span>setCallback() <span class="overload">[2/2]</span></h2>
  144. <div class="memitem">
  145. <div class="memproto">
  146. <table class="memname">
  147. <tr>
  148. <td class="memname">void FsDateTime::setCallback </td>
  149. <td>(</td>
  150. <td class="paramtype">void(*)(uint16_t *date, uint16_t *time, uint8_t *ms10)&#160;</td>
  151. <td class="paramname"><em>dateTime</em></td><td>)</td>
  152. <td></td>
  153. </tr>
  154. </table>
  155. </div><div class="memdoc">
  156. <p>Set the date/time callback function</p>
  157. <dl class="params"><dt>Parameters</dt><dd>
  158. <table class="params">
  159. <tr><td class="paramdir">[in]</td><td class="paramname">dateTime</td><td>The user's call back function. The callback function is of the form:</td></tr>
  160. </table>
  161. </dd>
  162. </dl>
  163. <div class="fragment"><div class="line"><span class="keywordtype">void</span> dateTime(uint16_t* date, uint16_t* time, uint8_t* ms10) {</div>
  164. <div class="line"> uint16_t year;</div>
  165. <div class="line"> uint8_t month, day, hour, minute, second;</div>
  166. <div class="line"> </div>
  167. <div class="line"> <span class="comment">// User gets date and time from GPS or real-time clock here</span></div>
  168. <div class="line"> </div>
  169. <div class="line"> <span class="comment">// return date using FAT_DATE macro to format fields</span></div>
  170. <div class="line"> *date = FAT_DATE(year, month, day);</div>
  171. <div class="line"> </div>
  172. <div class="line"> <span class="comment">// return time using FAT_TIME macro to format fields</span></div>
  173. <div class="line"> *time = FAT_TIME(hour, minute, second);</div>
  174. <div class="line"> </div>
  175. <div class="line"> *ms10 = &lt;tens of ms since second/1&gt;</div>
  176. <div class="line">}</div>
  177. </div><!-- fragment --><p>Sets the function that is called when a file is created or when a file's directory entry is modified by sync(). All timestamps, access, creation, and modify, are set when a file is created. sync() maintains the last access date and last modify date/time. </p>
  178. </div>
  179. </div>
  180. <h2 class="groupheader">Variable Documentation</h2>
  181. <a id="ab4e1acabf30bc682af20e1cc93330a6a"></a>
  182. <h2 class="memtitle"><span class="permalink"><a href="#ab4e1acabf30bc682af20e1cc93330a6a">&#9670;&nbsp;</a></span>callback</h2>
  183. <div class="memitem">
  184. <div class="memproto">
  185. <table class="memname">
  186. <tr>
  187. <td class="memname">void(* FsDateTime::callback = <a class="el" href="_stdio_stream_8h.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a></td>
  188. </tr>
  189. </table>
  190. </div><div class="memdoc">
  191. <p>Date time callback. </p>
  192. </div>
  193. </div>
  194. <a id="a1c19b53a8b6c93d38a4bb2f2981a4efa"></a>
  195. <h2 class="memtitle"><span class="permalink"><a href="#a1c19b53a8b6c93d38a4bb2f2981a4efa">&#9670;&nbsp;</a></span>callback2</h2>
  196. <div class="memitem">
  197. <div class="memproto">
  198. <table class="memname">
  199. <tr>
  200. <td class="memname">void(* FsDateTime::callback2 = <a class="el" href="_stdio_stream_8h.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a></td>
  201. </tr>
  202. </table>
  203. </div><div class="memdoc">
  204. <p>Date time callback. </p>
  205. </div>
  206. </div>
  207. </div><!-- contents -->
  208. <!-- start footer part -->
  209. <hr class="footer"/><address class="footer"><small>
  210. Generated on Fri Dec 6 2019 09:45:12 for SdFat by &#160;<a href="http://www.doxygen.org/index.html">
  211. <img class="footer" src="doxygen.png" alt="doxygen"/>
  212. </a> 1.8.16
  213. </small></address>
  214. </body>
  215. </html>