classtimer.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://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.10"/>
  7. <title>CoffeePi: timer Class Reference</title>
  8. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  9. <script type="text/javascript" src="jquery.js"></script>
  10. <script type="text/javascript" src="dynsections.js"></script>
  11. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  12. <script type="text/javascript" src="search/searchdata.js"></script>
  13. <script type="text/javascript" src="search/search.js"></script>
  14. <script type="text/javascript">
  15. $(document).ready(function() { init_search(); });
  16. </script>
  17. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  18. </head>
  19. <body>
  20. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  21. <div id="titlearea">
  22. <table cellspacing="0" cellpadding="0">
  23. <tbody>
  24. <tr style="height: 56px;">
  25. <td id="projectalign" style="padding-left: 0.5em;">
  26. <div id="projectname">CoffeePi
  27. </div>
  28. <div id="projectbrief">Coffee machine control for Raspberry Pi</div>
  29. </td>
  30. </tr>
  31. </tbody>
  32. </table>
  33. </div>
  34. <!-- end header part -->
  35. <!-- Generated by Doxygen 1.8.10 -->
  36. <script type="text/javascript">
  37. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  38. </script>
  39. <div id="navrow1" class="tabs">
  40. <ul class="tablist">
  41. <li><a href="index.html"><span>Main&#160;Page</span></a></li>
  42. <li class="current"><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
  43. <li><a href="files.html"><span>Files</span></a></li>
  44. <li>
  45. <div id="MSearchBox" class="MSearchBoxInactive">
  46. <span class="left">
  47. <img id="MSearchSelect" src="search/mag_sel.png"
  48. onmouseover="return searchBox.OnSearchSelectShow()"
  49. onmouseout="return searchBox.OnSearchSelectHide()"
  50. alt=""/>
  51. <input type="text" id="MSearchField" value="Search" accesskey="S"
  52. onfocus="searchBox.OnSearchFieldFocus(true)"
  53. onblur="searchBox.OnSearchFieldFocus(false)"
  54. onkeyup="searchBox.OnSearchFieldChange(event)"/>
  55. </span><span class="right">
  56. <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
  57. </span>
  58. </div>
  59. </li>
  60. </ul>
  61. </div>
  62. <div id="navrow2" class="tabs2">
  63. <ul class="tablist">
  64. <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
  65. <li><a href="classes.html"><span>Data&#160;Structure&#160;Index</span></a></li>
  66. <li><a href="functions.html"><span>Data&#160;Fields</span></a></li>
  67. </ul>
  68. </div>
  69. <!-- window showing the filter options -->
  70. <div id="MSearchSelectWindow"
  71. onmouseover="return searchBox.OnSearchSelectShow()"
  72. onmouseout="return searchBox.OnSearchSelectHide()"
  73. onkeydown="return searchBox.OnSearchSelectKey(event)">
  74. </div>
  75. <!-- iframe showing the search results (closed by default) -->
  76. <div id="MSearchResultsWindow">
  77. <iframe src="javascript:void(0)" frameborder="0"
  78. name="MSearchResults" id="MSearchResults">
  79. </iframe>
  80. </div>
  81. </div><!-- top -->
  82. <div class="header">
  83. <div class="summary">
  84. <a href="#pub-methods">Public Member Functions</a> &#124;
  85. <a href="#pub-attribs">Data Fields</a> </div>
  86. <div class="headertitle">
  87. <div class="title">timer Class Reference</div> </div>
  88. </div><!--header-->
  89. <div class="contents">
  90. <p>Timer Class This class allows the creation of multiple timers that are based by a divider on a single system timer.
  91. <a href="classtimer.html#details">More...</a></p>
  92. <p><code>#include &lt;<a class="el" href="timer_8h_source.html">timer.h</a>&gt;</code></p>
  93. <table class="memberdecls">
  94. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
  95. Public Member Functions</h2></td></tr>
  96. <tr class="memitem:a863dd9a194499a5ebbaf6937969916f2"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtimer.html#a863dd9a194499a5ebbaf6937969916f2">timer</a> (void(*handler)(void))</td></tr>
  97. <tr class="memdesc:a863dd9a194499a5ebbaf6937969916f2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Timer constructor Depending on the call of the constructor the handler will be called as thread or not. <a href="#a863dd9a194499a5ebbaf6937969916f2">More...</a><br /></td></tr>
  98. <tr class="separator:a863dd9a194499a5ebbaf6937969916f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
  99. <tr class="memitem:a36730b19460d9576fe6d7535f969105a"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtimer.html#a36730b19460d9576fe6d7535f969105a">timer</a> (void *(*handler)(void *))</td></tr>
  100. <tr class="separator:a36730b19460d9576fe6d7535f969105a"><td class="memSeparator" colspan="2">&#160;</td></tr>
  101. <tr class="memitem:a0a4b48605728320ce7a5a825e34e16f2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtimer.html#a0a4b48605728320ce7a5a825e34e16f2">setDivider</a> (int divider)</td></tr>
  102. <tr class="memdesc:a0a4b48605728320ce7a5a825e34e16f2"><td class="mdescLeft">&#160;</td><td class="mdescRight">sets the divider for this timer (based on system timer) <a href="#a0a4b48605728320ce7a5a825e34e16f2">More...</a><br /></td></tr>
  103. <tr class="separator:a0a4b48605728320ce7a5a825e34e16f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
  104. <tr class="memitem:a3d5386a682a23df5c6a841ce8fc55bd4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtimer.html#a3d5386a682a23df5c6a841ce8fc55bd4">getDivider</a> ()</td></tr>
  105. <tr class="memdesc:a3d5386a682a23df5c6a841ce8fc55bd4"><td class="mdescLeft">&#160;</td><td class="mdescRight">reads the timer divider <a href="#a3d5386a682a23df5c6a841ce8fc55bd4">More...</a><br /></td></tr>
  106. <tr class="separator:a3d5386a682a23df5c6a841ce8fc55bd4"><td class="memSeparator" colspan="2">&#160;</td></tr>
  107. <tr class="memitem:a7d9f6d9f98d51534be127d57f497b345"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtimer.html#a7d9f6d9f98d51534be127d57f497b345">call</a> ()</td></tr>
  108. <tr class="memdesc:a7d9f6d9f98d51534be127d57f497b345"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calls the timer handler if enabled. <a href="#a7d9f6d9f98d51534be127d57f497b345">More...</a><br /></td></tr>
  109. <tr class="separator:a7d9f6d9f98d51534be127d57f497b345"><td class="memSeparator" colspan="2">&#160;</td></tr>
  110. <tr class="memitem:a9aa894a57748b2bdf3adce46f5736794"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtimer.html#a9aa894a57748b2bdf3adce46f5736794">start</a> ()</td></tr>
  111. <tr class="memdesc:a9aa894a57748b2bdf3adce46f5736794"><td class="mdescLeft">&#160;</td><td class="mdescRight">enables the timer <a href="#a9aa894a57748b2bdf3adce46f5736794">More...</a><br /></td></tr>
  112. <tr class="separator:a9aa894a57748b2bdf3adce46f5736794"><td class="memSeparator" colspan="2">&#160;</td></tr>
  113. <tr class="memitem:a3218d61649e284071544b17c8c915ecc"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtimer.html#a3218d61649e284071544b17c8c915ecc">stop</a> ()</td></tr>
  114. <tr class="memdesc:a3218d61649e284071544b17c8c915ecc"><td class="mdescLeft">&#160;</td><td class="mdescRight">disables the timer <a href="#a3218d61649e284071544b17c8c915ecc">More...</a><br /></td></tr>
  115. <tr class="separator:a3218d61649e284071544b17c8c915ecc"><td class="memSeparator" colspan="2">&#160;</td></tr>
  116. <tr class="memitem:abbb117c0ae32aa48df5df60328e224f9"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtimer.html#abbb117c0ae32aa48df5df60328e224f9">isActive</a> ()</td></tr>
  117. <tr class="memdesc:abbb117c0ae32aa48df5df60328e224f9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the timers active state. <a href="#abbb117c0ae32aa48df5df60328e224f9">More...</a><br /></td></tr>
  118. <tr class="separator:abbb117c0ae32aa48df5df60328e224f9"><td class="memSeparator" colspan="2">&#160;</td></tr>
  119. </table><table class="memberdecls">
  120. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
  121. Data Fields</h2></td></tr>
  122. <tr class="memitem:a296c5e65582e19eaf61ae0bffa4071dc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classtimer.html">timer</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtimer.html#a296c5e65582e19eaf61ae0bffa4071dc">next</a></td></tr>
  123. <tr class="memdesc:a296c5e65582e19eaf61ae0bffa4071dc"><td class="mdescLeft">&#160;</td><td class="mdescRight">contains the pointer on the next timer element of the list <a href="#a296c5e65582e19eaf61ae0bffa4071dc">More...</a><br /></td></tr>
  124. <tr class="separator:a296c5e65582e19eaf61ae0bffa4071dc"><td class="memSeparator" colspan="2">&#160;</td></tr>
  125. </table>
  126. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  127. <div class="textblock"><p>Timer Class This class allows the creation of multiple timers that are based by a divider on a single system timer. </p>
  128. </div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
  129. <a class="anchor" id="a863dd9a194499a5ebbaf6937969916f2"></a>
  130. <div class="memitem">
  131. <div class="memproto">
  132. <table class="memname">
  133. <tr>
  134. <td class="memname">timer::timer </td>
  135. <td>(</td>
  136. <td class="paramtype">void(*)(void)&#160;</td>
  137. <td class="paramname"><em>handler</em></td><td>)</td>
  138. <td></td>
  139. </tr>
  140. </table>
  141. </div><div class="memdoc">
  142. <p>Timer constructor Depending on the call of the constructor the handler will be called as thread or not. </p>
  143. <dl class="params"><dt>Parameters</dt><dd>
  144. <table class="params">
  145. <tr><td class="paramname">*handler</td><td>target pointer to the method </td></tr>
  146. </table>
  147. </dd>
  148. </dl>
  149. </div>
  150. </div>
  151. <a class="anchor" id="a36730b19460d9576fe6d7535f969105a"></a>
  152. <div class="memitem">
  153. <div class="memproto">
  154. <table class="memname">
  155. <tr>
  156. <td class="memname">timer::timer </td>
  157. <td>(</td>
  158. <td class="paramtype">void *(*)(void *)&#160;</td>
  159. <td class="paramname"><em>handler</em></td><td>)</td>
  160. <td></td>
  161. </tr>
  162. </table>
  163. </div><div class="memdoc">
  164. </div>
  165. </div>
  166. <h2 class="groupheader">Member Function Documentation</h2>
  167. <a class="anchor" id="a7d9f6d9f98d51534be127d57f497b345"></a>
  168. <div class="memitem">
  169. <div class="memproto">
  170. <table class="memname">
  171. <tr>
  172. <td class="memname">void timer::call </td>
  173. <td>(</td>
  174. <td class="paramname"></td><td>)</td>
  175. <td></td>
  176. </tr>
  177. </table>
  178. </div><div class="memdoc">
  179. <p>Calls the timer handler if enabled. </p>
  180. </div>
  181. </div>
  182. <a class="anchor" id="a3d5386a682a23df5c6a841ce8fc55bd4"></a>
  183. <div class="memitem">
  184. <div class="memproto">
  185. <table class="memname">
  186. <tr>
  187. <td class="memname">int timer::getDivider </td>
  188. <td>(</td>
  189. <td class="paramname"></td><td>)</td>
  190. <td></td>
  191. </tr>
  192. </table>
  193. </div><div class="memdoc">
  194. <p>reads the timer divider </p>
  195. <dl class="section return"><dt>Returns</dt><dd>timer divider </dd></dl>
  196. </div>
  197. </div>
  198. <a class="anchor" id="abbb117c0ae32aa48df5df60328e224f9"></a>
  199. <div class="memitem">
  200. <div class="memproto">
  201. <table class="memname">
  202. <tr>
  203. <td class="memname">bool timer::isActive </td>
  204. <td>(</td>
  205. <td class="paramname"></td><td>)</td>
  206. <td></td>
  207. </tr>
  208. </table>
  209. </div><div class="memdoc">
  210. <p>Returns the timers active state. </p>
  211. <dl class="section return"><dt>Returns</dt><dd>true if active </dd></dl>
  212. </div>
  213. </div>
  214. <a class="anchor" id="a0a4b48605728320ce7a5a825e34e16f2"></a>
  215. <div class="memitem">
  216. <div class="memproto">
  217. <table class="memname">
  218. <tr>
  219. <td class="memname">void timer::setDivider </td>
  220. <td>(</td>
  221. <td class="paramtype">int&#160;</td>
  222. <td class="paramname"><em>divider</em></td><td>)</td>
  223. <td></td>
  224. </tr>
  225. </table>
  226. </div><div class="memdoc">
  227. <p>sets the divider for this timer (based on system timer) </p>
  228. <dl class="params"><dt>Parameters</dt><dd>
  229. <table class="params">
  230. <tr><td class="paramname">divider</td><td>integer timer divider </td></tr>
  231. </table>
  232. </dd>
  233. </dl>
  234. </div>
  235. </div>
  236. <a class="anchor" id="a9aa894a57748b2bdf3adce46f5736794"></a>
  237. <div class="memitem">
  238. <div class="memproto">
  239. <table class="memname">
  240. <tr>
  241. <td class="memname">void timer::start </td>
  242. <td>(</td>
  243. <td class="paramname"></td><td>)</td>
  244. <td></td>
  245. </tr>
  246. </table>
  247. </div><div class="memdoc">
  248. <p>enables the timer </p>
  249. </div>
  250. </div>
  251. <a class="anchor" id="a3218d61649e284071544b17c8c915ecc"></a>
  252. <div class="memitem">
  253. <div class="memproto">
  254. <table class="memname">
  255. <tr>
  256. <td class="memname">void timer::stop </td>
  257. <td>(</td>
  258. <td class="paramname"></td><td>)</td>
  259. <td></td>
  260. </tr>
  261. </table>
  262. </div><div class="memdoc">
  263. <p>disables the timer </p>
  264. </div>
  265. </div>
  266. <h2 class="groupheader">Field Documentation</h2>
  267. <a class="anchor" id="a296c5e65582e19eaf61ae0bffa4071dc"></a>
  268. <div class="memitem">
  269. <div class="memproto">
  270. <table class="memname">
  271. <tr>
  272. <td class="memname"><a class="el" href="classtimer.html">timer</a>* timer::next</td>
  273. </tr>
  274. </table>
  275. </div><div class="memdoc">
  276. <p>contains the pointer on the next timer element of the list </p>
  277. </div>
  278. </div>
  279. <hr/>The documentation for this class was generated from the following files:<ul>
  280. <li><a class="el" href="timer_8h_source.html">timer.h</a></li>
  281. <li><a class="el" href="timer_8cpp.html">timer.cpp</a></li>
  282. </ul>
  283. </div><!-- contents -->
  284. <!-- start footer part -->
  285. <hr class="footer"/><address class="footer"><small>
  286. Generated by &#160;<a href="http://www.doxygen.org/index.html">
  287. <img class="footer" src="doxygen.png" alt="doxygen"/>
  288. </a> 1.8.10
  289. </small></address>
  290. </body>
  291. </html>