Exemplo n.º 1
0
bool sdmmcShowDeviceInfo(SdmmcDriver *sdmmcp)
{
	sSdCard *pSd =&sdmmcp->card;
		TRACE_INFO("Show Device Info:\n\r");

	#ifndef SDMMC_TRIM_INFO
		const uint8_t card_type = sdmmcp->card.bCardType;
		TRACE_INFO_1("Card Type: %d\n\r", card_type);
	#endif
		TRACE_INFO("Dumping Status ... \n\r");
		SD_DumpStatus(pSd);
	#ifndef SDMMC_TRIM_INFO
		if (card_type & CARD_TYPE_bmSDMMC)
			SD_DumpCID(pSd);
		if (card_type & CARD_TYPE_bmSD) {
			SD_DumpSCR(pSd->SCR);
			SD_DumpSSR(pSd->SSR);
		}
		if (card_type & CARD_TYPE_bmSDMMC)
			SD_DumpCSD(pSd);
	#ifndef SDMMC_TRIM_MMC
		if (card_type & CARD_TYPE_bmMMC)
			SD_DumpExtCSD(pSd->EXT);
	#endif
	#ifndef SDMMC_TRIM_SDIO
		if (card_type & CARD_TYPE_bmSDIO)
			SDIO_DumpCardInformation(sdmmcp);
	#endif

	#endif
		return true;
}
Exemplo n.º 2
0
static void SDDiskInit(sSdCard *pSd)
{
    uint8_t sdConnected[BOARD_NUM_MCI];
    uint8_t i;
    msdBuffer = (uint8_t *)BUF_START_ADDR;
    /* Infinite loop */
    for (i = 0; i < BOARD_NUM_MCI; i ++) sdConnected[i]=0;
    for (i = 0; i < BOARD_NUM_MCI; i ++)
    {
        if (CardIsConnected(i)) {
            if (sdConnected[i] == 0) {
                sdConnected[i] = 1;
                printf("-I- connect to solt %x \n\r",i);
                CardInit(i);
                pSd = &sdDrv[i];
                SD_DumpCID(pSd->CID);
                SD_DumpCSD(pSd->CSD);
                SD_DumpExtCSD(pSd->EXT);
                MEDSdusb_Initialize(&medias[0], pSd);
            }
        }
        else if (sdConnected[i]) {
            sdConnected[i] = 0;
            printf("** Card %d Disconnected\n\r",i);
        }
    }
    
    LUN_Init(&(luns[0]),
             &(medias[0]),
             msdBuffer, MSD_BUFFER_SIZE,
             0, 0, 0, 0,
             MSDCallbacks_Data);
}
Exemplo n.º 3
0
/**
 * Dump card registers
 * \param iMci Controller number.
 */
static void DumpCardInfo(uint8_t iMci)
{
    sSdCard *pSd = &sdDrv[iMci];

    if (SD_GetCardType(pSd) & CARD_TYPE_bmSDIO)
    {
        SDIO_DumpCardInformation(pSd);
    }

    if (SD_GetCardType(pSd) & CARD_TYPE_bmSDMMC)
    {
        SD_DumpCID(pSd->CID);
        SD_DumpCSD(pSd->CSD);
    }
}