SD卡的读取

2019-10-12 14:44发布


if(SDIO->RESP1&SD_CARD_LOCKED)return SD_LOCK_UNLOCK_FAILED;//¿¨ËøÁË
if((blksize>0)&&(blksize<=2048)&&((blksize&(blksize-1))==0))
{
  power=convert_from_bytes_to_power_of_two(blksize);
   

   SDIO_CmdInitStructure.SDIO_Argument =  blksize;//·&cent;&Euml;&Iacute;CMD16+&Eacute;è&Ouml;&Atilde;&Ecirc;&yacute;&frac34;&Yacute;&sup3;¤&para;&Egrave;&Icirc;&ordf;blksize,&para;&Igrave;&Iuml;ì&Oacute;&brvbar;
  SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_SET_BLOCKLEN;
  SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short;
  SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;
  SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;
  SDIO_SendCommand(&SDIO_CmdInitStructure);
  errorstatus=CmdResp1Error(SD_CMD_SET_BLOCKLEN); //&micro;&Egrave;&acute;&yacute;R1&Iuml;ì&Oacute;&brvbar;   
  if(errorstatus!=SD_OK)return errorstatus;    //&Iuml;ì&Oacute;&brvbar;&acute;í&Icirc;ó  
}else return SD_INVALID_PARAMETER;   
这段是原子的SD卡的读多块的程序,他是设置SD卡的快的大小,还是就是告诉SD卡传输过程中的数据快的大小呢(就是和设置SDIO_DCTRL,寄存器中的4到7位一样呢?)
求大神讲解一下

)
0条回答

一周热门 更多>