diff --git a/FATFS/shimatta_sdio_driver/shimatta_sdio-driver.c b/FATFS/shimatta_sdio_driver/shimatta_sdio-driver.c index fcd3893..858aeaf 100644 --- a/FATFS/shimatta_sdio_driver/shimatta_sdio-driver.c +++ b/FATFS/shimatta_sdio_driver/shimatta_sdio-driver.c @@ -67,7 +67,7 @@ void SDIO_DMA_Init(){ DMASTREAM->CR = DMAM2P; //Address Conffiguration //Memory address is set by write and read block functions - //DMASTREAM->M0AR = (uint32_t)&rxtxbuffer; + //DMASTREAM->M0AR = (uint32_t)&rxtxbuffer; //Has to be set in red/write func DMASTREAM->PAR = (uint32_t)&SDIO->FIFO; //Not sure if this works //DMASTREAM->CR |= DMA_SxCR_EN; @@ -129,7 +129,7 @@ int SDIO_getResp(uint8_t expectedCMD, uint8_t typeOfAns, uint32_t *responseBuffe while (1) { if (SDIO->STA & SDIO_STA_CMDREND) break; //Corrct Respone Received - //Exclude 41 from valid CRC check + //Exclude ACMD41 from valid CRC check if ((SDIO->STA & SDIO_STA_CCRCFAIL)) { if(expectedCMD == 41) { //This command does not have a CRC...Doushite.... diff --git a/FATFS/shimatta_sdio_driver/shimatta_sdio-driver.h b/FATFS/shimatta_sdio_driver/shimatta_sdio-driver.h index 05feaf8..7ab4883 100644 --- a/FATFS/shimatta_sdio_driver/shimatta_sdio-driver.h +++ b/FATFS/shimatta_sdio_driver/shimatta_sdio-driver.h @@ -19,6 +19,8 @@ DRESULT SDIO_disk_write(const BYTE *buff, DWORD sector, UINT count); DRESULT SDIO_disk_ioctl(BYTE cmd, void* buff); DWORD get_fattime(); + +//Defines for Card Status in struct _CardStatus #define CURRENT_STATE_IDLE 0 #define CURRENT_STATE_READY 1 #define CURRENT_STATE_IDENT 2 @@ -30,6 +32,7 @@ DWORD get_fattime(); #define CURRENT_STATE_DIS 8 + typedef struct _CardStatus { uint32_t reserved : 3; uint32_t AKE_SEQ_ERROR : 1; @@ -63,9 +66,13 @@ typedef struct _CardStatus { #define CARD_MMC 2//Never use. MMC not supported #define CARD_NONE 0 +#define CCS_SC 0 +#define CCS_HC 1 + typedef struct _SDInfo { uint32_t rca; uint8_t type; + uint8_t CCS; }SDInfo_t; typedef union _StatusConv {