Information Technology Reference
In-Depth Information
do
{
// Read from the card until receiving a response or a timeout.
data_token = ReadMedia();
index--;
} while ((data_token == SDC_FLOATING_BUS) && (index != 0));
if ((index == 0) || (data_token != DATA_START_TOKEN))
// The card didn't send a data start token.
status = sdcCardTimeout;
else
{
// The card sent a data start token.
// Read a sector's worth of data from the card.
for (index = 0; index < SDC_SECTOR_SIZE; index++)
{
buffer[index] = ReadMedia();
}
// Read the CRC bytes.
mReadCRC();
}
// Generate 8 clock cycles to complete the command.
mSend8ClkCycles();
}
// Deselect the card.
SDC_CS = 1;
return(status);
}
Writing a Sector
MultiMediaCard firmware writes data to the storage media in sectors. The
SectorWrite function and related code below perform this function. The
Search WWH ::




Custom Search