Texas Instruments TMS320C64x DSP User Manual

Page 285

Advertising
background image

Example 1: Noncontinuous Frame Capture for 525/60 Format

A-9

Video Port Configuration Examples

SPRU629

void configVPCapEDMAChannel(EDMA_Handle *edmaHandle, Int32 eventId,

Int32 *tccNum, Uint32 srcAddr,

Uint32 dstAddr, Uint32 frameCount,

Uint32 elementCount)

{

Int32 tcc = 0;

/* Open Y EVT EDMA channel

*/

*edmaHandle = EDMA_open(eventId, EDMA_OPEN_RESET);

if(*edmaHandle == EDMA_HINV)

test_exit(FAIL);

/* allocate TCC for Y event

*/

if((tcc = EDMA_intAlloc(–1)) == –1)

test_exit(FAIL);

/* Configure EDMA parameters

*/

EDMA_configArgs(

*edmaHandle,

EDMA_OPT_RMK(

EDMA_OPT_PRI_MEDIUM, /* medium priority */

EDMA_OPT_ESIZE_32BIT, /* Element size 32 bits */

EDMA_OPT_2DS_NO, /* 1–dimensional source(FIFO) */

EDMA_OPT_SUM_NONE, /* fixed src address mode(FIFO) */

EDMA_OPT_2DD_YES, /* 2–dimensional destination */

EDMA_OPT_DUM_INC, /* destination increment */

EDMA_OPT_TCINT_YES, /* Enable transfer complete */

/* indication */

EDMA_OPT_TCC_OF(tcc & 0xF),

EDMA_OPT_TCCM_OF(((tcc & 0x30) >> 4)),

EDMA_OPT_ATCINT_NO, /* Disable Alternate Transfer */

/* Complete Interrupt */

EDMA_OPT_ATCC_OF(0),

EDMA_OPT_PDTS_DISABLE, /* disable PDT(peripheral device */

/* transfer) mode for source */

EDMA_OPT_PDTD_DISABLE, /* disable PDT mode for dest */

EDMA_OPT_LINK_NO, /* Disable linking */

EDMA_OPT_FS_NO /* Array synchronization */

),

EDMA_SRC_RMK(srcAddr),

EDMA_CNT_RMK(EDMA_CNT_FRMCNT_OF((frameCount – 1)),

EDMA_CNT_ELECNT_OF(elementCount)),

EDMA_DST_RMK(dstAddr),

EDMA_IDX_RMK(EDMA_IDX_FRMIDX_OF((elementCount * 4)),

EDMA_IDX_ELEIDX_OF(0)), /* note: 32–bit element size */

/* no RLD in 2D and no linking */

EDMA_RLD_RMK(EDMA_RLD_ELERLD_OF(0), EDMA_RLD_LINK_OF(0))

);

*tccNum = tcc;

}

Advertising