Part Number:PROCESSOR-SDK-OMAPL138
Tool/software: TI-RTOS
Hi All,
Recently. I have started with OMAPL138 TI RTOS.
I have started with SPI interface, in PDK_omapl138_1_0_5 Am able to get examples of SPI configuration in polling, interrrupt mode and it is working properly, Now, Am trying to configure SPI with EDMA support, but couldn't find any example for SPI DMA configuration.
I have tried configuring DMA support for SPI as follows, but it is not working. Can any one help me to configure DMA for SPI.
SPI_v0_HWAttrs spi_cfg;
/* Get the default UART init configurations */
SPI_socGetInitCfg(SPI_INSTANCE, &spi_cfg);
spi_cfg.enableIntr = false;
spi_cfg.edmaHandle = SPIApp_edmaInit();
spi_cfg.dmaMode = true;
spi_cfg.csNum = 0;
SPI_socSetInitCfg(SPI_INSTANCE, &spi_cfg);
SPI_Params_init(&spiParams);
spiParams.frameFormat = SPI_POL0_PHA1;
spiParams.mode = SPI_MASTER;
// spiParams.dataSize = 16;
/* Init SPI driver */
SPI_init();
hwHandle = (SPI_Handle)SPI_open(SPI_INSTANCE, &spiParams);
if (!hwHandle)
{
testPassed = false;
}
/* Enable transfer */
xferEnable = 1;
SPI_control(hwHandle, SPI_V0_CMD_XFER_ACTIVATE, (void *)&xferEnable);
while(1)
{
/*Assign TXbuff and Rxbuff to hwHandle*/
retVal = SPI_transfer(hwHandle, &transaction);
delay(1000);
if (retVal == false)
{
testPassed = false;
}
}
/*DMA initialization*/
static EDMA3_RM_Handle MCSPIApp_edmaInit(void)
{
EDMA3_DRV_Result edmaResult = EDMA3_DRV_E_INVALID_PARAM;
static EDMA3_RM_Handle gEdmaHandle = NULL;
uint32_t edma3Id = 0;
gEdmaHandle = (EDMA3_RM_Handle)edma3init(edma3Id, &edmaResult);
if (edmaResult != EDMA3_DRV_SOK)
{
/* Report EDMA Error */
System_printf("\nEDMA driver initialization FAIL\n");
}
else
{
System_printf("\nEDMA driver initialization pass.\n");
}
return(gEdmaHandle);
}
Thanks,
Bhargavi.