aboutsummaryrefslogtreecommitdiffstats
path: root/drv_Cwlinux.c
diff options
context:
space:
mode:
Diffstat (limited to 'drv_Cwlinux.c')
-rw-r--r--drv_Cwlinux.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/drv_Cwlinux.c b/drv_Cwlinux.c
index f870c53..fbf2393 100644
--- a/drv_Cwlinux.c
+++ b/drv_Cwlinux.c
@@ -1,9 +1,9 @@
-/* $Id: drv_Cwlinux.c 789 2007-04-30 04:48:10Z michael $
- * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_Cwlinux.c $
+/* $Id: drv_Cwlinux.c 929 2008-12-31 06:40:59Z michael $
+ * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_Cwlinux.c $
*
* new style driver for Cwlinux display modules
*
- * Copyright (C) 1999, 2000 Michael Reinelt <reinelt@eunet.at>
+ * Copyright (C) 1999, 2000 Michael Reinelt <michael@reinelt.co.at>
* Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net>
*
* This file is part of LCD4Linux.
@@ -83,8 +83,10 @@ typedef struct {
/* Fixme: number of gpo's should be verified */
static MODEL Models[] = {
+ /* type, name, rows, cols, xres/char, yres/char, gpo's, gpi's, definable chars, protocol */
{0x01, "CW1602", 2, 16, 5, 7, 2, 2, 8, 1},
{0x02, "CW12232", 4, 20, 6, 8, 2, 2, 16, 2},
+ {0x03, "CW12832", 4, 21, 6, 8, 2, 2, 16, 2},
{0xff, "Unknown", -1, -1, -1, -1, -1, -1, -1, -1}
};
@@ -173,7 +175,7 @@ static void drv_CW1602_defchar(const int ascii, const unsigned char *buffer)
static void drv_CW12232_defchar(const int ascii, const unsigned char *buffer)
{
int i, j;
- char cmd[10] = "\376Nn123456\375";
+ char cmd[10] = "\376Nn123456\375"; /* 0xfe 'N' [1..16] (6 Bytes Data) 0xfd */
cmd[2] = (char) ascii;
@@ -236,8 +238,8 @@ static int drv_CW_brightness(int brightness)
if (brightness < 0)
brightness = 0;
- if (brightness > 255)
- brightness = 255;
+ if (brightness > 8)
+ brightness = 8;
Brightness = brightness;
switch (Brightness) {
@@ -319,7 +321,7 @@ static int drv_CW_start(const char *section)
if (drv_generic_serial_open(section, Name, 0) < 0)
return -1;
- /* read firmware version */
+ /* read firmware version: 0xfe '1' 0xfd */
drv_generic_serial_write("\3761\375", 3);
usleep(100000);
if (drv_generic_serial_read(buffer, 2) != 2) {
@@ -328,7 +330,7 @@ static int drv_CW_start(const char *section)
info("Cwlinux Firmware V%d.%d", (int) buffer[0], (int) buffer[1]);
}
- /* read model mumber */
+ /* read model mumber: 0xfe 0x30 0xfd */
drv_generic_serial_write("\3760\375", 3);
usleep(100000);
if (drv_generic_serial_read(buffer, 2) != 2) {
@@ -425,7 +427,7 @@ int drv_CW_init(const char *section, const int quiet)
WIDGET_CLASS wc;
int ret;
- info("%s: %s", Name, "$Rev: 789 $");
+ info("%s: %s", Name, "$Rev: 929 $");
/* display preferences */
CHAR0 = 1; /* ASCII of first user-defineable char */