Soldered SD Card Arduino Library 1.0.0
Easily read and write files to and form the SD card breakout! A fork of the original SDFat library by Bill Greiman.
Loading...
Searching...
No Matches
SdCardInfo.h
Go to the documentation of this file.
25#ifndef SdCardInfo_h
26#define SdCardInfo_h
27#include "../common/SysCall.h"
28#include <stdint.h>
29// Based on the document:
30//
31// SD Specifications
32// Part 1
33// Physical Layer
34// Simplified Specification
35// Version 5.00
36// Aug 10, 2016
37//
38// https://www.sdcard.org/downloads/pls/
39//------------------------------------------------------------------------------
40// SD card errors
41// See the SD Specification for command info.
42#define SD_ERROR_CODE_LIST \
43 SD_CARD_ERROR(NONE, "No error") \
44 SD_CARD_ERROR(CMD0, "Card reset failed") \
45 SD_CARD_ERROR(CMD2, "SDIO read CID") \
46 SD_CARD_ERROR(CMD3, "SDIO publish RCA") \
47 SD_CARD_ERROR(CMD6, "Switch card function") \
48 SD_CARD_ERROR(CMD7, "SDIO card select") \
49 SD_CARD_ERROR(CMD8, "Send and check interface settings") \
50 SD_CARD_ERROR(CMD9, "Read CSD data") \
51 SD_CARD_ERROR(CMD10, "Read CID data") \
52 SD_CARD_ERROR(CMD12, "Stop multiple block read") \
53 SD_CARD_ERROR(CMD13, "Read card status") \
54 SD_CARD_ERROR(CMD17, "Read single block") \
55 SD_CARD_ERROR(CMD18, "Read multiple blocks") \
56 SD_CARD_ERROR(CMD24, "Write single block") \
57 SD_CARD_ERROR(CMD25, "Write multiple blocks") \
58 SD_CARD_ERROR(CMD32, "Set first erase block") \
59 SD_CARD_ERROR(CMD33, "Set last erase block") \
60 SD_CARD_ERROR(CMD38, "Erase selected blocks") \
61 SD_CARD_ERROR(CMD58, "Read OCR register") \
62 SD_CARD_ERROR(CMD59, "Set CRC mode") \
63 SD_CARD_ERROR(ACMD6, "Set SDIO bus width") \
64 SD_CARD_ERROR(ACMD13, "Read extended status") \
65 SD_CARD_ERROR(ACMD23, "Set pre-erased count") \
66 SD_CARD_ERROR(ACMD41, "Activate card initialization") \
67 SD_CARD_ERROR(READ_TOKEN, "Bad read data token") \
68 SD_CARD_ERROR(READ_CRC, "Read CRC error") \
69 SD_CARD_ERROR(READ_FIFO, "SDIO fifo read timeout") \
70 SD_CARD_ERROR(READ_REG, "Read CID or CSD failed.") \
71 SD_CARD_ERROR(READ_START, "Bad readStart argument") \
72 SD_CARD_ERROR(READ_TIMEOUT, "Read data timeout") \
73 SD_CARD_ERROR(STOP_TRAN, "Multiple block stop failed") \
74 SD_CARD_ERROR(TRANSFER_COMPLETE, "SDIO transfer complete") \
75 SD_CARD_ERROR(WRITE_DATA, "Write data not accepted") \
76 SD_CARD_ERROR(WRITE_FIFO, "SDIO fifo write timeout") \
77 SD_CARD_ERROR(WRITE_START, "Bad writeStart argument") \
78 SD_CARD_ERROR(WRITE_PROGRAMMING, "Flash programming") \
79 SD_CARD_ERROR(WRITE_TIMEOUT, "Write timeout") \
80 SD_CARD_ERROR(DMA, "DMA transfer failed") \
81 SD_CARD_ERROR(ERASE, "Card did not accept erase commands") \
82 SD_CARD_ERROR(ERASE_SINGLE_SECTOR, "Card does not support erase") \
83 SD_CARD_ERROR(ERASE_TIMEOUT, "Erase command timeout") \
84 SD_CARD_ERROR(INIT_NOT_CALLED, "Card has not been initialized") \
85 SD_CARD_ERROR(INVALID_CARD_CONFIG, "Invalid card config") \
86 SD_CARD_ERROR(FUNCTION_NOT_SUPPORTED, "Unsupported SDIO command")
87
88enum
89{
90#define SD_CARD_ERROR(e, m) SD_CARD_ERROR_##e,
91 SD_ERROR_CODE_LIST
92#undef SD_CARD_ERROR
94};
95void printSdErrorSymbol(print_t *pr, uint8_t code);
96void printSdErrorText(print_t *pr, uint8_t code);
97//------------------------------------------------------------------------------
98// card types
100const uint8_t SD_CARD_TYPE_SD1 = 1;
102const uint8_t SD_CARD_TYPE_SD2 = 2;
104const uint8_t SD_CARD_TYPE_SDHC = 3;
105//------------------------------------------------------------------------------
106// SD operation timeouts
108const uint8_t SD_CMD0_RETRY = 10;
110const uint16_t SD_CMD_TIMEOUT = 300;
112const uint16_t SD_ERASE_TIMEOUT = 10000;
114const uint16_t SD_INIT_TIMEOUT = 2000;
116const uint16_t SD_READ_TIMEOUT = 300;
118const uint16_t SD_WRITE_TIMEOUT = 600;
119//------------------------------------------------------------------------------
120// SD card commands
122const uint8_t CMD0 = 0X00;
124const uint8_t CMD2 = 0X02;
126const uint8_t CMD3 = 0X03;
128const uint8_t CMD6 = 0X06;
130const uint8_t CMD7 = 0X07;
132const uint8_t CMD8 = 0X08;
134const uint8_t CMD9 = 0X09;
136const uint8_t CMD10 = 0X0A;
138const uint8_t CMD11 = 0X0B;
140const uint8_t CMD12 = 0X0C;
142const uint8_t CMD13 = 0X0D;
144const uint8_t CMD17 = 0X11;
146const uint8_t CMD18 = 0X12;
148const uint8_t CMD24 = 0X18;
150const uint8_t CMD25 = 0X19;
152const uint8_t CMD32 = 0X20;
155const uint8_t CMD33 = 0X21;
157const uint8_t CMD38 = 0X26;
159const uint8_t CMD55 = 0X37;
161const uint8_t CMD58 = 0X3A;
163const uint8_t CMD59 = 0X3B;
165const uint8_t ACMD6 = 0X06;
167const uint8_t ACMD13 = 0X0D;
170const uint8_t ACMD23 = 0X17;
173const uint8_t ACMD41 = 0X29;
174//==============================================================================
175// CARD_STATUS
177const uint32_t CARD_STATUS_OUT_OF_RANGE = 1UL << 31;
179const uint32_t CARD_STATUS_ADDRESS_ERROR = 1UL << 30;
181const uint32_t CARD_STATUS_SECTOR_LEN_ERROR = 1UL << 29;
183const uint32_t CARD_STATUS_ERASE_SEQ_ERROR = 1UL << 28;
185const uint32_t CARD_STATUS_ERASE_PARAM = 1UL << 27;
187const uint32_t CARD_STATUS_WP_VIOLATION = 1UL << 26;
189const uint32_t CARD_STATUS_CARD_IS_LOCKED = 1UL << 25;
191const uint32_t CARD_STATUS_LOCK_UNLOCK_FAILED = 1UL << 24;
193const uint32_t CARD_STATUS_COM_CRC_ERROR = 1UL << 23;
195const uint32_t CARD_STATUS_ILLEGAL_COMMAND = 1UL << 22;
197const uint32_t CARD_STATUS_CARD_ECC_FAILED = 1UL << 21;
199const uint32_t CARD_STATUS_CC_ERROR = 1UL << 20;
201const uint32_t CARD_STATUS_ERROR = 1UL << 19;
202// bits 19, 18, and 17 reserved.
204const uint32_t CARD_STATUS_CSD_OVERWRITE = 1UL << 16;
206const uint32_t CARD_STATUS_WP_ERASE_SKIP = 1UL << 15;
208const uint32_t CARD_STATUS_CARD_ECC_DISABLED = 1UL << 14;
210const uint32_t CARD_STATUS_ERASE_RESET = 1UL << 13;
224const uint32_t CARD_STATUS_CURRENT_STATE = 0XF << 9;
228const uint32_t CARD_STATUS_READY_FOR_DATA = 1UL << 8;
229// bit 7 reserved.
231const uint32_t CARD_STATUS_FX_EVENT = 1UL << 6;
233const uint32_t CARD_STATUS_APP_CMD = 1UL << 5;
234// bit 4 reserved.
236const uint32_t CARD_STATUS_AKE_SEQ_ERROR = 1UL << 3;
237// bits 2,1, and 0 reserved for manufacturer test mode.
238//==============================================================================
240const uint8_t R1_READY_STATE = 0X00;
242const uint8_t R1_IDLE_STATE = 0X01;
244const uint8_t R1_ILLEGAL_COMMAND = 0X04;
246const uint8_t DATA_START_SECTOR = 0XFE;
248const uint8_t STOP_TRAN_TOKEN = 0XFD;
250const uint8_t WRITE_MULTIPLE_TOKEN = 0XFC;
252const uint8_t DATA_RES_MASK = 0X1F;
254const uint8_t DATA_RES_ACCEPTED = 0X05;
255//==============================================================================
260typedef struct CID
261{
262 // byte 0
264 unsigned char mid;
265 // byte 1-2
267 char oid[2];
268 // byte 3-7
270 char pnm[5];
271 // byte 8
273 unsigned char prv_m : 4;
275 unsigned char prv_n : 4;
276 // byte 9-12
278 uint32_t psn;
279 // byte 13
281 unsigned char mdt_year_high : 4;
283 unsigned char reserved : 4;
284 // byte 14
286 unsigned char mdt_month : 4;
288 unsigned char mdt_year_low : 4;
289 // byte 15
291 unsigned char always1 : 1;
293 unsigned char crc : 7;
294} __attribute__((packed)) cid_t;
295
296//==============================================================================
297#ifndef DOXYGEN_SHOULD_SKIP_THIS
302typedef struct CSDV1
303{
304 // byte 0
305 unsigned char reserved1 : 6;
306 unsigned char csd_ver : 2;
307 // byte 1
308 unsigned char taac;
309 // byte 2
310 unsigned char nsac;
311 // byte 3
312 unsigned char tran_speed;
313 // byte 4
314 unsigned char ccc_high;
315 // byte 5
316 unsigned char read_bl_len : 4;
317 unsigned char ccc_low : 4;
318 // byte 6
319 unsigned char c_size_high : 2;
320 unsigned char reserved2 : 2;
321 unsigned char dsr_imp : 1;
322 unsigned char read_blk_misalign : 1;
323 unsigned char write_blk_misalign : 1;
324 unsigned char read_bl_partial : 1;
325 // byte 7
326 unsigned char c_size_mid;
327 // byte 8
328 unsigned char vdd_r_curr_max : 3;
329 unsigned char vdd_r_curr_min : 3;
330 unsigned char c_size_low : 2;
331 // byte 9
332 unsigned char c_size_mult_high : 2;
333 unsigned char vdd_w_cur_max : 3;
334 unsigned char vdd_w_curr_min : 3;
335 // byte 10
336 unsigned char sector_size_high : 6;
337 unsigned char erase_blk_en : 1;
338 unsigned char c_size_mult_low : 1;
339 // byte 11
340 unsigned char wp_grp_size : 7;
341 unsigned char sector_size_low : 1;
342 // byte 12
343 unsigned char write_bl_len_high : 2;
344 unsigned char r2w_factor : 3;
345 unsigned char reserved3 : 2;
346 unsigned char wp_grp_enable : 1;
347 // byte 13
348 unsigned char reserved4 : 5;
349 unsigned char write_partial : 1;
350 unsigned char write_bl_len_low : 2;
351 // byte 14
352 unsigned char reserved5 : 2;
353 unsigned char file_format : 2;
354 unsigned char tmp_write_protect : 1;
355 unsigned char perm_write_protect : 1;
356 unsigned char copy : 1;
358 unsigned char file_format_grp : 1;
359 // byte 15
360 unsigned char always1 : 1;
361 unsigned char crc : 7;
362} __attribute__((packed)) csd1_t;
363//==============================================================================
368typedef struct CSDV2
369{
370 // byte 0
371 unsigned char reserved1 : 6;
372 unsigned char csd_ver : 2;
373 // byte 1
375 unsigned char taac;
376 // byte 2
378 unsigned char nsac;
379 // byte 3
380 unsigned char tran_speed;
381 // byte 4
382 unsigned char ccc_high;
383 // byte 5
385 unsigned char read_bl_len : 4;
386 unsigned char ccc_low : 4;
387 // byte 6
389 unsigned char reserved2 : 4;
390 unsigned char dsr_imp : 1;
392 unsigned char read_blk_misalign : 1;
394 unsigned char write_blk_misalign : 1;
396 unsigned char read_bl_partial : 1;
397 // byte 7
399 unsigned char c_size_high : 6;
401 unsigned char reserved3 : 2;
402 // byte 8
404 unsigned char c_size_mid;
405 // byte 9
407 unsigned char c_size_low;
408 // byte 10
410 unsigned char sector_size_high : 6;
412 unsigned char erase_blk_en : 1;
414 unsigned char reserved4 : 1;
415 // byte 11
416 unsigned char wp_grp_size : 7;
418 unsigned char sector_size_low : 1;
419 // byte 12
421 unsigned char write_bl_len_high : 2;
423 unsigned char r2w_factor : 3;
425 unsigned char reserved5 : 2;
427 unsigned char wp_grp_enable : 1;
428 // byte 13
429 unsigned char reserved6 : 5;
431 unsigned char write_partial : 1;
433 unsigned char write_bl_len_low : 2;
434 // byte 14
435 unsigned char reserved7 : 2;
437 unsigned char file_format : 2;
438 unsigned char tmp_write_protect : 1;
439 unsigned char perm_write_protect : 1;
440 unsigned char copy : 1;
442 unsigned char file_format_grp : 1;
443 // byte 15
445 unsigned char always1 : 1;
447 unsigned char crc : 7;
448} __attribute__((packed)) csd2_t;
449//==============================================================================
454union csd_t {
455 csd1_t v1;
456 csd2_t v2;
458//-----------------------------------------------------------------------------
459inline uint32_t sdCardCapacity(csd_t *csd)
460{
461 if (csd->v1.csd_ver == 0)
462 {
463 uint8_t read_bl_len = csd->v1.read_bl_len;
464 uint16_t c_size = (csd->v1.c_size_high << 10) | (csd->v1.c_size_mid << 2) | csd->v1.c_size_low;
465 uint8_t c_size_mult = (csd->v1.c_size_mult_high << 1) | csd->v1.c_size_mult_low;
466 return (uint32_t)(c_size + 1) << (c_size_mult + read_bl_len - 7);
467 }
468 else if (csd->v2.csd_ver == 1)
469 {
470 return (((uint32_t)csd->v2.c_size_high << 16) + ((uint16_t)csd->v2.c_size_mid << 8) + csd->v2.c_size_low + 1)
471 << 10;
472 }
473 else
474 {
475 return 0;
476 }
477}
478//-----------------------------------------------------------------------------
479// fields are big endian
480typedef struct SdStatus
481{
483 uint8_t reserved1;
484 uint8_t sdCardType[2];
486 uint8_t speedClass;
488 uint8_t auSize;
489 uint8_t eraseSize[2];
492 uint8_t videoSpeed;
493 uint8_t vscAuSize[2];
494 uint8_t susAddr[3];
495 uint8_t reserved2[3];
498#endif // DOXYGEN_SHOULD_SKIP_THIS
499#endif // SdCardInfo_h
const uint32_t CARD_STATUS_ERASE_RESET
Definition SdCardInfo.h:210
const uint8_t CMD25
Definition SdCardInfo.h:150
const uint8_t CMD2
Definition SdCardInfo.h:124
const uint8_t CMD7
Definition SdCardInfo.h:130
const uint32_t CARD_STATUS_CARD_IS_LOCKED
Definition SdCardInfo.h:189
const uint16_t SD_INIT_TIMEOUT
Definition SdCardInfo.h:114
const uint16_t SD_CMD_TIMEOUT
Definition SdCardInfo.h:110
const uint8_t CMD12
Definition SdCardInfo.h:140
const uint8_t WRITE_MULTIPLE_TOKEN
Definition SdCardInfo.h:250
struct SdStatus SdStatus_t
const uint32_t CARD_STATUS_ERROR
Definition SdCardInfo.h:201
const uint8_t CMD17
Definition SdCardInfo.h:144
const uint8_t SD_CARD_TYPE_SD2
Definition SdCardInfo.h:102
const uint8_t CMD18
Definition SdCardInfo.h:146
void printSdErrorText(print_t *pr, uint8_t code)
Definition SdCardInfo.cpp:48
const uint16_t SD_ERASE_TIMEOUT
Definition SdCardInfo.h:112
const uint32_t CARD_STATUS_ERASE_SEQ_ERROR
Definition SdCardInfo.h:183
const uint8_t CMD13
Definition SdCardInfo.h:142
const uint32_t CARD_STATUS_ERASE_PARAM
Definition SdCardInfo.h:185
const uint8_t DATA_RES_ACCEPTED
Definition SdCardInfo.h:254
const uint32_t CARD_STATUS_FX_EVENT
Definition SdCardInfo.h:231
const uint8_t CMD8
Definition SdCardInfo.h:132
const uint8_t STOP_TRAN_TOKEN
Definition SdCardInfo.h:248
const uint8_t SD_CMD0_RETRY
Definition SdCardInfo.h:108
const uint16_t SD_WRITE_TIMEOUT
Definition SdCardInfo.h:118
const uint32_t CARD_STATUS_READY_FOR_DATA
Definition SdCardInfo.h:228
const uint32_t CARD_STATUS_AKE_SEQ_ERROR
Definition SdCardInfo.h:236
const uint8_t CMD38
Definition SdCardInfo.h:157
const uint8_t ACMD6
Definition SdCardInfo.h:165
const uint8_t CMD55
Definition SdCardInfo.h:159
const uint8_t CMD9
Definition SdCardInfo.h:134
uint32_t sdCardCapacity(csd_t *csd)
Definition SdCardInfo.h:459
const uint32_t CARD_STATUS_WP_ERASE_SKIP
Definition SdCardInfo.h:206
void printSdErrorSymbol(print_t *pr, uint8_t code)
Definition SdCardInfo.cpp:32
const uint8_t CMD24
Definition SdCardInfo.h:148
const uint8_t CMD59
Definition SdCardInfo.h:163
union csd_t __attribute__
const uint32_t CARD_STATUS_APP_CMD
Definition SdCardInfo.h:233
const uint8_t SD_CARD_TYPE_SD1
Definition SdCardInfo.h:100
const uint8_t CMD32
Definition SdCardInfo.h:152
@ SD_CARD_ERROR_UNKNOWN
Definition SdCardInfo.h:93
const uint32_t CARD_STATUS_CARD_ECC_FAILED
Definition SdCardInfo.h:197
const uint8_t ACMD13
Definition SdCardInfo.h:167
const uint8_t SD_CARD_TYPE_SDHC
Definition SdCardInfo.h:104
const uint32_t CARD_STATUS_LOCK_UNLOCK_FAILED
Definition SdCardInfo.h:191
const uint32_t CARD_STATUS_ILLEGAL_COMMAND
Definition SdCardInfo.h:195
const uint32_t CARD_STATUS_SECTOR_LEN_ERROR
Definition SdCardInfo.h:181
const uint8_t DATA_START_SECTOR
Definition SdCardInfo.h:246
const uint8_t ACMD23
Definition SdCardInfo.h:170
const uint8_t CMD0
Definition SdCardInfo.h:122
const uint16_t SD_READ_TIMEOUT
Definition SdCardInfo.h:116
const uint8_t R1_READY_STATE
Definition SdCardInfo.h:240
const uint8_t CMD10
Definition SdCardInfo.h:136
const uint8_t CMD6
Definition SdCardInfo.h:128
const uint8_t CMD58
Definition SdCardInfo.h:161
const uint32_t CARD_STATUS_ADDRESS_ERROR
Definition SdCardInfo.h:179
const uint32_t CARD_STATUS_CURRENT_STATE
Definition SdCardInfo.h:224
const uint8_t ACMD41
Definition SdCardInfo.h:173
const uint8_t CMD11
Definition SdCardInfo.h:138
const uint8_t R1_ILLEGAL_COMMAND
Definition SdCardInfo.h:244
const uint32_t CARD_STATUS_COM_CRC_ERROR
Definition SdCardInfo.h:193
const uint32_t CARD_STATUS_WP_VIOLATION
Definition SdCardInfo.h:187
const uint8_t DATA_RES_MASK
Definition SdCardInfo.h:252
const uint32_t CARD_STATUS_CSD_OVERWRITE
Definition SdCardInfo.h:204
const uint32_t CARD_STATUS_CURRENT_STATE_SHIFT
Definition SdCardInfo.h:226
const uint32_t CARD_STATUS_CC_ERROR
Definition SdCardInfo.h:199
const uint8_t CMD3
Definition SdCardInfo.h:126
unsigned char read_bl_len
Definition SdCardInfo.h:12
const uint8_t CMD33
Definition SdCardInfo.h:155
const uint32_t CARD_STATUS_CARD_ECC_DISABLED
Definition SdCardInfo.h:208
const uint8_t R1_IDLE_STATE
Definition SdCardInfo.h:242
const uint32_t CARD_STATUS_OUT_OF_RANGE
Definition SdCardInfo.h:177
Print print_t
Definition SysCall.h:66
Card IDentification (CID) register.
Definition SdCardInfo.h:261
char oid[2]
Definition SdCardInfo.h:267
unsigned char prv_m
Definition SdCardInfo.h:273
unsigned char mdt_month
Definition SdCardInfo.h:286
char pnm[5]
Definition SdCardInfo.h:270
unsigned char mdt_year_high
Definition SdCardInfo.h:281
unsigned char reserved
Definition SdCardInfo.h:283
unsigned char crc
Definition SdCardInfo.h:293
unsigned char mid
Definition SdCardInfo.h:264
uint32_t psn
Definition SdCardInfo.h:278
unsigned char prv_n
Definition SdCardInfo.h:275
unsigned char always1
Definition SdCardInfo.h:291
unsigned char mdt_year_low
Definition SdCardInfo.h:288
CSD register for version 1.00 cards .
Definition SdCardInfo.h:303
unsigned char c_size_mid
Definition SdCardInfo.h:326
unsigned char tran_speed
Definition SdCardInfo.h:312
unsigned char c_size_low
Definition SdCardInfo.h:330
unsigned char reserved2
Definition SdCardInfo.h:320
unsigned char write_bl_len_high
Definition SdCardInfo.h:343
unsigned char always1
Definition SdCardInfo.h:360
unsigned char crc
Definition SdCardInfo.h:361
unsigned char nsac
Definition SdCardInfo.h:310
unsigned char vdd_w_curr_min
Definition SdCardInfo.h:334
unsigned char reserved1
Definition SdCardInfo.h:305
unsigned char write_partial
Definition SdCardInfo.h:349
unsigned char vdd_r_curr_min
Definition SdCardInfo.h:329
unsigned char read_bl_len
Definition SdCardInfo.h:316
unsigned char file_format
Definition SdCardInfo.h:353
unsigned char vdd_r_curr_max
Definition SdCardInfo.h:328
unsigned char r2w_factor
Definition SdCardInfo.h:344
unsigned char reserved3
Definition SdCardInfo.h:345
unsigned char taac
Definition SdCardInfo.h:308
unsigned char sector_size_high
Definition SdCardInfo.h:336
unsigned char c_size_high
Definition SdCardInfo.h:319
unsigned char read_blk_misalign
Definition SdCardInfo.h:322
unsigned char erase_blk_en
Definition SdCardInfo.h:337
unsigned char vdd_w_cur_max
Definition SdCardInfo.h:333
unsigned char ccc_low
Definition SdCardInfo.h:317
unsigned char file_format_grp
Definition SdCardInfo.h:358
unsigned char c_size_mult_high
Definition SdCardInfo.h:332
unsigned char perm_write_protect
Definition SdCardInfo.h:355
unsigned char csd_ver
Definition SdCardInfo.h:306
unsigned char sector_size_low
Definition SdCardInfo.h:341
unsigned char wp_grp_size
Definition SdCardInfo.h:340
unsigned char write_bl_len_low
Definition SdCardInfo.h:350
unsigned char reserved5
Definition SdCardInfo.h:352
unsigned char wp_grp_enable
Definition SdCardInfo.h:346
unsigned char reserved4
Definition SdCardInfo.h:348
unsigned char copy
Definition SdCardInfo.h:356
unsigned char write_blk_misalign
Definition SdCardInfo.h:323
unsigned char tmp_write_protect
Definition SdCardInfo.h:354
unsigned char dsr_imp
Definition SdCardInfo.h:321
unsigned char c_size_mult_low
Definition SdCardInfo.h:338
unsigned char read_bl_partial
Definition SdCardInfo.h:324
unsigned char ccc_high
Definition SdCardInfo.h:314
CSD register for version 2.00 cards.
Definition SdCardInfo.h:369
unsigned char reserved2
Definition SdCardInfo.h:389
unsigned char tran_speed
Definition SdCardInfo.h:380
unsigned char reserved3
Definition SdCardInfo.h:401
unsigned char sector_size_high
Definition SdCardInfo.h:410
unsigned char perm_write_protect
Definition SdCardInfo.h:439
unsigned char ccc_high
Definition SdCardInfo.h:382
unsigned char dsr_imp
Definition SdCardInfo.h:390
unsigned char c_size_mid
Definition SdCardInfo.h:404
unsigned char c_size_high
Definition SdCardInfo.h:399
unsigned char write_bl_len_low
Definition SdCardInfo.h:433
unsigned char reserved7
Definition SdCardInfo.h:435
unsigned char reserved1
Definition SdCardInfo.h:371
unsigned char copy
Definition SdCardInfo.h:440
unsigned char csd_ver
Definition SdCardInfo.h:372
unsigned char write_partial
Definition SdCardInfo.h:431
unsigned char reserved4
Definition SdCardInfo.h:414
unsigned char c_size_low
Definition SdCardInfo.h:407
unsigned char ccc_low
Definition SdCardInfo.h:386
unsigned char read_bl_len
Definition SdCardInfo.h:385
unsigned char r2w_factor
Definition SdCardInfo.h:423
unsigned char wp_grp_size
Definition SdCardInfo.h:416
unsigned char erase_blk_en
Definition SdCardInfo.h:412
unsigned char wp_grp_enable
Definition SdCardInfo.h:427
unsigned char file_format
Definition SdCardInfo.h:437
unsigned char reserved6
Definition SdCardInfo.h:429
unsigned char nsac
Definition SdCardInfo.h:378
unsigned char read_blk_misalign
Definition SdCardInfo.h:392
unsigned char always1
Definition SdCardInfo.h:445
unsigned char write_blk_misalign
Definition SdCardInfo.h:394
unsigned char taac
Definition SdCardInfo.h:375
unsigned char crc
Definition SdCardInfo.h:447
unsigned char read_bl_partial
Definition SdCardInfo.h:396
unsigned char reserved5
Definition SdCardInfo.h:425
unsigned char sector_size_low
Definition SdCardInfo.h:418
unsigned char tmp_write_protect
Definition SdCardInfo.h:438
unsigned char file_format_grp
Definition SdCardInfo.h:442
unsigned char write_bl_len_high
Definition SdCardInfo.h:421
Definition SdCardInfo.h:481
uint8_t reservedManufacturer[40]
Definition SdCardInfo.h:496
uint8_t sdCardType[2]
Definition SdCardInfo.h:484
uint8_t eraseTimeoutOffset
Definition SdCardInfo.h:490
uint8_t videoSpeed
Definition SdCardInfo.h:492
uint8_t speedClass
Definition SdCardInfo.h:486
uint8_t uhsSpeedAuSize
Definition SdCardInfo.h:491
uint8_t performanceMove
Definition SdCardInfo.h:487
uint8_t busWidthSecureMode
Definition SdCardInfo.h:482
uint8_t reserved2[3]
Definition SdCardInfo.h:495
uint8_t sizeOfProtectedArea[4]
Definition SdCardInfo.h:485
uint8_t reserved1
Definition SdCardInfo.h:483
uint8_t auSize
Definition SdCardInfo.h:488
uint8_t vscAuSize[2]
Definition SdCardInfo.h:493
uint8_t susAddr[3]
Definition SdCardInfo.h:494
uint8_t eraseSize[2]
Definition SdCardInfo.h:489
Union of old and new style CSD register.
Definition SdCardInfo.h:454
csd2_t v2
Definition SdCardInfo.h:456
csd1_t v1
Definition SdCardInfo.h:455