User`s manual
OP710076
Graphics Programming
Initialization
The OP7100, unlike most other Rabbit Semiconductor controllers, uses the
maximum I/O and memory wait states when main() gets control. The wait
states can be reduced to improve performance. The following statement
sets up the proper wait states for the standard OP7100 (using a 90 ns flash
memory).
outport(DCNTL,(inport(DCNTL)&0xf)|0x60);
The graphic LCD can be set up by a simple function call to
op71Init();
This function initializes and starts the LCD controller before supplying
voltage to the LCD screen.
The backlight is controlled by op71BackLight(int isOn). Pass zero to
turn off the backlight (default) or a non-zero value to turn on the backlight.
If you have an OP7100 equipped with software contrast control, call
op71SetContrast(unsigned level) to change contrast. The range
of level is from 0 to 63. A level of 30 usually yields reasonable contrast
at room temperature.
Drawing Primitives
You can draw various objects on the LCD. Before doing any drawing,
specify the type of the "brush" by calling op71SetBrushType(int
type)
. Four brush macros are supported:
GL
_
SET sets the pixels as specified by the plot commands, but leaves
other pixels alone;
GL
_
CLEAR clears the pixels as specified by the plot commands, but
leaves other pixels alone;
GL
_
XOR toggles the pixels as specified by the plot command, but
leaves other pixels alone;
GL
_
BLOCK forces the value of pixels in groups of eight vertical
pixels. GL
_
BLOCK is useful when speed is important, the current
pixels need to be overwritten, and the overwriting pixels are
aligned in eight-pixel rows.
Plot a Pixel
• int op71PlotDot(int x, int y);
x and y are the coordinates, the upper left corner is (0,0).
Figure 3-8 shows the coordinate system for the LCD pixels.