Post Go back to editing

To transfer the Img_Data[128*128*2] to the middle of Img_Buff[720*576*2] using MDMA Transfer in BF609 Processor

Category: Software
Product Number: BF609

What i need is to transfer the data in 2D transfer to make the data image overlay on the bugger image. 

memcpy_all(Img_Data, 128, 128, 16, 16, Img_Buff+323152, 128, 128, 16, 16);

The function i used is below & the Msize Configured is 16 Bytes

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;[[e
    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 overlay an image data to the Centre of image buffer



Edited the unwanted links in function
[edited by: NavDel at 12:18 PM (GMT -4) on 11 May 2023]