各位专家好:
我提出的问题不是像例程一样,在for循环里跑多个channel:
/* Run the test for EDMA Instance 1 and 2; both have the same limits. */
for (instNum = 1; instNum < 3; instNum++)
{
/* EDMA Instance 1 and 2: Supports 64 DMA Channels. */
for (channelNum = 0; channelNum < 64; channelNum++)
{
if (edma_ping_pong_xfer_gbl_region(instNum, channelNum) < 0)
{
printf("Error: Testing EDMA(%d) Ping-Pong Test (Global) Region for Channel %d FAILED\n",
instNum, channelNum);
return;
}
printf("Debug: Testing EDMA(%d) Ping-Pong Test (Global) Region for Channel %d Passed\n",
instNum, channelNum);
}
}
我的意思是在打开一个EDMA的model之后,同时打开两个通道,即:
//打开edma实例
hEdmaModule = CSL_edma3Open(&edmaObj, instNum, NULL, &status);
if ( (hEdmaModule == NULL) || (status != CSL_SOK))
{
printf ("Error: EDMA module open failed\n");
}
//打开读通道
chAttr.regionNum = CSL_EDMA3_REGION_GLOBAL;
chAttr.chaNum = channelNum_Read;
hEdmaReadChannel = CSL_edma3ChannelOpen(&chObj, instNum, &chAttr, &status);
if ((hEdmaReadChannel == NULL) || (status != CSL_SOK))
{
printf ("Error: Unable to open EDMA Channel:%d\n", channelNum_Read);
}
//打开写通道
chAttr.regionNum = CSL_EDMA3_REGION_GLOBAL;
chAttr.chaNum = channelNum_write;
hEdmaWriteChannel = CSL_edma3ChannelOpen(&chObj, instNum, &chAttr, &status);
if ((hEdmaWriteChannel == NULL) || (status != CSL_SOK))
{
printf ("Error: Unable to open EDMA Channel:%d\n", channelNum_write);
}
跑我上面的代码,我做实验验证了:打开的channel等于EDMA实例对象的句柄,多次调用函数CSL_edma3ChannelOpen()函数,写入相同的instNum和不同的chAttr.chaNum,后写入的chaNum会覆盖在原有的chAttr.chaNum上。且打开的通道指向一个model的同一块地址。所以我才想问,是不是对于一个edma只能同时跑一个通道?如果需要同时读写两个通道,是不是得用两个edma instance?
(另:附上目前的EDMA信道控制器的框图)