EasyManua.ls Logo

Texas Instruments CC3235 SimpleLink Series - Page 367

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
367
SWRU543January 2019
Submit Documentation Feedback
Copyright © 2019, Texas Instruments Incorporated
SD Host Controller Interface
//
// Wait for card to become ready.
//
do
{
if( (ulRet = SendCmd(CMD_APP_CMD,0)) == 0 )
{
ulRet = SendCmd(CMD_SD_SEND_OP_COND,0x00E00000);
//
// Response contains 32-bit OCR register
//
SDHostRespGet(SDHOST_BASE,ulResp);
}
}while((ulRet == 0)
&&((ulResp[0] >>31) == 0));
//
// Check the response
//
if(ulRet == 0)
{
CardAttrib->ulCardType = CARD_TYPE_SDCARD;
}
else // CMD 55 is not recognised by SDHost cards.
{
//
// Confirm if its a SDHost card
//
ulRet = SendCmd(CMD_SEND_OP_COND,0);
if( ulRet == 0)
{
CardAttrib->ulCardType = CARD_TYPE_MMC;
}
}
}
}
//
// Get the RCA of the attached card
//
if(ulRet == 0)
{
ulRet = SendCmd(CMD_ALL_SEND_CID,0);
if( ulRet == 0)
{
SendCmd(CMD_SEND_REL_ADDR,0);
SDHostRespGet(SDHOST_BASE,ulResp);
//
// Fill in the RCA
//
CardAttrib->ulRCA = (ulResp[0]
>> 16);
//
// Get tha card capacity
//
CardAttrib->ullCapacity = CardCapacityGet(CardAttrib->ulRCA);
}
}
//
// return status.
//

Table of Contents

Related product manuals