DS785UM1
8-15
Copyright 2007 Cirrus Logic
Graphics Accelerator
EP93xx User’s Guide
8
8
8
9. Setup BLKDESTWIDTH Register
Write ‘abs(X2 -X1) modulo 4096, minus 1’ to the WIDTH field in the
register.
10.Setup BLKDESTHEIGHT Register
Write ‘abs(Y2 - Y1) / 4096, minus 1’ to the HEIGHT field in the
register.
11.Setup BLOCKCTRL Register
A. Clear the
register by writing 0x0000_0000 to it.
B. Set the LINE bit to ‘1’
C. If X2 > X1, set the DXDIR bit to ‘1’, else set the DXDIR bit to ‘0’
D. If Y2 > Y1, set the DYDIR bit to ‘1’, else set the DYDIR bit to ‘0’
E. Either set the BG bit to ‘1’ to use the background color specified in
register or set the BG bit to ‘0’ for transparent background.
F. Set the P bits to the value for the desired BPP color depth
G. If interrupts are desired, set the INTEN bit to ‘1’
H. Set the EN bit to ‘1’
The final step is to wait for an interrupt or poll for EN = ‘0’ in the BLOCKCTRL register. When
the EN bit becomes cleared to ‘0’, the line draw function is complete.
8.6.2 Example of Breshenham’s Algorithm Line Draw
To achieve the following display and pattern, follow Steps 1 to 14 in this section.
•
Display size is 640 x 480 x 16-bits per pixel
•
Display memory starts at physical location 0x0000_0000
•
Pattern is 8 transparent pixels and 8 white pixels
•
X2 = 20, X1 = 101
•
Y2 = 20, Y1 = 301
The following sequence describes how to set up those registers that are used for a
Breshenham’s algorithm line draw.
1. Write XINIT = 0x800 (2048) and YINIT = 0x800 to the
register
2. Write PTTN = 0x00FF and CNT = 0xF to the
register
3. Write LEN = 0x140 to the
register, where LEN = 640 (pixels) x 1/2
(1 / # of 16-bit pixels in word) = 640 x 1/2 = 320 = 0x140
4. Write SPEL = 0x8 and EPEL = 0x0 to the
register, where:
Summary of Contents for EP93 Series
Page 28: ...P 6 DS785UM1 Copyright 2007 Cirrus Logic Preface EP93xx User s Guide PP P ...
Page 162: ...5 36 DS785UM1 Copyright 2007 Cirrus Logic System Controller EP93xx User s Guide 55 5 ...
Page 576: ...15 18 DS785UM1 Copyright 2007 Cirrus Logic UART2 EP93xx User s Guide 1515 15 ...
Page 634: ...17 38 DS785UM1 Copyright 2007 Cirrus Logic IrDA EP93xx User s Guide 1717 17 ...
Page 648: ...19 6 DS785UM1 Copyright 2007 Cirrus Logic Watchdog Timer EP93xx User s Guide 1919 19 ...
Page 688: ...21 32 DS785UM1 Copyright 2007 Cirrus Logic I2S Controller EP93xx User s Guide 2121 21 ...
Page 790: ...27 20 DS785UM1 Copyright 2007 Cirrus Logic IDE Interface EP93xx User s Guide 2727 27 ...
Page 808: ...28 18 DS785UM1 Copyright 2007 Cirrus Logic GPIO Interface EP93xx User s Guide 2828 28 ...