EasyManua.ls Logo

Texas Instruments CC3235 SimpleLink Series - Card Types

Texas Instruments CC3235 SimpleLink Series
799 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
www.ti.com
Initialization and Configuration Using Peripheral APIs
369
SWRU543January 2019
Submit Documentation Feedback
Copyright © 2019, Texas Instruments Incorporated
SD Host Controller Interface
11.4.5 Block Write
The code that follows shows a block write using peripheral APIs:
Unsigned long CardWriteBlock(CardAttrib_t *Card, unsigned char *pBuffer,
unsigned long ulBlockNo, unsigned long ulBlockCount)
{
unsigned long ulSize;
unsigned long ulBlkIndx;
ulBlockCount = ulBlockCount + ulBlockNo;
for(ulBlkIndx = ulBlockNo; ulBlkIndx
<ulBlockCount; ulBlkIndx++)
{
ulSize = 128;
if(Card->ulCapClass == CARD_CAP_CLASS_SDSC)
{
ulBlockNo = ulBlkIndx * 512;
}
if( SendCmd(CMD_WRITE_SINGLE_BLK, ulBlockNo) == 0 )
{
// Write the data
while(ulSize--)
{
SDHostDataWrite(SDHOST_BASE,*((unsigned long *)pBuffer));
pBuffer+=4;
}
// Wait for transfer completion.
while( !(SDHostIntStatus(SDHOST_BASE)
&amp;SDHOST_INT_TC) );
}
else
{
return 1;
}
}
// Return error
return 0;
}
11.5 Performance and Testing
The APIs discussed in the preceding sections were tested using the cards types listed in Table 11-1:
Table 11-1. Card Types
Vendor Size Capacity Class Block Read/Write Comments
Transcend 2GB SDSC Passed
Transcend 16GB SDHC Passed
Strontium 2GB SDSC Passed

Table of Contents

Related product manuals