spi_8h.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  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: spi.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">spi.h File Reference</div> </div>
  87. </div><!--header-->
  88. <div class="contents">
  89. <div class="textblock"><code>#include &lt;inttypes.h&gt;</code><br />
  90. </div>
  91. <p><a href="spi_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:aa9f52b418d31ac71ce93f2d7846ded90"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="spi_8h.html#aa9f52b418d31ac71ce93f2d7846ded90">SHIFT_SCLR</a>&#160;&#160;&#160;21</td></tr>
  96. <tr class="separator:aa9f52b418d31ac71ce93f2d7846ded90"><td class="memSeparator" colspan="2">&#160;</td></tr>
  97. <tr class="memitem:aed6e9b64896ee902a2f02b1e49e65a11"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="spi_8h.html#aed6e9b64896ee902a2f02b1e49e65a11">SHIFT_RCK</a>&#160;&#160;&#160;22</td></tr>
  98. <tr class="separator:aed6e9b64896ee902a2f02b1e49e65a11"><td class="memSeparator" colspan="2">&#160;</td></tr>
  99. <tr class="memitem:aa846752b3dc2a7a280e1c97191c1e378"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="spi_8h.html#aa846752b3dc2a7a280e1c97191c1e378">SHIFT_G</a>&#160;&#160;&#160;26</td></tr>
  100. <tr class="separator:aa846752b3dc2a7a280e1c97191c1e378"><td class="memSeparator" colspan="2">&#160;</td></tr>
  101. </table><table class="memberdecls">
  102. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
  103. Functions</h2></td></tr>
  104. <tr class="memitem:a7402e4a56146a9e3df480b206a3f7e7e"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="spi_8h.html#a7402e4a56146a9e3df480b206a3f7e7e">spi_readwrite</a> (uint8_t data)</td></tr>
  105. <tr class="memdesc:a7402e4a56146a9e3df480b206a3f7e7e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes the data on the SPI bus and returns the reply. <a href="#a7402e4a56146a9e3df480b206a3f7e7e">More...</a><br /></td></tr>
  106. <tr class="separator:a7402e4a56146a9e3df480b206a3f7e7e"><td class="memSeparator" colspan="2">&#160;</td></tr>
  107. <tr class="memitem:ae909944aa85ae98323073c628be541aa"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="spi_8h.html#ae909944aa85ae98323073c628be541aa">spi_init</a> (void)</td></tr>
  108. <tr class="memdesc:ae909944aa85ae98323073c628be541aa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes the SPI bus. <a href="#ae909944aa85ae98323073c628be541aa">More...</a><br /></td></tr>
  109. <tr class="separator:ae909944aa85ae98323073c628be541aa"><td class="memSeparator" colspan="2">&#160;</td></tr>
  110. <tr class="memitem:ac7600504b8cf1ac90ce331a5ed23c3db"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="spi_8h.html#ac7600504b8cf1ac90ce331a5ed23c3db">shift_init</a> (void)</td></tr>
  111. <tr class="memdesc:ac7600504b8cf1ac90ce331a5ed23c3db"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes the shift register. <a href="#ac7600504b8cf1ac90ce331a5ed23c3db">More...</a><br /></td></tr>
  112. <tr class="separator:ac7600504b8cf1ac90ce331a5ed23c3db"><td class="memSeparator" colspan="2">&#160;</td></tr>
  113. <tr class="memitem:aec7140cda479ce5f88361739e86ccecd"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="spi_8h.html#aec7140cda479ce5f88361739e86ccecd">shift_data</a> (uint8_t data)</td></tr>
  114. <tr class="memdesc:aec7140cda479ce5f88361739e86ccecd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sends a byte to the shift register. <a href="#aec7140cda479ce5f88361739e86ccecd">More...</a><br /></td></tr>
  115. <tr class="separator:aec7140cda479ce5f88361739e86ccecd"><td class="memSeparator" colspan="2">&#160;</td></tr>
  116. </table>
  117. <h2 class="groupheader">Macro Definition Documentation</h2>
  118. <a class="anchor" id="aa846752b3dc2a7a280e1c97191c1e378"></a>
  119. <div class="memitem">
  120. <div class="memproto">
  121. <table class="memname">
  122. <tr>
  123. <td class="memname">#define SHIFT_G&#160;&#160;&#160;26</td>
  124. </tr>
  125. </table>
  126. </div><div class="memdoc">
  127. </div>
  128. </div>
  129. <a class="anchor" id="aed6e9b64896ee902a2f02b1e49e65a11"></a>
  130. <div class="memitem">
  131. <div class="memproto">
  132. <table class="memname">
  133. <tr>
  134. <td class="memname">#define SHIFT_RCK&#160;&#160;&#160;22</td>
  135. </tr>
  136. </table>
  137. </div><div class="memdoc">
  138. </div>
  139. </div>
  140. <a class="anchor" id="aa9f52b418d31ac71ce93f2d7846ded90"></a>
  141. <div class="memitem">
  142. <div class="memproto">
  143. <table class="memname">
  144. <tr>
  145. <td class="memname">#define SHIFT_SCLR&#160;&#160;&#160;21</td>
  146. </tr>
  147. </table>
  148. </div><div class="memdoc">
  149. </div>
  150. </div>
  151. <h2 class="groupheader">Function Documentation</h2>
  152. <a class="anchor" id="aec7140cda479ce5f88361739e86ccecd"></a>
  153. <div class="memitem">
  154. <div class="memproto">
  155. <table class="memname">
  156. <tr>
  157. <td class="memname">void shift_data </td>
  158. <td>(</td>
  159. <td class="paramtype">uint8_t&#160;</td>
  160. <td class="paramname"><em>data</em></td><td>)</td>
  161. <td></td>
  162. </tr>
  163. </table>
  164. </div><div class="memdoc">
  165. <p>Sends a byte to the shift register. </p>
  166. <dl class="params"><dt>Parameters</dt><dd>
  167. <table class="params">
  168. <tr><td class="paramname">data</td><td>Data byte </td></tr>
  169. </table>
  170. </dd>
  171. </dl>
  172. </div>
  173. </div>
  174. <a class="anchor" id="ac7600504b8cf1ac90ce331a5ed23c3db"></a>
  175. <div class="memitem">
  176. <div class="memproto">
  177. <table class="memname">
  178. <tr>
  179. <td class="memname">void shift_init </td>
  180. <td>(</td>
  181. <td class="paramtype">void&#160;</td>
  182. <td class="paramname"></td><td>)</td>
  183. <td></td>
  184. </tr>
  185. </table>
  186. </div><div class="memdoc">
  187. <p>Initializes the shift register. </p>
  188. </div>
  189. </div>
  190. <a class="anchor" id="ae909944aa85ae98323073c628be541aa"></a>
  191. <div class="memitem">
  192. <div class="memproto">
  193. <table class="memname">
  194. <tr>
  195. <td class="memname">void spi_init </td>
  196. <td>(</td>
  197. <td class="paramtype">void&#160;</td>
  198. <td class="paramname"></td><td>)</td>
  199. <td></td>
  200. </tr>
  201. </table>
  202. </div><div class="memdoc">
  203. <p>Initializes the SPI bus. </p>
  204. </div>
  205. </div>
  206. <a class="anchor" id="a7402e4a56146a9e3df480b206a3f7e7e"></a>
  207. <div class="memitem">
  208. <div class="memproto">
  209. <table class="memname">
  210. <tr>
  211. <td class="memname">uint8_t spi_readwrite </td>
  212. <td>(</td>
  213. <td class="paramtype">uint8_t&#160;</td>
  214. <td class="paramname"><em>data</em></td><td>)</td>
  215. <td></td>
  216. </tr>
  217. </table>
  218. </div><div class="memdoc">
  219. <p>Writes the data on the SPI bus and returns the reply. </p>
  220. <dl class="params"><dt>Parameters</dt><dd>
  221. <table class="params">
  222. <tr><td class="paramname">data</td><td>byte to write to the bus </td></tr>
  223. </table>
  224. </dd>
  225. </dl>
  226. <dl class="section return"><dt>Returns</dt><dd>byte read from the bus </dd></dl>
  227. </div>
  228. </div>
  229. </div><!-- contents -->
  230. <!-- start footer part -->
  231. <hr class="footer"/><address class="footer"><small>
  232. Generated by &#160;<a href="http://www.doxygen.org/index.html">
  233. <img class="footer" src="doxygen.png" alt="doxygen"/>
  234. </a> 1.8.10
  235. </small></address>
  236. </body>
  237. </html>