1 | Drivers for the Epson Graphic LCD Controller (GLC) chip
|
---|
2 | -------------------------------------------------------
|
---|
3 |
|
---|
4 | Document: glcfns.doc Version 3 1988-08-03
|
---|
5 |
|
---|
6 | Based on: glcinit.c Version 5 1988-08-03
|
---|
7 | glcdefs.h Version 3 1988-08-03
|
---|
8 | glcplot.s Version 2 1987-04-23
|
---|
9 |
|
---|
10 | --------------------------------------------------------------------------------
|
---|
11 |
|
---|
12 |
|
---|
13 | GLC Function synopsis:
|
---|
14 | ----------------------
|
---|
15 |
|
---|
16 | GLCcrc unsigned GLCcrc(row, col)
|
---|
17 | GLCcurs void GLCcurs(crs)
|
---|
18 | GLCcxy unsigned GLCcxy(x, y)
|
---|
19 | GLCdisp void GLCdisp(dsp, crs, blk1, blk2, blk3)
|
---|
20 | GLCinit void GLCinit()
|
---|
21 | GLCplot void GLCplot(x, y, val)
|
---|
22 | GLCtext void GLCtext(row, col, s)
|
---|
23 | GLCwrts void GLCwrts(s)
|
---|
24 |
|
---|
25 |
|
---|
26 | GLC Variable synopsis:
|
---|
27 | ----------------------
|
---|
28 |
|
---|
29 | lcdbase unsigned lcdbase; LCD graphics base address
|
---|
30 | lcdbit unsigned lcdbit; LCD graphics pixel bit mask
|
---|
31 | lcdcol unsigned lcdcol; LCD text column
|
---|
32 | lcdctl1 unsigned lcdctl1; LCD display control -- command
|
---|
33 | lcdctl2 unsigned lcdctl2; LCD display control -- data
|
---|
34 | lcdcurs unsigned lcdcurs; LCD graphics pixel byte address
|
---|
35 | lcdrow unsigned lcdrow; LCD text row
|
---|
36 | lcdx unsigned lcdx; LCD graphics x
|
---|
37 | lcdy unsigned lcdy; LCD graphics y
|
---|
38 |
|
---|
39 | |
---|
40 | GLC Constants:
|
---|
41 | --------------
|
---|
42 |
|
---|
43 | #define G_INIT (char)0x40 initialize GLC
|
---|
44 | #define G_MWRITE (char)0x42 set memory write mode
|
---|
45 | #define G_MREAD (char)0x43 set memory read mode
|
---|
46 | #define G_SETSAD (char)0x44 set scroll addresses
|
---|
47 | #define G_CRSWR (char)0x46 write cursor address
|
---|
48 | #define G_CRSRD (char)0x47 read cursor address
|
---|
49 | #define G_CRSMRT (char)0x4C set cursor direction - right
|
---|
50 | #define G_CRSMLT (char)0x4D set cursor direction - left
|
---|
51 | #define G_CRSMUP (char)0x4E set cursor direction - up
|
---|
52 | #define G_CRSMDN (char)0x4F set cursor direction - down
|
---|
53 | #define G_ERASE (char)0x52 erase
|
---|
54 | #define G_SLEEP (char)0x53 set sleep mode
|
---|
55 | #define G_DSPCTL (char)0x58 set display controls
|
---|
56 | #define G_HSCRL (char)0x5A set horizontal dot scroll
|
---|
57 | #define G_OVRLAY (char)0x5B set overlay mode
|
---|
58 | #define G_CGRAM (char)0x5C set CG RAM base
|
---|
59 | #define G_CRSFRM (char)0x5D set cursor format
|
---|
60 |
|
---|
61 | #define LCD_WC lcd_a1 write command address
|
---|
62 | #define LCD_RS lcd_a0 read status address
|
---|
63 | #define LCD_WD lcd_a0 write data address
|
---|
64 | #define LCD_RD lcd_a1 read data address
|
---|
65 |
|
---|
66 | #define G_PLANE1 (unsigned)0x0000 plane 1 base address
|
---|
67 | #define G_PLANE2 (unsigned)0x2000 plane 2 base address
|
---|
68 |
|
---|
69 | #define G_OFF 0 off
|
---|
70 | #define G_ON 1 on
|
---|
71 | #define G_B2 2 blink - FR/32
|
---|
72 | #define G_B1 3 blink - FR/64
|
---|
73 | |
---|
74 | GLC characteristics:
|
---|
75 | --------------------
|
---|
76 |
|
---|
77 | Graphics:
|
---|
78 |
|
---|
79 | 510 pixels wide by 64 pixels high.
|
---|
80 | Graphics are in plane 2.
|
---|
81 | X = 0, Y = 0 is the lower left corner of the display.
|
---|
82 |
|
---|
83 | Text:
|
---|
84 |
|
---|
85 | 8 rows by 85 columns
|
---|
86 | Text is in plane 1.
|
---|
87 | Row 0, Column 0 is the upper left corner of the display.
|
---|
88 |
|
---|
89 | Characters:
|
---|
90 |
|
---|
91 | Internal ASCII character generator.
|
---|
92 | 5 pixels wide by 7 pixels high, in a 6 by 8 block.
|
---|
93 |
|
---|
94 | G_INIT parameters:
|
---|
95 | ------------------
|
---|
96 |
|
---|
97 | 0x12 P1 IV, M/S, W/S, M2, M1, M0
|
---|
98 | 0x05 P2 WF, FX
|
---|
99 | 0x07 P3 FY
|
---|
100 | 0x54 P4 C/R
|
---|
101 | 0x58 P5 TC/R
|
---|
102 | 0x3F P6 L/F
|
---|
103 | 0x55 P7 APL
|
---|
104 | 0x00 P8 APH
|
---|
105 |
|
---|
106 | G_SETSAD parameters:
|
---|
107 | --------------------
|
---|
108 |
|
---|
109 | 0x00 P1 SAD1L
|
---|
110 | 0x00 P2 SAD1H
|
---|
111 | 0x3F P3 SL1
|
---|
112 | 0x00 P4 SAD2L
|
---|
113 | 0x20 P5 SAD2H
|
---|
114 | 0x3F P6 SL2
|
---|
115 | 0x00 P7 SAD3L
|
---|
116 | 0x00 P8 SAD3H
|
---|
117 |
|
---|
118 | |
---|
119 | GLC initialization values:
|
---|
120 | --------------------------
|
---|
121 |
|
---|
122 | G_INIT:
|
---|
123 | -------
|
---|
124 |
|
---|
125 | IV 0 correct screen to top line
|
---|
126 | M/S 1 master mode
|
---|
127 | W/S 0 single screen drive
|
---|
128 | M2 0 8 pixel wide CG
|
---|
129 | M1 0 32 character CG RAM area
|
---|
130 | M0 0 internal CG
|
---|
131 |
|
---|
132 | WF 0 "line reversion" drive
|
---|
133 | FX 0x05 6 pixel character block width
|
---|
134 |
|
---|
135 | FY 0x07 8 pixel character block height
|
---|
136 |
|
---|
137 | C/R 0x54 85 characters per line
|
---|
138 |
|
---|
139 | TC/R 0x58 89 scan times per line
|
---|
140 |
|
---|
141 | L/F 0x3F 64 lines
|
---|
142 |
|
---|
143 | APL,APH 0x0055 virtual screen size = 85 characters
|
---|
144 |
|
---|
145 |
|
---|
146 | G_SETSAD:
|
---|
147 | ---------
|
---|
148 |
|
---|
149 | SAD1 0x0000 plane 1 (text plane) address = 0x0000
|
---|
150 |
|
---|
151 | SL1 0x3F plane 1 height = 64 lines
|
---|
152 |
|
---|
153 | SAD2 0x2000 plane 2 (graphics plane) address = 0x2000
|
---|
154 |
|
---|
155 | SL2 0x3F plane 2 height = 64 lines
|
---|
156 | |
---|
157 | Functions:
|
---|
158 | ----------
|
---|
159 |
|
---|
160 | unsigned
|
---|
161 | GLCcrc(row, col)
|
---|
162 | unsigned row, col;
|
---|
163 |
|
---|
164 | Positions the GLC cursor at ('row', 'col') preparatory
|
---|
165 | to writing text. Returns the calculated cursor address.
|
---|
166 |
|
---|
167 | GLCcurs(crs)
|
---|
168 | short crs;
|
---|
169 |
|
---|
170 | Turns the cursor on or off.
|
---|
171 |
|
---|
172 | unsigned
|
---|
173 | GLCcxy(x, y)
|
---|
174 | unsigned x, y;
|
---|
175 |
|
---|
176 | Positions the GLC cursor at ('x', 'y') preparatory to
|
---|
177 | writing graphics. Returns a bit mask for the pixel.
|
---|
178 | Leaves the cursor address in lcdcurs.
|
---|
179 | Limits: 0 LE x LE 511, 0 LE y LE 63.
|
---|
180 |
|
---|
181 | GLCdisp(dsp, crs, blk1, blk2, blk3)
|
---|
182 | short dsp, crs, blk1, blk2, blk3;
|
---|
183 |
|
---|
184 | Sets the overall display, cursor and block status values.
|
---|
185 |
|
---|
186 | GLCinit()
|
---|
187 |
|
---|
188 | Initializes the GLC.
|
---|
189 |
|
---|
190 | GLCplot(x, y, val)
|
---|
191 | unsigned x, y, val;
|
---|
192 |
|
---|
193 | Plots a dot at x, y. The dot will be dark if val is non-zero.
|
---|
194 |
|
---|
195 | GLCtext(row, col, s)
|
---|
196 | unsigned row, col;
|
---|
197 | char *s;
|
---|
198 |
|
---|
199 | Sets the GLC cursor to ('row', 'col'), then writes the
|
---|
200 | character string pointed to by 's'.
|
---|
201 | Cursor must start and end on the same line.
|
---|
202 | No error checks are done.
|
---|
203 |
|
---|
204 | GLCwrts(s)
|
---|
205 | char *s;
|
---|
206 |
|
---|
207 | Writes the character string pointed to by 's' at the
|
---|
208 | current cursor position on the LCD display.
|
---|
209 | Cursor must start and end on the same line.
|
---|
210 | No error checks are done.
|
---|