/* -------------------------------------------------------------------- */
/* NAME : eve_dma_macros.h                                              */
/*                                                                      */
/* DESCRIPTION:                                                         */
/*                                                                      */
/* This file contains macros to trigger a DMA transfer DMA_SUBMIT(),    */
/* and check for transfer completion DMA_WAIT().                        */
/*                                                                      */
/* DMA_SUBMIT accepts a wait_word that will set one or several events   */
/* on event set register (ESR). wait_word is a compilation of the event */   
/* numbers associated with each transfer request.                       */
/*                                                                      */
/* DMA_WAIT polls the interrupt pending register (IPR) to check for     */
/* transfer completion of the events triggered in DMA_SUBMIT. It        */
/* accepts a wait_word that is a compilation of the unique transfer     */
/* complete codes (tcc) that are associated with each event.            */ 
/*                                                                      */
/* Since the wait and submit words can have multiple events associated  */
/* with them, we can trigger multiple transfers and check for their     */
/* completion in one call.                                              */
/* -------------------------------------------------------------------- */    

#define DMA_SUBMIT(submit_word)  edma_cc->ESR  = submit_word;


#define DMA_WAIT(wait_word) {                                          \
                               while  ((edma_cc->IPR & wait_word) != wait_word);   \
                               edma_cc->ICR  = wait_word;              \
                            }

