在c55_csl_3.07里面的CSL_MMCSD_SdCardFSExample例程中,有一个是通过DMA向SD卡中写入数据,即mmcConfigFs("dmaTest");但是查看mmcConfigFs函数,没有发现和DMA相关的内容,关键语句就是ATA_write(pAtaFile, gMmcWriteBuf, 1);,这个ATA_write函数也好像没有区分是poll模式还是DMA模式。请问通过DMA想SD卡写入数据是如何操作的?谢谢
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
在c55_csl_3.07里面的CSL_MMCSD_SdCardFSExample例程中,有一个是通过DMA向SD卡中写入数据,即mmcConfigFs("dmaTest");但是查看mmcConfigFs函数,没有发现和DMA相关的内容,关键语句就是ATA_write(pAtaFile, gMmcWriteBuf, 1);,这个ATA_write函数也好像没有区分是poll模式还是DMA模式。请问通过DMA想SD卡写入数据是如何操作的?谢谢
这里设置了。
/* Configure the DMA in case of operating mode is set to DMA */
if(opMode == CSL_MMCSD_OPMODE_DMA)
{
/* Initialize Dma */
status = DMA_init();
if (status != CSL_SOK)
{
printf("DMA_init Failed!\n");
return(status);
}
/* Open Dma channel for MMCSD write */
dmaWrHandle = DMA_open(CSL_DMA_CHAN0, &dmaWrChanObj, &status);
if((dmaWrHandle == NULL) || (status != CSL_SOK))
{
printf("DMA_open for MMCSD Write Failed!\n");
return(status);
}
/* Open Dma channel for MMCSD read */
dmaRdHandle = DMA_open(CSL_DMA_CHAN1, &dmaRdChanObj, &status);
if((dmaRdHandle == NULL) || (status != CSL_SOK))
{
printf("DMA_open for MMCSD Read Failed!\n");
return(status);
}
/* Set the DMA handle for MMC read */
status = MMC_setDmaHandle(mmcsdHandle, dmaWrHandle, dmaRdHandle);
if(status != CSL_SOK)
{
printf("API: MMC_setDmaHandle for MMCSD Failed\n");
return(status);
}