Texas Instruments TMS320C64x DSP User Manual

Page 295

Advertising
background image

Example 2: Noncontinuous Frame Display for 525/60 Format

A-19

Video Port Configuration Examples

SPRU629

/* enable three EDMA channels

*/

EDMA_enableChannel(hEdmaVPDispY);
EDMA_enableChannel(hEdmaVPDispCb);
EDMA_enableChannel(hEdmaVPDispCr);

}

/*–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– */
/* Function : configVPDispEDMAChannel */
/* */
/* Input(s) : edmaHandle – pointer to EDMA handle. */
/* eventId – EDMA eventId. */
/* tccNum – pointer to transfer complete number. */
/* srcAddr – source address for EDMA transfer. */
/* dstAddr – destination address for EDMA transfer */
/* frameCount – frame count. */
/* elementCount – element count(32–bit element size). */
/* */
/* Output(s): edmaHandle – edma Handle of the given event. */
/* tccNum – transfer complete code for the given */
/* event. */
/* */
/* Description : Configures the given VP display EDMA channel. */
/* The destination address update is fixed because */
/* the displayed data is write to the FIFO. */
/* In this example, the source address mode is */
/* auto–increment. But, in real–time applications */
/* there is lot of flexibility in the way display */
/* buffers can be managed like ping–pong and round */
/* robin,

etc. */

/*–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– */
void configVPDispEDMAChannel(EDMA_Handle *edmaHandle,
Int32 eventId, Int32 *tccNum,
Uint32 srcAddr, Uint32 dstAddr,
Uint32 frameCount, Uint32 elementCount)
{

Int32 tcc = 0;

/* Open Y event 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);

Advertising