case CTRL_SYNC: //等待写过程 SD_CS(0); //选中SD卡 if(SD_Wait_Ready())result = RES_ERROR;/*等待卡准备好*/ else res = RES_OK; //成功 SD_CS(1); //释放SD卡 break; case GET_SECTOR_SIZE://获取扇区大小 *(DWORD*)buff = 512; res = RES_OK; //成功 break; cas...
void *buff /* Buffer to send/receive control data */ ) { if (drv==0) { switch (ctrl) { case CTRL_SYNC : return RES_OK; case GET_SECTOR_COUNT : return RES_OK; case GET_BLOCK_SIZE : return RES_OK; case CTRL_POWER : break; case CTRL_LOCK : break; case CTRL_EJECT : break;...
case CTRL_SYNC: res = RES_OK; break; case GET_SECTOR_SIZE: *(DWORD*)buff = 512; res = RES_OK; break; case GET_BLOCK_SIZE: *(WORD*)buff = SDCardInfo.CardBlockSize; res = RES_OK; break; case GET_SECTOR_COUNT: *(DWORD*)buff = SDCardInfo.CardCapacity/512; res = RES_OK; b...
22.2 硬件设计 22.3 程序设计 22.4 运行验证 22.1 FATFS简介 FATFS是一个完全免费开源的FAT/exFAT...
switch (ctrl) { case CTRL_SYNC : return RES_OK; case GET_SECTOR_COUNT : return RES_OK; case GET_BLOCK_SIZE : return RES_OK; case CTRL_POWER : break; case CTRL_LOCK : break; case CTRL_EJECT : break; /* MMC/SDC command */ ...
switch (ctrl) { case CTRL_SYNC : return RES_OK; case GET_SECTOR_COUNT : return RES_OK; case GET_BLOCK_SIZE : return RES_OK; case CTRL_POWER : break; case CTRL_LOCK : break; case CTRL_EJECT : break; /* MMC/SDC command */ ...
case CTRL_SYNC: if(SD_GetTransferState()==SD_NO_TRANSFER) { res = RES_OK; } else { res = RES_ERROR; } break; case GET_BLOCK_SIZE: *(WORD*)buff = 512; res = RES_OK; break; case GET_SECTOR_COUNT: //读卡容量 ///formula of the capacity/// // // memory capacity...
caseCTRL_SYNC: res=RES_OK; break; /* Get number of sectors on the disk (DWORD) */ caseGET_SECTOR_COUNT: if(USBH_MSC_GetLUNInfo(&hUsbHostFS,lun,&info)==USBH_OK) { *(DWORD*)buff=info.capacity.block_nbr; res=RES_OK;
case CTRL_SYNC: //等待写过程 SD_CS(0); //选中SD卡 if(SD_Wait_Ready())result = RES_ERROR;/*等待卡准备好*/ else res = RES_OK; //成功 SD_CS(1); //释放SD卡 break; case GET_SECTOR_SIZE://获取扇区大小 *(DWORD*)buff = 512; ...
16. case CTRL_SYNC: 17. break; 18. case GET_SECTOR_COUNT: // 扇区个数 19. *(DWORD*)buff = Flash_Sector_Count; 20. break; 21. case GET_SECTOR_SIZE: // 扇区大小 22. *(WORD*)buff = Flash_Sector_Size; 23. break; 24. case GET_BLOCK_SIZE: // 每次最少擦除扇区个数 ...