EasyManua.ls Logo

Texas Instruments CC3235 SimpleLink Series - Page 368

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...
Initialization and Configuration Using Peripheral APIs
www.ti.com
368
SWRU543January 2019
Submit Documentation Feedback
Copyright © 2019, Texas Instruments Incorporated
SD Host Controller Interface
return ulRet;
}
The structure used in the API has the following format:
typedef struct
{
unsigned long ulCardType;
unsigned long long ullCapacity;
unsigned long ulVersion;
unsigned long ulCapClass;
unsigned short ulRCA;
}CardAttrib_t;
11.4.4 Block Read
The code that follows shows a block read using peripheral APIs:
unsigned long CardReadBlock(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; // 512/4
// Compute linear address from block no. for SDSC cards.
if(Card->ulCapClass == CARD_CAP_CLASS_SDSC)
{
ulBlockNo = ulBlkIndx * 512;
}
if( SendCmd(CMD_READ_SINGLE_BLK, ulBlockNo) == 0 )
{
// Read out the data.
while(ulSize--)
{
MAP_SDHostDataRead(SDHOST_BASE,((unsigned long *)pBuffer);
pBuffer+=4;
}
}
else
{
// Retutn error
return 1;
}
}
// Return success
return 0;
}

Table of Contents

Related product manuals