DMA frame buffer copy

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • DMA frame buffer copy

      In an effort to optimize my application, I am investigating DMA transfer for frame buffer copies. The "Multiple Buffering" chapter in the manual describes how to inform emWin to use a custom callback routine in LCD_X_Config():

      LCD_SetDevFunc(0, LCD_DEVFUNC_COPYBUFFER, (void (*)())_CopyBuffer);

      The problem I'm having with DMA implementation is how to notify emWin that the buffer copy is completed. Since emWin is not expecting _CopyBuffer() to return anything, I end up with one of the following scenarios:
      1. DMA transfer is started inside _CopyBuffer() and the function returns. emWin thinks upon return that the frame buffer copy is done, so I end up with the incorrect buffer being displayed (flipping between buffers which are obviously wrong). I am using triple buffering.
      2. I create a loop inside _CopyBuffer() which waits for the DMA transfer to complete. This is no benefit over a standard memcpy().

      Am I missing something simple or is this just not possible?

      emWin V5.38
      NXP LPC546xx