各位前辈,我在非操作系统下测试SD卡,现在想读取SD_STATUS的64个字节,不知道怎样修改这段码码?有劳各位指点一下,谢谢!
int CMD13(void)//SEND_STATUS
{
int response0;
rSDICARG=RCA<<16; // CMD13(RCA,stuff bit)
rSDICCON=(0x1<<9)|(0x1<<8)|0x4d; // sht_resp, wait_resp, start, CMD13
//-- Check end of CMD13
if(!Chk_CMDend(13, 1))
return 0;
//Uart_Printf("rSDIRSP0=0x%x\n", rSDIRSP0);
if(rSDIRSP0&0x100)
//Uart_Printf("Ready for Data\n");
// else
//Uart_Printf("Not Ready\n");
response0=rSDIRSP0;
response0 &= 0x3c00;
response0 = response0 >> 9;
//Uart_Printf("Current Status=%d\n", response0);
if(response0==6)
Test_SDI();
rSDICSTA=0xa00; // Clear cmd_end(with rsp)
return 1;
}