You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

718 lines
33KB

  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.6"/>
  7. <title>SdFat: Sd2Card 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="doxygen.css" rel="stylesheet" type="text/css" />
  12. </head>
  13. <body>
  14. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  15. <div id="titlearea">
  16. <table cellspacing="0" cellpadding="0">
  17. <tbody>
  18. <tr style="height: 56px;">
  19. <td style="padding-left: 0.5em;">
  20. <div id="projectname">SdFat
  21. </div>
  22. </td>
  23. </tr>
  24. </tbody>
  25. </table>
  26. </div>
  27. <!-- end header part -->
  28. <!-- Generated by Doxygen 1.8.6 -->
  29. <div id="navrow1" class="tabs">
  30. <ul class="tablist">
  31. <li><a href="index.html"><span>Main&#160;Page</span></a></li>
  32. <li><a href="namespaces.html"><span>Namespaces</span></a></li>
  33. <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
  34. <li><a href="files.html"><span>Files</span></a></li>
  35. </ul>
  36. </div>
  37. <div id="navrow2" class="tabs2">
  38. <ul class="tablist">
  39. <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
  40. <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
  41. <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
  42. </ul>
  43. </div>
  44. </div><!-- top -->
  45. <div class="header">
  46. <div class="summary">
  47. <a href="#pub-methods">Public Member Functions</a> &#124;
  48. <a href="class_sd2_card-members.html">List of all members</a> </div>
  49. <div class="headertitle">
  50. <div class="title">Sd2Card Class Reference</div> </div>
  51. </div><!--header-->
  52. <div class="contents">
  53. <p>Raw access to SD and SDHC flash memory cards.
  54. <a href="class_sd2_card.html#details">More...</a></p>
  55. <p><code>#include &lt;Sd2Card.h&gt;</code></p>
  56. <table class="memberdecls">
  57. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
  58. Public Member Functions</h2></td></tr>
  59. <tr class="memitem:a4e55e83403be452b10b0564ca63896f1"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd2_card.html#a4e55e83403be452b10b0564ca63896f1">begin</a> (uint8_t chipSelectPin=<a class="el" href="_sd_spi_8h.html#ae6b17538c14ba6c91ccb513db2c4c29c">SD_CHIP_SELECT_PIN</a>, uint8_t <a class="el" href="class_sd2_card.html#a6bcfd1bf665bf4ff88a46c07741fac43">sckDivisor</a>=SPI_FULL_SPEED)</td></tr>
  60. <tr class="separator:a4e55e83403be452b10b0564ca63896f1"><td class="memSeparator" colspan="2">&#160;</td></tr>
  61. <tr class="memitem:a21ef1c5321041d4d73107b84e2db5189"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd2_card.html#a21ef1c5321041d4d73107b84e2db5189">cardSize</a> ()</td></tr>
  62. <tr class="separator:a21ef1c5321041d4d73107b84e2db5189"><td class="memSeparator" colspan="2">&#160;</td></tr>
  63. <tr class="memitem:a2d73473118c5692e0f7d13db7da3570f"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd2_card.html#a2d73473118c5692e0f7d13db7da3570f">erase</a> (uint32_t firstBlock, uint32_t lastBlock)</td></tr>
  64. <tr class="separator:a2d73473118c5692e0f7d13db7da3570f"><td class="memSeparator" colspan="2">&#160;</td></tr>
  65. <tr class="memitem:aceacbe30077e41ab84a34e629a03bb33"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd2_card.html#aceacbe30077e41ab84a34e629a03bb33">eraseSingleBlockEnable</a> ()</td></tr>
  66. <tr class="separator:aceacbe30077e41ab84a34e629a03bb33"><td class="memSeparator" colspan="2">&#160;</td></tr>
  67. <tr class="memitem:af03e574590524f93a61641604e02f79f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd2_card.html#af03e574590524f93a61641604e02f79f">error</a> (uint8_t code)</td></tr>
  68. <tr class="separator:af03e574590524f93a61641604e02f79f"><td class="memSeparator" colspan="2">&#160;</td></tr>
  69. <tr class="memitem:a3549d1878c0134171e399fd2d60b96f7"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd2_card.html#a3549d1878c0134171e399fd2d60b96f7">errorCode</a> () const </td></tr>
  70. <tr class="separator:a3549d1878c0134171e399fd2d60b96f7"><td class="memSeparator" colspan="2">&#160;</td></tr>
  71. <tr class="memitem:a1736acdbf194c6a2fd923c0a5049c016"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd2_card.html#a1736acdbf194c6a2fd923c0a5049c016">errorData</a> () const </td></tr>
  72. <tr class="separator:a1736acdbf194c6a2fd923c0a5049c016"><td class="memSeparator" colspan="2">&#160;</td></tr>
  73. <tr class="memitem:a71523097165fce957c7f65b033471fc7"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd2_card.html#a71523097165fce957c7f65b033471fc7">init</a> (uint8_t <a class="el" href="class_sd2_card.html#a6bcfd1bf665bf4ff88a46c07741fac43">sckDivisor</a>=SPI_FULL_SPEED, uint8_t chipSelectPin=<a class="el" href="_sd_spi_8h.html#ae6b17538c14ba6c91ccb513db2c4c29c">SD_CHIP_SELECT_PIN</a>)</td></tr>
  74. <tr class="separator:a71523097165fce957c7f65b033471fc7"><td class="memSeparator" colspan="2">&#160;</td></tr>
  75. <tr class="memitem:a28eafda720598dcb2923955776199e19"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd2_card.html#a28eafda720598dcb2923955776199e19">isBusy</a> ()</td></tr>
  76. <tr class="separator:a28eafda720598dcb2923955776199e19"><td class="memSeparator" colspan="2">&#160;</td></tr>
  77. <tr class="memitem:a6b015ee1c94004b8b16639910e5a3466"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd2_card.html#a6b015ee1c94004b8b16639910e5a3466">readBlock</a> (uint32_t block, uint8_t *dst)</td></tr>
  78. <tr class="separator:a6b015ee1c94004b8b16639910e5a3466"><td class="memSeparator" colspan="2">&#160;</td></tr>
  79. <tr class="memitem:abaf488d56f653efa8e3349bf803ce2b0"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd2_card.html#abaf488d56f653efa8e3349bf803ce2b0">readCID</a> (cid_t *cid)</td></tr>
  80. <tr class="separator:abaf488d56f653efa8e3349bf803ce2b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
  81. <tr class="memitem:a1b0c68df7f508f876d56fc1270536c87"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd2_card.html#a1b0c68df7f508f876d56fc1270536c87">readCSD</a> (csd_t *csd)</td></tr>
  82. <tr class="separator:a1b0c68df7f508f876d56fc1270536c87"><td class="memSeparator" colspan="2">&#160;</td></tr>
  83. <tr class="memitem:a7d6e8a504f8525afd6d36a22ee5b8cc0"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd2_card.html#a7d6e8a504f8525afd6d36a22ee5b8cc0">readData</a> (uint8_t *dst)</td></tr>
  84. <tr class="separator:a7d6e8a504f8525afd6d36a22ee5b8cc0"><td class="memSeparator" colspan="2">&#160;</td></tr>
  85. <tr class="memitem:a3259be9721e14a2edf8b549e4aeb2e40"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd2_card.html#a3259be9721e14a2edf8b549e4aeb2e40">readStart</a> (uint32_t blockNumber)</td></tr>
  86. <tr class="separator:a3259be9721e14a2edf8b549e4aeb2e40"><td class="memSeparator" colspan="2">&#160;</td></tr>
  87. <tr class="memitem:ae133ad5a80c2652a964afd2320cc7c94"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd2_card.html#ae133ad5a80c2652a964afd2320cc7c94">readStop</a> ()</td></tr>
  88. <tr class="separator:ae133ad5a80c2652a964afd2320cc7c94"><td class="memSeparator" colspan="2">&#160;</td></tr>
  89. <tr class="memitem:a6bcfd1bf665bf4ff88a46c07741fac43"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd2_card.html#a6bcfd1bf665bf4ff88a46c07741fac43">sckDivisor</a> ()</td></tr>
  90. <tr class="separator:a6bcfd1bf665bf4ff88a46c07741fac43"><td class="memSeparator" colspan="2">&#160;</td></tr>
  91. <tr class="memitem:a17c8713ae610106567679a8685696375"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd2_card.html#a17c8713ae610106567679a8685696375">Sd2Card</a> ()</td></tr>
  92. <tr class="separator:a17c8713ae610106567679a8685696375"><td class="memSeparator" colspan="2">&#160;</td></tr>
  93. <tr class="memitem:adcee026d613619414e2b6d3eca2c6537"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd2_card.html#adcee026d613619414e2b6d3eca2c6537">type</a> () const </td></tr>
  94. <tr class="separator:adcee026d613619414e2b6d3eca2c6537"><td class="memSeparator" colspan="2">&#160;</td></tr>
  95. <tr class="memitem:ad5eecc3e1e68b9e5a43edfb8e4205469"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd2_card.html#ad5eecc3e1e68b9e5a43edfb8e4205469">writeBlock</a> (uint32_t blockNumber, const uint8_t *src)</td></tr>
  96. <tr class="separator:ad5eecc3e1e68b9e5a43edfb8e4205469"><td class="memSeparator" colspan="2">&#160;</td></tr>
  97. <tr class="memitem:afb96025babf92878213dd691263d93ef"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd2_card.html#afb96025babf92878213dd691263d93ef">writeData</a> (const uint8_t *src)</td></tr>
  98. <tr class="separator:afb96025babf92878213dd691263d93ef"><td class="memSeparator" colspan="2">&#160;</td></tr>
  99. <tr class="memitem:a1039df4f6620213a98b317d11da2014e"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd2_card.html#a1039df4f6620213a98b317d11da2014e">writeStart</a> (uint32_t blockNumber, uint32_t eraseCount)</td></tr>
  100. <tr class="separator:a1039df4f6620213a98b317d11da2014e"><td class="memSeparator" colspan="2">&#160;</td></tr>
  101. <tr class="memitem:a7e1ec48b0a83d13415841da870290f64"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd2_card.html#a7e1ec48b0a83d13415841da870290f64">writeStop</a> ()</td></tr>
  102. <tr class="separator:a7e1ec48b0a83d13415841da870290f64"><td class="memSeparator" colspan="2">&#160;</td></tr>
  103. </table>
  104. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  105. <div class="textblock"><p>Raw access to SD and SDHC flash memory cards. </p>
  106. </div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
  107. <a class="anchor" id="a17c8713ae610106567679a8685696375"></a>
  108. <div class="memitem">
  109. <div class="memproto">
  110. <table class="mlabels">
  111. <tr>
  112. <td class="mlabels-left">
  113. <table class="memname">
  114. <tr>
  115. <td class="memname">Sd2Card::Sd2Card </td>
  116. <td>(</td>
  117. <td class="paramname"></td><td>)</td>
  118. <td></td>
  119. </tr>
  120. </table>
  121. </td>
  122. <td class="mlabels-right">
  123. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  124. </tr>
  125. </table>
  126. </div><div class="memdoc">
  127. <p>Construct an instance of <a class="el" href="class_sd2_card.html" title="Raw access to SD and SDHC flash memory cards. ">Sd2Card</a>. </p>
  128. </div>
  129. </div>
  130. <h2 class="groupheader">Member Function Documentation</h2>
  131. <a class="anchor" id="a4e55e83403be452b10b0564ca63896f1"></a>
  132. <div class="memitem">
  133. <div class="memproto">
  134. <table class="memname">
  135. <tr>
  136. <td class="memname">bool Sd2Card::begin </td>
  137. <td>(</td>
  138. <td class="paramtype">uint8_t&#160;</td>
  139. <td class="paramname"><em>chipSelectPin</em> = <code><a class="el" href="_sd_spi_8h.html#ae6b17538c14ba6c91ccb513db2c4c29c">SD_CHIP_SELECT_PIN</a></code>, </td>
  140. </tr>
  141. <tr>
  142. <td class="paramkey"></td>
  143. <td></td>
  144. <td class="paramtype">uint8_t&#160;</td>
  145. <td class="paramname"><em>sckDivisor</em> = <code>SPI_FULL_SPEED</code>&#160;</td>
  146. </tr>
  147. <tr>
  148. <td></td>
  149. <td>)</td>
  150. <td></td><td></td>
  151. </tr>
  152. </table>
  153. </div><div class="memdoc">
  154. <p>Initialize an SD flash memory card.</p>
  155. <dl class="params"><dt>Parameters</dt><dd>
  156. <table class="params">
  157. <tr><td class="paramdir">[in]</td><td class="paramname">chipSelectPin</td><td>SD chip select pin number. </td></tr>
  158. <tr><td class="paramdir">[in]</td><td class="paramname">sckDivisor</td><td>SPI SCK clock rate divisor.</td></tr>
  159. </table>
  160. </dd>
  161. </dl>
  162. <dl class="section return"><dt>Returns</dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. The reason for failure can be determined by calling <a class="el" href="class_sd2_card.html#a3549d1878c0134171e399fd2d60b96f7">errorCode()</a> and <a class="el" href="class_sd2_card.html#a1736acdbf194c6a2fd923c0a5049c016">errorData()</a>. </dd></dl>
  163. </div>
  164. </div>
  165. <a class="anchor" id="a21ef1c5321041d4d73107b84e2db5189"></a>
  166. <div class="memitem">
  167. <div class="memproto">
  168. <table class="memname">
  169. <tr>
  170. <td class="memname">uint32_t Sd2Card::cardSize </td>
  171. <td>(</td>
  172. <td class="paramname"></td><td>)</td>
  173. <td></td>
  174. </tr>
  175. </table>
  176. </div><div class="memdoc">
  177. <p>Determine the size of an SD flash memory card.</p>
  178. <dl class="section return"><dt>Returns</dt><dd>The number of 512 byte data blocks in the card or zero if an error occurs. </dd></dl>
  179. </div>
  180. </div>
  181. <a class="anchor" id="a2d73473118c5692e0f7d13db7da3570f"></a>
  182. <div class="memitem">
  183. <div class="memproto">
  184. <table class="memname">
  185. <tr>
  186. <td class="memname">bool Sd2Card::erase </td>
  187. <td>(</td>
  188. <td class="paramtype">uint32_t&#160;</td>
  189. <td class="paramname"><em>firstBlock</em>, </td>
  190. </tr>
  191. <tr>
  192. <td class="paramkey"></td>
  193. <td></td>
  194. <td class="paramtype">uint32_t&#160;</td>
  195. <td class="paramname"><em>lastBlock</em>&#160;</td>
  196. </tr>
  197. <tr>
  198. <td></td>
  199. <td>)</td>
  200. <td></td><td></td>
  201. </tr>
  202. </table>
  203. </div><div class="memdoc">
  204. <p>Erase a range of blocks.</p>
  205. <dl class="params"><dt>Parameters</dt><dd>
  206. <table class="params">
  207. <tr><td class="paramdir">[in]</td><td class="paramname">firstBlock</td><td>The address of the first block in the range. </td></tr>
  208. <tr><td class="paramdir">[in]</td><td class="paramname">lastBlock</td><td>The address of the last block in the range.</td></tr>
  209. </table>
  210. </dd>
  211. </dl>
  212. <dl class="section note"><dt>Note</dt><dd>This function requests the SD card to do a flash erase for a range of blocks. The data on the card after an erase operation is either 0 or 1, depends on the card vendor. The card must support single block erase.</dd></dl>
  213. <dl class="section return"><dt>Returns</dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. </dd></dl>
  214. </div>
  215. </div>
  216. <a class="anchor" id="aceacbe30077e41ab84a34e629a03bb33"></a>
  217. <div class="memitem">
  218. <div class="memproto">
  219. <table class="memname">
  220. <tr>
  221. <td class="memname">bool Sd2Card::eraseSingleBlockEnable </td>
  222. <td>(</td>
  223. <td class="paramname"></td><td>)</td>
  224. <td></td>
  225. </tr>
  226. </table>
  227. </div><div class="memdoc">
  228. <p>Determine if card supports single block erase.</p>
  229. <dl class="section return"><dt>Returns</dt><dd>The value one, true, is returned if single block erase is supported. The value zero, false, is returned if single block erase is not supported. </dd></dl>
  230. </div>
  231. </div>
  232. <a class="anchor" id="af03e574590524f93a61641604e02f79f"></a>
  233. <div class="memitem">
  234. <div class="memproto">
  235. <table class="mlabels">
  236. <tr>
  237. <td class="mlabels-left">
  238. <table class="memname">
  239. <tr>
  240. <td class="memname">void Sd2Card::error </td>
  241. <td>(</td>
  242. <td class="paramtype">uint8_t&#160;</td>
  243. <td class="paramname"><em>code</em></td><td>)</td>
  244. <td></td>
  245. </tr>
  246. </table>
  247. </td>
  248. <td class="mlabels-right">
  249. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  250. </tr>
  251. </table>
  252. </div><div class="memdoc">
  253. <p>Set SD error code. </p>
  254. <dl class="params"><dt>Parameters</dt><dd>
  255. <table class="params">
  256. <tr><td class="paramdir">[in]</td><td class="paramname">code</td><td>value for error code. </td></tr>
  257. </table>
  258. </dd>
  259. </dl>
  260. </div>
  261. </div>
  262. <a class="anchor" id="a3549d1878c0134171e399fd2d60b96f7"></a>
  263. <div class="memitem">
  264. <div class="memproto">
  265. <table class="mlabels">
  266. <tr>
  267. <td class="mlabels-left">
  268. <table class="memname">
  269. <tr>
  270. <td class="memname">int Sd2Card::errorCode </td>
  271. <td>(</td>
  272. <td class="paramname"></td><td>)</td>
  273. <td> const</td>
  274. </tr>
  275. </table>
  276. </td>
  277. <td class="mlabels-right">
  278. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  279. </tr>
  280. </table>
  281. </div><div class="memdoc">
  282. <dl class="section return"><dt>Returns</dt><dd>error code for last error. See <a class="el" href="_sd2_card_8h.html" title="Sd2Card class for V2 SD/SDHC cards. ">Sd2Card.h</a> for a list of error codes. </dd></dl>
  283. </div>
  284. </div>
  285. <a class="anchor" id="a1736acdbf194c6a2fd923c0a5049c016"></a>
  286. <div class="memitem">
  287. <div class="memproto">
  288. <table class="mlabels">
  289. <tr>
  290. <td class="mlabels-left">
  291. <table class="memname">
  292. <tr>
  293. <td class="memname">int Sd2Card::errorData </td>
  294. <td>(</td>
  295. <td class="paramname"></td><td>)</td>
  296. <td> const</td>
  297. </tr>
  298. </table>
  299. </td>
  300. <td class="mlabels-right">
  301. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  302. </tr>
  303. </table>
  304. </div><div class="memdoc">
  305. <dl class="section return"><dt>Returns</dt><dd>error data for last error. </dd></dl>
  306. </div>
  307. </div>
  308. <a class="anchor" id="a71523097165fce957c7f65b033471fc7"></a>
  309. <div class="memitem">
  310. <div class="memproto">
  311. <table class="mlabels">
  312. <tr>
  313. <td class="mlabels-left">
  314. <table class="memname">
  315. <tr>
  316. <td class="memname">bool Sd2Card::init </td>
  317. <td>(</td>
  318. <td class="paramtype">uint8_t&#160;</td>
  319. <td class="paramname"><em>sckDivisor</em> = <code>SPI_FULL_SPEED</code>, </td>
  320. </tr>
  321. <tr>
  322. <td class="paramkey"></td>
  323. <td></td>
  324. <td class="paramtype">uint8_t&#160;</td>
  325. <td class="paramname"><em>chipSelectPin</em> = <code><a class="el" href="_sd_spi_8h.html#ae6b17538c14ba6c91ccb513db2c4c29c">SD_CHIP_SELECT_PIN</a></code>&#160;</td>
  326. </tr>
  327. <tr>
  328. <td></td>
  329. <td>)</td>
  330. <td></td><td></td>
  331. </tr>
  332. </table>
  333. </td>
  334. <td class="mlabels-right">
  335. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  336. </tr>
  337. </table>
  338. </div><div class="memdoc">
  339. <p>Initialize an SD flash memory card.</p>
  340. <dl class="params"><dt>Parameters</dt><dd>
  341. <table class="params">
  342. <tr><td class="paramdir">[in]</td><td class="paramname">chipSelectPin</td><td>SD chip select pin number. </td></tr>
  343. <tr><td class="paramdir">[in]</td><td class="paramname">sckDivisor</td><td>SPI SCK clock rate divisor.</td></tr>
  344. </table>
  345. </dd>
  346. </dl>
  347. <dl class="section return"><dt>Returns</dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. The reason for failure can be determined by calling <a class="el" href="class_sd2_card.html#a3549d1878c0134171e399fd2d60b96f7">errorCode()</a> and <a class="el" href="class_sd2_card.html#a1736acdbf194c6a2fd923c0a5049c016">errorData()</a>. </dd></dl>
  348. </div>
  349. </div>
  350. <a class="anchor" id="a28eafda720598dcb2923955776199e19"></a>
  351. <div class="memitem">
  352. <div class="memproto">
  353. <table class="memname">
  354. <tr>
  355. <td class="memname">bool Sd2Card::isBusy </td>
  356. <td>(</td>
  357. <td class="paramname"></td><td>)</td>
  358. <td></td>
  359. </tr>
  360. </table>
  361. </div><div class="memdoc">
  362. <p>Check for busy. MISO low indicates the card is busy.</p>
  363. <dl class="section return"><dt>Returns</dt><dd>true if busy else false. </dd></dl>
  364. </div>
  365. </div>
  366. <a class="anchor" id="a6b015ee1c94004b8b16639910e5a3466"></a>
  367. <div class="memitem">
  368. <div class="memproto">
  369. <table class="memname">
  370. <tr>
  371. <td class="memname">bool Sd2Card::readBlock </td>
  372. <td>(</td>
  373. <td class="paramtype">uint32_t&#160;</td>
  374. <td class="paramname"><em>blockNumber</em>, </td>
  375. </tr>
  376. <tr>
  377. <td class="paramkey"></td>
  378. <td></td>
  379. <td class="paramtype">uint8_t *&#160;</td>
  380. <td class="paramname"><em>dst</em>&#160;</td>
  381. </tr>
  382. <tr>
  383. <td></td>
  384. <td>)</td>
  385. <td></td><td></td>
  386. </tr>
  387. </table>
  388. </div><div class="memdoc">
  389. <p>Read a 512 byte block from an SD card.</p>
  390. <dl class="params"><dt>Parameters</dt><dd>
  391. <table class="params">
  392. <tr><td class="paramdir">[in]</td><td class="paramname">blockNumber</td><td>Logical block to be read. </td></tr>
  393. <tr><td class="paramdir">[out]</td><td class="paramname">dst</td><td>Pointer to the location that will receive the data.</td></tr>
  394. </table>
  395. </dd>
  396. </dl>
  397. <dl class="section return"><dt>Returns</dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. </dd></dl>
  398. </div>
  399. </div>
  400. <a class="anchor" id="abaf488d56f653efa8e3349bf803ce2b0"></a>
  401. <div class="memitem">
  402. <div class="memproto">
  403. <table class="mlabels">
  404. <tr>
  405. <td class="mlabels-left">
  406. <table class="memname">
  407. <tr>
  408. <td class="memname">bool Sd2Card::readCID </td>
  409. <td>(</td>
  410. <td class="paramtype">cid_t *&#160;</td>
  411. <td class="paramname"><em>cid</em></td><td>)</td>
  412. <td></td>
  413. </tr>
  414. </table>
  415. </td>
  416. <td class="mlabels-right">
  417. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  418. </tr>
  419. </table>
  420. </div><div class="memdoc">
  421. <p>Read a card's CID register. The CID contains card identification information such as Manufacturer ID, Product name, Product serial number and Manufacturing date.</p>
  422. <dl class="params"><dt>Parameters</dt><dd>
  423. <table class="params">
  424. <tr><td class="paramdir">[out]</td><td class="paramname">cid</td><td>pointer to area for returned data.</td></tr>
  425. </table>
  426. </dd>
  427. </dl>
  428. <dl class="section return"><dt>Returns</dt><dd>true for success or false for failure. </dd></dl>
  429. </div>
  430. </div>
  431. <a class="anchor" id="a1b0c68df7f508f876d56fc1270536c87"></a>
  432. <div class="memitem">
  433. <div class="memproto">
  434. <table class="mlabels">
  435. <tr>
  436. <td class="mlabels-left">
  437. <table class="memname">
  438. <tr>
  439. <td class="memname">bool Sd2Card::readCSD </td>
  440. <td>(</td>
  441. <td class="paramtype">csd_t *&#160;</td>
  442. <td class="paramname"><em>csd</em></td><td>)</td>
  443. <td></td>
  444. </tr>
  445. </table>
  446. </td>
  447. <td class="mlabels-right">
  448. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  449. </tr>
  450. </table>
  451. </div><div class="memdoc">
  452. <p>Read a card's CSD register. The CSD contains Card-Specific Data that provides information regarding access to the card's contents.</p>
  453. <dl class="params"><dt>Parameters</dt><dd>
  454. <table class="params">
  455. <tr><td class="paramdir">[out]</td><td class="paramname">csd</td><td>pointer to area for returned data.</td></tr>
  456. </table>
  457. </dd>
  458. </dl>
  459. <dl class="section return"><dt>Returns</dt><dd>true for success or false for failure. </dd></dl>
  460. </div>
  461. </div>
  462. <a class="anchor" id="a7d6e8a504f8525afd6d36a22ee5b8cc0"></a>
  463. <div class="memitem">
  464. <div class="memproto">
  465. <table class="memname">
  466. <tr>
  467. <td class="memname">bool Sd2Card::readData </td>
  468. <td>(</td>
  469. <td class="paramtype">uint8_t *&#160;</td>
  470. <td class="paramname"><em>dst</em></td><td>)</td>
  471. <td></td>
  472. </tr>
  473. </table>
  474. </div><div class="memdoc">
  475. <p>Read one data block in a multiple block read sequence</p>
  476. <dl class="params"><dt>Parameters</dt><dd>
  477. <table class="params">
  478. <tr><td class="paramdir">[in]</td><td class="paramname">dst</td><td>Pointer to the location for the data to be read.</td></tr>
  479. </table>
  480. </dd>
  481. </dl>
  482. <dl class="section return"><dt>Returns</dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. </dd></dl>
  483. </div>
  484. </div>
  485. <a class="anchor" id="a3259be9721e14a2edf8b549e4aeb2e40"></a>
  486. <div class="memitem">
  487. <div class="memproto">
  488. <table class="memname">
  489. <tr>
  490. <td class="memname">bool Sd2Card::readStart </td>
  491. <td>(</td>
  492. <td class="paramtype">uint32_t&#160;</td>
  493. <td class="paramname"><em>blockNumber</em></td><td>)</td>
  494. <td></td>
  495. </tr>
  496. </table>
  497. </div><div class="memdoc">
  498. <p>Start a read multiple blocks sequence.</p>
  499. <dl class="params"><dt>Parameters</dt><dd>
  500. <table class="params">
  501. <tr><td class="paramdir">[in]</td><td class="paramname">blockNumber</td><td>Address of first block in sequence.</td></tr>
  502. </table>
  503. </dd>
  504. </dl>
  505. <dl class="section note"><dt>Note</dt><dd>This function is used with <a class="el" href="class_sd2_card.html#a7d6e8a504f8525afd6d36a22ee5b8cc0">readData()</a> and <a class="el" href="class_sd2_card.html#ae133ad5a80c2652a964afd2320cc7c94">readStop()</a> for optimized multiple block reads. SPI chipSelect must be low for the entire sequence.</dd></dl>
  506. <dl class="section return"><dt>Returns</dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. </dd></dl>
  507. </div>
  508. </div>
  509. <a class="anchor" id="ae133ad5a80c2652a964afd2320cc7c94"></a>
  510. <div class="memitem">
  511. <div class="memproto">
  512. <table class="memname">
  513. <tr>
  514. <td class="memname">bool Sd2Card::readStop </td>
  515. <td>(</td>
  516. <td class="paramname"></td><td>)</td>
  517. <td></td>
  518. </tr>
  519. </table>
  520. </div><div class="memdoc">
  521. <p>End a read multiple blocks sequence.</p>
  522. <dl class="section return"><dt>Returns</dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. </dd></dl>
  523. </div>
  524. </div>
  525. <a class="anchor" id="a6bcfd1bf665bf4ff88a46c07741fac43"></a>
  526. <div class="memitem">
  527. <div class="memproto">
  528. <table class="mlabels">
  529. <tr>
  530. <td class="mlabels-left">
  531. <table class="memname">
  532. <tr>
  533. <td class="memname">uint8_t Sd2Card::sckDivisor </td>
  534. <td>(</td>
  535. <td class="paramname"></td><td>)</td>
  536. <td></td>
  537. </tr>
  538. </table>
  539. </td>
  540. <td class="mlabels-right">
  541. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  542. </tr>
  543. </table>
  544. </div><div class="memdoc">
  545. <p>Return SCK divisor.</p>
  546. <dl class="section return"><dt>Returns</dt><dd>Requested SCK divisor. </dd></dl>
  547. </div>
  548. </div>
  549. <a class="anchor" id="adcee026d613619414e2b6d3eca2c6537"></a>
  550. <div class="memitem">
  551. <div class="memproto">
  552. <table class="mlabels">
  553. <tr>
  554. <td class="mlabels-left">
  555. <table class="memname">
  556. <tr>
  557. <td class="memname">int Sd2Card::type </td>
  558. <td>(</td>
  559. <td class="paramname"></td><td>)</td>
  560. <td> const</td>
  561. </tr>
  562. </table>
  563. </td>
  564. <td class="mlabels-right">
  565. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  566. </tr>
  567. </table>
  568. </div><div class="memdoc">
  569. <p>Return the card type: SD V1, SD V2 or SDHC </p>
  570. <dl class="section return"><dt>Returns</dt><dd>0 - SD V1, 1 - SD V2, or 3 - SDHC. </dd></dl>
  571. </div>
  572. </div>
  573. <a class="anchor" id="ad5eecc3e1e68b9e5a43edfb8e4205469"></a>
  574. <div class="memitem">
  575. <div class="memproto">
  576. <table class="memname">
  577. <tr>
  578. <td class="memname">bool Sd2Card::writeBlock </td>
  579. <td>(</td>
  580. <td class="paramtype">uint32_t&#160;</td>
  581. <td class="paramname"><em>blockNumber</em>, </td>
  582. </tr>
  583. <tr>
  584. <td class="paramkey"></td>
  585. <td></td>
  586. <td class="paramtype">const uint8_t *&#160;</td>
  587. <td class="paramname"><em>src</em>&#160;</td>
  588. </tr>
  589. <tr>
  590. <td></td>
  591. <td>)</td>
  592. <td></td><td></td>
  593. </tr>
  594. </table>
  595. </div><div class="memdoc">
  596. <p>Writes a 512 byte block to an SD card.</p>
  597. <dl class="params"><dt>Parameters</dt><dd>
  598. <table class="params">
  599. <tr><td class="paramdir">[in]</td><td class="paramname">blockNumber</td><td>Logical block to be written. </td></tr>
  600. <tr><td class="paramdir">[in]</td><td class="paramname">src</td><td>Pointer to the location of the data to be written. </td></tr>
  601. </table>
  602. </dd>
  603. </dl>
  604. <dl class="section return"><dt>Returns</dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. </dd></dl>
  605. </div>
  606. </div>
  607. <a class="anchor" id="afb96025babf92878213dd691263d93ef"></a>
  608. <div class="memitem">
  609. <div class="memproto">
  610. <table class="memname">
  611. <tr>
  612. <td class="memname">bool Sd2Card::writeData </td>
  613. <td>(</td>
  614. <td class="paramtype">const uint8_t *&#160;</td>
  615. <td class="paramname"><em>src</em></td><td>)</td>
  616. <td></td>
  617. </tr>
  618. </table>
  619. </div><div class="memdoc">
  620. <p>Write one data block in a multiple block write sequence </p>
  621. <dl class="params"><dt>Parameters</dt><dd>
  622. <table class="params">
  623. <tr><td class="paramdir">[in]</td><td class="paramname">src</td><td>Pointer to the location of the data to be written. </td></tr>
  624. </table>
  625. </dd>
  626. </dl>
  627. <dl class="section return"><dt>Returns</dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. </dd></dl>
  628. </div>
  629. </div>
  630. <a class="anchor" id="a1039df4f6620213a98b317d11da2014e"></a>
  631. <div class="memitem">
  632. <div class="memproto">
  633. <table class="memname">
  634. <tr>
  635. <td class="memname">bool Sd2Card::writeStart </td>
  636. <td>(</td>
  637. <td class="paramtype">uint32_t&#160;</td>
  638. <td class="paramname"><em>blockNumber</em>, </td>
  639. </tr>
  640. <tr>
  641. <td class="paramkey"></td>
  642. <td></td>
  643. <td class="paramtype">uint32_t&#160;</td>
  644. <td class="paramname"><em>eraseCount</em>&#160;</td>
  645. </tr>
  646. <tr>
  647. <td></td>
  648. <td>)</td>
  649. <td></td><td></td>
  650. </tr>
  651. </table>
  652. </div><div class="memdoc">
  653. <p>Start a write multiple blocks sequence.</p>
  654. <dl class="params"><dt>Parameters</dt><dd>
  655. <table class="params">
  656. <tr><td class="paramdir">[in]</td><td class="paramname">blockNumber</td><td>Address of first block in sequence. </td></tr>
  657. <tr><td class="paramdir">[in]</td><td class="paramname">eraseCount</td><td>The number of blocks to be pre-erased.</td></tr>
  658. </table>
  659. </dd>
  660. </dl>
  661. <dl class="section note"><dt>Note</dt><dd>This function is used with <a class="el" href="class_sd2_card.html#afb96025babf92878213dd691263d93ef">writeData()</a> and <a class="el" href="class_sd2_card.html#a7e1ec48b0a83d13415841da870290f64">writeStop()</a> for optimized multiple block writes.</dd></dl>
  662. <dl class="section return"><dt>Returns</dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. </dd></dl>
  663. </div>
  664. </div>
  665. <a class="anchor" id="a7e1ec48b0a83d13415841da870290f64"></a>
  666. <div class="memitem">
  667. <div class="memproto">
  668. <table class="memname">
  669. <tr>
  670. <td class="memname">bool Sd2Card::writeStop </td>
  671. <td>(</td>
  672. <td class="paramname"></td><td>)</td>
  673. <td></td>
  674. </tr>
  675. </table>
  676. </div><div class="memdoc">
  677. <p>End a write multiple blocks sequence.</p>
  678. <dl class="section return"><dt>Returns</dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. </dd></dl>
  679. </div>
  680. </div>
  681. <hr/>The documentation for this class was generated from the following files:<ul>
  682. <li>Arduino/libraries/SdFat/<a class="el" href="_sd2_card_8h.html">Sd2Card.h</a></li>
  683. <li>Arduino/libraries/SdFat/<a class="el" href="_sd2_card_8cpp.html">Sd2Card.cpp</a></li>
  684. </ul>
  685. </div><!-- contents -->
  686. <!-- start footer part -->
  687. <hr class="footer"/><address class="footer"><small>
  688. Generated on Sun Aug 24 2014 09:37:38 for SdFat by &#160;<a href="http://www.doxygen.org/index.html">
  689. <img class="footer" src="doxygen.png" alt="doxygen"/>
  690. </a> 1.8.6
  691. </small></address>
  692. </body>
  693. </html>