EasyManua.ls Logo

Texas Instruments CC3235 SimpleLink Series - Page 366

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
366
SWRU543January 2019
Submit Documentation Feedback
Copyright © 2019, Texas Instruments Incorporated
SD Host Controller Interface
Another command example is the SD card command 18, used to read multiple blocks from the SD card.
The command takes the block number or linear address of the first byte to be read based on the version
and capacity of the attached card:
#define CMD_READ_MULTI_BLK SDHOST_CMD_18| SDHOST_RD_CMD| SDHOST_RESP_LEN_48| SDHOST_MULTI_BLK
SendCmd(CMD_READ_MULTI_BLK,
<ulBlockNo>)
11.4.3 Card Detection and Initialization
The code that follows shows a card detection and initialization using peripheral APIs:
CardInit(CardAttrib_t *CardAttrib)
{
unsigned long ulRet;
unsigned long ulResp[4];
//
// Initialize the attributes.
//
CardAttrib->ulCardType = CARD_TYPE_UNKNOWN;
CardAttrib->ulCapClass = CARD_CAP_CLASS_SDSC;
CardAttrib->ulRCA = 0;
CardAttrib->ulVersion = CARD_VERSION_1;
//
// Send std GO IDLE command
//
if( SendCmd(CMD_GO_IDLE_STATE, 0) == 0)
{
ulRet = SendCmd(CMD_SEND_IF_COND,0x00000100);
//
// It's a SD ver 2.0 or higher card
//
if(ulRet == 0)
{
CardAttrib->ulVersion = CARD_VERSION_2;
CardAttrib->ulCardType = CARD_TYPE_SDCARD;
//
// Wait for card to become ready.
//
do
{
//
// Send ACMD41
//
SendCmd(CMD_APP_CMD,0);
ulRet = SendCmd(CMD_SD_SEND_OP_COND,0x40E00000);
//
// Response contains 32-bit OCR register
//
SDHostRespGet(SDHOST_BASE,ulResp);
}while(((ulResp[0] >> 31) == 0));
if(ulResp[0] &amp; (1UL<<30)) {
CardAttrib->ulCapClass = CARD_CAP_CLASS_SDHC;
}
}
else //It's a MMC or SD 1.x card
{

Table of Contents

Related product manuals