diff options
-rw-r--r-- | Makefile.am | 1 | ||||
-rw-r--r-- | Makefile.in | 2 | ||||
-rw-r--r-- | config.h.in | 3 | ||||
-rwxr-xr-x | configure | 9 | ||||
-rw-r--r-- | configure.in | 2 | ||||
-rw-r--r-- | drivers.m4 | 2 | ||||
-rw-r--r-- | drv_LCDLinux.c | 22 | ||||
-rw-r--r-- | drv_LCDLinux.h | 90 |
8 files changed, 23 insertions, 108 deletions
diff --git a/Makefile.am b/Makefile.am index 47bfe79..46dd741 100644 --- a/Makefile.am +++ b/Makefile.am @@ -61,7 +61,6 @@ drv_Cwlinux.c \ drv_HD44780.c \ drv_Image.c \ drv_LCDLinux.c \ -drv_LCDLinux.h \ drv_LCDTerm.c \ drv_LPH7508.c \ drv_LUIse.c \ diff --git a/Makefile.in b/Makefile.in index fac2395..2fd087d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -104,7 +104,7 @@ lcd4linux_DEPENDENCIES = @DRIVERS@ @PLUGINS@ lcd4linux_SOURCES = lcd4linux.c cfg.c cfg.h debug.c debug.h drv.c drv.h evaluator.c evaluator.h hash.c hash.h layout.c layout.h pid.c pid.h timer.c timer.h thread.c thread.h udelay.c udelay.h qprintf.c qprintf.h widget.c widget.h widget_text.c widget_text.h widget_bar.c widget_bar.h widget_icon.c widget_icon.h widget_gpo.c widget_gpo.h plugin.c plugin.h plugin_cfg.c plugin_math.c plugin_string.c plugin_test.c plugin_time.c -EXTRA_lcd4linux_SOURCES = drv_generic_text.c drv_generic_text.h drv_generic_graphic.c drv_generic_graphic.h drv_generic_gpio.c drv_generic_gpio.h drv_generic_serial.c drv_generic_serial.h drv_generic_parport.c drv_generic_parport.h drv_generic_i2c.c drv_generic_i2c.h drv_BeckmannEgle.c drv_BWCT.c drv_Crystalfontz.c drv_Curses.c drv_Cwlinux.c drv_HD44780.c drv_Image.c drv_LCDLinux.c drv_LCDLinux.h drv_LCDTerm.c drv_LPH7508.c drv_LUIse.c drv_M50530.c drv_MatrixOrbital.c drv_MilfordInstruments.c drv_Noritake.c drv_NULL.c drv_RouterBoard.c drv_Sample.c drv_serdisplib.c drv_SimpleLCD.c drv_T6963.c drv_Trefon.c drv_USBLCD.c drv_WincorNixdorf.c drv_X11.c font_6x8.h lcd4linux_i2c.h plugin_apm.c plugin_cpuinfo.c plugin_diskstats.c plugin_dvb.c plugin_exec.c plugin_i2c_sensors.c plugin_imon.c plugin_isdn.c plugin_loadavg.c plugin_meminfo.c plugin_mysql.c plugin_netdev.c plugin_pop3.c plugin_ppp.c plugin_proc_stat.c plugin_python.c plugin_sample.c plugin_seti.c plugin_statfs.c plugin_uname.c plugin_uptime.c plugin_wireless.c plugin_xmms.c +EXTRA_lcd4linux_SOURCES = drv_generic_text.c drv_generic_text.h drv_generic_graphic.c drv_generic_graphic.h drv_generic_gpio.c drv_generic_gpio.h drv_generic_serial.c drv_generic_serial.h drv_generic_parport.c drv_generic_parport.h drv_generic_i2c.c drv_generic_i2c.h drv_BeckmannEgle.c drv_BWCT.c drv_Crystalfontz.c drv_Curses.c drv_Cwlinux.c drv_HD44780.c drv_Image.c drv_LCDLinux.c drv_LCDTerm.c drv_LPH7508.c drv_LUIse.c drv_M50530.c drv_MatrixOrbital.c drv_MilfordInstruments.c drv_Noritake.c drv_NULL.c drv_RouterBoard.c drv_Sample.c drv_serdisplib.c drv_SimpleLCD.c drv_T6963.c drv_Trefon.c drv_USBLCD.c drv_WincorNixdorf.c drv_X11.c font_6x8.h lcd4linux_i2c.h plugin_apm.c plugin_cpuinfo.c plugin_diskstats.c plugin_dvb.c plugin_exec.c plugin_i2c_sensors.c plugin_imon.c plugin_isdn.c plugin_loadavg.c plugin_meminfo.c plugin_mysql.c plugin_netdev.c plugin_pop3.c plugin_ppp.c plugin_proc_stat.c plugin_python.c plugin_sample.c plugin_seti.c plugin_statfs.c plugin_uname.c plugin_uptime.c plugin_wireless.c plugin_xmms.c EXTRA_DIST = lcd4linux.conf.sample lcd4kde.conf lcd4linux.kdelnk lcd4linux.xpm lcd4linux.lsm curses.m4 AUTHORS CREDITS FAQ NEWS TODO README README.Drivers README.Plugins README.KDE plugin_sample.c diff --git a/config.h.in b/config.h.in index cc914f8..759048b 100644 --- a/config.h.in +++ b/config.h.in @@ -52,6 +52,9 @@ /* Define to 1 if you have the <linux/dvb/frontend.h> header file. */ #undef HAVE_LINUX_DVB_FRONTEND_H +/* Define to 1 if you have the <linux/hd44780.h> header file. */ +#undef HAVE_LINUX_HD44780_H + /* Define to 1 if you have the <linux/isdn.h> header file. */ #undef HAVE_LINUX_ISDN_H @@ -5921,7 +5921,8 @@ done # check for LCD-Linux -for ac_header in linux/lcd-linux.h + +for ac_header in linux/lcd-linux.h linux/hd44780.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then @@ -6066,7 +6067,7 @@ if test `eval echo '${'$as_ac_Header'}'` = yes; then _ACEOF has_lcd_linux="true" else - has_lcd_linux="false" + has_lcd_linux="false"; break fi done @@ -6402,8 +6403,8 @@ cat >>confdefs.h <<\_ACEOF _ACEOF else - { echo "$as_me:$LINENO: WARNING: lcd-linux.h not found: LCD-Linux driver disabled" >&5 -echo "$as_me: WARNING: lcd-linux.h not found: LCD-Linux driver disabled" >&2;} + { echo "$as_me:$LINENO: WARNING: linux/lcd-linux.h or linux/hd44780.h not found: LCD-Linux driver disabled" >&5 +echo "$as_me: WARNING: linux/lcd-linux.h or linux/hd44780.h not found: LCD-Linux driver disabled" >&2;} fi fi diff --git a/configure.in b/configure.in index 8bbebb7..ce32aad 100644 --- a/configure.in +++ b/configure.in @@ -69,7 +69,7 @@ AC_CHECK_HEADERS(luise.h, [has_luise="true"], [has_luise="false"]) AC_CHECK_HEADERS(serdisplib/serdisp.h, [has_serdisplib="true"], [has_serdisplib="false"]) # check for LCD-Linux -AC_CHECK_HEADERS(linux/lcd-linux.h, [has_lcd_linux="true"], [has_lcd_linux="false"]) +AC_CHECK_HEADERS(linux/lcd-linux.h linux/hd44780.h, [has_lcd_linux="true"], [has_lcd_linux="false"; break]) # check for python AC_MSG_CHECKING(if python support is wanted) @@ -238,7 +238,7 @@ if test "$LCDLINUX" = "yes"; then DRIVERS="$DRIVERS drv_LCDLinux.o" AC_DEFINE(WITH_LCDLINUX,1,[LCD-Linux driver]) else - AC_MSG_WARN(lcd-linux.h not found: LCD-Linux driver disabled) + AC_MSG_WARN(linux/lcd-linux.h or linux/hd44780.h not found: LCD-Linux driver disabled) fi fi diff --git a/drv_LCDLinux.c b/drv_LCDLinux.c index 1703cee..78e0f03 100644 --- a/drv_LCDLinux.c +++ b/drv_LCDLinux.c @@ -1,4 +1,4 @@ -/* $Id: drv_LCDLinux.c,v 1.10 2005/08/27 07:02:25 reinelt Exp $ +/* $Id: drv_LCDLinux.c,v 1.11 2006/01/18 11:49:48 reinelt Exp $ * * driver for the LCD-Linux HD44780 kernel driver * http://lcd-linux.sourceforge.net @@ -24,6 +24,9 @@ * * * $Log: drv_LCDLinux.c,v $ + * Revision 1.11 2006/01/18 11:49:48 reinelt + * adopted to lcd-linux-0.9.2 + * * Revision 1.10 2005/08/27 07:02:25 reinelt * LCD-Linux updated to 0.9.0 * @@ -88,8 +91,8 @@ #include "drv_generic_text.h" #define LCD_LINUX_MAIN -#include "drv_LCDLinux.h" - +#include <linux/lcd-linux.h> +#include <linux/hd44780.h> static char Name[] = "LCD-Linux"; static char Device[] = "/dev/lcd"; @@ -196,13 +199,12 @@ static int drv_LL_start(const char *section, const int quiet) error("%s: Could not query display information!", Name); return -1; } - info("%s: %dx%d display with %d controllers, flags=0x%02x:", - Name, buf.cntr_cols, buf.cntr_rows, buf.num_cntr, buf.flags); + info("%s: %dx%d display with %d controllers, flags=0x%02x:", Name, buf.cntr_cols, buf.cntr_rows, buf.num_cntr, buf.flags); info("%s: busy-flag checking %sabled", Name, buf.flags & HD44780_CHECK_BF ? "en" : "dis"); info("%s: bus width %d bits", Name, buf.flags & HD44780_4BITS_BUS ? 4 : 8); info("%s: font size %s", Name, buf.flags & HD44780_5X10_FONT ? "5x10" : "5x8"); - + /* overwrite with size from lcd4linux.conf */ @@ -231,7 +233,7 @@ static int drv_LL_start(const char *section, const int quiet) if (commit && ioctl(lcdlinux_fd, IOCTL_SET_PARAM, &buf) != 0) { error("%s: ioctl(IOCTL_SET_PARAM) failed: %s", Name, strerror(errno)); return -1; - } + } /* initialize display */ drv_LL_clear(); /* clear display */ @@ -240,7 +242,7 @@ static int drv_LL_start(const char *section, const int quiet) /* No return value check since this ioctl cannot fail */ raw_mode = 1; ioctl(lcdlinux_fd, IOCTL_RAW_MODE, &raw_mode); - + if (!quiet) { char buffer[40]; qprintf(buffer, sizeof(buffer), "%s %dx%d", Name, DCOLS, DROWS); @@ -365,12 +367,12 @@ int drv_LL_quit(const int quiet) if (!quiet) { drv_generic_text_greet("goodbye!", NULL); } - + /* Enable control characters interpretation. */ /* No return value check since this ioctl cannot fail */ raw_mode = 0; ioctl(lcdlinux_fd, IOCTL_RAW_MODE, &raw_mode); - + /* close device */ close(lcdlinux_fd); diff --git a/drv_LCDLinux.h b/drv_LCDLinux.h deleted file mode 100644 index c7c7e71..0000000 --- a/drv_LCDLinux.h +++ /dev/null @@ -1,90 +0,0 @@ -/* hd44780.h - * - * $Id: drv_LCDLinux.h,v 1.6 2005/08/27 07:02:25 reinelt Exp $ - * - * LCD-Linux: - * Driver for HD44780 compatible displays connected to the parallel port. - * - * HD44780 header file. - * - * Copyright (C) 2004, 2005 Mattia Jona-Lasinio (mjona@users.sourceforge.net) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#ifndef HD44780_H -#define HD44780_H - -#include <linux/lcd-linux.h> - -#define HD44780_VERSION "0.9.0" /* Version number */ -#define HD44780_STRING "hd44780" - - -/* IOCTLs */ -#include <asm/ioctl.h> -#define IOCTL_RAW_CMD _IOW(LCD_MAJOR, 0, unsigned char *) - -/* flags */ -#define HD44780_CHECK_BF 0x0001 /* Do busy flag checking */ -#define HD44780_4BITS_BUS 0x0002 /* Set the bus length to 4 bits */ -#define HD44780_5X10_FONT 0x0004 /* Use 5x10 dots fonts */ - - - -/*** HD44780 Command Set ***/ - -/* Clear Display*/ -#define CLR_DISP 0x01 /* Clear entire display; cursor at row 0, column 0 */ - -/* Return Home */ -#define RET_HOME 0x02 /* Cursor at row 0, column 0; display content doesn't change */ - -/* Entry Mode Set */ -#define DISP_SHIFT_ON 0x05 /* Shift display, not cursor after data write */ -#define DISP_SHIFT_OFF 0x04 /* Shift cursor, not display after data write */ -#define CURS_INC 0x06 /* Shift on the right after data read/write */ -#define CURS_DEC 0x04 /* Shift on the left after data read/write */ - -/* Display on/off Control */ -#define BLINK_ON 0x09 /* Cursor blinking on */ -#define BLINK_OFF 0x08 /* Cursor blinking off */ -#define CURS_ON 0x0a /* Display Cursor */ -#define CURS_OFF 0x08 /* Hide Cursor */ -#define DISP_ON 0x0c /* Turn on display updating */ -#define DISP_OFF 0x08 /* Freeze display content */ - -/* Cursor or Display Shift */ -#define SHIFT_RIGHT 0x14 /* Shift on the right */ -#define SHIFT_LEFT 0x10 /* Shift on the left */ -#define SHIFT_DISP 0x18 /* Shift display */ -#define SHIFT_CURS 0x10 /* Shift cursor */ - -/* Function Set */ -#define FONT_5X10 0x24 /* Select 5x10 dots font */ -#define FONT_5X8 0x20 /* Select 5x8 dots font */ -#define DISP_2_LINES 0x28 /* Select 2 lines display (only 5x8 font allowed) */ -#define DISP_1_LINE 0x20 /* Select 1 line display */ -#define BUS_8_BITS 0x30 /* Set 8 data bits */ -#define BUS_4_BITS 0x20 /* Set 4 data bits */ - -/* Set CGRAM Address */ -#define CGRAM_IO 0x40 /* Access the CGRAM */ - -/* Set DDRAM Address */ -#define DDRAM_IO 0x80 /* Access the DDRAM */ - -#endif /* HD44780 included */ |