aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Makefile.am3
-rw-r--r--Makefile.in4
-rw-r--r--drv_T6963.c124
-rw-r--r--lcd4linux.conf.sample37
-rw-r--r--plugin_kvv.c8
5 files changed, 100 insertions, 76 deletions
diff --git a/Makefile.am b/Makefile.am
index 359dd2e..f835144 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -7,7 +7,8 @@ PLUGINS=@PLUGINS@
bin_PROGRAMS = lcd4linux
-AM_CFLAGS = -D_GNU_SOURCE -Wall -Wextra -fno-strict-aliasing
+# Fixme: -W should be renamed to -Wextra someday...
+AM_CFLAGS = -D_GNU_SOURCE -Wall -W -fno-strict-aliasing
lcd4linux_LDFLAGS =
lcd4linux_LDADD = @DRIVERS@ @PLUGINS@ @DRVLIBS@ @PLUGINLIBS@
diff --git a/Makefile.in b/Makefile.in
index 6a3da74..0f47a59 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -184,7 +184,9 @@ sysconfdir = @sysconfdir@
target_alias = @target_alias@
AUTOMAKE_OPTIONS = gnu
CLEANFILES = *~
-AM_CFLAGS = -D_GNU_SOURCE -Wall -Wextra -fno-strict-aliasing
+
+# Fixme: -W should be renamed to -Wextra someday...
+AM_CFLAGS = -D_GNU_SOURCE -Wall -W -fno-strict-aliasing
lcd4linux_LDFLAGS =
lcd4linux_LDADD = @DRIVERS@ @PLUGINS@ @DRVLIBS@ @PLUGINLIBS@
lcd4linux_DEPENDENCIES = @DRIVERS@ @PLUGINS@
diff --git a/drv_T6963.c b/drv_T6963.c
index 5ccafcb..272e8ee 100644
--- a/drv_T6963.c
+++ b/drv_T6963.c
@@ -1,4 +1,4 @@
-/* $Id: drv_T6963.c,v 1.22 2006/08/13 09:53:10 reinelt Exp $
+/* $Id: drv_T6963.c,v 1.23 2006/08/16 14:18:14 reinelt Exp $
*
* new style driver for T6963-based displays
*
@@ -23,6 +23,9 @@
*
*
* $Log: drv_T6963.c,v $
+ * Revision 1.23 2006/08/16 14:18:14 reinelt
+ * T6963 enhancements: soft timing, DualScan, Cell size
+ *
* Revision 1.22 2006/08/13 09:53:10 reinelt
* dynamic properties added (used by 'style' of text widget)
*
@@ -153,6 +156,15 @@ static MODEL Models[] = {
};
+/* font width of display */
+static int CELL;
+
+/* text rows/columns */
+static int TROWS, TCOLS;
+
+/* SingleScan or DualScan */
+static int DualScan = 0;
+
/* Timings */
static int T_ACC, T_OH, T_PW, T_DH, T_CDS;
@@ -350,7 +362,7 @@ static void drv_T6_clear(const unsigned short addr, const int len)
drv_T6_send_word(0x24, addr); /* Set Adress Pointer */
drv_T6_write_cmd(0xb0); /* Set Data Auto Write */
for (i = 0; i < len; i++) {
- drv_T6_write_auto(0);
+ drv_T6_write_auto(0x0);
if (bug) {
bug = 0;
debug("bug occured at byte %d of %d", i, len);
@@ -365,7 +377,7 @@ static void drv_T6_copy(const unsigned short addr, const unsigned char *data, co
{
int i;
- drv_T6_send_word(0x24, 0x0200 + addr); /* Set Adress Pointer */
+ drv_T6_send_word(0x24, addr); /* Set Adress Pointer */
drv_T6_write_cmd(0xb0); /* Set Data Auto Write */
for (i = 0; i < len; i++) {
drv_T6_write_auto(*(data++));
@@ -381,64 +393,43 @@ static void drv_T6_copy(const unsigned short addr, const unsigned char *data, co
static void drv_T6_blit(const int row, const int col, const int height, const int width)
{
- int i, j, e, m;
- int r, c;
+ int r, c, a, b;
+ int i, j, e, n;
+ int base;
for (r = row; r < row + height; r++) {
for (c = col; c < col + width; c++) {
- unsigned char mask = 1 << (XRES - 1 - c % XRES);
+ unsigned char mask = 1 << (CELL - 1 - c % CELL);
if (drv_generic_graphic_black(r, c)) {
/* set bit */
- Buffer1[(r * DCOLS + c) / XRES] |= mask;
+ Buffer1[(r * DCOLS + c) / CELL] |= mask;
} else {
/* clear bit */
- Buffer1[(r * DCOLS + c) / XRES] &= ~mask;
+ Buffer1[(r * DCOLS + c) / CELL] &= ~mask;
}
}
- }
-
- /* upper half */
-
- /* max address */
- if (row + height - 1 < 64) {
- m = ((row + height - 1) * DCOLS + col + width) / XRES;
- } else {
- m = (64 * DCOLS + col + width) / XRES;
- }
-
- for (i = (row * DCOLS + col) / XRES; i <= m; i++) {
- if (Buffer1[i] == Buffer2[i])
- continue;
- for (j = i, e = 0; i <= m; i++) {
- if (Buffer1[i] == Buffer2[i]) {
- if (++e > 4)
- break;
- } else {
- e = 0;
+ a = (r * DCOLS + col) / CELL;
+ b = (r * DCOLS + col + width + CELL - 1) / CELL;
+ for (i = a; i <= b; i++) {
+ if (Buffer1[i] == Buffer2[i])
+ continue;
+ for (j = i, e = 0; i <= b; i++) {
+ if (Buffer1[i] == Buffer2[i]) {
+ if (++e > 4)
+ break;
+ } else {
+ e = 0;
+ }
}
- }
- memcpy(Buffer2 + j, Buffer1 + j, i - j - e + 1);
- drv_T6_copy(j, Buffer1 + j, i - j - e + 1);
- }
-
- /* lower half */
-
- /* max address */
- m = ((row + height - 1) * DCOLS + col + width) / XRES;
-
- for (i = (64 * DCOLS + col) / XRES; i <= m; i++) {
- if (Buffer1[i] == Buffer2[i])
- continue;
- for (j = i, e = 0; i <= m; i++) {
- if (Buffer1[i] == Buffer2[i]) {
- if (++e > 4)
- break;
+ if (DualScan && r >= DROWS / 2) {
+ base = 0x8200 - DCOLS * DROWS / 2 / CELL;
} else {
- e = 0;
+ base = 0x0200;
}
+ n = i - j - e + 1;
+ memcpy(Buffer2 + j, Buffer1 + j, n);
+ drv_T6_copy(base + j, Buffer1 + j, n);
}
- memcpy(Buffer2 + j, Buffer1 + j, i - j - e + 1);
- drv_T6_copy(j, Buffer1 + j, i - j - e + 1);
}
}
@@ -446,7 +437,6 @@ static void drv_T6_blit(const int row, const int col, const int height, const in
static int drv_T6_start(const char *section)
{
char *model, *s;
- int rows, TROWS, TCOLS;
model = cfg_get(section, "Model", "generic");
if (model != NULL && *model != '\0') {
@@ -460,7 +450,6 @@ static int drv_T6_start(const char *section)
return -1;
}
Model = i;
- info("%s: using model '%s'", Name, Models[Model].name);
} else {
error("%s: empty '%s.Model' entry from %s", Name, section, cfg_source());
return -1;
@@ -487,8 +476,17 @@ static int drv_T6_start(const char *section)
}
free(s);
- TROWS = DROWS / YRES; /* text rows */
- TCOLS = DCOLS / XRES; /* text cols */
+
+ /* get font width of display */
+ cfg_number(section, "Cell", 6, 5, 8, &CELL);
+
+ TROWS = DROWS / 8; /* text rows */
+ TCOLS = DCOLS / CELL; /* text columns */
+
+ /* get DualScan mode */
+ cfg_number(section, "DualScan", 0, 0, 1, &DualScan);
+
+ info("%s: %dx%d %sScan %d bits/cell", Name, DCOLS, DROWS, DualScan ? "Dual" : "Single", CELL);
Buffer1 = malloc(TCOLS * DROWS);
if (Buffer1 == NULL) {
@@ -552,16 +550,16 @@ static int drv_T6_start(const char *section)
/* clear display */
- /* upper half */
- rows = TROWS > 8 ? 8 : TROWS;
- drv_T6_clear(0x0000, TCOLS * rows); /* clear text area */
- drv_T6_clear(0x0200, TCOLS * rows * 8); /* clear graphic area */
-
- /* lower half */
- if (TROWS > 8) {
- rows = TROWS - 8;
- drv_T6_clear(0x8000, TCOLS * rows); /* clear text area #2 */
- drv_T6_clear(0x8200, TCOLS * rows * 8); /* clear graphic area #2 */
+ if (DualScan) {
+ /* upper half */
+ drv_T6_clear(0x0000, TCOLS * TROWS / 2); /* clear text area */
+ drv_T6_clear(0x0200, TCOLS * TROWS * 8 / 2); /* clear graphic area */
+ /* lower half */
+ drv_T6_clear(0x8000, TCOLS * TROWS / 2); /* clear text area */
+ drv_T6_clear(0x8200, TCOLS * TROWS * 8 / 2); /* clear graphic area */
+ } else {
+ drv_T6_clear(0x0000, TCOLS * TROWS); /* clear text area */
+ drv_T6_clear(0x0200, TCOLS * TROWS * 8); /* clear graphic area */
}
return 0;
@@ -597,7 +595,7 @@ int drv_T6_init(const char *section, const int quiet)
{
int ret;
- info("%s: %s", Name, "$Revision: 1.22 $");
+ info("%s: %s", Name, "$Revision: 1.23 $");
/* real worker functions */
drv_generic_graphic_real_blit = drv_T6_blit;
diff --git a/lcd4linux.conf.sample b/lcd4linux.conf.sample
index b64b7d1..7728d55 100644
--- a/lcd4linux.conf.sample
+++ b/lcd4linux.conf.sample
@@ -357,23 +357,42 @@ Display T6963-240x64 {
Driver 'T6963'
Port '/dev/parports/0'
Size '240x64'
- Font '6x8'
+ DualScan 0
+ Cell 6
Wire.CE 'STROBE'
Wire.CD 'SLCTIN'
Wire.RD 'AUTOFD'
Wire.WR 'INIT'
+ Timing.fuzz 120
+ Font '6x8'
}
Display T6963-240x128 {
Driver 'T6963'
Port '/dev/parports/0'
Size '240x128'
+ DualScan 0
+ Cell 6
+ Wire.CE 'STROBE'
+ Wire.CD 'SLCTIN'
+ Wire.RD 'AUTOFD'
+ Wire.WR 'INIT'
+ Timing.fuzz 120
Font '6x8'
+}
+
+Display T6963-240x128D {
+ Driver 'T6963'
+ Port '/dev/parports/0'
+ Size '240x128'
+ DualScan 1
+ Cell 6
Wire.CE 'STROBE'
Wire.CD 'SLCTIN'
Wire.RD 'AUTOFD'
Wire.WR 'INIT'
Timing.fuzz 120
+ Font '6x8'
}
@@ -431,13 +450,12 @@ Display Image {
Basecolor '80d000'
}
-Plugin KVV {
- StationID '12_701'
- Refresh 30
-
- Proxy 'igate'
- Port 8080;
-}
+#Plugin KVV {
+# StationID '12_701'
+# Refresh 30
+# Proxy 'igate'
+# Port 8080;
+#}
Plugin Seti {
Directory '/root/setiathome-3.08.i686-pc-linux-gnu'
@@ -1127,8 +1145,9 @@ Layout Debug {
#Display 'SimpleLCD'
#Display 'BA63'
#Display 'CT20x4'
-Display 'T6963-240x128'
#Display 'T6963-240x64'
+#Display 'T6963-240x128'
+Display 'T6963-240x128D'
#Display 'XWindow'
#Display 'USBLCD'
#Display 'BWCT'
diff --git a/plugin_kvv.c b/plugin_kvv.c
index 72414e0..3f9c82a 100644
--- a/plugin_kvv.c
+++ b/plugin_kvv.c
@@ -1,4 +1,4 @@
-/* $Id: plugin_kvv.c,v 1.4 2006/08/15 17:28:27 harbaum Exp $
+/* $Id: plugin_kvv.c,v 1.5 2006/08/16 14:18:14 reinelt Exp $
*
* plugin kvv (karlsruher verkehrsverbund)
*
@@ -23,6 +23,9 @@
*
*
* $Log: plugin_kvv.c,v $
+ * Revision 1.5 2006/08/16 14:18:14 reinelt
+ * T6963 enhancements: soft timing, DualScan, Cell size
+ *
* Revision 1.4 2006/08/15 17:28:27 harbaum
* Cleaned up thread and error handling
*
@@ -353,7 +356,8 @@ static void process_station_string(char *str)
}
}
-static void kvv_client(void *dummy)
+static void kvv_client( __attribute__ ((unused))
+ void *dummy)
{
char ibuffer[4096];
char obuffer[1024];