|
Using
a Graphics-Based LCD
Module with C
by Bob Perrin and Tak Auyeung
Start ý Software
Overview ý The Bottom Layer ý Initializing
the LCD Display ý Shadow Display ý
Drawing Dots and Lines ý Printing
Text ý Extensions ý Sources
and PDF
EXTENSIONS
The driver discussed in this article
is a good start for many applications. Interesting extensions include
functions that perform the following tasks:
ý read from a bitmap (.bmp)
file and display the bitmap on the LCD
ý read from the display and save either
the bitmap of the entire screen or a rectangle to a .bmp
file
ý draw circles
ý scroll a rectangle area vertically
ý scroll a rectangle area horizontally
There is also room for efficiency improvement
in the implementation of the driver code. Rewriting in assembly can
further optimize some code (especially the bit-banging code). Specialized
cases can improve the efficiency of some C code.
WRAPPING IT UP
For this article, we put together a system
of simple hardware and portable C code that allows a graphics-based
LCD to be driven from an embedded controller. The schematic in Figure
1 and the code in glcd.c and glcd.h can be used freely
as is or adapted for your application.
Using a graphics LCD is a bit more complicated
than using a simple bit-mapped LCD module, but with a little work
at the driver level, software can abstract the difficulties from the
application. If your next project can benefit from a graphics-based
display, you now have the basics required to design one into your
system.
PREVIOUS
NEXT
Circuit Cellar provides up-to-date information
for engineers. Visit www.circuitcellar.com
for more information and additional articles.
For subscription information, call (860) 875-2199, subscribe@circuitcellar.com
or subscribe
online. ýCircuit Cellar, the Magazine for Computer Applications.
Posted with permission.
|