crc_8cpp.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  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: crc.cpp 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> &#124;
  85. <a href="#var-members">Variables</a> </div>
  86. <div class="headertitle">
  87. <div class="title">crc.cpp File Reference</div> </div>
  88. </div><!--header-->
  89. <div class="contents">
  90. <div class="textblock"><code>#include &quot;<a class="el" href="crc_8h_source.html">crc.h</a>&quot;</code><br />
  91. </div><table class="memberdecls">
  92. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
  93. Macros</h2></td></tr>
  94. <tr class="memitem:a241aeeb764887ae5e3de58b98f04b16d"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crc_8cpp.html#a241aeeb764887ae5e3de58b98f04b16d">WIDTH</a>&#160;&#160;&#160;(8 * sizeof(<a class="el" href="crc_8h.html#a73364f0434186bc77eaa8e3b03a437be">crc</a>))</td></tr>
  95. <tr class="separator:a241aeeb764887ae5e3de58b98f04b16d"><td class="memSeparator" colspan="2">&#160;</td></tr>
  96. <tr class="memitem:a118ad552670dbefa1df0ba72d147f5e1"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crc_8cpp.html#a118ad552670dbefa1df0ba72d147f5e1">TOPBIT</a>&#160;&#160;&#160;(1 &lt;&lt; (<a class="el" href="crc_8cpp.html#a241aeeb764887ae5e3de58b98f04b16d">WIDTH</a> - 1))</td></tr>
  97. <tr class="separator:a118ad552670dbefa1df0ba72d147f5e1"><td class="memSeparator" colspan="2">&#160;</td></tr>
  98. <tr class="memitem:ac5944d40ab44731450a57acd7f027f6a"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crc_8cpp.html#ac5944d40ab44731450a57acd7f027f6a">REFLECT_DATA</a>(X)&#160;&#160;&#160;((unsigned char) reflect((X), 8))</td></tr>
  99. <tr class="separator:ac5944d40ab44731450a57acd7f027f6a"><td class="memSeparator" colspan="2">&#160;</td></tr>
  100. <tr class="memitem:a2354513de80cf643198f44d7030b74d7"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crc_8cpp.html#a2354513de80cf643198f44d7030b74d7">REFLECT_REMAINDER</a>(X)&#160;&#160;&#160;((<a class="el" href="crc_8h.html#a73364f0434186bc77eaa8e3b03a437be">crc</a>) reflect((X), <a class="el" href="crc_8cpp.html#a241aeeb764887ae5e3de58b98f04b16d">WIDTH</a>))</td></tr>
  101. <tr class="separator:a2354513de80cf643198f44d7030b74d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
  102. </table><table class="memberdecls">
  103. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
  104. Functions</h2></td></tr>
  105. <tr class="memitem:a027c2916f24b3daaf662408cc72026b1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="crc_8h.html#a73364f0434186bc77eaa8e3b03a437be">crc</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crc_8cpp.html#a027c2916f24b3daaf662408cc72026b1">crcSlow</a> (unsigned char const message[], int nBytes)</td></tr>
  106. <tr class="separator:a027c2916f24b3daaf662408cc72026b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
  107. <tr class="memitem:a5a735798e6972adc694a5428dd7ccaf9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crc_8cpp.html#a5a735798e6972adc694a5428dd7ccaf9">crcInit</a> (void)</td></tr>
  108. <tr class="separator:a5a735798e6972adc694a5428dd7ccaf9"><td class="memSeparator" colspan="2">&#160;</td></tr>
  109. <tr class="memitem:a31e9ca3a3979a4c1e5043f5bfa5befaf"><td class="memItemLeft" align="right" valign="top"><a class="el" href="crc_8h.html#a73364f0434186bc77eaa8e3b03a437be">crc</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crc_8cpp.html#a31e9ca3a3979a4c1e5043f5bfa5befaf">crcFast</a> (unsigned char const message[], int nBytes)</td></tr>
  110. <tr class="separator:a31e9ca3a3979a4c1e5043f5bfa5befaf"><td class="memSeparator" colspan="2">&#160;</td></tr>
  111. </table><table class="memberdecls">
  112. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
  113. Variables</h2></td></tr>
  114. <tr class="memitem:aa0b98c402a809d26602bb9a693083720"><td class="memItemLeft" align="right" valign="top"><a class="el" href="crc_8h.html#a73364f0434186bc77eaa8e3b03a437be">crc</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="crc_8cpp.html#aa0b98c402a809d26602bb9a693083720">crcTable</a> [256]</td></tr>
  115. <tr class="separator:aa0b98c402a809d26602bb9a693083720"><td class="memSeparator" colspan="2">&#160;</td></tr>
  116. </table>
  117. <h2 class="groupheader">Macro Definition Documentation</h2>
  118. <a class="anchor" id="ac5944d40ab44731450a57acd7f027f6a"></a>
  119. <div class="memitem">
  120. <div class="memproto">
  121. <table class="memname">
  122. <tr>
  123. <td class="memname">#define REFLECT_DATA</td>
  124. <td>(</td>
  125. <td class="paramtype">&#160;</td>
  126. <td class="paramname">X</td><td>)</td>
  127. <td>&#160;&#160;&#160;((unsigned char) reflect((X), 8))</td>
  128. </tr>
  129. </table>
  130. </div><div class="memdoc">
  131. </div>
  132. </div>
  133. <a class="anchor" id="a2354513de80cf643198f44d7030b74d7"></a>
  134. <div class="memitem">
  135. <div class="memproto">
  136. <table class="memname">
  137. <tr>
  138. <td class="memname">#define REFLECT_REMAINDER</td>
  139. <td>(</td>
  140. <td class="paramtype">&#160;</td>
  141. <td class="paramname">X</td><td>)</td>
  142. <td>&#160;&#160;&#160;((<a class="el" href="crc_8h.html#a73364f0434186bc77eaa8e3b03a437be">crc</a>) reflect((X), <a class="el" href="crc_8cpp.html#a241aeeb764887ae5e3de58b98f04b16d">WIDTH</a>))</td>
  143. </tr>
  144. </table>
  145. </div><div class="memdoc">
  146. </div>
  147. </div>
  148. <a class="anchor" id="a118ad552670dbefa1df0ba72d147f5e1"></a>
  149. <div class="memitem">
  150. <div class="memproto">
  151. <table class="memname">
  152. <tr>
  153. <td class="memname">#define TOPBIT&#160;&#160;&#160;(1 &lt;&lt; (<a class="el" href="crc_8cpp.html#a241aeeb764887ae5e3de58b98f04b16d">WIDTH</a> - 1))</td>
  154. </tr>
  155. </table>
  156. </div><div class="memdoc">
  157. </div>
  158. </div>
  159. <a class="anchor" id="a241aeeb764887ae5e3de58b98f04b16d"></a>
  160. <div class="memitem">
  161. <div class="memproto">
  162. <table class="memname">
  163. <tr>
  164. <td class="memname">#define WIDTH&#160;&#160;&#160;(8 * sizeof(<a class="el" href="crc_8h.html#a73364f0434186bc77eaa8e3b03a437be">crc</a>))</td>
  165. </tr>
  166. </table>
  167. </div><div class="memdoc">
  168. </div>
  169. </div>
  170. <h2 class="groupheader">Function Documentation</h2>
  171. <a class="anchor" id="a31e9ca3a3979a4c1e5043f5bfa5befaf"></a>
  172. <div class="memitem">
  173. <div class="memproto">
  174. <table class="memname">
  175. <tr>
  176. <td class="memname"><a class="el" href="crc_8h.html#a73364f0434186bc77eaa8e3b03a437be">crc</a> crcFast </td>
  177. <td>(</td>
  178. <td class="paramtype">unsigned char const&#160;</td>
  179. <td class="paramname"><em>message</em>[], </td>
  180. </tr>
  181. <tr>
  182. <td class="paramkey"></td>
  183. <td></td>
  184. <td class="paramtype">int&#160;</td>
  185. <td class="paramname"><em>nBytes</em>&#160;</td>
  186. </tr>
  187. <tr>
  188. <td></td>
  189. <td>)</td>
  190. <td></td><td></td>
  191. </tr>
  192. </table>
  193. </div><div class="memdoc">
  194. </div>
  195. </div>
  196. <a class="anchor" id="a5a735798e6972adc694a5428dd7ccaf9"></a>
  197. <div class="memitem">
  198. <div class="memproto">
  199. <table class="memname">
  200. <tr>
  201. <td class="memname">void crcInit </td>
  202. <td>(</td>
  203. <td class="paramtype">void&#160;</td>
  204. <td class="paramname"></td><td>)</td>
  205. <td></td>
  206. </tr>
  207. </table>
  208. </div><div class="memdoc">
  209. </div>
  210. </div>
  211. <a class="anchor" id="a027c2916f24b3daaf662408cc72026b1"></a>
  212. <div class="memitem">
  213. <div class="memproto">
  214. <table class="memname">
  215. <tr>
  216. <td class="memname"><a class="el" href="crc_8h.html#a73364f0434186bc77eaa8e3b03a437be">crc</a> crcSlow </td>
  217. <td>(</td>
  218. <td class="paramtype">unsigned char const&#160;</td>
  219. <td class="paramname"><em>message</em>[], </td>
  220. </tr>
  221. <tr>
  222. <td class="paramkey"></td>
  223. <td></td>
  224. <td class="paramtype">int&#160;</td>
  225. <td class="paramname"><em>nBytes</em>&#160;</td>
  226. </tr>
  227. <tr>
  228. <td></td>
  229. <td>)</td>
  230. <td></td><td></td>
  231. </tr>
  232. </table>
  233. </div><div class="memdoc">
  234. </div>
  235. </div>
  236. <h2 class="groupheader">Variable Documentation</h2>
  237. <a class="anchor" id="aa0b98c402a809d26602bb9a693083720"></a>
  238. <div class="memitem">
  239. <div class="memproto">
  240. <table class="memname">
  241. <tr>
  242. <td class="memname"><a class="el" href="crc_8h.html#a73364f0434186bc77eaa8e3b03a437be">crc</a> crcTable[256]</td>
  243. </tr>
  244. </table>
  245. </div><div class="memdoc">
  246. </div>
  247. </div>
  248. </div><!-- contents -->
  249. <!-- start footer part -->
  250. <hr class="footer"/><address class="footer"><small>
  251. Generated by &#160;<a href="http://www.doxygen.org/index.html">
  252. <img class="footer" src="doxygen.png" alt="doxygen"/>
  253. </a> 1.8.10
  254. </small></address>
  255. </body>
  256. </html>