By using the below code I could able to get the data transferred to the middle of the buffer but in liner(1D) condition only.
memcpy_all(Img_Data, 128, 128, 16, 16, Img_Buff+323152, 128, 128, 16, 16);
What I need is to transfer the data in 2D to make the image data overlay on the middle of image buffer.
The function that was used to for the DMA transfer is given below
void memcpy_all(int8u * pSource, int16u nSrcXCnt, int16u nSrcYCnt, int16u bySrcXMod,int16u bySrcYMod, int8u * pDestination, int16u nDstXCnt,
int16u nDstYCnt, int16u byDstXMod, int16u byDstYMod)
{
*pREG_DMA21_ADDRSTART = pSource;
*pREG_DMA21_XCNT = nSrcXCnt;
*pREG_DMA21_YCNT = nSrcYCnt;
*pREG_DMA21_XMOD = bySrcXMod;
*pREG_DMA21_YMOD = bySrcYMod;
ssync();
*pREG_DMA21_CFG = ENUM_DMA_CFG_ADDR2D | ENUM_DMA_CFG_STOP | ENUM_DMA_CFG_MSIZE16 | ENUM_DMA_CFG_PSIZE04 | ENUM_DMA_CFG_SYNC | ENUM_DMA_CFG_READ ;
*pREG_DMA22_ADDRSTART = pDestination;
*pREG_DMA22_XCNT = nDstXCnt;
*pREG_DMA22_YCNT = nDstYCnt;
*pREG_DMA22_XMOD = byDstXMod;
*pREG_DMA22_YMOD = byDstYMod;
ssync();
*pREG_DMA22_CFG = ENUM_DMA_CFG_ADDR2D | ENUM_DMA_CFG_STOP | ENUM_DMA_CFG_MSIZE16 | ENUM_DMA_CFG_PSIZE04 | ENUM_DMA_CFG_SYNC | ENUM_DMA_CFG_WRITE;
*pREG_DMA21_CFG |= ENUM_DMA_CFG_EN;
ssync();
*pREG_DMA22_CFG |= ENUM_DMA_CFG_EN;[[enter image description here](https://i.stack.imgur.com/F7z3H.jpg)](https://i.stack.imgur.com/GCcrb.jpg)
ssync();
while((*pREG_DMA22_STAT & BITM_DMA_STAT_RUN) >> BITP_DMA_STAT_RUN);
Delay(0xFF);
*pREG_DMA21_CFG &= ~ENUM_DMA_CFG_EN;
ssync();
*pREG_DMA22_CFG &= ~ENUM_DMA_CFG_EN;
ssync();
Kindly help me to get the image data[1281282] overlay to the middle of the image buffer[7205762] using BF609 processor.