Information Technology Reference
In-Depth Information
else
{
index = 0x2FF;
//Wait for the data_start token or a timeout.
do
{
data_token = ReadMedia();
index--;
} while ((data_token == SDC_FLOATING_BUS) && (index != 0));
if ((index == 0) || (data_token != DATA_START_TOKEN))
status = sdcCardTimeout;
else
{
// A data start token was received.
// Read the CSD register's 16 bytes.
for (index = 0; index < CSD_SIZE; index++)
{
gblCSDReg._byte[index] = ReadMedia();
}
}
// Generate 8 clock cycles to complete the command.
mSend8ClkCycles();
}
// Deselect the card.
SDC_CS = 1;
return(status);
}
Reading a Sector
MultiMediaCard firmware reads data from the storage media in sectors,
which are typically 512 bytes. The SectorRead function and related code
below perform this function. The function accepts a 32-bit LBA that identi-
Search WWH ::




Custom Search