Information Technology Reference
In-Depth Information
else
{
// The command was accepted.
// Send a data start token.
WriteSPI(DATA_START_TOKEN);
// Send a sector's worth of data.
for(index = 0; index < 512; index++)
WriteSPI(buffer[index]);
// Send the CRC bytes.
mSendCRC();
// Read the card's response.
data_response = ReadMedia();
if ((data_response & 0x0F) != DATA_ACCEPTED)
{
status = sdcCardDataRejected;
}
else
{
// The card is writing the data into the storage media.
// Wait for the card to return non-zero (not busy) or a timeout.
index = 0;
do
{
data_response = ReadMedia();
index++;
} while ((data_response == 0x00) && (index != 0));
Search WWH ::




Custom Search