NAR-4040 User’s Manual
53
5.9 Sample
Code
/* *************************************
* EZIO RS232 LCD Control Sample Program
* *************************************
* *************************************************************************
* Company:
Portwell Inc.
* Date:
4/16/2003
* Program:
02A.c
* Version:
1.02
* Compile:
Linux GNU C
* Purpose:
Direct access to EZIO LCD, the program will display
*
messages according to the control button. The current
*
version only has the following function:
*
*
1: display welcome message
*
2: display UP message if "scroll up" button is pressed
*
3: display ENTER message if "ENTER" button is pressed
*
4: display ESC message if "ESC" button is pressed
*
5: display DOWN message if "scroll down" button is pressed
*
* Program Overview:
*
*
- Parameters:
*
fd
: a file name for open() method, here represents the com port
*
Cmd
:
command
prefix
*
cls
:
clear
command
*
init
:
initialize
command
*
blank
: display blank screen
*
stopsend
: stop input/output
*
home
: move cursor to initial position
*
readkey
: set to read from EZIO
*
hide
: hide cursor & display blanked characters
*
movel
: move cursor one character left
*
mover
: move cursor one character right
*
turn
: turn on blinking-block cursor
*
show
: turn on underline cursor
*
scl
: scroll cursor one character left
*
scr
: scroll cursor one character right
*
setdis
: set character-generator address
*
* -
Procedure:
*
1. The program sets up the environment, i.e. com port settings.
*
2. The main function MUST call init() twice to initialize EZIO
*
before any communication.
*
3. For executing any command, the command prefix, Cmd, MUST be
*
called be command. So all command contains two parts, eg.
*
to initialize the sequence of HEX number is 0xFE, 0x25.
*
4. After clear screen and display welcome message, ReadKey()
*
method must be call to advise EZIO for reading data.
*
5. A pooling method is implemented to get input from EZIO while
*
any button is pressed.
*
*
- NOTE: This program is a sample program provided " AS IS" with NO
*
warranty.
*
* Copyright (c) Portwell, Inc. All Rights Reserved.
*
* ************************************************************************/
Summary of Contents for NAR-4040
Page 3: ...NAR 4040 User s Manual 2 5 9 Sample Code 53 ...
Page 27: ...Fig 3 2 PPAP 3711VL System Block Diagram NAR 4040 User s Manual 26 ...
Page 46: ...NAR 4040 User s Manual 45 pop dx pop cx ret FIXDELAY ENDP END programstart ...
Page 53: ...NAR 4040 User s Manual 52 5 8 Character Generator ROM CGROM ...