User`s manual

PK2100
System Development s 4-5
lcd_printf( long cursor, char *fmt, arg... )
Print on the liquid crystal display screen. The variable cursor
determines the position of the cursor before and after the string of
characters determined by the format *fmt and the arguments
(arg...) is printed according to traditional printf conventions.
The cursor variable is a long integer consisting of four bytes, Y1, X1,
Y2, X2, where Y1 is in the most significant byte. The pair Y1, X1 is
the position of the cursor before writing and Y2, X2 is where the
cursor will be positioned after writing. The upper four bits of Y2
specify whether the cursor will be left on (1) or off (0) after the print is
complete. If *fmt is a null string, then only cursor positioning will
take place.
Lines On a 2 × 20 screen (Y values) are numbered 0 and 1. Columns
(X values) are numbered 0...19. A screen with four lines has lines
numbered 03.
The function lcd_printf is not reentrant. If it is used in a
multitasking environment, it is necessary to restrict lcd_printf to
only one task at a time. Several utility routines make this possible.
The following routines save and restore the contents of the liquid
crystal display screen. The program must have the token to use
these routines in a multitasking environment.
lcd_savscrn( struct lcd_scrn *s )
lcd_resscrn( struct lcd_scrn *s )
The following routines erase the screen or a line on the screen. The
user must have the token to call these routines in a multitasking
environment.
lcd_erase()
lcd_erase_line( int line ) // line is 0 or 1
A copy of the display contents and the location of the cursor is updated
in memory whenever lcd_printf prints to the liquid crystal display.
The function lcd_savscrn copies this image to a user-specified save
area. The function lcd_resscrn copies the screen save area back to
the screen and the image copy. A task can use these routines to
interrupt another task using the liquid crystal display, save the image,
use the liquid crystal display, restore the image, and return the liquid
crystal display to the original task.