# CSD Register Masks¶

group group_sd_host_macros_csd

The masks below are for CSD Register Version 2.0 and can be used with the Cy_SD_Host_GetCsd function.

Defines

CY_SD_HOST_CSD_V2_CSD_STRUCTURE

CSD structure (contained in csd[3])

CY_SD_HOST_CSD_V2_TAAC

The data read access-time (contained in csd[3]).

This field is fixed to 0Eh, which indicates 1 ms.

CY_SD_HOST_CSD_V2_NSAC

The data read access-time in CLK cycles (NSAC*100) (contained in csd[3]).

This field is fixed to 00h. NSAC should not be used to calculate time-out values for CSD Version 2.0.

CY_SD_HOST_CSD_V2_TRAN_SPEED

The max.

data transfer rate (contained in csd[2]). Equals to 0x32 (25 MHz) or 0x5A (50 MHz).

CY_SD_HOST_CSD_V2_CCC

The card command classes (contained in csd[2]).

The card command class register CCC defines which command classes are supported by this card. A value of 1 in a CCC bit means that the corresponding command class is supported.

CY_SD_HOST_CSD_V2_READ_BL_LEN

The max.

read data block length (contained in csd[2]). This field is fixed to 9h, which indicates READ_BL_LEN=512 Byte.

CY_SD_HOST_CSD_V2_READ_BL_PARTIAL

The partial blocks for read allowed (contained in csd[2]).

This field is fixed to 0, which indicates partial block read is inhibited and only unit of block access is allowed.

CY_SD_HOST_CSD_V2_WRITE_BLK_MISALIGN

The write block misalignment (contained in csd[2]).

This field is fixed to 0, which indicates write access crossing physical block boundaries is always disabled in High Capacity SD Memory Card.

CY_SD_HOST_CSD_V2_READ_BLK_MISALIGN

The read block misalignment (contained in csd[2]).

This field is fixed to 0, which indicates read access crossing physical block boundaries is always disabled in High Capacity SD Memory Card.

CY_SD_HOST_CSD_V2_DSR_IMP

The DSR implemented (contained in csd[2]).

Defines if the configurable driver stage is integrated on the card.

CY_SD_HOST_CSD_V2_C_SIZE_MASK

The device size (contained in csd[1]).

This parameter is used to calculate the user data area capacity in the SD memory card (not include the protected area). The user data area capacity is calculated from C_SIZE as follows: memory capacity = (C_SIZE+1) * 512K byte.

CY_SD_HOST_CSD_V2_ERASE_BLK_EN

The erase single block enable (contained in csd[1]).

This field is fixed to 1, which means the host can erase one or multiple units of 512 bytes.

CY_SD_HOST_CSD_V2_SECTOR_SIZE_MSB

The MSB of erase sector size (6 MSB bits contained in csd[1]).

SECTOR_SIZE is fixed to 7Fh, which indicates 64 KBytes. This value does not relate to erase operation. Version 2.00 cards indicates memory boundary by AU size and this field should not be used.

CY_SD_HOST_CSD_V2_SECTOR_SIZE_LSB

The LSB of erase sector size (1 LSB bit of SECTOR_SIZE contained in csd[0]).

CY_SD_HOST_CSD_V2_WP_GRP_SIZE

The write protect group size (contained in csd[0]).

This field is fixed to 00h. The High Capacity SD Memory Card does not support write protected groups.

CY_SD_HOST_CSD_V2_WP_GRP_ENABLE

The write protect group enable (contained in csd[0]).

This field is fixed to 0. The High Capacity SD Memory Card does not support write protected groups.

CY_SD_HOST_CSD_V2_R2W_FACTOR

The write speed factor (contained in csd[0]).

This field is fixed to 2h, which indicates 4 multiples.

CY_SD_HOST_CSD_V2_WRITE_BL_LEN

The max.

write data block length (contained in csd[0]). This field is fixed to 9h, which indicates WRITE_BL_LEN=512 Byte.

CY_SD_HOST_CSD_V2_WRITE_BL_PARTIAL

The partial blocks for write allowed (contained in csd[0]).

This field is fixed to 0, which indicates partial block read is inhibited and only unit of block access is allowed.

CY_SD_HOST_CSD_V2_FILE_FORMAT_GRP

The File format group (contained in csd[0]).

This field is set to 0. Host should not use this field.

CY_SD_HOST_CSD_V2_COPY

The copy flag (OTP) (contained in csd[0]).

Defines if the contents is original (=0) or has been copied (=1). The COPY bit for OTP and MTP devices, sold to end consumers, is set to 1, which identifies the card contents as a copy. The COPY bit is a one time programmable bit.

CY_SD_HOST_CSD_V2_PERM_WRITE_PROTECT

The permanent write protection (contained in csd[0]).

Permanently protects the entire card content against overwriting or erasing (all write and erase commands for this card are permanently disabled). The default value is 0, i.e. not permanently write protected.

CY_SD_HOST_CSD_V2_TMP_WRITE_PROTECT

The temporary write protection (contained in csd[0]).

Temporarily protects the entire card content from being overwritten or erased (all write and erase commands for this card are temporarily disabled). This bit can be set and reset. The default value is 0, i.e. not write protected.

CY_SD_HOST_CSD_V2_FILE_FORMAT

The File format (contained in csd[0]).

This field is set to 0. Host should not use this field.