Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

402 linhas
16KB

  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: SdSpiAltDriver 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 class="current"><a href="annotated.html"><span>Classes</span></a></li>
  42. <li><a href="files.html"><span>Files</span></a></li>
  43. <li>
  44. <div id="MSearchBox" class="MSearchBoxInactive">
  45. <span class="left">
  46. <img id="MSearchSelect" src="search/mag_sel.png"
  47. onmouseover="return searchBox.OnSearchSelectShow()"
  48. onmouseout="return searchBox.OnSearchSelectHide()"
  49. alt=""/>
  50. <input type="text" id="MSearchField" value="Search" accesskey="S"
  51. onfocus="searchBox.OnSearchFieldFocus(true)"
  52. onblur="searchBox.OnSearchFieldFocus(false)"
  53. onkeyup="searchBox.OnSearchFieldChange(event)"/>
  54. </span><span class="right">
  55. <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
  56. </span>
  57. </div>
  58. </li>
  59. </ul>
  60. </div>
  61. <div id="navrow2" class="tabs2">
  62. <ul class="tablist">
  63. <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
  64. <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
  65. <li><a href="functions.html"><span>Class&#160;Members</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="#pub-methods">Public Member Functions</a> &#124;
  84. <a href="class_sd_spi_alt_driver-members.html">List of all members</a> </div>
  85. <div class="headertitle">
  86. <div class="title">SdSpiAltDriver Class Reference</div> </div>
  87. </div><!--header-->
  88. <div class="contents">
  89. <p>Optimized SPI class for access to SD and SDHC flash memory cards.
  90. <a href="class_sd_spi_alt_driver.html#details">More...</a></p>
  91. <p><code>#include &lt;SdSpiDriver.h&gt;</code></p>
  92. <table class="memberdecls">
  93. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
  94. Public Member Functions</h2></td></tr>
  95. <tr class="memitem:a53cb88d35df119828ec3702a39552e93"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_spi_alt_driver.html#a53cb88d35df119828ec3702a39552e93">activate</a> ()</td></tr>
  96. <tr class="separator:a53cb88d35df119828ec3702a39552e93"><td class="memSeparator" colspan="2">&#160;</td></tr>
  97. <tr class="memitem:ae7fc7ae005002e9a1de3e0b7440e971e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_spi_alt_driver.html#ae7fc7ae005002e9a1de3e0b7440e971e">begin</a> (uint8_t csPin)</td></tr>
  98. <tr class="separator:ae7fc7ae005002e9a1de3e0b7440e971e"><td class="memSeparator" colspan="2">&#160;</td></tr>
  99. <tr class="memitem:ae6ce25d124e31a8762375ae548a92818"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_spi_alt_driver.html#ae6ce25d124e31a8762375ae548a92818">deactivate</a> ()</td></tr>
  100. <tr class="separator:ae6ce25d124e31a8762375ae548a92818"><td class="memSeparator" colspan="2">&#160;</td></tr>
  101. <tr class="memitem:a639cae65cc4f66e70a39c5b3fc00aa76"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_spi_alt_driver.html#a639cae65cc4f66e70a39c5b3fc00aa76">receive</a> ()</td></tr>
  102. <tr class="separator:a639cae65cc4f66e70a39c5b3fc00aa76"><td class="memSeparator" colspan="2">&#160;</td></tr>
  103. <tr class="memitem:accca10152516408100e890e9abb2bc64"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_spi_alt_driver.html#accca10152516408100e890e9abb2bc64">receive</a> (uint8_t *buf, size_t n)</td></tr>
  104. <tr class="separator:accca10152516408100e890e9abb2bc64"><td class="memSeparator" colspan="2">&#160;</td></tr>
  105. <tr class="memitem:a1e52a39ab018b5c07089befbec21ada5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_spi_alt_driver.html#a1e52a39ab018b5c07089befbec21ada5">select</a> ()</td></tr>
  106. <tr class="separator:a1e52a39ab018b5c07089befbec21ada5"><td class="memSeparator" colspan="2">&#160;</td></tr>
  107. <tr class="memitem:a872ec7667a758f2fbcb8bf987ea825c4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_spi_alt_driver.html#a872ec7667a758f2fbcb8bf987ea825c4">send</a> (uint8_t data)</td></tr>
  108. <tr class="separator:a872ec7667a758f2fbcb8bf987ea825c4"><td class="memSeparator" colspan="2">&#160;</td></tr>
  109. <tr class="memitem:a9399a2957507a822f3b1b2630b81c510"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_spi_alt_driver.html#a9399a2957507a822f3b1b2630b81c510">send</a> (const uint8_t *buf, size_t n)</td></tr>
  110. <tr class="separator:a9399a2957507a822f3b1b2630b81c510"><td class="memSeparator" colspan="2">&#160;</td></tr>
  111. <tr class="memitem:a334ecbbe8809b38c0b724eeeb3ef1e14"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_spi_alt_driver.html#a334ecbbe8809b38c0b724eeeb3ef1e14">setPort</a> (uint8_t portNumber)</td></tr>
  112. <tr class="separator:a334ecbbe8809b38c0b724eeeb3ef1e14"><td class="memSeparator" colspan="2">&#160;</td></tr>
  113. <tr class="memitem:a91d7ef40a801ae73d0e0b5f440ab0eef"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_spi_alt_driver.html#a91d7ef40a801ae73d0e0b5f440ab0eef">setSpiSettings</a> (SPISettings spiSettings)</td></tr>
  114. <tr class="separator:a91d7ef40a801ae73d0e0b5f440ab0eef"><td class="memSeparator" colspan="2">&#160;</td></tr>
  115. <tr class="memitem:a731497cc1efc4bd0875d61b0d84979ff"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_spi_alt_driver.html#a731497cc1efc4bd0875d61b0d84979ff">unselect</a> ()</td></tr>
  116. <tr class="separator:a731497cc1efc4bd0875d61b0d84979ff"><td class="memSeparator" colspan="2">&#160;</td></tr>
  117. </table>
  118. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  119. <div class="textblock"><p>Optimized SPI class for access to SD and SDHC flash memory cards. </p>
  120. </div><h2 class="groupheader">Member Function Documentation</h2>
  121. <a class="anchor" id="a53cb88d35df119828ec3702a39552e93"></a>
  122. <div class="memitem">
  123. <div class="memproto">
  124. <table class="memname">
  125. <tr>
  126. <td class="memname">void SdSpiAltDriver::activate </td>
  127. <td>(</td>
  128. <td class="paramname"></td><td>)</td>
  129. <td></td>
  130. </tr>
  131. </table>
  132. </div><div class="memdoc">
  133. <p>Activate SPI hardware. </p>
  134. </div>
  135. </div>
  136. <a class="anchor" id="ae7fc7ae005002e9a1de3e0b7440e971e"></a>
  137. <div class="memitem">
  138. <div class="memproto">
  139. <table class="memname">
  140. <tr>
  141. <td class="memname">void SdSpiAltDriver::begin </td>
  142. <td>(</td>
  143. <td class="paramtype">uint8_t&#160;</td>
  144. <td class="paramname"><em>csPin</em></td><td>)</td>
  145. <td></td>
  146. </tr>
  147. </table>
  148. </div><div class="memdoc">
  149. <p>Initialize the SPI bus.</p>
  150. <dl class="params"><dt>Parameters</dt><dd>
  151. <table class="params">
  152. <tr><td class="paramdir">[in]</td><td class="paramname">csPin</td><td>SD card chip select pin. </td></tr>
  153. </table>
  154. </dd>
  155. </dl>
  156. </div>
  157. </div>
  158. <a class="anchor" id="ae6ce25d124e31a8762375ae548a92818"></a>
  159. <div class="memitem">
  160. <div class="memproto">
  161. <table class="memname">
  162. <tr>
  163. <td class="memname">void SdSpiAltDriver::deactivate </td>
  164. <td>(</td>
  165. <td class="paramname"></td><td>)</td>
  166. <td></td>
  167. </tr>
  168. </table>
  169. </div><div class="memdoc">
  170. <p>Deactivate SPI hardware. </p>
  171. </div>
  172. </div>
  173. <a class="anchor" id="a639cae65cc4f66e70a39c5b3fc00aa76"></a>
  174. <div class="memitem">
  175. <div class="memproto">
  176. <table class="memname">
  177. <tr>
  178. <td class="memname">uint8_t SdSpiAltDriver::receive </td>
  179. <td>(</td>
  180. <td class="paramname"></td><td>)</td>
  181. <td></td>
  182. </tr>
  183. </table>
  184. </div><div class="memdoc">
  185. <p>Receive a byte.</p>
  186. <dl class="section return"><dt>Returns</dt><dd>The byte. </dd></dl>
  187. </div>
  188. </div>
  189. <a class="anchor" id="accca10152516408100e890e9abb2bc64"></a>
  190. <div class="memitem">
  191. <div class="memproto">
  192. <table class="memname">
  193. <tr>
  194. <td class="memname">uint8_t SdSpiAltDriver::receive </td>
  195. <td>(</td>
  196. <td class="paramtype">uint8_t *&#160;</td>
  197. <td class="paramname"><em>buf</em>, </td>
  198. </tr>
  199. <tr>
  200. <td class="paramkey"></td>
  201. <td></td>
  202. <td class="paramtype">size_t&#160;</td>
  203. <td class="paramname"><em>n</em>&#160;</td>
  204. </tr>
  205. <tr>
  206. <td></td>
  207. <td>)</td>
  208. <td></td><td></td>
  209. </tr>
  210. </table>
  211. </div><div class="memdoc">
  212. <p>Receive multiple bytes.</p>
  213. <dl class="params"><dt>Parameters</dt><dd>
  214. <table class="params">
  215. <tr><td class="paramdir">[out]</td><td class="paramname">buf</td><td>Buffer to receive the data. </td></tr>
  216. <tr><td class="paramdir">[in]</td><td class="paramname">n</td><td>Number of bytes to receive.</td></tr>
  217. </table>
  218. </dd>
  219. </dl>
  220. <dl class="section return"><dt>Returns</dt><dd>Zero for no error or nonzero error code. </dd></dl>
  221. </div>
  222. </div>
  223. <a class="anchor" id="a1e52a39ab018b5c07089befbec21ada5"></a>
  224. <div class="memitem">
  225. <div class="memproto">
  226. <table class="mlabels">
  227. <tr>
  228. <td class="mlabels-left">
  229. <table class="memname">
  230. <tr>
  231. <td class="memname">void SdSpiAltDriver::select </td>
  232. <td>(</td>
  233. <td class="paramname"></td><td>)</td>
  234. <td></td>
  235. </tr>
  236. </table>
  237. </td>
  238. <td class="mlabels-right">
  239. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  240. </tr>
  241. </table>
  242. </div><div class="memdoc">
  243. <p>Set CS low. </p>
  244. </div>
  245. </div>
  246. <a class="anchor" id="a872ec7667a758f2fbcb8bf987ea825c4"></a>
  247. <div class="memitem">
  248. <div class="memproto">
  249. <table class="memname">
  250. <tr>
  251. <td class="memname">void SdSpiAltDriver::send </td>
  252. <td>(</td>
  253. <td class="paramtype">uint8_t&#160;</td>
  254. <td class="paramname"><em>data</em></td><td>)</td>
  255. <td></td>
  256. </tr>
  257. </table>
  258. </div><div class="memdoc">
  259. <p>Send a byte.</p>
  260. <dl class="params"><dt>Parameters</dt><dd>
  261. <table class="params">
  262. <tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>Byte to send </td></tr>
  263. </table>
  264. </dd>
  265. </dl>
  266. </div>
  267. </div>
  268. <a class="anchor" id="a9399a2957507a822f3b1b2630b81c510"></a>
  269. <div class="memitem">
  270. <div class="memproto">
  271. <table class="memname">
  272. <tr>
  273. <td class="memname">void SdSpiAltDriver::send </td>
  274. <td>(</td>
  275. <td class="paramtype">const uint8_t *&#160;</td>
  276. <td class="paramname"><em>buf</em>, </td>
  277. </tr>
  278. <tr>
  279. <td class="paramkey"></td>
  280. <td></td>
  281. <td class="paramtype">size_t&#160;</td>
  282. <td class="paramname"><em>n</em>&#160;</td>
  283. </tr>
  284. <tr>
  285. <td></td>
  286. <td>)</td>
  287. <td></td><td></td>
  288. </tr>
  289. </table>
  290. </div><div class="memdoc">
  291. <p>Send multiple bytes.</p>
  292. <dl class="params"><dt>Parameters</dt><dd>
  293. <table class="params">
  294. <tr><td class="paramdir">[in]</td><td class="paramname">buf</td><td>Buffer for data to be sent. </td></tr>
  295. <tr><td class="paramdir">[in]</td><td class="paramname">n</td><td>Number of bytes to send. </td></tr>
  296. </table>
  297. </dd>
  298. </dl>
  299. </div>
  300. </div>
  301. <a class="anchor" id="a334ecbbe8809b38c0b724eeeb3ef1e14"></a>
  302. <div class="memitem">
  303. <div class="memproto">
  304. <table class="memname">
  305. <tr>
  306. <td class="memname">void SdSpiAltDriver::setPort </td>
  307. <td>(</td>
  308. <td class="paramtype">uint8_t&#160;</td>
  309. <td class="paramname"><em>portNumber</em></td><td>)</td>
  310. <td></td>
  311. </tr>
  312. </table>
  313. </div><div class="memdoc">
  314. <p>Set SPI port number. </p><dl class="params"><dt>Parameters</dt><dd>
  315. <table class="params">
  316. <tr><td class="paramdir">[in]</td><td class="paramname">portNumber</td><td>Hardware SPI port number. </td></tr>
  317. </table>
  318. </dd>
  319. </dl>
  320. </div>
  321. </div>
  322. <a class="anchor" id="a91d7ef40a801ae73d0e0b5f440ab0eef"></a>
  323. <div class="memitem">
  324. <div class="memproto">
  325. <table class="mlabels">
  326. <tr>
  327. <td class="mlabels-left">
  328. <table class="memname">
  329. <tr>
  330. <td class="memname">void SdSpiAltDriver::setSpiSettings </td>
  331. <td>(</td>
  332. <td class="paramtype">SPISettings&#160;</td>
  333. <td class="paramname"><em>spiSettings</em></td><td>)</td>
  334. <td></td>
  335. </tr>
  336. </table>
  337. </td>
  338. <td class="mlabels-right">
  339. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  340. </tr>
  341. </table>
  342. </div><div class="memdoc">
  343. <p>Save SPISettings.</p>
  344. <dl class="params"><dt>Parameters</dt><dd>
  345. <table class="params">
  346. <tr><td class="paramdir">[in]</td><td class="paramname">spiSettings</td><td>SPI speed, mode, and byte order. </td></tr>
  347. </table>
  348. </dd>
  349. </dl>
  350. </div>
  351. </div>
  352. <a class="anchor" id="a731497cc1efc4bd0875d61b0d84979ff"></a>
  353. <div class="memitem">
  354. <div class="memproto">
  355. <table class="mlabels">
  356. <tr>
  357. <td class="mlabels-left">
  358. <table class="memname">
  359. <tr>
  360. <td class="memname">void SdSpiAltDriver::unselect </td>
  361. <td>(</td>
  362. <td class="paramname"></td><td>)</td>
  363. <td></td>
  364. </tr>
  365. </table>
  366. </td>
  367. <td class="mlabels-right">
  368. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  369. </tr>
  370. </table>
  371. </div><div class="memdoc">
  372. <p>Set CS high. </p>
  373. </div>
  374. </div>
  375. <hr/>The documentation for this class was generated from the following file:<ul>
  376. <li>Arduino/libraries/SdFat/src/<a class="el" href="_sd_spi_driver_8h.html">SdSpiDriver.h</a></li>
  377. </ul>
  378. </div><!-- contents -->
  379. <!-- start footer part -->
  380. <hr class="footer"/><address class="footer"><small>
  381. Generated on Fri Aug 19 2016 08:28:00 for SdFat by &#160;<a href="http://www.doxygen.org/index.html">
  382. <img class="footer" src="doxygen.png" alt="doxygen"/>
  383. </a> 1.8.10
  384. </small></address>
  385. </body>
  386. </html>