|
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
|