/*
 * $Id: lcd.h,v 1.3 1999/10/26 17:46:41 root Exp $
 *
 * $log:$
 */

#ifndef LCD_H
#define LCD_H

#define LCD_READEN  0x20
#define LCD_BUTS 0x8
#define LCD_RS	 0x4
#define LCD_RW   0x2
#define LCD_EN   0x1


#define LCD_BUTS_BUT1		0x20
#define LCD_BUTS_BUT2		0x80
#define LCD_BUTS_BUT3		0x40

#define LCD_BUTS_MASK		(LCD_BUTS_BUT1|LCD_BUTS_BUT2|LCD_BUTS_BUT3)

#define LCD_DDPOS 0x80
#define LCD_DDPOS_MASK 0x7f

#define LCD_CGPOS 0x40
#define LCD_CGPOS_MASK 0x3f

#define LCD_FNSET 0x20
#define LCD_FNSET_8BIT 		0x10
#define LCD_FNSET_2LINES 	0x08
#define LCD_FNSET_10SCANS	0x04

#define LCD_CSFT  0x10
#define LCD_CSFT_SCROLL		0x08
#define LCD_CSFT_DIR		0x04

#define LCD_DOOC  0x08
#define LCD_DOOC_DISPEN 	0x04
#define LCD_DOOC_CURSEN		0x02
#define LCD_DOOC_BLINK		0x01


#define LCD_EMOD  0x04
#define LCD_EMOD_DIR		0x02
#define LCD_EMOD_SCROLL		0x01

#define LCD_HOME  0x02

#define LCD_CLS	  0x01


#define LCD_STAT_BUSY		0x80


typedef struct Lcd_struct
  {
    char *name;                 /*Model name */
    int base;                   /*Base address */
    int epp;                    /*Epp port */
#define LCD_FONT_7  0
#define LCD_FONT_10 1
    int font;                   /*Font */
    int w;                      /*Chars */
    int h;                      /*Lines */
    int bpl;                    /*Bytes per line */
    int ctg;                    /*Non Contiguous screen mem, ie one line posing as two */

    int ddmem;                  /*where writing */
    int spos;                   /*Screen Pos */
    int mpos;                   /*Mem pos */
    int sinc;                   /*scrn inc */
    int minc;                   /*mem inc */
  }
 *Lcd;

#define LCD_LM020L	{"LM020L", 0, 0, LCD_FONT_7 ,  8, 2, 40, 1, 0, 0, 0, 0, 0}
#define LCD_H2571	{"H2571",  0, 0, LCD_FONT_10, 32, 1, 40, 0, 0, 0, 0, 0, 0}

#endif
