您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

class_sd_spi_lib.html 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  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>SdFat: SdSpiLib Class 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">SdFat
  27. </div>
  28. </td>
  29. </tr>
  30. </tbody>
  31. </table>
  32. </div>
  33. <!-- end header part -->
  34. <!-- Generated by Doxygen 1.8.10 -->
  35. <script type="text/javascript">
  36. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  37. </script>
  38. <div id="navrow1" class="tabs">
  39. <ul class="tablist">
  40. <li><a href="index.html"><span>Main&#160;Page</span></a></li>
  41. <li><a href="modules.html"><span>Modules</span></a></li>
  42. <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
  43. <li><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="annotated.html"><span>Class&#160;List</span></a></li>
  65. <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
  66. <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
  67. </ul>
  68. </div>
  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><!-- top -->
  82. <div class="header">
  83. <div class="summary">
  84. <a href="#pub-methods">Public Member Functions</a> &#124;
  85. <a href="class_sd_spi_lib-members.html">List of all members</a> </div>
  86. <div class="headertitle">
  87. <div class="title">SdSpiLib Class Reference</div> </div>
  88. </div><!--header-->
  89. <div class="contents">
  90. <p>Arduino SPI library class for access to SD and SDHC flash memory cards.
  91. <a href="class_sd_spi_lib.html#details">More...</a></p>
  92. <p><code>#include &lt;SdSpi.h&gt;</code></p>
  93. <table class="memberdecls">
  94. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
  95. Public Member Functions</h2></td></tr>
  96. <tr class="memitem:aa924fd665bd8598d325e44ff10607bd9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_spi_lib.html#aa924fd665bd8598d325e44ff10607bd9">begin</a> (uint8_t chipSelectPin)</td></tr>
  97. <tr class="separator:aa924fd665bd8598d325e44ff10607bd9"><td class="memSeparator" colspan="2">&#160;</td></tr>
  98. <tr class="memitem:afecc9a75f05a7f3c9d74cd40b310c343"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_spi_lib.html#afecc9a75f05a7f3c9d74cd40b310c343">beginTransaction</a> (uint8_t divisor)</td></tr>
  99. <tr class="separator:afecc9a75f05a7f3c9d74cd40b310c343"><td class="memSeparator" colspan="2">&#160;</td></tr>
  100. <tr class="memitem:a8e9bf91c47f1923abeb14d338aaae569"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_spi_lib.html#a8e9bf91c47f1923abeb14d338aaae569">endTransaction</a> ()</td></tr>
  101. <tr class="separator:a8e9bf91c47f1923abeb14d338aaae569"><td class="memSeparator" colspan="2">&#160;</td></tr>
  102. <tr class="memitem:ac3c8027243a2fef5894809cbb7bed837"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_spi_lib.html#ac3c8027243a2fef5894809cbb7bed837">receive</a> ()</td></tr>
  103. <tr class="separator:ac3c8027243a2fef5894809cbb7bed837"><td class="memSeparator" colspan="2">&#160;</td></tr>
  104. <tr class="memitem:ad835adf6990e6368ec577f00edf365b0"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_spi_lib.html#ad835adf6990e6368ec577f00edf365b0">receive</a> (uint8_t *buf, size_t n)</td></tr>
  105. <tr class="separator:ad835adf6990e6368ec577f00edf365b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
  106. <tr class="memitem:a070de2435f58f4f98c224c4b1b4be888"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_spi_lib.html#a070de2435f58f4f98c224c4b1b4be888">send</a> (uint8_t b)</td></tr>
  107. <tr class="separator:a070de2435f58f4f98c224c4b1b4be888"><td class="memSeparator" colspan="2">&#160;</td></tr>
  108. <tr class="memitem:a58af4700449aadc2b418fac59fda6e1b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_spi_lib.html#a58af4700449aadc2b418fac59fda6e1b">send</a> (const uint8_t *buf, size_t n)</td></tr>
  109. <tr class="separator:a58af4700449aadc2b418fac59fda6e1b"><td class="memSeparator" colspan="2">&#160;</td></tr>
  110. </table>
  111. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  112. <div class="textblock"><p>Arduino SPI library class for access to SD and SDHC flash memory cards. </p>
  113. </div><h2 class="groupheader">Member Function Documentation</h2>
  114. <a class="anchor" id="aa924fd665bd8598d325e44ff10607bd9"></a>
  115. <div class="memitem">
  116. <div class="memproto">
  117. <table class="mlabels">
  118. <tr>
  119. <td class="mlabels-left">
  120. <table class="memname">
  121. <tr>
  122. <td class="memname">void SdSpiLib::begin </td>
  123. <td>(</td>
  124. <td class="paramtype">uint8_t&#160;</td>
  125. <td class="paramname"><em>chipSelectPin</em></td><td>)</td>
  126. <td></td>
  127. </tr>
  128. </table>
  129. </td>
  130. <td class="mlabels-right">
  131. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  132. </tr>
  133. </table>
  134. </div><div class="memdoc">
  135. <p>Initialize the SPI bus.</p>
  136. <dl class="params"><dt>Parameters</dt><dd>
  137. <table class="params">
  138. <tr><td class="paramdir">[in]</td><td class="paramname">chipSelectPin</td><td>SD card chip select pin. </td></tr>
  139. </table>
  140. </dd>
  141. </dl>
  142. </div>
  143. </div>
  144. <a class="anchor" id="afecc9a75f05a7f3c9d74cd40b310c343"></a>
  145. <div class="memitem">
  146. <div class="memproto">
  147. <table class="mlabels">
  148. <tr>
  149. <td class="mlabels-left">
  150. <table class="memname">
  151. <tr>
  152. <td class="memname">void SdSpiLib::beginTransaction </td>
  153. <td>(</td>
  154. <td class="paramtype">uint8_t&#160;</td>
  155. <td class="paramname"><em>divisor</em></td><td>)</td>
  156. <td></td>
  157. </tr>
  158. </table>
  159. </td>
  160. <td class="mlabels-right">
  161. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  162. </tr>
  163. </table>
  164. </div><div class="memdoc">
  165. <p>Set SPI options for access to SD/SDHC cards.</p>
  166. <dl class="params"><dt>Parameters</dt><dd>
  167. <table class="params">
  168. <tr><td class="paramdir">[in]</td><td class="paramname">divisor</td><td>SCK clock divider relative to the system clock. </td></tr>
  169. </table>
  170. </dd>
  171. </dl>
  172. </div>
  173. </div>
  174. <a class="anchor" id="a8e9bf91c47f1923abeb14d338aaae569"></a>
  175. <div class="memitem">
  176. <div class="memproto">
  177. <table class="mlabels">
  178. <tr>
  179. <td class="mlabels-left">
  180. <table class="memname">
  181. <tr>
  182. <td class="memname">void SdSpiLib::endTransaction </td>
  183. <td>(</td>
  184. <td class="paramname"></td><td>)</td>
  185. <td></td>
  186. </tr>
  187. </table>
  188. </td>
  189. <td class="mlabels-right">
  190. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  191. </tr>
  192. </table>
  193. </div><div class="memdoc">
  194. <p>End SPI transaction. </p>
  195. </div>
  196. </div>
  197. <a class="anchor" id="ac3c8027243a2fef5894809cbb7bed837"></a>
  198. <div class="memitem">
  199. <div class="memproto">
  200. <table class="mlabels">
  201. <tr>
  202. <td class="mlabels-left">
  203. <table class="memname">
  204. <tr>
  205. <td class="memname">uint8_t SdSpiLib::receive </td>
  206. <td>(</td>
  207. <td class="paramname"></td><td>)</td>
  208. <td></td>
  209. </tr>
  210. </table>
  211. </td>
  212. <td class="mlabels-right">
  213. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  214. </tr>
  215. </table>
  216. </div><div class="memdoc">
  217. <p>Receive a byte.</p>
  218. <dl class="section return"><dt>Returns</dt><dd>The byte. </dd></dl>
  219. </div>
  220. </div>
  221. <a class="anchor" id="ad835adf6990e6368ec577f00edf365b0"></a>
  222. <div class="memitem">
  223. <div class="memproto">
  224. <table class="mlabels">
  225. <tr>
  226. <td class="mlabels-left">
  227. <table class="memname">
  228. <tr>
  229. <td class="memname">uint8_t SdSpiLib::receive </td>
  230. <td>(</td>
  231. <td class="paramtype">uint8_t *&#160;</td>
  232. <td class="paramname"><em>buf</em>, </td>
  233. </tr>
  234. <tr>
  235. <td class="paramkey"></td>
  236. <td></td>
  237. <td class="paramtype">size_t&#160;</td>
  238. <td class="paramname"><em>n</em>&#160;</td>
  239. </tr>
  240. <tr>
  241. <td></td>
  242. <td>)</td>
  243. <td></td><td></td>
  244. </tr>
  245. </table>
  246. </td>
  247. <td class="mlabels-right">
  248. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  249. </tr>
  250. </table>
  251. </div><div class="memdoc">
  252. <p>Receive multiple bytes.</p>
  253. <dl class="params"><dt>Parameters</dt><dd>
  254. <table class="params">
  255. <tr><td class="paramdir">[out]</td><td class="paramname">buf</td><td>Buffer to receive the data. </td></tr>
  256. <tr><td class="paramdir">[in]</td><td class="paramname">n</td><td>Number of bytes to receive.</td></tr>
  257. </table>
  258. </dd>
  259. </dl>
  260. <dl class="section return"><dt>Returns</dt><dd>Zero for no error or nonzero error code. </dd></dl>
  261. </div>
  262. </div>
  263. <a class="anchor" id="a070de2435f58f4f98c224c4b1b4be888"></a>
  264. <div class="memitem">
  265. <div class="memproto">
  266. <table class="mlabels">
  267. <tr>
  268. <td class="mlabels-left">
  269. <table class="memname">
  270. <tr>
  271. <td class="memname">void SdSpiLib::send </td>
  272. <td>(</td>
  273. <td class="paramtype">uint8_t&#160;</td>
  274. <td class="paramname"><em>b</em></td><td>)</td>
  275. <td></td>
  276. </tr>
  277. </table>
  278. </td>
  279. <td class="mlabels-right">
  280. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  281. </tr>
  282. </table>
  283. </div><div class="memdoc">
  284. <p>Send a byte.</p>
  285. <dl class="params"><dt>Parameters</dt><dd>
  286. <table class="params">
  287. <tr><td class="paramdir">[in]</td><td class="paramname">b</td><td>Byte to send </td></tr>
  288. </table>
  289. </dd>
  290. </dl>
  291. </div>
  292. </div>
  293. <a class="anchor" id="a58af4700449aadc2b418fac59fda6e1b"></a>
  294. <div class="memitem">
  295. <div class="memproto">
  296. <table class="mlabels">
  297. <tr>
  298. <td class="mlabels-left">
  299. <table class="memname">
  300. <tr>
  301. <td class="memname">void SdSpiLib::send </td>
  302. <td>(</td>
  303. <td class="paramtype">const uint8_t *&#160;</td>
  304. <td class="paramname"><em>buf</em>, </td>
  305. </tr>
  306. <tr>
  307. <td class="paramkey"></td>
  308. <td></td>
  309. <td class="paramtype">size_t&#160;</td>
  310. <td class="paramname"><em>n</em>&#160;</td>
  311. </tr>
  312. <tr>
  313. <td></td>
  314. <td>)</td>
  315. <td></td><td></td>
  316. </tr>
  317. </table>
  318. </td>
  319. <td class="mlabels-right">
  320. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  321. </tr>
  322. </table>
  323. </div><div class="memdoc">
  324. <p>Send multiple bytes.</p>
  325. <dl class="params"><dt>Parameters</dt><dd>
  326. <table class="params">
  327. <tr><td class="paramdir">[in]</td><td class="paramname">buf</td><td>Buffer for data to be sent. </td></tr>
  328. <tr><td class="paramdir">[in]</td><td class="paramname">n</td><td>Number of bytes to send. </td></tr>
  329. </table>
  330. </dd>
  331. </dl>
  332. </div>
  333. </div>
  334. <hr/>The documentation for this class was generated from the following file:<ul>
  335. <li>Arduino/libraries/SdFat/src/SdSpiCard/<a class="el" href="_sd_spi_8h.html">SdSpi.h</a></li>
  336. </ul>
  337. </div><!-- contents -->
  338. <!-- start footer part -->
  339. <hr class="footer"/><address class="footer"><small>
  340. Generated on Fri Feb 12 2016 13:43:49 for SdFat by &#160;<a href="http://www.doxygen.org/index.html">
  341. <img class="footer" src="doxygen.png" alt="doxygen"/>
  342. </a> 1.8.10
  343. </small></address>
  344. </body>
  345. </html>