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