global_8h_source.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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: global.h Source File</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. </div><!-- top -->
  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 class="header">
  82. <div class="headertitle">
  83. <div class="title">global.h</div> </div>
  84. </div><!--header-->
  85. <div class="contents">
  86. <a href="global_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>&#160;<span class="comment">/**********************************************************************</span></div>
  87. <div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> Universitaet Ulm</span></div>
  88. <div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> Abteilung Organisation und Management von Informationssystemen</span></div>
  89. <div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"></span></div>
  90. <div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> Author: Philipp Hinz</span></div>
  91. <div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"></span></div>
  92. <div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> **********************************************************************/</span></div>
  93. <div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;</div>
  94. <div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="preprocessor">#ifndef _GLOBAL_H_</span></div>
  95. <div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="preprocessor">#define _GLOBAL_H_</span></div>
  96. <div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;</div>
  97. <div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="preprocessor">#include &lt;pthread.h&gt;</span></div>
  98. <div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;</div>
  99. <div class="line"><a name="l00014"></a><span class="lineno"><a class="line" href="global_8h.html#aa8cbb3355883e35c18820bfa63c4ce3a"> 14</a></span>&#160;<span class="preprocessor">#define SPI_CHANNEL 1 // 0 or 1 on Raspberry Pi</span></div>
  100. <div class="line"><a name="l00015"></a><span class="lineno"><a class="line" href="global_8h.html#a0056b7fdd0f81fad9cd38e9fd389a4b6"> 15</a></span>&#160;<span class="preprocessor">#define SPI_SPEED 200000 // SPI clock speed in Hz</span></div>
  101. <div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;</div>
  102. <div class="line"><a name="l00017"></a><span class="lineno"><a class="line" href="global_8h.html#a91dee3a4ce745234c8a4998388d6c645"> 17</a></span>&#160;<span class="preprocessor">#define TIMER_DELAY_US 50000 // Basic timer delay in us</span></div>
  103. <div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment">// SQL config</span></div>
  104. <div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;</div>
  105. <div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="global_8h.html#ad55c274bf698014e01dbc9afde3fc610"> 20</a></span>&#160;<span class="preprocessor">#define SQL_DATABASE &quot;coffee.sqlite&quot;</span></div>
  106. <div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div>
  107. <div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="comment">// Global variables</span></div>
  108. <div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;</div>
  109. <div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="global_8h.html#a0b2caeb4b6f130be43e5a2f0267dd453">verbose</a>;</div>
  110. <div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">bool</span> <a class="code" href="global_8h.html#ae88c926fe2a10f736eb01b1d1e899a1c">optDate</a>, <a class="code" href="global_8h.html#a7bfeade3d2f19e8baecdcddd7f9162fa">optPower</a>, <a class="code" href="global_8h.html#a2a24ab7c0142e353c9ce9ca1ee1210bb">optCold</a>;</div>
  111. <div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="keyword">extern</span> pthread_mutex_t <a class="code" href="global_8h.html#a4acff8232e4aec9cd5c6dc200ac55ef3">mutex</a>;</div>
  112. <div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="keyword">extern</span> pthread_t <a class="code" href="global_8h.html#a5e61240888e929e526f41e19b6c0bd46">thread</a>[];</div>
  113. <div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;</div>
  114. <div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;</div>
  115. <div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="comment">// Thread IDs</span></div>
  116. <div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="global_8h.html#a67a7c5f1e4a75f1508395d450895990d"> 31</a></span>&#160;<span class="preprocessor">#define THREAD_MAIN 0</span></div>
  117. <div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="global_8h.html#a77f390a98c0e73ae38abd20f467d6cce"> 32</a></span>&#160;<span class="preprocessor">#define THREAD_STRIPE 1</span></div>
  118. <div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="global_8h.html#a843e1fa4b4de70b9f31d42a41a896c1c"> 33</a></span>&#160;<span class="preprocessor">#define THREAD_DISPLAY 2</span></div>
  119. <div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="global_8h.html#a5f697926bb7bcc4722a9e650a1acdb6a"> 34</a></span>&#160;<span class="preprocessor">#define THREAD_COFFEE 3</span></div>
  120. <div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;</div>
  121. <div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;</div>
  122. <div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="keywordtype">void</span> <a class="code" href="global_8h.html#ab6e46b0071bb3330546b7f2b601d0a6c">killThread</a>(<span class="keywordtype">int</span> threadid, <span class="keywordtype">int</span> sig);</div>
  123. <div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;</div>
  124. <div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;<span class="preprocessor">#endif</span></div>
  125. <div class="ttc" id="global_8h_html_ab6e46b0071bb3330546b7f2b601d0a6c"><div class="ttname"><a href="global_8h.html#ab6e46b0071bb3330546b7f2b601d0a6c">killThread</a></div><div class="ttdeci">void killThread(int threadid, int sig)</div><div class="ttdoc">Sends a signal to a thread. </div><div class="ttdef"><b>Definition:</b> main.cpp:216</div></div>
  126. <div class="ttc" id="global_8h_html_ae88c926fe2a10f736eb01b1d1e899a1c"><div class="ttname"><a href="global_8h.html#ae88c926fe2a10f736eb01b1d1e899a1c">optDate</a></div><div class="ttdeci">bool optDate</div><div class="ttdef"><b>Definition:</b> main.cpp:33</div></div>
  127. <div class="ttc" id="global_8h_html_a5e61240888e929e526f41e19b6c0bd46"><div class="ttname"><a href="global_8h.html#a5e61240888e929e526f41e19b6c0bd46">thread</a></div><div class="ttdeci">pthread_t thread[]</div><div class="ttdef"><b>Definition:</b> main.cpp:41</div></div>
  128. <div class="ttc" id="global_8h_html_a4acff8232e4aec9cd5c6dc200ac55ef3"><div class="ttname"><a href="global_8h.html#a4acff8232e4aec9cd5c6dc200ac55ef3">mutex</a></div><div class="ttdeci">pthread_mutex_t mutex</div><div class="ttdef"><b>Definition:</b> main.cpp:42</div></div>
  129. <div class="ttc" id="global_8h_html_a0b2caeb4b6f130be43e5a2f0267dd453"><div class="ttname"><a href="global_8h.html#a0b2caeb4b6f130be43e5a2f0267dd453">verbose</a></div><div class="ttdeci">int verbose</div><div class="ttdef"><b>Definition:</b> main.cpp:32</div></div>
  130. <div class="ttc" id="global_8h_html_a2a24ab7c0142e353c9ce9ca1ee1210bb"><div class="ttname"><a href="global_8h.html#a2a24ab7c0142e353c9ce9ca1ee1210bb">optCold</a></div><div class="ttdeci">bool optCold</div><div class="ttdef"><b>Definition:</b> main.cpp:35</div></div>
  131. <div class="ttc" id="global_8h_html_a7bfeade3d2f19e8baecdcddd7f9162fa"><div class="ttname"><a href="global_8h.html#a7bfeade3d2f19e8baecdcddd7f9162fa">optPower</a></div><div class="ttdeci">bool optPower</div><div class="ttdef"><b>Definition:</b> main.cpp:34</div></div>
  132. </div><!-- fragment --></div><!-- contents -->
  133. <!-- start footer part -->
  134. <hr class="footer"/><address class="footer"><small>
  135. Generated by &#160;<a href="http://www.doxygen.org/index.html">
  136. <img class="footer" src="doxygen.png" alt="doxygen"/>
  137. </a> 1.8.10
  138. </small></address>
  139. </body>
  140. </html>