![background image](http://html.mh-extra.com/html/texas-instruments/tvp4020-permedia-2/tvp4020-permedia-2_reference-manual_1097169025.webp)
Programming Model
TVP4020
Programmers Reference Manual
16
0x003280F0
value 1
value 2
value 3
The Mode bits are set to 2 so this is indexed mode. The Mask field
(0x0032) has 3 bits set so there are three data words following the tag
description word. Bits 1, 4 and 5 are set so the tag offsets are 1, 4 and 5.
The major group is given by the bits 4-8 which are 0x0F (in indexed
mode bits 0-3 are ignored). Thus the actual registers to update have
address tags 0x0F1, 0x0F4 and 0x0F5. These are updated with value 1,
value 2 and value 3 respectively.
DMA Example
The following pseudo-code shows the previous example of drawing a
series of rectangles but this time using the DMA controller. This example
uses a single DMA buffer and the simplest Hold Mode for the tag
description words in the buffer.
UINT32
*pbuf;
DMAAddress (physical address of dma_buffer)
while (*DMACount != 0)
;
// wait for DMA to complete
pbuf = dma_buffer;
*pbuf++ = PERMEDIATagdXDom;
*pbuf++ = 0;
*pbuf++ = PERMEDIATagdXSub;
*pbuf++ = 0;
*pbuf++ = PERMEDIATagdY;
*pbuf++ = 1 << 16;
for (i = 0; i < nrects; ++i) {
*pbuf++ = PERMEDIATagStartXDom;
*pbuf++ = rect->x1 << 16; // Start dominant edge
*pbuf++ = PERMEDIATagStartXSub
*pbuf++ = rect->x2 << 16; // Start of subordinate edge
*pbuf++ = PERMEDIATagCount;
*pbuf++ = rect->y2 - rect->y1;
*pbuf++ = PERMEDIATagYStart;
*pbuf++ = rect->y1 << 16;
*pbuf++ = PERMEDIATagRender;
*pbuf++ = PERMEDIA_TRAPEZOID_PRIMITIVE;
}
// initiate DMA
DMACount((int)(pbuf - dma_buffer))
Summary of Contents for TVP4020 PERMEDIA 2
Page 1: ...Texas Instruments TVP4020 PERMEDIA 2 Programmer s Reference Manual Issue 4 ...
Page 284: ...TVP4020 Programmers Reference Manual A Gouraud Shaded Triangle 275 ...
Page 292: ...TVP4020 Programmers Reference Manual Register Tables 283 ...
Page 314: ...TVP4020 Programmers Reference Manual Index 305 ...
Page 315: ...Index TVP4020 Programmers Reference Manual 306 Index ...
Page 323: ...Index TVP4020 Programmers Reference Manual 314 ...