NAR-5620 Series
User
’
s
Manual
46
*
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.
*
* ************************************************************************/
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
static int fd;
void SetEnvironment () {
system("stty ispeed 2400 < /dev/ttyS1");
system("stty raw < /dev/ttyS1");
}
int Cmd = 254; /* EZIO Command */
int cls = 1;
/* Clear screen */
void Cls () {
write(fd,&Cmd,1);
write(fd,&cls,1);
}
int init = 0x28;
void Init () {
write(fd,&Cmd,1);