1 |
--- lcdproc-0.5.2/server/drivers/Makefile.am.roamer 2007-04-14 08:39:53.000000000 -0600 |
2 |
+++ lcdproc-0.5.2/server/drivers/Makefile.am 2008-04-12 14:49:28.000000000 -0600 |
3 |
@@ -19,7 +19,7 @@ |
4 |
#LIBS = |
5 |
|
6 |
pkglib_PROGRAMS = @DRIVERS@ |
7 |
-EXTRA_PROGRAMS = bayrad CFontz CFontz633 CFontzPacket curses CwLnx ea65 EyeboxOne g15 glcdlib glk hd44780 icp_a106 imon IOWarrior irman joy lb216 lcdm001 lcterm lirc MD8800 ms6931 mtc_s16209x MtxOrb NoritakeVFD picolcd pyramid sed1330 sed1520 serialPOS serialVFD stv5730 svga t6963 text tyan sli ula200 xosd |
8 |
+EXTRA_PROGRAMS = bayrad CFontz CFontz633 CFontzPacket curses CwLnx ea65 EyeboxOne g15 glcdlib glk hd44780 icp_a106 imon IOWarrior irman joy lb216 lcdm001 lcterm lirc MD8800 ms6931 mtc_s16209x MtxOrb NoritakeVFD picolcd pyramid roamer sed1330 sed1520 serialPOS serialVFD stv5730 svga t6963 text tyan sli ula200 xosd |
9 |
noinst_LIBRARIES = libLCD.a libbignum.a |
10 |
|
11 |
IOWarrior_CFLAGS = @libusb_cflags@ $(AM_CFLAGS) |
12 |
@@ -89,6 +89,7 @@ |
13 |
NoritakeVFD_SOURCES = lcd.h lcd_lib.h NoritakeVFD.c NoritakeVFD.h report.h |
14 |
picolcd_SOURCES = lcd.h picolcd.h picolcd.c report.h |
15 |
pyramid_SOURCES = lcd.h pylcd.c pylcd.h |
16 |
+roamer_SOURCES = lcd.h lcd_lib.h roamer.h roamer.c report.h |
17 |
sed1330_SOURCES = lcd.h sed1330.h sed1330.c port.h lpt-port.h timing.h report.h |
18 |
sed1520_SOURCES = lcd.h sed1520.c sed1520.h sed1520fm.c sed1520fm.h port.h report.h |
19 |
serialPOS_SOURCES = lcd.h lcd_lib.h serialPOS.c serialPOS.h report.h adv_bignum.h |
20 |
--- lcdproc-0.5.2/server/drivers/Makefile.in.roamer 2007-04-27 04:40:28.000000000 -0600 |
21 |
+++ lcdproc-0.5.2/server/drivers/Makefile.in 2008-04-12 14:57:41.000000000 -0600 |
22 |
@@ -46,10 +46,10 @@ |
23 |
lcdm001$(EXEEXT) lcterm$(EXEEXT) lirc$(EXEEXT) MD8800$(EXEEXT) \ |
24 |
ms6931$(EXEEXT) mtc_s16209x$(EXEEXT) MtxOrb$(EXEEXT) \ |
25 |
NoritakeVFD$(EXEEXT) picolcd$(EXEEXT) pyramid$(EXEEXT) \ |
26 |
- sed1330$(EXEEXT) sed1520$(EXEEXT) serialPOS$(EXEEXT) \ |
27 |
- serialVFD$(EXEEXT) stv5730$(EXEEXT) svga$(EXEEXT) \ |
28 |
- t6963$(EXEEXT) text$(EXEEXT) tyan$(EXEEXT) sli$(EXEEXT) \ |
29 |
- ula200$(EXEEXT) xosd$(EXEEXT) |
30 |
+ roamer$(EXEEXT) sed1330$(EXEEXT) sed1520$(EXEEXT) \ |
31 |
+ serialPOS$(EXEEXT) serialVFD$(EXEEXT) stv5730$(EXEEXT) \ |
32 |
+ svga$(EXEEXT) t6963$(EXEEXT) text$(EXEEXT) tyan$(EXEEXT) \ |
33 |
+ sli$(EXEEXT) ula200$(EXEEXT) xosd$(EXEEXT) |
34 |
subdir = server/drivers |
35 |
DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in |
36 |
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 |
37 |
@@ -157,6 +157,9 @@ |
38 |
am_pyramid_OBJECTS = pylcd.$(OBJEXT) |
39 |
pyramid_OBJECTS = $(am_pyramid_OBJECTS) |
40 |
pyramid_DEPENDENCIES = libLCD.a |
41 |
+am_roamer_OBJECTS = roamer.$(OBJEXT) |
42 |
+roamer_OBJECTS = $(am_roamer_OBJECTS) |
43 |
+roamer_DEPENDENCIES = libLCD.a |
44 |
am_sed1330_OBJECTS = sed1330.$(OBJEXT) |
45 |
sed1330_OBJECTS = $(am_sed1330_OBJECTS) |
46 |
sed1330_LDADD = $(LDADD) |
47 |
@@ -211,11 +214,11 @@ |
48 |
$(irman_SOURCES) $(joy_SOURCES) $(lb216_SOURCES) \ |
49 |
$(lcdm001_SOURCES) $(lcterm_SOURCES) $(lirc_SOURCES) \ |
50 |
$(ms6931_SOURCES) $(mtc_s16209x_SOURCES) $(picolcd_SOURCES) \ |
51 |
- $(pyramid_SOURCES) $(sed1330_SOURCES) $(sed1520_SOURCES) \ |
52 |
- $(serialPOS_SOURCES) $(serialVFD_SOURCES) $(sli_SOURCES) \ |
53 |
- $(stv5730_SOURCES) $(svga_SOURCES) $(t6963_SOURCES) \ |
54 |
- $(text_SOURCES) $(tyan_SOURCES) $(ula200_SOURCES) \ |
55 |
- $(xosd_SOURCES) |
56 |
+ $(pyramid_SOURCES) $(roamer_SOURCES) $(sed1330_SOURCES) \ |
57 |
+ $(sed1520_SOURCES) $(serialPOS_SOURCES) $(serialVFD_SOURCES) \ |
58 |
+ $(sli_SOURCES) $(stv5730_SOURCES) $(svga_SOURCES) \ |
59 |
+ $(t6963_SOURCES) $(text_SOURCES) $(tyan_SOURCES) \ |
60 |
+ $(ula200_SOURCES) $(xosd_SOURCES) |
61 |
DIST_SOURCES = $(libLCD_a_SOURCES) $(libbignum_a_SOURCES) \ |
62 |
$(CFontz_SOURCES) $(CFontz633_SOURCES) $(CFontzPacket_SOURCES) \ |
63 |
$(CwLnx_SOURCES) $(EyeboxOne_SOURCES) $(IOWarrior_SOURCES) \ |
64 |
@@ -227,10 +230,11 @@ |
65 |
$(joy_SOURCES) $(lb216_SOURCES) $(lcdm001_SOURCES) \ |
66 |
$(lcterm_SOURCES) $(lirc_SOURCES) $(ms6931_SOURCES) \ |
67 |
$(mtc_s16209x_SOURCES) $(picolcd_SOURCES) $(pyramid_SOURCES) \ |
68 |
- $(sed1330_SOURCES) $(sed1520_SOURCES) $(serialPOS_SOURCES) \ |
69 |
- $(serialVFD_SOURCES) $(sli_SOURCES) $(stv5730_SOURCES) \ |
70 |
- $(svga_SOURCES) $(t6963_SOURCES) $(text_SOURCES) \ |
71 |
- $(tyan_SOURCES) $(ula200_SOURCES) $(xosd_SOURCES) |
72 |
+ $(roamer_SOURCES) $(sed1330_SOURCES) $(sed1520_SOURCES) \ |
73 |
+ $(serialPOS_SOURCES) $(serialVFD_SOURCES) $(sli_SOURCES) \ |
74 |
+ $(stv5730_SOURCES) $(svga_SOURCES) $(t6963_SOURCES) \ |
75 |
+ $(text_SOURCES) $(tyan_SOURCES) $(ula200_SOURCES) \ |
76 |
+ $(xosd_SOURCES) |
77 |
ETAGS = etags |
78 |
CTAGS = ctags |
79 |
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) |
80 |
@@ -374,6 +378,7 @@ |
81 |
NoritakeVFD_LDADD = libLCD.a |
82 |
picolcd_LDADD = libLCD.a @LIBUSBLCD@ |
83 |
pyramid_LDADD = libLCD.a |
84 |
+roamer_LDADD = libLCD.a |
85 |
serialPOS_LDADD = libLCD.a libbignum.a |
86 |
serialVFD_LDADD = libLCD.a libbignum.a |
87 |
svga_LDADD = @LIBSVGA@ |
88 |
@@ -413,6 +418,7 @@ |
89 |
NoritakeVFD_SOURCES = lcd.h lcd_lib.h NoritakeVFD.c NoritakeVFD.h report.h |
90 |
picolcd_SOURCES = lcd.h picolcd.h picolcd.c report.h |
91 |
pyramid_SOURCES = lcd.h pylcd.c pylcd.h |
92 |
+roamer_SOURCES = lcd.h lcd_lib.h roamer.h roamer.c report.h |
93 |
sed1330_SOURCES = lcd.h sed1330.h sed1330.c port.h lpt-port.h timing.h report.h |
94 |
sed1520_SOURCES = lcd.h sed1520.c sed1520.h sed1520fm.c sed1520fm.h port.h report.h |
95 |
serialPOS_SOURCES = lcd.h lcd_lib.h serialPOS.c serialPOS.h report.h adv_bignum.h |
96 |
@@ -577,6 +583,9 @@ |
97 |
pyramid$(EXEEXT): $(pyramid_OBJECTS) $(pyramid_DEPENDENCIES) |
98 |
@rm -f pyramid$(EXEEXT) |
99 |
$(LINK) $(pyramid_LDFLAGS) $(pyramid_OBJECTS) $(pyramid_LDADD) $(LIBS) |
100 |
+roamer$(EXEEXT): $(roamer_OBJECTS) $(roamer_DEPENDENCIES) |
101 |
+ @rm -f roamer$(EXEEXT) |
102 |
+ $(LINK) $(roamer_LDFLAGS) $(roamer_OBJECTS) $(roamer_LDADD) $(LIBS) |
103 |
sed1330$(EXEEXT): $(sed1330_OBJECTS) $(sed1330_DEPENDENCIES) |
104 |
@rm -f sed1330$(EXEEXT) |
105 |
$(LINK) $(sed1330_LDFLAGS) $(sed1330_OBJECTS) $(sed1330_LDADD) $(LIBS) |
106 |
--- lcdproc-0.5.2/server/drivers/roamer.c.roamer 2008-04-12 14:58:09.000000000 -0600 |
107 |
+++ lcdproc-0.5.2/server/drivers/roamer.c 2008-04-11 22:39:15.000000000 -0600 |
108 |
@@ -0,0 +1,387 @@ |
109 |
+/* This is the LCDproc driver for Rackable Systems Roamer LCD. |
110 |
+ |
111 |
+ Copyright (C) 2008 Shad L. Lords |
112 |
+ |
113 |
+ This program is free software; you can redistribute it and/or modify |
114 |
+ it under the terms of the GNU General Public License as published by |
115 |
+ the Free Software Foundation; either version 2 of the License, or |
116 |
+ any later version. |
117 |
+ |
118 |
+ This program is distributed in the hope that it will be useful, |
119 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of |
120 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
121 |
+ GNU General Public License for more details. |
122 |
+ |
123 |
+ You should have received a copy of the GNU General Public License |
124 |
+ along with this program; if not, write to the Free Software |
125 |
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 |
126 |
+ |
127 |
+ |
128 |
+ List of driver entry point: |
129 |
+ |
130 |
+ init Implemented. |
131 |
+ close Implemented. |
132 |
+ width Implemented. |
133 |
+ height Implemented. |
134 |
+ clear Implemented by space filling no custom char info. |
135 |
+ flush Implemented. |
136 |
+ string Implemented. |
137 |
+ chr Implemented. |
138 |
+ set_contrast Implemented. |
139 |
+ backlight Implemented. |
140 |
+ */ |
141 |
+ |
142 |
+#include <stdlib.h> |
143 |
+#include <stdio.h> |
144 |
+#include <unistd.h> |
145 |
+#include <termios.h> |
146 |
+#include <fcntl.h> |
147 |
+#include <string.h> |
148 |
+#include <errno.h> |
149 |
+ |
150 |
+#ifdef HAVE_CONFIG_H |
151 |
+#include "config.h" |
152 |
+#endif |
153 |
+ |
154 |
+#include "lcd.h" |
155 |
+#include "roamer.h" |
156 |
+#include "report.h" |
157 |
+ |
158 |
+// Variables |
159 |
+typedef struct { |
160 |
+ int fd; |
161 |
+ char lcd_init[3]; |
162 |
+ char lcd_close[4]; |
163 |
+ int width; |
164 |
+ int height; |
165 |
+ char *framebuf; |
166 |
+ char *backingstore; |
167 |
+ char beat; |
168 |
+} PrivateData; |
169 |
+ |
170 |
+// Vars for the server core |
171 |
+MODULE_EXPORT char *api_version = API_VERSION; |
172 |
+MODULE_EXPORT int stay_in_foreground = 0; |
173 |
+MODULE_EXPORT int supports_multiple = 1; |
174 |
+MODULE_EXPORT char *symbol_prefix = "roamer_"; |
175 |
+ |
176 |
+ |
177 |
+MODULE_EXPORT int |
178 |
+roamer_init (Driver *drvthis) |
179 |
+{ |
180 |
+ struct termios portset; |
181 |
+ |
182 |
+ char device[256] = DEFAULT_DEVICE; |
183 |
+ int speed = DEFAULT_SPEED; |
184 |
+ char size[256] = DEFAULT_SIZE; |
185 |
+ char buf[256] = ""; |
186 |
+ int tmp, w, h; |
187 |
+ |
188 |
+ PrivateData *p; |
189 |
+ |
190 |
+ /* Alocate and store private data */ |
191 |
+ p = (PrivateData *) malloc(sizeof(PrivateData)); |
192 |
+ if (p == NULL) |
193 |
+ return -1; |
194 |
+ if (drvthis->store_private_ptr(drvthis, p)) |
195 |
+ return -1; |
196 |
+ |
197 |
+ /* Initialise the PrivateData structure */ |
198 |
+ p->fd = -1; |
199 |
+ |
200 |
+ p->width = LCD_DEFAULT_WIDTH; |
201 |
+ p->height = LCD_DEFAULT_HEIGHT; |
202 |
+ |
203 |
+ p->framebuf = NULL; |
204 |
+ p->backingstore = NULL; |
205 |
+ |
206 |
+ /* Control codes for display */ |
207 |
+ snprintf(p->lcd_init, 3, "%c%c", 0x1e, 0x1d); |
208 |
+ snprintf(p->lcd_close, 4, "%c%c%c", 0x1e, 0x1b, 0x1b); |
209 |
+ |
210 |
+ /* Get serial device to use */ |
211 |
+ strncpy(device, drvthis->config_get_string(drvthis->name, "Device", 0, DEFAULT_DEVICE), sizeof(device)); |
212 |
+ device[sizeof(device)-1] = '\0'; |
213 |
+ report(RPT_INFO, "%s: using Device %s", drvthis->name, device); |
214 |
+ |
215 |
+ /* Get display size */ |
216 |
+ strncpy(size, drvthis->config_get_string(drvthis->name, "Size", 0, DEFAULT_SIZE), sizeof(size)); |
217 |
+ size[sizeof(size)-1] = '\0'; |
218 |
+ if ((sscanf(size, "%dx%d", &w, &h) != 2) |
219 |
+ || (w <= 0) || (w > LCD_MAX_WIDTH) |
220 |
+ || (h <= 0) || (h > LCD_MAX_HEIGHT)) { |
221 |
+ report(RPT_WARNING, "%s: cannot read Size: %s; using default %s", |
222 |
+ drvthis->name, size, DEFAULT_SIZE); |
223 |
+ sscanf(DEFAULT_SIZE , "%dx%d", &w, &h); |
224 |
+ } |
225 |
+ p->width = w; |
226 |
+ p->height = h; |
227 |
+ |
228 |
+ /* Get speed */ |
229 |
+ tmp = drvthis->config_get_int(drvthis->name, "Speed", 0, DEFAULT_SPEED); |
230 |
+ switch (tmp) { |
231 |
+ case 1200: |
232 |
+ speed = B1200; |
233 |
+ break; |
234 |
+ case 2400: |
235 |
+ speed = B2400; |
236 |
+ break; |
237 |
+ case 4800: |
238 |
+ speed = B4800; |
239 |
+ break; |
240 |
+ case 9600: |
241 |
+ speed = B9600; |
242 |
+ break; |
243 |
+ default: |
244 |
+ speed = B9600; |
245 |
+ report(RPT_WARNING, "%s: Speed must be 1200, 2400, 4800 or 9600; using default %d", |
246 |
+ drvthis->name, tmp); |
247 |
+ } |
248 |
+ |
249 |
+ /* Set up io port correctly, and open it... */ |
250 |
+ p->fd = open(device, O_RDWR | O_NOCTTY); |
251 |
+ if (p->fd == -1) { |
252 |
+ report(RPT_ERR, "%s: open(%s) failed (%s)", drvthis->name, device, strerror(errno)); |
253 |
+ if (errno == EACCES) |
254 |
+ report(RPT_ERR, "%s: %s device could not be opened...", drvthis->name, device); |
255 |
+ return -1; |
256 |
+ } |
257 |
+ report(RPT_INFO, "%s: opened display on %s", drvthis->name, device); |
258 |
+ |
259 |
+ tcgetattr(p->fd, &portset); |
260 |
+ |
261 |
+ // THIS ALL COMMENTED OUT BECAUSE WE NEED TO SET TIMEOUTS |
262 |
+ /* We use RAW mode */ |
263 |
+#ifdef HAVE_CFMAKERAW_NOT |
264 |
+ /* The easy way */ |
265 |
+ cfmakeraw(&portset); |
266 |
+#else |
267 |
+ /* The hard way */ |
268 |
+ portset.c_iflag &= ~( IGNBRK | BRKINT | PARMRK | ISTRIP |
269 |
+ | INLCR | IGNCR | ICRNL | IXON ); |
270 |
+ portset.c_oflag &= ~OPOST; |
271 |
+ portset.c_lflag &= ~( ECHO | ECHONL | ICANON | ISIG | IEXTEN ); |
272 |
+ portset.c_cflag &= ~( CSIZE | PARENB | CRTSCTS ); |
273 |
+ portset.c_cflag |= CS8 | CREAD | CLOCAL; |
274 |
+ portset.c_cc[VMIN] = 1; |
275 |
+ portset.c_cc[VTIME] = 3; |
276 |
+#endif |
277 |
+ |
278 |
+ /* Set port speed */ |
279 |
+ cfsetospeed(&portset, speed); |
280 |
+ cfsetispeed(&portset, B0); |
281 |
+ |
282 |
+ /* Do it... */ |
283 |
+ tcsetattr(p->fd, TCSANOW, &portset); |
284 |
+ |
285 |
+ write(p->fd, p->lcd_init, sizeof(p->lcd_init)-1); |
286 |
+ |
287 |
+ /* Make sure the frame buffer is there... */ |
288 |
+ p->framebuf = (unsigned char *) calloc(p->width * p->height, 1); |
289 |
+ if (p->framebuf == NULL) { |
290 |
+ report(RPT_ERR, "%s: unable to create framebuffer", drvthis->name); |
291 |
+ return -1; |
292 |
+ } |
293 |
+ memset(p->framebuf, ' ', p->width * p->height); |
294 |
+ |
295 |
+ /* make sure the framebuffer backing store is there... */ |
296 |
+ p->backingstore = (unsigned char *) malloc(p->width * p->height); |
297 |
+ if (p->backingstore == NULL) { |
298 |
+ report(RPT_ERR, "%s: unable to create framebuffer backing store", drvthis->name); |
299 |
+ return -1; |
300 |
+ } |
301 |
+ memset(p->backingstore, ' ', p->width * p->height); |
302 |
+ |
303 |
+ /* set initial LCD configuration */ |
304 |
+ roamer_clear(drvthis); |
305 |
+ |
306 |
+ report(RPT_DEBUG, "%s: init() done", drvthis->name); |
307 |
+ |
308 |
+ return 1; |
309 |
+} |
310 |
+ |
311 |
+///////////////////////////////////////////////////////////////// |
312 |
+// Closes the device |
313 |
+// |
314 |
+MODULE_EXPORT void |
315 |
+roamer_close (Driver *drvthis) |
316 |
+{ |
317 |
+ PrivateData *p = drvthis->private_data; |
318 |
+ |
319 |
+ if (p != NULL) { |
320 |
+ write(p->fd, p->lcd_close, sizeof(p->lcd_close)-1); |
321 |
+ |
322 |
+ if (p->fd >= 0) |
323 |
+ close(p->fd); |
324 |
+ |
325 |
+ if (p->framebuf) |
326 |
+ free(p->framebuf); |
327 |
+ p->framebuf = NULL; |
328 |
+ |
329 |
+ if (p->backingstore) |
330 |
+ free(p->backingstore); |
331 |
+ p->backingstore = NULL; |
332 |
+ |
333 |
+ free(p); |
334 |
+ } |
335 |
+ drvthis->store_private_ptr(drvthis, NULL); |
336 |
+ report(RPT_DEBUG, "%s: closed", drvthis->name); |
337 |
+} |
338 |
+ |
339 |
+///////////////////////////////////////////////////////////////// |
340 |
+// Returns the display width |
341 |
+// |
342 |
+MODULE_EXPORT int |
343 |
+roamer_width (Driver *drvthis) |
344 |
+{ |
345 |
+ PrivateData *p = drvthis->private_data; |
346 |
+ |
347 |
+ return p->width; |
348 |
+} |
349 |
+ |
350 |
+///////////////////////////////////////////////////////////////// |
351 |
+// Returns the display height |
352 |
+// |
353 |
+MODULE_EXPORT int |
354 |
+roamer_height (Driver *drvthis) |
355 |
+{ |
356 |
+ PrivateData *p = drvthis->private_data; |
357 |
+ |
358 |
+ return p->height; |
359 |
+} |
360 |
+ |
361 |
+///////////////////////////////////////////////////////////////// |
362 |
+// Clears the LCD screen |
363 |
+// |
364 |
+MODULE_EXPORT void |
365 |
+roamer_clear (Driver *drvthis) |
366 |
+{ |
367 |
+ PrivateData *p = drvthis->private_data; |
368 |
+ |
369 |
+ /* replace all chars in framebuf with spaces */ |
370 |
+ memset(p->framebuf, ' ', (p->width * p->height)); |
371 |
+ |
372 |
+ report(RPT_DEBUG, "%s: cleared framebuffer", drvthis->name); |
373 |
+} |
374 |
+ |
375 |
+////////////////////////////////////////////////////////////////// |
376 |
+// Flushes all output to the lcd... |
377 |
+// |
378 |
+MODULE_EXPORT void |
379 |
+roamer_flush (Driver *drvthis) |
380 |
+{ |
381 |
+ PrivateData *p = drvthis->private_data; |
382 |
+ |
383 |
+ char out[ (p->width*p->height) + 2 ]; |
384 |
+ |
385 |
+ report(RPT_DEBUG, "%s Framebuf: '%.*s'", drvthis->name, p->width*p->height, p->framebuf); |
386 |
+ report(RPT_DEBUG, "%s Backingstore: '%.*s'", drvthis->name, p->width*p->height, p->backingstore); |
387 |
+ |
388 |
+ // skip over identical buffers |
389 |
+ if ( memcmp(p->framebuf, p->backingstore, p->width*p->height) == 0) { |
390 |
+ return; |
391 |
+ } |
392 |
+ |
393 |
+ snprintf(out, p->width*p->height+2, "M%.*s", p->width*p->height, p->framebuf); |
394 |
+ report(RPT_DEBUG, "%s writing: M%.*s", drvthis->name, p->width*p->height, p->framebuf); |
395 |
+ |
396 |
+ write(p->fd, out, sizeof(out)-1); |
397 |
+ |
398 |
+ memcpy(p->backingstore, p->framebuf, p->width * p->height); |
399 |
+ report(RPT_DEBUG, "%s: frame buffer flushed", drvthis->name); |
400 |
+} |
401 |
+ |
402 |
+///////////////////////////////////////////////////////////////// |
403 |
+// Prints a string on the lcd display, at position (x,y). The |
404 |
+// upper-left is (1,1), and the lower right should be (20,4). |
405 |
+// |
406 |
+MODULE_EXPORT void |
407 |
+roamer_string (Driver *drvthis, int x, int y, const char string[]) |
408 |
+{ |
409 |
+ PrivateData *p = drvthis->private_data; |
410 |
+ int i; |
411 |
+ |
412 |
+ x--; y--; // Convert 1-based coords to 0-based... |
413 |
+ |
414 |
+ if ((y < 0) || (y >= p->height)) |
415 |
+ return; |
416 |
+ |
417 |
+ for (i = 0; (string[i] != '\0') && (x < p->width); i++, x++) { |
418 |
+ if (x >= 0) // no write left of left border |
419 |
+ p->framebuf[(y * p->width) + x] = string[i]; |
420 |
+ } |
421 |
+ report(RPT_DEBUG, "%s: printed string at (%d,%d)", drvthis->name, x, y); |
422 |
+} |
423 |
+ |
424 |
+///////////////////////////////////////////////////////////////// |
425 |
+// Prints a character on the lcd display, at position (x,y). The |
426 |
+// upper-left is (1,1), and the lower right should be (20,4). |
427 |
+// |
428 |
+MODULE_EXPORT void |
429 |
+roamer_chr (Driver *drvthis, int x, int y, char c) |
430 |
+{ |
431 |
+ PrivateData *p = drvthis->private_data; |
432 |
+ |
433 |
+ x--; y--; // Convert 1-based coords to 0-based... |
434 |
+ |
435 |
+ if (c == '#') |
436 |
+ c = 0xFF; |
437 |
+ |
438 |
+ if ((x >= 0) && (y >= 0) && (x < p->width) && (y < p->height)) |
439 |
+ p->framebuf[(y * p->width) + x] = c; |
440 |
+ |
441 |
+ report(RPT_DEBUG, "%s: writing character %02X to position (%d,%d)", drvthis->name, c, x, y); |
442 |
+} |
443 |
+ |
444 |
+///////////////////////////////////////////////////////////// |
445 |
+// Does the heartbeat... |
446 |
+// |
447 |
+MODULE_EXPORT void |
448 |
+roamer_heartbeat (Driver *drvthis, int state) |
449 |
+{ |
450 |
+ PrivateData *p = drvthis->private_data; |
451 |
+ |
452 |
+ static int timer = 0; |
453 |
+ static int saved_state = HEARTBEAT_ON; |
454 |
+ char out[3]; |
455 |
+ char beat; |
456 |
+ |
457 |
+ if (state) |
458 |
+ saved_state = state; |
459 |
+ if (state == HEARTBEAT_ON) { |
460 |
+ beat = ((timer + 4) & 4) ? '1' : '0'; |
461 |
+// if (p->beat != beat) { |
462 |
+// snprintf(out, 4, "L%c", beat); |
463 |
+// write(p->fd, out, sizeof(out)-1); |
464 |
+// } |
465 |
+// p->beat = beat; |
466 |
+ |
467 |
+ roamer_chr(drvthis, p->width, 1, (beat == '1') ? '#' : ' '); |
468 |
+ roamer_flush(drvthis); |
469 |
+ } |
470 |
+ timer++; |
471 |
+ timer &= 0x0F; |
472 |
+} |
473 |
+ |
474 |
+///////////////////////////////////////////////////////////////// |
475 |
+// Sets the contrast |
476 |
+// |
477 |
+MODULE_EXPORT void |
478 |
+roamer_set_contrast (Driver *drvthis, int promille) |
479 |
+{ |
480 |
+ //PrivateData *p = drvthis->private_data; |
481 |
+ |
482 |
+ report(RPT_DEBUG, "%s: contrast (%d)", drvthis->name, promille); |
483 |
+} |
484 |
+ |
485 |
+///////////////////////////////////////////////////////////////// |
486 |
+// Sets the backlight brightness |
487 |
+// |
488 |
+MODULE_EXPORT void |
489 |
+roamer_backlight (Driver *drvthis, int on) |
490 |
+{ |
491 |
+ //PrivateData *p = drvthis->private_data; |
492 |
+ |
493 |
+ report(RPT_DEBUG, "%s: backlight (%s)", drvthis->name, (on) ? "ON" : "OFF"); |
494 |
+} |
495 |
+ |
496 |
--- lcdproc-0.5.2/server/drivers/roamer.h.roamer 2008-04-12 14:58:12.000000000 -0600 |
497 |
+++ lcdproc-0.5.2/server/drivers/roamer.h 2008-04-11 16:05:31.000000000 -0600 |
498 |
@@ -0,0 +1,23 @@ |
499 |
+#ifndef LCD_ROAMER_H |
500 |
+#define LCD_ROAMER_H |
501 |
+ |
502 |
+#include "lcd.h" |
503 |
+ |
504 |
+#define DEFAULT_DEVICE "/dev/ttyS0" |
505 |
+#define DEFAULT_SPEED 9600 |
506 |
+#define DEFAULT_SIZE "20x2" |
507 |
+ |
508 |
+ |
509 |
+MODULE_EXPORT int roamer_init (Driver *drvthis); |
510 |
+MODULE_EXPORT void roamer_close (Driver *drvthis); |
511 |
+MODULE_EXPORT int roamer_width (Driver *drvthis); |
512 |
+MODULE_EXPORT int roamer_height (Driver *drvthis); |
513 |
+MODULE_EXPORT void roamer_clear (Driver *drvthis); |
514 |
+MODULE_EXPORT void roamer_flush (Driver *drvthis); |
515 |
+MODULE_EXPORT void roamer_string (Driver *drvthis, int x, int y, const char string[]); |
516 |
+MODULE_EXPORT void roamer_chr (Driver *drvthis, int x, int y, char c); |
517 |
+MODULE_EXPORT void roamer_heartbeat (Driver *drvthis, int state); |
518 |
+MODULE_EXPORT void roamer_set_contrast (Driver *drvthis, int promille); |
519 |
+MODULE_EXPORT void roamer_backlight (Driver *drvthis, int on); |
520 |
+ |
521 |
+#endif |
522 |
--- lcdproc-0.5.2/docs/lcdproc-user/drivers/roamer.docbook.roamer 2008-04-12 14:38:40.000000000 -0600 |
523 |
+++ lcdproc-0.5.2/docs/lcdproc-user/drivers/roamer.docbook 2008-04-12 14:41:53.000000000 -0600 |
524 |
@@ -0,0 +1,79 @@ |
525 |
+<sect1 id="roamer-howto"> |
526 |
+<title>The roamer Driver</title> |
527 |
+ |
528 |
+<para> |
529 |
+This section talks about using LCDproc with a roamer controller from rackable systems. |
530 |
+</para> |
531 |
+ |
532 |
+<para> |
533 |
+The <code>roamer</code> driver is currently working with the roamer 4.4.5 emulation protocol, |
534 |
+but can be extended to work with various other protocols. |
535 |
+</para> |
536 |
+ |
537 |
+<para> |
538 |
+The driver should operate most roamer displays from 4.0 thru 4.4.5 with a serial (RS-232) input. |
539 |
+Because these displays use a standardized protocol, if the protocol is |
540 |
+supported by your display, it should work as expected. |
541 |
+Feedback is welcome. |
542 |
+</para> |
543 |
+ |
544 |
+<!-- ## Roamer driver ## --> |
545 |
+<sect2 id="roamer-config"> |
546 |
+<title>Configuration in LCDd.conf</title> |
547 |
+ |
548 |
+<sect3 id="roamer-config-section"> |
549 |
+<title>[roamer]</title> |
550 |
+ |
551 |
+<variablelist> |
552 |
+ |
553 |
+<varlistentry> |
554 |
+ <term> |
555 |
+ <command>Device=</command> |
556 |
+ <arg choice="plain"><replaceable>DEVICE</replaceable></arg> |
557 |
+ </term> |
558 |
+ <listitem><para> |
559 |
+ Device to use in serial mode. Usual values are <filename>/dev/ttyS0</filename> or |
560 |
+ <filename>/dev/cu.usbserial</filename>. Default is <filename>/dev/lcd</filename>. |
561 |
+ </para></listitem> |
562 |
+</varlistentry> |
563 |
+ |
564 |
+<varlistentry> |
565 |
+ <term> |
566 |
+ <command>Size=</command> |
567 |
+ <arg choice="plain"> |
568 |
+ <replaceable>WIDTH</replaceable> |
569 |
+ <literal>x</literal> |
570 |
+ <replaceable>HEIGHT</replaceable> |
571 |
+ </arg> |
572 |
+ </term> |
573 |
+ <listitem><para> |
574 |
+ Specifies the size of the VFD in characters. |
575 |
+ If not given, it defaults to <literal>20x2</literal>. |
576 |
+ </para></listitem> |
577 |
+</varlistentry> |
578 |
+ |
579 |
+<varlistentry> |
580 |
+ <term> |
581 |
+ <command>Speed=</command> |
582 |
+ <arg choice="plain"> |
583 |
+ <group choice="req"> |
584 |
+ <arg choice="plain"><literal>1200</literal></arg> |
585 |
+ <arg choice="plain"><literal>2400</literal></arg> |
586 |
+ <arg choice="plain"><literal><emphasis>9600</emphasis></literal></arg> |
587 |
+ <arg choice="plain"><literal>19200</literal></arg> |
588 |
+ <arg choice="plain"><literal>115200</literal></arg> |
589 |
+ </group> |
590 |
+ </arg> |
591 |
+ </term> |
592 |
+ <listitem><para> |
593 |
+ Set the the baud rate communication with the POS display. |
594 |
+ If not given the default of <literal>9600</literal> is used. |
595 |
+ </para></listitem> |
596 |
+</varlistentry> |
597 |
+</variablelist> |
598 |
+ |
599 |
+</sect3> |
600 |
+ |
601 |
+</sect2> |
602 |
+ |
603 |
+</sect1> |
604 |
--- lcdproc-0.5.2/docs/lcdproc-user/drivers/Makefile.am.roamer 2007-04-27 03:41:19.000000000 -0600 |
605 |
+++ lcdproc-0.5.2/docs/lcdproc-user/drivers/Makefile.am 2008-04-12 14:42:29.000000000 -0600 |
606 |
@@ -29,6 +29,7 @@ |
607 |
picolcd.docbook \ |
608 |
ppttrouble.docbook \ |
609 |
pylcd.docbook \ |
610 |
+ roamer.docbook \ |
611 |
sed1330.docbook \ |
612 |
sed1520.docbook \ |
613 |
serialPOS.docbook \ |
614 |
--- lcdproc-0.5.2/docs/lcdproc-user/drivers/Makefile.in.roamer 2008-04-12 14:43:51.000000000 -0600 |
615 |
+++ lcdproc-0.5.2/docs/lcdproc-user/drivers/Makefile.in 2008-04-12 14:42:52.000000000 -0600 |
616 |
@@ -190,6 +190,7 @@ |
617 |
picolcd.docbook \ |
618 |
ppttrouble.docbook \ |
619 |
pylcd.docbook \ |
620 |
+ roamer.docbook \ |
621 |
sed1330.docbook \ |
622 |
sed1520.docbook \ |
623 |
serialPOS.docbook \ |
624 |
--- lcdproc-0.5.2/docs/lcdproc-user/drivers.docbook.roamer 2007-04-14 08:38:34.000000000 -0600 |
625 |
+++ lcdproc-0.5.2/docs/lcdproc-user/drivers.docbook 2008-04-12 14:44:17.000000000 -0600 |
626 |
@@ -35,6 +35,7 @@ |
627 |
&NoritakeVFD; |
628 |
&picolcd; |
629 |
&pylcd; |
630 |
+&roamer; |
631 |
&sed1330; |
632 |
&sed1520; |
633 |
&serialPOS; |
634 |
--- lcdproc-0.5.2/docs/lcdproc-user/lcdproc-user.docbook.roamer 2007-04-14 08:38:34.000000000 -0600 |
635 |
+++ lcdproc-0.5.2/docs/lcdproc-user/lcdproc-user.docbook 2008-04-12 14:44:49.000000000 -0600 |
636 |
@@ -41,6 +41,7 @@ |
637 |
<!ENTITY NoritakeVFD SYSTEM "drivers/NoritakeVFD.docbook"> |
638 |
<!ENTITY picolcd SYSTEM "drivers/picolcd.docbook"> |
639 |
<!ENTITY pylcd SYSTEM "drivers/pylcd.docbook"> |
640 |
+ <!ENTITY roamer SYSTEM "drivers/roamer.docbook"> |
641 |
<!ENTITY sed1330 SYSTEM "drivers/sed1330.docbook"> |
642 |
<!ENTITY sed1520 SYSTEM "drivers/sed1520.docbook"> |
643 |
<!ENTITY serialPOS SYSTEM "drivers/serialPOS.docbook"> |
644 |
--- lcdproc-0.5.2/configure.roamer 2007-04-27 04:40:29.000000000 -0600 |
645 |
+++ lcdproc-0.5.2/configure 2008-04-12 14:37:28.000000000 -0600 |
646 |
@@ -1329,9 +1329,9 @@ |
647 |
bayrad,CFontz,CFontz633,CFontzPacket,curses,CwLnx,ea65, |
648 |
EyeboxOne,g15,glcdlib,glk,hd44780,icp_a106,imon,IOWarrior, |
649 |
irman,joy,lb216,lcdm001,lcterm,lirc,MD8800,ms6931, |
650 |
- mtc_s16209x,MtxOrb,NoritakeVFD,picolcd,pyramid,sed1330 |
651 |
- sed1520,serialPOS,serialVFD,sli,stv5730,svga,t6963,text, |
652 |
- tyan,ula200,xosd |
653 |
+ mtc_s16209x,MtxOrb,NoritakeVFD,picolcd,pyramid,roamer, |
654 |
+ sed1330,sed1520,serialPOS,serialVFD,sli,stv5730,svga, |
655 |
+ t6963,text,tyan,ula200,xosd |
656 |
'all' compiles all drivers; |
657 |
'all,!xxx,!yyy' de-selects previously selected drivers |
658 |
--enable-seamless-hbars no gaps in horizontal bar graphs (if HW supports it) |
659 |
@@ -9699,7 +9699,7 @@ |
660 |
fi |
661 |
|
662 |
|
663 |
-allDrivers=bayrad,CFontz,CFontz633,CFontzPacket,curses,CwLnx,ea65,EyeboxOne,g15,glcdlib,glk,hd44780,icp_a106,imon,IOWarrior,irman,joy,lb216,lcdm001,lcterm,lirc,MD8800,ms6931,mtc_s16209x,MtxOrb,NoritakeVFD,picolcd,pyramid,sed1330,sed1520,serialPOS,serialVFD,sli,stv5730,svga,t6963,text,tyan,ula200,xosd |
664 |
+allDrivers=bayrad,CFontz,CFontz633,CFontzPacket,curses,CwLnx,ea65,EyeboxOne,g15,glcdlib,glk,hd44780,icp_a106,imon,IOWarrior,irman,joy,lb216,lcdm001,lcterm,lirc,MD8800,ms6931,mtc_s16209x,MtxOrb,NoritakeVFD,picolcd,pyramid,roamer,sed1330,sed1520,serialPOS,serialVFD,sli,stv5730,svga,t6963,text,tyan,ula200,xosd |
665 |
|
666 |
drivers=`echo $drivers | sed -e 's/,/ /g'` |
667 |
|
668 |
@@ -12454,6 +12454,10 @@ |
669 |
DRIVERS="$DRIVERS pyramid${SO}" |
670 |
actdrivers="$actdrivers pyramid" |
671 |
;; |
672 |
+ roamer) |
673 |
+ DRIVERS="$DRIVERS roamer${SO}" |
674 |
+ actdrivers="$actdrivers roamer" |
675 |
+ ;; |
676 |
sed1330) |
677 |
if test "$ac_cv_port_have_lpt" = yes |
678 |
then |
679 |
--- lcdproc-0.5.2/LCDd.conf.roamer 2007-04-25 13:56:43.000000000 -0600 |
680 |
+++ lcdproc-0.5.2/LCDd.conf 2008-04-12 14:46:45.000000000 -0600 |
681 |
@@ -39,8 +39,9 @@ |
682 |
# bayrad, CFontz, CFontz633, CFontzPacket, curses, CwLnx, ea65, |
683 |
# EyeboxOne, g15, glcdlib, glk, hd44780, icp_a106, imon, IOWarrior, |
684 |
# irman, joy, lb216, lcdm001, lcterm, lirc, MD8800, ms6931, mtc_s16209x, |
685 |
-# MtxOrb, NoritakeVFD, picolcd, pyramid, sed1330, sed1520, serialPOS, |
686 |
-# serialVFD, sli, stv5730, svga, t6963, text, tyan, ula200, xosd |
687 |
+# MtxOrb, NoritakeVFD, picolcd, pyramid, roamer, sed1330, sed1520, |
688 |
+# serialPOS, serialVFD, sli, stv5730, svga, t6963, text, tyan, ula200, |
689 |
+# xosd |
690 |
Driver=curses |
691 |
|
692 |
# Tells the driver to bind to the given interface |
693 |
@@ -754,6 +755,20 @@ |
694 |
|
695 |
|
696 |
|
697 |
+## roamer display driver ## |
698 |
+[roamer] |
699 |
+ |
700 |
+# Device to use in serial modea [default: /dev/lcd] |
701 |
+Device=/dev/ttyS0 |
702 |
+ |
703 |
+# Specifies the size of the display in characters. [default: 20x2] |
704 |
+Size=20x2 |
705 |
+ |
706 |
+# communication baud rate with the display [default: 9600; legal: 1200, 2400, 19200, 115200] |
707 |
+Speed=9600 |
708 |
+ |
709 |
+ |
710 |
+ |
711 |
## Seiko Epson 1330 driver ## |
712 |
[sed1330] |
713 |
|