123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
- <meta http-equiv="X-UA-Compatible" content="IE=9"/>
- <meta name="generator" content="Doxygen 1.8.10"/>
- <title>CoffeePi: coffee.h Source File</title>
- <link href="tabs.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="jquery.js"></script>
- <script type="text/javascript" src="dynsections.js"></script>
- <link href="search/search.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="search/searchdata.js"></script>
- <script type="text/javascript" src="search/search.js"></script>
- <script type="text/javascript">
- $(document).ready(function() { init_search(); });
- </script>
- <link href="doxygen.css" rel="stylesheet" type="text/css" />
- </head>
- <body>
- <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
- <div id="titlearea">
- <table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
- <td id="projectalign" style="padding-left: 0.5em;">
- <div id="projectname">CoffeePi
- </div>
- <div id="projectbrief">Coffee machine control for Raspberry Pi</div>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <!-- end header part -->
- <!-- Generated by Doxygen 1.8.10 -->
- <script type="text/javascript">
- var searchBox = new SearchBox("searchBox", "search",false,'Search');
- </script>
- <div id="navrow1" class="tabs">
- <ul class="tablist">
- <li><a href="index.html"><span>Main Page</span></a></li>
- <li><a href="annotated.html"><span>Data Structures</span></a></li>
- <li class="current"><a href="files.html"><span>Files</span></a></li>
- <li>
- <div id="MSearchBox" class="MSearchBoxInactive">
- <span class="left">
- <img id="MSearchSelect" src="search/mag_sel.png"
- onmouseover="return searchBox.OnSearchSelectShow()"
- onmouseout="return searchBox.OnSearchSelectHide()"
- alt=""/>
- <input type="text" id="MSearchField" value="Search" accesskey="S"
- onfocus="searchBox.OnSearchFieldFocus(true)"
- onblur="searchBox.OnSearchFieldFocus(false)"
- onkeyup="searchBox.OnSearchFieldChange(event)"/>
- </span><span class="right">
- <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
- </span>
- </div>
- </li>
- </ul>
- </div>
- <div id="navrow2" class="tabs2">
- <ul class="tablist">
- <li><a href="files.html"><span>File List</span></a></li>
- <li><a href="globals.html"><span>Globals</span></a></li>
- </ul>
- </div>
- </div><!-- top -->
- <!-- window showing the filter options -->
- <div id="MSearchSelectWindow"
- onmouseover="return searchBox.OnSearchSelectShow()"
- onmouseout="return searchBox.OnSearchSelectHide()"
- onkeydown="return searchBox.OnSearchSelectKey(event)">
- </div>
- <!-- iframe showing the search results (closed by default) -->
- <div id="MSearchResultsWindow">
- <iframe src="javascript:void(0)" frameborder="0"
- name="MSearchResults" id="MSearchResults">
- </iframe>
- </div>
- <div class="header">
- <div class="headertitle">
- <div class="title">coffee.h</div> </div>
- </div><!--header-->
- <div class="contents">
- <a href="coffee_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div>
- <div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"> * coffee.h</span></div>
- <div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> *</span></div>
- <div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> * Created on: Sep 25, 2017</span></div>
- <div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> * Author: sebastian</span></div>
- <div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> */</span></div>
- <div class="line"><a name="l00007"></a><span class="lineno"> 7</span> </div>
- <div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="preprocessor">#ifndef COFFEE_H_</span></div>
- <div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="preprocessor">#define COFFEE_H_</span></div>
- <div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="preprocessor">#include <csignal></span></div>
- <div class="line"><a name="l00011"></a><span class="lineno"> 11</span> </div>
- <div class="line"><a name="l00012"></a><span class="lineno"> 12</span> </div>
- <div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment">//define status</span></div>
- <div class="line"><a name="l00014"></a><span class="lineno"><a class="line" href="coffee_8h.html#a0cc0d45e13bc83065d45df9d3d1dc887"> 14</a></span> <span class="preprocessor">#define STATE_OFF 0</span></div>
- <div class="line"><a name="l00015"></a><span class="lineno"><a class="line" href="coffee_8h.html#ab87d7787dc7a2c2afc6d7853353d7003"> 15</a></span> <span class="preprocessor">#define STATE_HEATING 1</span></div>
- <div class="line"><a name="l00016"></a><span class="lineno"><a class="line" href="coffee_8h.html#af74b21e82c0f8fbf7f697db071d420a0"> 16</a></span> <span class="preprocessor">#define STATE_INITALHEATING 2</span></div>
- <div class="line"><a name="l00017"></a><span class="lineno"><a class="line" href="coffee_8h.html#aafff27c7165f059a969fe60fee51f683"> 17</a></span> <span class="preprocessor">#define STATE_IDLE 3</span></div>
- <div class="line"><a name="l00018"></a><span class="lineno"><a class="line" href="coffee_8h.html#a7a56332694aec763a9f8028113a07199"> 18</a></span> <span class="preprocessor">#define STATE_BREW 4</span></div>
- <div class="line"><a name="l00019"></a><span class="lineno"><a class="line" href="coffee_8h.html#af696741daae3faab28c27755188fd828"> 19</a></span> <span class="preprocessor">#define STATE_BREWMANUAL 5</span></div>
- <div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="coffee_8h.html#a3a3e5a95a5ba91345c6a1b6f7e06c737"> 20</a></span> <span class="preprocessor">#define STATE_CLEANING 6</span></div>
- <div class="line"><a name="l00021"></a><span class="lineno"><a class="line" href="coffee_8h.html#a7bf0c086c7c41c12cc63324327932d91"> 21</a></span> <span class="preprocessor">#define STATE_ERROR 7</span></div>
- <div class="line"><a name="l00022"></a><span class="lineno"> 22</span> </div>
- <div class="line"><a name="l00023"></a><span class="lineno"><a class="line" href="coffee_8h.html#ad8bfbae67917bc4a69ae336c65b3aba2"> 23</a></span> <span class="preprocessor">#define AMOUNT_PREINFUSION 3 //Preinfusion amount in ml</span></div>
- <div class="line"><a name="l00024"></a><span class="lineno"><a class="line" href="coffee_8h.html#ad4b00557d847ecf54b790844b3be2eb0"> 24</a></span> <span class="preprocessor">#define TIME_SOAK 3000//Time between preinfusion and infusion in ms</span></div>
- <div class="line"><a name="l00025"></a><span class="lineno"><a class="line" href="coffee_8h.html#acd34aefc536dfe9b45dbed679cf6afaf"> 25</a></span> <span class="preprocessor">#define TIME_INFUSION 25000 //Infusion time in ms</span></div>
- <div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="coffee_8h.html#a4e3abbeb2301b9265ee297ee63e2f4c8"> 26</a></span> <span class="preprocessor">#define AMOUNT_DBLESPRESSO 25.0 //Size of a double espresso in ml</span></div>
- <div class="line"><a name="l00027"></a><span class="lineno"> 27</span> </div>
- <div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="keywordtype">void</span> *<a class="code" href="coffee_8h.html#afed8c565650f5808745b6c6c7d45462c">coffeeThread</a>(<span class="keywordtype">void</span> *threadid);</div>
- <div class="line"><a name="l00029"></a><span class="lineno"> 29</span> </div>
- <div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="keywordtype">void</span> <a class="code" href="coffee_8h.html#a44f0ebaec249d2ce6316c1bddff54d79">coffeeHandler</a> (<span class="keywordtype">int</span> signum, siginfo_t *siginfo, <span class="keywordtype">void</span> *context);</div>
- <div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="keywordtype">int</span> <a class="code" href="coffee_8h.html#a3290268b8fcbba9a6b642b68860a8503">getSigValue</a>(<span class="keywordtype">void</span>);</div>
- <div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="keywordtype">bool</span> <a class="code" href="coffee_8h.html#a63f25020d1567a2d5e03a9a59e75a0fc">SigValueEmpty</a>(<span class="keywordtype">void</span>);</div>
- <div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="keywordtype">void</span> <a class="code" href="coffee_8h.html#ae4d9681385a3f678dee40458cf55dca0">changeState</a>(<span class="keywordtype">int</span> newState);</div>
- <div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="keywordtype">int</span> <a class="code" href="coffee_8h.html#afc0b4325b7cabe49f623d5e44aaa37d7">getState</a>(<span class="keywordtype">void</span>);</div>
- <div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="keywordtype">void</span> <a class="code" href="coffee_8h.html#a66d75a676639d0f8e56c0efe76547482">brewTimeHandler</a> (<span class="keywordtype">void</span>);</div>
- <div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="keywordtype">void</span> <a class="code" href="coffee_8h.html#a5c611f1d81caf2f51c8b77b307028e4d">coffeeTerminate</a>(<span class="keywordtype">void</span>);</div>
- <div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="keywordtype">void</span> <a class="code" href="coffee_8h.html#a343324d9863aa6eb3d7e2a183aec4a09">coffeeBrew</a>(<span class="keywordtype">void</span>);</div>
- <div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="keywordtype">void</span> <a class="code" href="coffee_8h.html#a7c29bb32c4f3971f78dd515e568042c3">coffeeIncreaseBrewCounter</a>(<span class="keywordtype">void</span>);</div>
- <div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="keywordtype">void</span> <a class="code" href="coffee_8h.html#a11b81e21f5769fc6b0e55ecbac8d3976">coffeeIncreaseHeatingTime</a>(uint64_t <a class="code" href="coffee_8cpp.html#ac88c1bf95effb2aeddc71b1c2cf9034b">heatingTime</a>);</div>
- <div class="line"><a name="l00040"></a><span class="lineno"> 40</span> </div>
- <div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="preprocessor">#endif </span><span class="comment">/* COFFEE_H_ */</span><span class="preprocessor"></span></div>
- <div class="ttc" id="coffee_8h_html_a63f25020d1567a2d5e03a9a59e75a0fc"><div class="ttname"><a href="coffee_8h.html#a63f25020d1567a2d5e03a9a59e75a0fc">SigValueEmpty</a></div><div class="ttdeci">bool SigValueEmpty(void)</div><div class="ttdef"><b>Definition:</b> coffee.cpp:238</div></div>
- <div class="ttc" id="coffee_8h_html_a5c611f1d81caf2f51c8b77b307028e4d"><div class="ttname"><a href="coffee_8h.html#a5c611f1d81caf2f51c8b77b307028e4d">coffeeTerminate</a></div><div class="ttdeci">void coffeeTerminate(void)</div><div class="ttdoc">handles program termination </div><div class="ttdef"><b>Definition:</b> coffee.cpp:275</div></div>
- <div class="ttc" id="coffee_8h_html_a11b81e21f5769fc6b0e55ecbac8d3976"><div class="ttname"><a href="coffee_8h.html#a11b81e21f5769fc6b0e55ecbac8d3976">coffeeIncreaseHeatingTime</a></div><div class="ttdeci">void coffeeIncreaseHeatingTime(uint64_t heatingTime)</div><div class="ttdef"><b>Definition:</b> coffee.cpp:350</div></div>
- <div class="ttc" id="coffee_8h_html_afc0b4325b7cabe49f623d5e44aaa37d7"><div class="ttname"><a href="coffee_8h.html#afc0b4325b7cabe49f623d5e44aaa37d7">getState</a></div><div class="ttdeci">int getState(void)</div><div class="ttdoc">Returns the current state of the FSM. </div><div class="ttdef"><b>Definition:</b> coffee.cpp:260</div></div>
- <div class="ttc" id="coffee_8h_html_a3290268b8fcbba9a6b642b68860a8503"><div class="ttname"><a href="coffee_8h.html#a3290268b8fcbba9a6b642b68860a8503">getSigValue</a></div><div class="ttdeci">int getSigValue(void)</div><div class="ttdoc">returns the Signal value from the last received Signal and clears the variable </div><div class="ttdef"><b>Definition:</b> coffee.cpp:232</div></div>
- <div class="ttc" id="coffee_8h_html_a7c29bb32c4f3971f78dd515e568042c3"><div class="ttname"><a href="coffee_8h.html#a7c29bb32c4f3971f78dd515e568042c3">coffeeIncreaseBrewCounter</a></div><div class="ttdeci">void coffeeIncreaseBrewCounter(void)</div><div class="ttdef"><b>Definition:</b> coffee.cpp:340</div></div>
- <div class="ttc" id="coffee_8h_html_a44f0ebaec249d2ce6316c1bddff54d79"><div class="ttname"><a href="coffee_8h.html#a44f0ebaec249d2ce6316c1bddff54d79">coffeeHandler</a></div><div class="ttdeci">void coffeeHandler(int signum, siginfo_t *siginfo, void *context)</div><div class="ttdoc">Handler for the Signal send to this thread It saves the type of signal received and tracks the time b...</div><div class="ttdef"><b>Definition:</b> coffee.cpp:222</div></div>
- <div class="ttc" id="coffee_8h_html_a343324d9863aa6eb3d7e2a183aec4a09"><div class="ttname"><a href="coffee_8h.html#a343324d9863aa6eb3d7e2a183aec4a09">coffeeBrew</a></div><div class="ttdeci">void coffeeBrew(void)</div><div class="ttdoc">Brewing process. </div><div class="ttdef"><b>Definition:</b> coffee.cpp:285</div></div>
- <div class="ttc" id="coffee_8cpp_html_ac88c1bf95effb2aeddc71b1c2cf9034b"><div class="ttname"><a href="coffee_8cpp.html#ac88c1bf95effb2aeddc71b1c2cf9034b">heatingTime</a></div><div class="ttdeci">double heatingTime</div><div class="ttdef"><b>Definition:</b> coffee.cpp:33</div></div>
- <div class="ttc" id="coffee_8h_html_a66d75a676639d0f8e56c0efe76547482"><div class="ttname"><a href="coffee_8h.html#a66d75a676639d0f8e56c0efe76547482">brewTimeHandler</a></div><div class="ttdeci">void brewTimeHandler(void)</div><div class="ttdoc">Counter for the brew time refresh every 200ms. </div><div class="ttdef"><b>Definition:</b> coffee.cpp:268</div></div>
- <div class="ttc" id="coffee_8h_html_ae4d9681385a3f678dee40458cf55dca0"><div class="ttname"><a href="coffee_8h.html#ae4d9681385a3f678dee40458cf55dca0">changeState</a></div><div class="ttdeci">void changeState(int newState)</div><div class="ttdoc">Changes the state of the machine to newState prints the change to the logger. </div><div class="ttdef"><b>Definition:</b> coffee.cpp:250</div></div>
- <div class="ttc" id="coffee_8h_html_afed8c565650f5808745b6c6c7d45462c"><div class="ttname"><a href="coffee_8h.html#afed8c565650f5808745b6c6c7d45462c">coffeeThread</a></div><div class="ttdeci">void * coffeeThread(void *threadid)</div><div class="ttdoc">Thread for the finite state machine It represents the current state of the machine and handles signal...</div><div class="ttdef"><b>Definition:</b> coffee.cpp:41</div></div>
- </div><!-- fragment --></div><!-- contents -->
- <!-- start footer part -->
- <hr class="footer"/><address class="footer"><small>
- Generated by  <a href="http://www.doxygen.org/index.html">
- <img class="footer" src="doxygen.png" alt="doxygen"/>
- </a> 1.8.10
- </small></address>
- </body>
- </html>
|