2 * Base driver module for Toshiba T6963 based LCD displays ver 2.2
3 * ( ver 2.* is not at all compatible to 1.* versions!)
5 * Parts of this file are based on the kernel driver by Alexander Frink <Alexander.Frink@Uni-Mainz.DE>
7 * This file is released under the GNU General Public License. Refer to the
8 * COPYING file distributed with this package.
10 * Copyright (c) 2001 Manuel Stahl <mythos@xmythos.de>
14 * 1 (Strobe) ----------- 5 (WR)
15 * 2-9 (Data) ----------- 11-18 (Data)
16 * 14 (Autofeed) -------- 7 (CE)
17 * 16 (Init) ------------ 8 (C/D)
18 * 17 (Slct) ------------ 6 (RD)
19 * 18 (GND) ------------- 3 (GND)
20 * +5V ------------------ 3(LCD +)
29 #define DEFAULT_CELL_WIDTH 6
30 #define DEFAULT_CELL_HEIGHT 8
31 #define DEFAULT_SIZE "20x6"
32 #define DEFAULT_PORT 0x378
33 #define DEFAULT_WRHI 0x04
34 #define DEFAULT_WRLO 0xfb
35 #define DEFAULT_CEHI 0xfe
36 #define DEFAULT_CELO 0x01
37 #define DEFAULT_CDHI 0xf7
38 #define DEFAULT_CDLO 0x08
39 #define DEFAULT_RDHI 0xfd
40 #define DEFAULT_RDLO 0x02
45 #define CUR_LOWER_THIRD 3
46 #define CUR_LOWER_HALF 4
47 #define CUR_TWO_THIRDS 5
52 #define T6963_DATAIN(p) port_out(T6963_CONTROL_PORT(p), port_in(T6963_CONTROL_PORT(p)) | 0x20)
54 #define T6963_DATAOUT(p) port_out(T6963_CONTROL_PORT(p), port_in(T6963_CONTROL_PORT(p)) & 0xdf)
56 #define TEXT_BASE 0x0000
57 #define ATTRIB_BASE 0x7000
58 #define CHARGEN_BASE 0xF000
60 #define SET_CURSOR_POINTER 0x21
61 #define SET_OFFSET_REGISTER 0x22
62 #define SET_ADDRESS_POINTER 0x24
64 #define SET_TEXT_HOME_ADDRESS 0x40
65 #define SET_TEXT_AREA 0x41
66 #define SET_GRAPHIC_HOME_ADDRESS 0x42
67 #define SET_GRAPHIC_AREA 0x43
71 #define EXOR_MODE 0x01
73 #define ATTRIBUTE_MODE 0x04
74 #define INTERNAL_CG 0x00
75 #define EXTERNAL_CG 0x08
77 #define SET_DISPLAY_MODE 0x90
79 #define CURSOR_ON 0x02
81 #define GRAPHIC_ON 0x08
83 #define SET_CURSOR_PATTERN 0xa0
85 #define DATA_WRITE_INC 0xc0
86 #define DATA_READ_INC 0xc1
87 #define DATA_WRITE_DEC 0xc2
88 #define DATA_READ_DEC 0xc3
89 #define DATA_WRITE 0xc4
90 #define DATA_READ 0xc5
92 #define AUTO_WRITE 0xb0
93 #define AUTO_READ 0xb1
94 #define AUTO_RESET 0xb
96 #define POSITION(x,y) ((y)*lcd.wid + (x))
98 #define T6963_DATA_PORT(p) (p)
99 #define T6963_STATUS_PORT(p) ((p)+1)
100 #define T6963_CONTROL_PORT(p) ((p)+2)
103 // ****************************************************************************************
104 // * V A R I A B L E S *
105 // ****************************************************************************************
107 typedef unsigned short u16
;
108 typedef unsigned char u8
;
110 // ****************************************************************************************
111 // * F U N C T I O N S *
112 // ****************************************************************************************
115 MODULE_EXPORT
int t6963_init (Driver
*drvthis
);
116 MODULE_EXPORT
void t6963_close (Driver
*drvthis
);
117 MODULE_EXPORT
int t6963_width (Driver
*drvthis
);
118 MODULE_EXPORT
int t6963_height (Driver
*drvthis
);
119 MODULE_EXPORT
void t6963_clear (Driver
*drvthis
);
120 MODULE_EXPORT
void t6963_flush (Driver
*drvthis
);
121 MODULE_EXPORT
void t6963_string (Driver
*drvthis
, int x
, int y
, const char string
[]);
122 MODULE_EXPORT
void t6963_chr (Driver
*drvthis
, int x
, int y
, char c
);
124 MODULE_EXPORT
void t6963_vbar (Driver
*drvthis
, int x
, int y
, int len
, int promille
, int options
);
125 MODULE_EXPORT
void t6963_hbar (Driver
*drvthis
, int x
, int y
, int len
, int promille
, int options
);
126 MODULE_EXPORT
void t6963_num (Driver
*drvthis
, int x
, int num
);
127 MODULE_EXPORT
int t6963_icon (Driver
*drvthis
, int x
, int y
, int icon
);
129 MODULE_EXPORT
void t6963_set_char (Driver
*drvthis
, int n
, char *dat
);
132 void t6963_graphic_clear (Driver
*drvthis
, int x1
, int y1
, int x2
, int y2
);
133 void t6963_set_nchar (Driver
*drvthis
, int n
, unsigned char *dat
, int num
);
135 void t6963_low_set_control(Driver
*drvthis
, char wr
, char ce
, char cd
, char rd
);
136 void t6963_low_dsp_ready(Driver
*drvthis
);
138 void t6963_low_data(Driver
*drvthis
, u8 byte
);
139 void t6963_low_command (Driver
*drvthis
, u8 byte
);
141 void t6963_low_command_byte(Driver
*drvthis
, u8 cmd
, u8 byte
);
142 void t6963_low_command_2_bytes(Driver
*drvthis
, u8 cmd
, u8 byte1
, u8 byte2
);
143 void t6963_low_command_word(Driver
*drvthis
, u8 cmd
, u16 word
);
145 void t6963_low_enable_mode (Driver
*drvthis
, u8 mode
);
146 void t6963_low_disable_mode (Driver
*drvthis
, u8 mode
);
148 void t6963_swap_buffers(Driver
*drvthis
);