coffee_8h.html 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  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: coffee.h File 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><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
  43. <li class="current"><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="files.html"><span>File&#160;List</span></a></li>
  65. <li><a href="globals.html"><span>Globals</span></a></li>
  66. </ul>
  67. </div>
  68. <!-- window showing the filter options -->
  69. <div id="MSearchSelectWindow"
  70. onmouseover="return searchBox.OnSearchSelectShow()"
  71. onmouseout="return searchBox.OnSearchSelectHide()"
  72. onkeydown="return searchBox.OnSearchSelectKey(event)">
  73. </div>
  74. <!-- iframe showing the search results (closed by default) -->
  75. <div id="MSearchResultsWindow">
  76. <iframe src="javascript:void(0)" frameborder="0"
  77. name="MSearchResults" id="MSearchResults">
  78. </iframe>
  79. </div>
  80. </div><!-- top -->
  81. <div class="header">
  82. <div class="summary">
  83. <a href="#define-members">Macros</a> &#124;
  84. <a href="#func-members">Functions</a> </div>
  85. <div class="headertitle">
  86. <div class="title">coffee.h File Reference</div> </div>
  87. </div><!--header-->
  88. <div class="contents">
  89. <div class="textblock"><code>#include &lt;csignal&gt;</code><br />
  90. </div>
  91. <p><a href="coffee_8h_source.html">Go to the source code of this file.</a></p>
  92. <table class="memberdecls">
  93. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
  94. Macros</h2></td></tr>
  95. <tr class="memitem:a0cc0d45e13bc83065d45df9d3d1dc887"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coffee_8h.html#a0cc0d45e13bc83065d45df9d3d1dc887">STATE_OFF</a>&#160;&#160;&#160;0</td></tr>
  96. <tr class="separator:a0cc0d45e13bc83065d45df9d3d1dc887"><td class="memSeparator" colspan="2">&#160;</td></tr>
  97. <tr class="memitem:ab87d7787dc7a2c2afc6d7853353d7003"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coffee_8h.html#ab87d7787dc7a2c2afc6d7853353d7003">STATE_HEATING</a>&#160;&#160;&#160;1</td></tr>
  98. <tr class="separator:ab87d7787dc7a2c2afc6d7853353d7003"><td class="memSeparator" colspan="2">&#160;</td></tr>
  99. <tr class="memitem:af74b21e82c0f8fbf7f697db071d420a0"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coffee_8h.html#af74b21e82c0f8fbf7f697db071d420a0">STATE_INITALHEATING</a>&#160;&#160;&#160;2</td></tr>
  100. <tr class="separator:af74b21e82c0f8fbf7f697db071d420a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
  101. <tr class="memitem:aafff27c7165f059a969fe60fee51f683"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coffee_8h.html#aafff27c7165f059a969fe60fee51f683">STATE_IDLE</a>&#160;&#160;&#160;3</td></tr>
  102. <tr class="separator:aafff27c7165f059a969fe60fee51f683"><td class="memSeparator" colspan="2">&#160;</td></tr>
  103. <tr class="memitem:a7a56332694aec763a9f8028113a07199"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coffee_8h.html#a7a56332694aec763a9f8028113a07199">STATE_BREW</a>&#160;&#160;&#160;4</td></tr>
  104. <tr class="separator:a7a56332694aec763a9f8028113a07199"><td class="memSeparator" colspan="2">&#160;</td></tr>
  105. <tr class="memitem:af696741daae3faab28c27755188fd828"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coffee_8h.html#af696741daae3faab28c27755188fd828">STATE_BREWMANUAL</a>&#160;&#160;&#160;5</td></tr>
  106. <tr class="separator:af696741daae3faab28c27755188fd828"><td class="memSeparator" colspan="2">&#160;</td></tr>
  107. <tr class="memitem:a3a3e5a95a5ba91345c6a1b6f7e06c737"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coffee_8h.html#a3a3e5a95a5ba91345c6a1b6f7e06c737">STATE_CLEANING</a>&#160;&#160;&#160;6</td></tr>
  108. <tr class="separator:a3a3e5a95a5ba91345c6a1b6f7e06c737"><td class="memSeparator" colspan="2">&#160;</td></tr>
  109. <tr class="memitem:a7bf0c086c7c41c12cc63324327932d91"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coffee_8h.html#a7bf0c086c7c41c12cc63324327932d91">STATE_ERROR</a>&#160;&#160;&#160;7</td></tr>
  110. <tr class="separator:a7bf0c086c7c41c12cc63324327932d91"><td class="memSeparator" colspan="2">&#160;</td></tr>
  111. <tr class="memitem:ad8bfbae67917bc4a69ae336c65b3aba2"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coffee_8h.html#ad8bfbae67917bc4a69ae336c65b3aba2">AMOUNT_PREINFUSION</a>&#160;&#160;&#160;3</td></tr>
  112. <tr class="separator:ad8bfbae67917bc4a69ae336c65b3aba2"><td class="memSeparator" colspan="2">&#160;</td></tr>
  113. <tr class="memitem:ad4b00557d847ecf54b790844b3be2eb0"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coffee_8h.html#ad4b00557d847ecf54b790844b3be2eb0">TIME_SOAK</a>&#160;&#160;&#160;3000</td></tr>
  114. <tr class="separator:ad4b00557d847ecf54b790844b3be2eb0"><td class="memSeparator" colspan="2">&#160;</td></tr>
  115. <tr class="memitem:acd34aefc536dfe9b45dbed679cf6afaf"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coffee_8h.html#acd34aefc536dfe9b45dbed679cf6afaf">TIME_INFUSION</a>&#160;&#160;&#160;25000</td></tr>
  116. <tr class="separator:acd34aefc536dfe9b45dbed679cf6afaf"><td class="memSeparator" colspan="2">&#160;</td></tr>
  117. <tr class="memitem:a4e3abbeb2301b9265ee297ee63e2f4c8"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coffee_8h.html#a4e3abbeb2301b9265ee297ee63e2f4c8">AMOUNT_DBLESPRESSO</a>&#160;&#160;&#160;25.0</td></tr>
  118. <tr class="separator:a4e3abbeb2301b9265ee297ee63e2f4c8"><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="func-members"></a>
  121. Functions</h2></td></tr>
  122. <tr class="memitem:afed8c565650f5808745b6c6c7d45462c"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coffee_8h.html#afed8c565650f5808745b6c6c7d45462c">coffeeThread</a> (void *threadid)</td></tr>
  123. <tr class="memdesc:afed8c565650f5808745b6c6c7d45462c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Thread for the finite state machine It represents the current state of the machine and handles signals coming from the pressure control, buttons, the brew switch and the proximity sensor. <a href="#afed8c565650f5808745b6c6c7d45462c">More...</a><br /></td></tr>
  124. <tr class="separator:afed8c565650f5808745b6c6c7d45462c"><td class="memSeparator" colspan="2">&#160;</td></tr>
  125. <tr class="memitem:a44f0ebaec249d2ce6316c1bddff54d79"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coffee_8h.html#a44f0ebaec249d2ce6316c1bddff54d79">coffeeHandler</a> (int signum, siginfo_t *siginfo, void *context)</td></tr>
  126. <tr class="memdesc:a44f0ebaec249d2ce6316c1bddff54d79"><td class="mdescLeft">&#160;</td><td class="mdescRight">Handler for the Signal send to this thread It saves the type of signal received and tracks the time between a push and release event of up to 4 signals The time is stored in the HalEvent variable when a release event is received. <a href="#a44f0ebaec249d2ce6316c1bddff54d79">More...</a><br /></td></tr>
  127. <tr class="separator:a44f0ebaec249d2ce6316c1bddff54d79"><td class="memSeparator" colspan="2">&#160;</td></tr>
  128. <tr class="memitem:a3290268b8fcbba9a6b642b68860a8503"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coffee_8h.html#a3290268b8fcbba9a6b642b68860a8503">getSigValue</a> (void)</td></tr>
  129. <tr class="memdesc:a3290268b8fcbba9a6b642b68860a8503"><td class="mdescLeft">&#160;</td><td class="mdescRight">returns the Signal value from the last received Signal and clears the variable <a href="#a3290268b8fcbba9a6b642b68860a8503">More...</a><br /></td></tr>
  130. <tr class="separator:a3290268b8fcbba9a6b642b68860a8503"><td class="memSeparator" colspan="2">&#160;</td></tr>
  131. <tr class="memitem:a63f25020d1567a2d5e03a9a59e75a0fc"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coffee_8h.html#a63f25020d1567a2d5e03a9a59e75a0fc">SigValueEmpty</a> (void)</td></tr>
  132. <tr class="separator:a63f25020d1567a2d5e03a9a59e75a0fc"><td class="memSeparator" colspan="2">&#160;</td></tr>
  133. <tr class="memitem:ae4d9681385a3f678dee40458cf55dca0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coffee_8h.html#ae4d9681385a3f678dee40458cf55dca0">changeState</a> (int newState)</td></tr>
  134. <tr class="memdesc:ae4d9681385a3f678dee40458cf55dca0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Changes the state of the machine to newState prints the change to the logger. <a href="#ae4d9681385a3f678dee40458cf55dca0">More...</a><br /></td></tr>
  135. <tr class="separator:ae4d9681385a3f678dee40458cf55dca0"><td class="memSeparator" colspan="2">&#160;</td></tr>
  136. <tr class="memitem:afc0b4325b7cabe49f623d5e44aaa37d7"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coffee_8h.html#afc0b4325b7cabe49f623d5e44aaa37d7">getState</a> (void)</td></tr>
  137. <tr class="memdesc:afc0b4325b7cabe49f623d5e44aaa37d7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the current state of the FSM. <a href="#afc0b4325b7cabe49f623d5e44aaa37d7">More...</a><br /></td></tr>
  138. <tr class="separator:afc0b4325b7cabe49f623d5e44aaa37d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
  139. <tr class="memitem:a66d75a676639d0f8e56c0efe76547482"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coffee_8h.html#a66d75a676639d0f8e56c0efe76547482">brewTimeHandler</a> (void)</td></tr>
  140. <tr class="memdesc:a66d75a676639d0f8e56c0efe76547482"><td class="mdescLeft">&#160;</td><td class="mdescRight">Counter for the brew time refresh every 200ms. <a href="#a66d75a676639d0f8e56c0efe76547482">More...</a><br /></td></tr>
  141. <tr class="separator:a66d75a676639d0f8e56c0efe76547482"><td class="memSeparator" colspan="2">&#160;</td></tr>
  142. <tr class="memitem:a5c611f1d81caf2f51c8b77b307028e4d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coffee_8h.html#a5c611f1d81caf2f51c8b77b307028e4d">coffeeTerminate</a> (void)</td></tr>
  143. <tr class="memdesc:a5c611f1d81caf2f51c8b77b307028e4d"><td class="mdescLeft">&#160;</td><td class="mdescRight">handles program termination <a href="#a5c611f1d81caf2f51c8b77b307028e4d">More...</a><br /></td></tr>
  144. <tr class="separator:a5c611f1d81caf2f51c8b77b307028e4d"><td class="memSeparator" colspan="2">&#160;</td></tr>
  145. <tr class="memitem:a343324d9863aa6eb3d7e2a183aec4a09"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coffee_8h.html#a343324d9863aa6eb3d7e2a183aec4a09">coffeeBrew</a> (void)</td></tr>
  146. <tr class="memdesc:a343324d9863aa6eb3d7e2a183aec4a09"><td class="mdescLeft">&#160;</td><td class="mdescRight">Brewing process. <a href="#a343324d9863aa6eb3d7e2a183aec4a09">More...</a><br /></td></tr>
  147. <tr class="separator:a343324d9863aa6eb3d7e2a183aec4a09"><td class="memSeparator" colspan="2">&#160;</td></tr>
  148. <tr class="memitem:a7c29bb32c4f3971f78dd515e568042c3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coffee_8h.html#a7c29bb32c4f3971f78dd515e568042c3">coffeeIncreaseBrewCounter</a> (void)</td></tr>
  149. <tr class="separator:a7c29bb32c4f3971f78dd515e568042c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
  150. <tr class="memitem:a11b81e21f5769fc6b0e55ecbac8d3976"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coffee_8h.html#a11b81e21f5769fc6b0e55ecbac8d3976">coffeeIncreaseHeatingTime</a> (uint64_t <a class="el" href="coffee_8cpp.html#ac88c1bf95effb2aeddc71b1c2cf9034b">heatingTime</a>)</td></tr>
  151. <tr class="separator:a11b81e21f5769fc6b0e55ecbac8d3976"><td class="memSeparator" colspan="2">&#160;</td></tr>
  152. </table>
  153. <h2 class="groupheader">Macro Definition Documentation</h2>
  154. <a class="anchor" id="a4e3abbeb2301b9265ee297ee63e2f4c8"></a>
  155. <div class="memitem">
  156. <div class="memproto">
  157. <table class="memname">
  158. <tr>
  159. <td class="memname">#define AMOUNT_DBLESPRESSO&#160;&#160;&#160;25.0</td>
  160. </tr>
  161. </table>
  162. </div><div class="memdoc">
  163. </div>
  164. </div>
  165. <a class="anchor" id="ad8bfbae67917bc4a69ae336c65b3aba2"></a>
  166. <div class="memitem">
  167. <div class="memproto">
  168. <table class="memname">
  169. <tr>
  170. <td class="memname">#define AMOUNT_PREINFUSION&#160;&#160;&#160;3</td>
  171. </tr>
  172. </table>
  173. </div><div class="memdoc">
  174. </div>
  175. </div>
  176. <a class="anchor" id="a7a56332694aec763a9f8028113a07199"></a>
  177. <div class="memitem">
  178. <div class="memproto">
  179. <table class="memname">
  180. <tr>
  181. <td class="memname">#define STATE_BREW&#160;&#160;&#160;4</td>
  182. </tr>
  183. </table>
  184. </div><div class="memdoc">
  185. </div>
  186. </div>
  187. <a class="anchor" id="af696741daae3faab28c27755188fd828"></a>
  188. <div class="memitem">
  189. <div class="memproto">
  190. <table class="memname">
  191. <tr>
  192. <td class="memname">#define STATE_BREWMANUAL&#160;&#160;&#160;5</td>
  193. </tr>
  194. </table>
  195. </div><div class="memdoc">
  196. </div>
  197. </div>
  198. <a class="anchor" id="a3a3e5a95a5ba91345c6a1b6f7e06c737"></a>
  199. <div class="memitem">
  200. <div class="memproto">
  201. <table class="memname">
  202. <tr>
  203. <td class="memname">#define STATE_CLEANING&#160;&#160;&#160;6</td>
  204. </tr>
  205. </table>
  206. </div><div class="memdoc">
  207. </div>
  208. </div>
  209. <a class="anchor" id="a7bf0c086c7c41c12cc63324327932d91"></a>
  210. <div class="memitem">
  211. <div class="memproto">
  212. <table class="memname">
  213. <tr>
  214. <td class="memname">#define STATE_ERROR&#160;&#160;&#160;7</td>
  215. </tr>
  216. </table>
  217. </div><div class="memdoc">
  218. </div>
  219. </div>
  220. <a class="anchor" id="ab87d7787dc7a2c2afc6d7853353d7003"></a>
  221. <div class="memitem">
  222. <div class="memproto">
  223. <table class="memname">
  224. <tr>
  225. <td class="memname">#define STATE_HEATING&#160;&#160;&#160;1</td>
  226. </tr>
  227. </table>
  228. </div><div class="memdoc">
  229. </div>
  230. </div>
  231. <a class="anchor" id="aafff27c7165f059a969fe60fee51f683"></a>
  232. <div class="memitem">
  233. <div class="memproto">
  234. <table class="memname">
  235. <tr>
  236. <td class="memname">#define STATE_IDLE&#160;&#160;&#160;3</td>
  237. </tr>
  238. </table>
  239. </div><div class="memdoc">
  240. </div>
  241. </div>
  242. <a class="anchor" id="af74b21e82c0f8fbf7f697db071d420a0"></a>
  243. <div class="memitem">
  244. <div class="memproto">
  245. <table class="memname">
  246. <tr>
  247. <td class="memname">#define STATE_INITALHEATING&#160;&#160;&#160;2</td>
  248. </tr>
  249. </table>
  250. </div><div class="memdoc">
  251. </div>
  252. </div>
  253. <a class="anchor" id="a0cc0d45e13bc83065d45df9d3d1dc887"></a>
  254. <div class="memitem">
  255. <div class="memproto">
  256. <table class="memname">
  257. <tr>
  258. <td class="memname">#define STATE_OFF&#160;&#160;&#160;0</td>
  259. </tr>
  260. </table>
  261. </div><div class="memdoc">
  262. </div>
  263. </div>
  264. <a class="anchor" id="acd34aefc536dfe9b45dbed679cf6afaf"></a>
  265. <div class="memitem">
  266. <div class="memproto">
  267. <table class="memname">
  268. <tr>
  269. <td class="memname">#define TIME_INFUSION&#160;&#160;&#160;25000</td>
  270. </tr>
  271. </table>
  272. </div><div class="memdoc">
  273. </div>
  274. </div>
  275. <a class="anchor" id="ad4b00557d847ecf54b790844b3be2eb0"></a>
  276. <div class="memitem">
  277. <div class="memproto">
  278. <table class="memname">
  279. <tr>
  280. <td class="memname">#define TIME_SOAK&#160;&#160;&#160;3000</td>
  281. </tr>
  282. </table>
  283. </div><div class="memdoc">
  284. </div>
  285. </div>
  286. <h2 class="groupheader">Function Documentation</h2>
  287. <a class="anchor" id="a66d75a676639d0f8e56c0efe76547482"></a>
  288. <div class="memitem">
  289. <div class="memproto">
  290. <table class="memname">
  291. <tr>
  292. <td class="memname">void brewTimeHandler </td>
  293. <td>(</td>
  294. <td class="paramtype">void&#160;</td>
  295. <td class="paramname"></td><td>)</td>
  296. <td></td>
  297. </tr>
  298. </table>
  299. </div><div class="memdoc">
  300. <p>Counter for the brew time refresh every 200ms. </p>
  301. </div>
  302. </div>
  303. <a class="anchor" id="ae4d9681385a3f678dee40458cf55dca0"></a>
  304. <div class="memitem">
  305. <div class="memproto">
  306. <table class="memname">
  307. <tr>
  308. <td class="memname">void changeState </td>
  309. <td>(</td>
  310. <td class="paramtype">int&#160;</td>
  311. <td class="paramname"><em>newState</em></td><td>)</td>
  312. <td></td>
  313. </tr>
  314. </table>
  315. </div><div class="memdoc">
  316. <p>Changes the state of the machine to newState prints the change to the logger. </p>
  317. <dl class="params"><dt>Parameters</dt><dd>
  318. <table class="params">
  319. <tr><td class="paramname">newState</td><td></td></tr>
  320. </table>
  321. </dd>
  322. </dl>
  323. </div>
  324. </div>
  325. <a class="anchor" id="a343324d9863aa6eb3d7e2a183aec4a09"></a>
  326. <div class="memitem">
  327. <div class="memproto">
  328. <table class="memname">
  329. <tr>
  330. <td class="memname">void coffeeBrew </td>
  331. <td>(</td>
  332. <td class="paramtype">void&#160;</td>
  333. <td class="paramname"></td><td>)</td>
  334. <td></td>
  335. </tr>
  336. </table>
  337. </div><div class="memdoc">
  338. <p>Brewing process. </p>
  339. </div>
  340. </div>
  341. <a class="anchor" id="a44f0ebaec249d2ce6316c1bddff54d79"></a>
  342. <div class="memitem">
  343. <div class="memproto">
  344. <table class="memname">
  345. <tr>
  346. <td class="memname">void coffeeHandler </td>
  347. <td>(</td>
  348. <td class="paramtype">int&#160;</td>
  349. <td class="paramname"><em>signum</em>, </td>
  350. </tr>
  351. <tr>
  352. <td class="paramkey"></td>
  353. <td></td>
  354. <td class="paramtype">siginfo_t *&#160;</td>
  355. <td class="paramname"><em>siginfo</em>, </td>
  356. </tr>
  357. <tr>
  358. <td class="paramkey"></td>
  359. <td></td>
  360. <td class="paramtype">void *&#160;</td>
  361. <td class="paramname"><em>context</em>&#160;</td>
  362. </tr>
  363. <tr>
  364. <td></td>
  365. <td>)</td>
  366. <td></td><td></td>
  367. </tr>
  368. </table>
  369. </div><div class="memdoc">
  370. <p>Handler for the Signal send to this thread It saves the type of signal received and tracks the time between a push and release event of up to 4 signals The time is stored in the HalEvent variable when a release event is received. </p>
  371. <dl class="params"><dt>Parameters</dt><dd>
  372. <table class="params">
  373. <tr><td class="paramname">signum</td><td></td></tr>
  374. <tr><td class="paramname">siginfo</td><td></td></tr>
  375. <tr><td class="paramname">context</td><td></td></tr>
  376. </table>
  377. </dd>
  378. </dl>
  379. </div>
  380. </div>
  381. <a class="anchor" id="a7c29bb32c4f3971f78dd515e568042c3"></a>
  382. <div class="memitem">
  383. <div class="memproto">
  384. <table class="memname">
  385. <tr>
  386. <td class="memname">void coffeeIncreaseBrewCounter </td>
  387. <td>(</td>
  388. <td class="paramtype">void&#160;</td>
  389. <td class="paramname"></td><td>)</td>
  390. <td></td>
  391. </tr>
  392. </table>
  393. </div><div class="memdoc">
  394. </div>
  395. </div>
  396. <a class="anchor" id="a11b81e21f5769fc6b0e55ecbac8d3976"></a>
  397. <div class="memitem">
  398. <div class="memproto">
  399. <table class="memname">
  400. <tr>
  401. <td class="memname">void coffeeIncreaseHeatingTime </td>
  402. <td>(</td>
  403. <td class="paramtype">uint64_t&#160;</td>
  404. <td class="paramname"><em>heatingTime</em></td><td>)</td>
  405. <td></td>
  406. </tr>
  407. </table>
  408. </div><div class="memdoc">
  409. </div>
  410. </div>
  411. <a class="anchor" id="a5c611f1d81caf2f51c8b77b307028e4d"></a>
  412. <div class="memitem">
  413. <div class="memproto">
  414. <table class="memname">
  415. <tr>
  416. <td class="memname">void coffeeTerminate </td>
  417. <td>(</td>
  418. <td class="paramtype">void&#160;</td>
  419. <td class="paramname"></td><td>)</td>
  420. <td></td>
  421. </tr>
  422. </table>
  423. </div><div class="memdoc">
  424. <p>handles program termination </p>
  425. </div>
  426. </div>
  427. <a class="anchor" id="afed8c565650f5808745b6c6c7d45462c"></a>
  428. <div class="memitem">
  429. <div class="memproto">
  430. <table class="memname">
  431. <tr>
  432. <td class="memname">void* coffeeThread </td>
  433. <td>(</td>
  434. <td class="paramtype">void *&#160;</td>
  435. <td class="paramname"><em>threadid</em></td><td>)</td>
  436. <td></td>
  437. </tr>
  438. </table>
  439. </div><div class="memdoc">
  440. <p>Thread for the finite state machine It represents the current state of the machine and handles signals coming from the pressure control, buttons, the brew switch and the proximity sensor. </p>
  441. <dl class="params"><dt>Parameters</dt><dd>
  442. <table class="params">
  443. <tr><td class="paramname">threadid</td><td>the ID of the thread </td></tr>
  444. </table>
  445. </dd>
  446. </dl>
  447. </div>
  448. </div>
  449. <a class="anchor" id="a3290268b8fcbba9a6b642b68860a8503"></a>
  450. <div class="memitem">
  451. <div class="memproto">
  452. <table class="memname">
  453. <tr>
  454. <td class="memname">int getSigValue </td>
  455. <td>(</td>
  456. <td class="paramtype">void&#160;</td>
  457. <td class="paramname"></td><td>)</td>
  458. <td></td>
  459. </tr>
  460. </table>
  461. </div><div class="memdoc">
  462. <p>returns the Signal value from the last received Signal and clears the variable </p>
  463. <dl class="section return"><dt>Returns</dt><dd>value sent with the last signal </dd></dl>
  464. </div>
  465. </div>
  466. <a class="anchor" id="afc0b4325b7cabe49f623d5e44aaa37d7"></a>
  467. <div class="memitem">
  468. <div class="memproto">
  469. <table class="memname">
  470. <tr>
  471. <td class="memname">int getState </td>
  472. <td>(</td>
  473. <td class="paramtype">void&#160;</td>
  474. <td class="paramname"></td><td>)</td>
  475. <td></td>
  476. </tr>
  477. </table>
  478. </div><div class="memdoc">
  479. <p>Returns the current state of the FSM. </p>
  480. </div>
  481. </div>
  482. <a class="anchor" id="a63f25020d1567a2d5e03a9a59e75a0fc"></a>
  483. <div class="memitem">
  484. <div class="memproto">
  485. <table class="memname">
  486. <tr>
  487. <td class="memname">bool SigValueEmpty </td>
  488. <td>(</td>
  489. <td class="paramtype">void&#160;</td>
  490. <td class="paramname"></td><td>)</td>
  491. <td></td>
  492. </tr>
  493. </table>
  494. </div><div class="memdoc">
  495. </div>
  496. </div>
  497. </div><!-- contents -->
  498. <!-- start footer part -->
  499. <hr class="footer"/><address class="footer"><small>
  500. Generated by &#160;<a href="http://www.doxygen.org/index.html">
  501. <img class="footer" src="doxygen.png" alt="doxygen"/>
  502. </a> 1.8.10
  503. </small></address>
  504. </body>
  505. </html>