From 55e2a61f5ebc3dbdc5336b98330d57bf6256a175 Mon Sep 17 00:00:00 2001 From: reinelt <> Date: Sun, 15 Feb 2004 21:43:43 +0000 Subject: [lcd4linux @ 2004-02-15 21:43:43 by reinelt] T6963 driver nearly finished framework for graphic displays done i2c_sensors patch from Xavier some more old generation files removed --- Makefile.am | 18 +- Makefile.in | 19 +- T6963.c | 511 ----------------------------- configure | 22 +- configure.in | 22 +- drv.c | 16 +- drv_HD44780.c | 10 +- drv_M50530.c | 15 +- drv_T6963.c | 498 +++++++++++++++++++++++++++++ drv_generic_graphic.c | 313 ++++++++++++++++++ drv_generic_graphic.h | 66 ++++ drv_generic_text.c | 14 +- drv_generic_text.h | 9 +- font_6x8.h | 845 ++++++++++++++++++++++++++++++++++++++++++++++++ fontmap.c | 871 -------------------------------------------------- fontmap.h | 39 --- lcd4linux.conf.sample | 14 +- libtool | 92 ++++-- pixmap.c | 330 ------------------- pixmap.h | 61 ---- plugin_i2c_sensors.c | 172 +++++----- widget_icon.c | 10 +- widget_icon.h | 26 +- 23 files changed, 1999 insertions(+), 1994 deletions(-) delete mode 100644 T6963.c create mode 100644 drv_T6963.c create mode 100644 drv_generic_graphic.c create mode 100644 drv_generic_graphic.h create mode 100644 font_6x8.h delete mode 100644 fontmap.c delete mode 100644 fontmap.h delete mode 100644 pixmap.c delete mode 100644 pixmap.h diff --git a/Makefile.am b/Makefile.am index e06282f..b76b57f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -52,20 +52,11 @@ plugin_xmms.c #liblcd4linux_la_LDFLAGS = -version-info 9:12:9 #liblcd4linux_la_LIBADD = @DRIVERS@ -#liblcd4linux_la_SOURCES = \ -#display.c display.h \ -#drv.c drv.h \ -#debug.c debug.h \ -#cfg.c cfg.h \ -#lock.c lock.h \ -#pixmap.c pixmap.h \ -#bar.c bar.h \ -#icon.c icon.h \ -#fontmap.c fontmap.h \ -#udelay.c udelay.h +#liblcd4linux_la_SOURCES = EXTRA_lcd4linux_SOURCES= \ drv_generic_text.c drv_generic_text.h \ +drv_generic_graphic.c drv_generic_graphic.h \ drv_generic_serial.c drv_generic_serial.h \ drv_generic_parport.c drv_generic_parport.h \ BeckmannEgle.c \ @@ -73,7 +64,7 @@ drv_Crystalfontz.c \ drv_Cwlinux.c \ drv_HD44780.c \ drv_M50530.c \ -T6963.c \ +drv_T6963.c \ drv_USBLCD.c \ drv_MatrixOrbital.c \ MilfordInstruments.c \ @@ -81,7 +72,8 @@ PalmPilot.c \ Raster.c \ SIN.c \ XWindow.c \ -Text.c +Text.c \ +font_6x8.h EXTRA_DIST = \ lcd4linux.conf.sample \ diff --git a/Makefile.in b/Makefile.in index 3ebd0c3..549e534 100644 --- a/Makefile.in +++ b/Makefile.in @@ -113,19 +113,9 @@ lcd4linux_SOURCES = lcd4linux.c cfg.c cfg.h deb #liblcd4linux_la_LDFLAGS = -version-info 9:12:9 #liblcd4linux_la_LIBADD = @DRIVERS@ -#liblcd4linux_la_SOURCES = \ -#display.c display.h \ -#drv.c drv.h \ -#debug.c debug.h \ -#cfg.c cfg.h \ -#lock.c lock.h \ -#pixmap.c pixmap.h \ -#bar.c bar.h \ -#icon.c icon.h \ -#fontmap.c fontmap.h \ -#udelay.c udelay.h +#liblcd4linux_la_SOURCES = -EXTRA_lcd4linux_SOURCES = drv_generic_text.c drv_generic_text.h drv_generic_serial.c drv_generic_serial.h drv_generic_parport.c drv_generic_parport.h BeckmannEgle.c drv_Crystalfontz.c drv_Cwlinux.c drv_HD44780.c drv_M50530.c T6963.c drv_USBLCD.c drv_MatrixOrbital.c MilfordInstruments.c PalmPilot.c Raster.c SIN.c XWindow.c Text.c +EXTRA_lcd4linux_SOURCES = drv_generic_text.c drv_generic_text.h drv_generic_graphic.c drv_generic_graphic.h drv_generic_serial.c drv_generic_serial.h drv_generic_parport.c drv_generic_parport.h BeckmannEgle.c drv_Crystalfontz.c drv_Cwlinux.c drv_HD44780.c drv_M50530.c drv_T6963.c drv_USBLCD.c drv_MatrixOrbital.c MilfordInstruments.c PalmPilot.c Raster.c SIN.c XWindow.c Text.c font_6x8.h EXTRA_DIST = lcd4linux.conf.sample lcd4kde.conf lcd4linux.kdelnk lcd4linux.xpm lcd4linux.lsm curses.m4 AUTHORS CREDITS FAQ NEWS TODO README README.Rows README.Tokens README.Drivers README.Plugins README.KDE plugin_sample.c @@ -172,10 +162,11 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = tar GZIP_ENV = --best DEP_FILES = .deps/BeckmannEgle.P .deps/MilfordInstruments.P \ -.deps/PalmPilot.P .deps/Raster.P .deps/SIN.P .deps/T6963.P .deps/Text.P \ +.deps/PalmPilot.P .deps/Raster.P .deps/SIN.P .deps/Text.P \ .deps/XWindow.P .deps/cfg.P .deps/debug.P .deps/drv.P \ .deps/drv_Crystalfontz.P .deps/drv_Cwlinux.P .deps/drv_HD44780.P \ -.deps/drv_M50530.P .deps/drv_MatrixOrbital.P .deps/drv_USBLCD.P \ +.deps/drv_M50530.P .deps/drv_MatrixOrbital.P .deps/drv_T6963.P \ +.deps/drv_USBLCD.P .deps/drv_generic_graphic.P \ .deps/drv_generic_parport.P .deps/drv_generic_serial.P \ .deps/drv_generic_text.P .deps/evaluator.P .deps/hash.P .deps/layout.P \ .deps/lcd4linux.P .deps/lock.P .deps/pid.P .deps/plugin.P \ diff --git a/T6963.c b/T6963.c deleted file mode 100644 index a8f98d0..0000000 --- a/T6963.c +++ /dev/null @@ -1,511 +0,0 @@ -/* $Id: T6963.c,v 1.15 2004/01/30 20:57:55 reinelt Exp $ - * - * driver for display modules based on the Toshiba T6963 chip - * - * Copyright 1999, 2000 Michael Reinelt - * - * This file is part of LCD4Linux. - * - * LCD4Linux 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, or (at your option) - * any later version. - * - * LCD4Linux 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., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * - * $Log: T6963.c,v $ - * Revision 1.15 2004/01/30 20:57:55 reinelt - * HD44780 patch from Martin Hejl - * dmalloc integrated - * - * Revision 1.14 2004/01/09 04:16:06 reinelt - * added 'section' argument to cfg_get(), but NULLed it on all calls by now. - * - * Revision 1.13 2003/10/05 17:58:50 reinelt - * libtool junk; copyright messages cleaned up - * - * Revision 1.12 2003/09/29 06:12:56 reinelt - * changed default HD44780 wiring: unused signals are GND - * - * Revision 1.11 2003/09/13 06:45:43 reinelt - * icons for all remaining drivers - * - * Revision 1.10 2003/08/16 07:31:35 reinelt - * double buffering in all drivers - * - * Revision 1.9 2003/08/15 07:54:07 reinelt - * HD44780 4 bit mode implemented - * - * Revision 1.8 2003/08/01 05:15:42 reinelt - * last cleanups for 0.9.9 - * - * Revision 1.7 2003/07/24 04:48:09 reinelt - * 'soft clear' needed for virtual rows - * - * Revision 1.6 2003/04/07 06:03:00 reinelt - * further parallel port abstraction - * - * Revision 1.5 2003/02/22 07:53:10 reinelt - * cfg_get(key,defval) - * - * Revision 1.4 2002/08/21 06:09:53 reinelt - * some T6963 fixes, ndelay wrap - * - * Revision 1.3 2002/08/19 04:41:20 reinelt - * introduced bar.c, moved bar stuff from display.h to bar.h - * - * Revision 1.2 2002/08/17 12:54:08 reinelt - * minor T6963 changes - * - * Revision 1.1 2002/04/29 11:00:26 reinelt - * - * added Toshiba T6963 driver - * added ndelay() with nanosecond resolution - * - * - */ - -/* - * - * exported fuctions: - * - * struct LCD T6963[] - * - */ - -#include "config.h" - -#include -#include -#include -#include - -#include "debug.h" -#include "cfg.h" -#include "display.h" -#include "bar.h" -#include "icon.h" -#include "parport.h" -#include "udelay.h" -#include "pixmap.h" - -#ifdef WITH_DMALLOC -#include -#endif - - -#define XRES 6 -#define YRES 8 - -static LCD Lcd; -static int Icons; - -unsigned char *Buffer1, *Buffer2; - -static unsigned char SIGNAL_CE; -static unsigned char SIGNAL_CD; -static unsigned char SIGNAL_RD; -static unsigned char SIGNAL_WR; - - -// Fixme: -static int bug=0; - -// perform normal status check -void T6_status1 (void) -{ - int n; - - // turn off data line drivers - parport_direction (1); - - // lower CE and RD - parport_control (SIGNAL_CE | SIGNAL_RD, 0); - - // Access Time: 150 ns - ndelay(150); - - // wait for STA0=1 and STA1=1 - n=0; - do { - rep_nop(); - if (++n>1000) { - debug("hang in status1"); - bug=1; - break; - } - } while ((parport_read() & 0x03) != 0x03); - - // rise RD and CE - parport_control (SIGNAL_RD | SIGNAL_CE, SIGNAL_RD | SIGNAL_CE); - - // Output Hold Time: 50 ns - ndelay(50); - - // turn on data line drivers - parport_direction (0); -} - - -// perform status check in "auto mode" -void T6_status2 (void) -{ - int n; - - // turn off data line drivers - parport_direction (1); - - // lower RD and CE - parport_control (SIGNAL_RD | SIGNAL_CE, 0); - - // Access Time: 150 ns - ndelay(150); - - // wait for STA3=1 - n=0; - do { - rep_nop(); - if (++n>1000) { - debug("hang in status2"); - bug=1; - break; - } - } while ((parport_read() & 0x08) != 0x08); - - // rise RD and CE - parport_control (SIGNAL_RD | SIGNAL_CE, SIGNAL_RD | SIGNAL_CE); - - // Output Hold Time: 50 ns - ndelay(50); - - // turn on data line drivers - parport_direction (0); -} - - -static void T6_write_cmd (unsigned char cmd) -{ - // wait until the T6963 is idle - T6_status1(); - - // put data on DB1..DB8 - parport_data (cmd); - - // lower WR and CE - parport_control (SIGNAL_WR | SIGNAL_CE, 0); - - // Pulse width - ndelay(80); - - // rise WR and CE - parport_control (SIGNAL_WR | SIGNAL_CE, SIGNAL_WR | SIGNAL_CE); - - // Data Hold Time - ndelay(40); -} - - -static void T6_write_data (unsigned char data) -{ - // wait until the T6963 is idle - T6_status1(); - - // put data on DB1..DB8 - parport_data (data); - - // lower C/D - parport_control (SIGNAL_CD, 0); - - // C/D Setup Time - ndelay(20); - - // lower WR and CE - parport_control (SIGNAL_WR | SIGNAL_CE, 0); - - // Pulse Width - ndelay(80); - - // rise WR and CE - parport_control (SIGNAL_WR | SIGNAL_CE, SIGNAL_WR | SIGNAL_CE); - - // Data Hold Time - ndelay(40); - - // rise CD - parport_control (SIGNAL_CD, SIGNAL_CD); -} - - -static void T6_write_auto (unsigned char data) -{ - // wait until the T6963 is idle - T6_status2(); - - // put data on DB1..DB8 - parport_data (data); - - // lower C/D - parport_control (SIGNAL_CD, 0); - - // C/D Setup Time - ndelay(20); - - // lower WR and CE - parport_control (SIGNAL_WR | SIGNAL_CE, 0); - - // Pulse Width - ndelay(80); - - // rise WR and CE - parport_control (SIGNAL_WR | SIGNAL_CE, SIGNAL_WR | SIGNAL_CE); - - // Data Hold Time - ndelay(40); - - // rise CD - parport_control (SIGNAL_CD, SIGNAL_CD); -} - - -#if 0 // not used -static void T6_send_byte (unsigned char cmd, unsigned char data) -{ - T6_write_data(data); - T6_write_cmd(cmd); -} -#endif - -static void T6_send_word (unsigned char cmd, unsigned short data) -{ - T6_write_data(data&0xff); - T6_write_data(data>>8); - T6_write_cmd(cmd); -} - - -static void T6_memset(unsigned short addr, unsigned char data, int len) -{ - int i; - - T6_send_word (0x24, addr); // Set Adress Pointer - T6_write_cmd(0xb0); // Set Data Auto Write - for (i=0; i8 ? 8 : Lcd.rows); - - T6_memset(0x0000, 0, Lcd.cols*rows); // clear text area - T6_memset(0x0200, 0, Lcd.cols*rows*8); // clear graphic area - - if (Lcd.rows>8) { - T6_memset(0x8000, 0, Lcd.cols*(Lcd.rows-rows)); // clear text area #2 - T6_memset(0x8200, 0, Lcd.cols*(Lcd.rows-rows)*8); // clear graphic area #2 - } - - memset(Buffer1,0,Lcd.cols*Lcd.rows*Lcd.yres*sizeof(*Buffer1)); - memset(Buffer2,0,Lcd.cols*Lcd.rows*Lcd.yres*sizeof(*Buffer2)); - } - - return pix_clear(); -} - - -int T6_init (LCD *Self) -{ - Lcd=*Self; - - if (pix_init (Lcd.rows, Lcd.cols, Lcd.xres, Lcd.yres)!=0) { - error ("T6963: pix_init(%d, %d, %d, %d) failed", Lcd.rows, Lcd.cols, Lcd.xres, Lcd.yres); - return -1; - } - - if (cfg_number(NULL, "Icons", 0, 0, 8, &Icons) < 0) return -1; - if (Icons>0) { - info ("allocating %d icons", Icons); - icon_init(Lcd.rows, Lcd.cols, Lcd.xres, Lcd.yres, 8, Icons, pix_icon); - Self->icons=Icons; - Lcd.icons=Icons; - } - - Buffer1=malloc(Lcd.cols*Lcd.rows*Lcd.yres); - if (Buffer1==NULL) { - error ("T6963: malloc(%d) failed: %s", Lcd.cols*Lcd.rows*Lcd.yres, strerror(errno)); - return -1; - } - - Buffer2=malloc(Lcd.cols*Lcd.rows*Lcd.yres); - if (Buffer2==NULL) { - error ("T6963: malloc(%d) failed: %s", Lcd.cols*Lcd.rows*Lcd.yres, strerror(errno)); - return -1; - } - - if ((SIGNAL_CE=parport_wire_ctrl ("CE", "STROBE"))==0xff) return -1; - if ((SIGNAL_CD=parport_wire_ctrl ("CD", "SELECT"))==0xff) return -1; - if ((SIGNAL_RD=parport_wire_ctrl ("RD", "AUTOFD"))==0xff) return -1; - if ((SIGNAL_WR=parport_wire_ctrl ("WR", "INIT") )==0xff) return -1; - - if (parport_open() != 0) { - error ("T6963: could not initialize parallel port!"); - return -1; - } - - // rise CE, CD, RD and WR - parport_control (SIGNAL_CE | SIGNAL_CD | SIGNAL_RD | SIGNAL_WR, - SIGNAL_CE | SIGNAL_CD | SIGNAL_RD | SIGNAL_WR); - - // set direction: write - parport_direction (0); - - debug ("setting %d columns", Lcd.cols); - - T6_send_word (0x40, 0x0000); // Set Text Home Address - T6_send_word (0x41, Lcd.cols); // Set Text Area - - T6_send_word (0x42, 0x0200); // Set Graphic Home Address - T6_send_word (0x43, Lcd.cols); // Set Graphic Area - - T6_write_cmd (0x80); // Mode Set: OR mode, Internal CG RAM mode - T6_send_word (0x22, 0x0002); // Set Offset Register - T6_write_cmd (0x98); // Set Display Mode: Curser off, Text off, Graphics on - T6_write_cmd (0xa0); // Set Cursor Pattern: 1 line cursor - T6_send_word (0x21, 0x0000); // Set Cursor Pointer to (0,0) - - T6_clear(1); - - return 0; -} - - -int T6_put (int row, int col, char *text) -{ - return pix_put(row,col,text); -} - - -int T6_bar (int type, int row, int col, int max, int len1, int len2) -{ - return pix_bar(type,row,col,max,len1,len2); -} - - -int T6_icon (int num, int seq, int row, int col) -{ - return icon_draw (num, seq, row, col); -} - - -int T6_flush (void) -{ - int i, j, e; - - memset(Buffer1,0,Lcd.cols*Lcd.rows*Lcd.yres*sizeof(*Buffer1)); - - for (i=0; i4) break; - } else { - e=0; - } - } - T6_memcpy (j, Buffer1+j, i-j-e+1); - } - - memcpy(Buffer2,Buffer1,Lcd.cols*Lcd.rows*Lcd.yres*sizeof(*Buffer1)); - - return 0; -} - - -int T6_quit (void) -{ - return parport_close(); -} - - -LCD T6963[] = { - { name: "TLC1091", - rows: 16, - cols: 40, - xres: 6, - yres: 8, - bars: BAR_L | BAR_R | BAR_U | BAR_D | BAR_H2 | BAR_V2 | BAR_T, - icons: 0, - gpos: 0, - init: T6_init, - clear: T6_clear, - put: T6_put, - bar: T6_bar, - icon: T6_icon, - gpo: NULL, - flush: T6_flush, - quit: T6_quit - }, - { name: "DMF5002N", - rows: 14, - cols: 16, - xres: 8, - yres: 8, - bars: BAR_L | BAR_R | BAR_U | BAR_D | BAR_H2 | BAR_V2 | BAR_T, - icons: 0, - gpos: 0, - init: T6_init, - clear: T6_clear, - put: T6_put, - bar: T6_bar, - icon: T6_icon, - gpo: NULL, - flush: T6_flush, - quit: T6_quit - }, - { NULL } -}; diff --git a/configure b/configure index 03f32b9..6925598 100755 --- a/configure +++ b/configure @@ -20935,7 +20935,7 @@ echo "${ECHO_T}done" >&6 PARPORT="no" SERIAL="no" TEXT="no" -RASTER="no" +GRAPHIC="no" if test "$BECKMANNEGLE" = "yes"; then # DRIVERS="$DRIVERS BeckmannEgle.lo" @@ -20984,6 +20984,7 @@ _ACEOF fi if test "$M50530" = "yes"; then + TEXT="yes" PARPORT="yes" # DRIVERS="$DRIVERS drv_M50530.lo" DRIVERS="$DRIVERS drv_M50530.o" @@ -20995,9 +20996,10 @@ _ACEOF fi if test "$T6963" = "yes"; then + GRAPHIC="yes" PARPORT="yes" -# DRIVERS="$DRIVERS T6963.lo" -# DRIVERS="$DRIVERS T6963.o" +# DRIVERS="$DRIVERS drv_T6963.lo" + DRIVERS="$DRIVERS drv_T6963.o" cat >>confdefs.h <<\_ACEOF #define WITH_T6963 1 @@ -21006,6 +21008,8 @@ _ACEOF fi if test "$USBLCD" = "yes"; then + TEXT="yes" + SERIAL="yes" # DRIVERS="$DRIVERS drv_USBLCD.lo" DRIVERS="$DRIVERS drv_USBLCD.o" @@ -21048,7 +21052,7 @@ fi if test "$PNG" = "yes"; then if test "$has_gd" = "true"; then - RASTER="yes" + GRAPHIC="yes" cat >>confdefs.h <<\_ACEOF #define WITH_PNG 1 @@ -21063,7 +21067,7 @@ fi if test "$PPM" = "yes"; then if test "$has_gd" = "true"; then - RASTER="yes" + GRAPHIC="yes" cat >>confdefs.h <<\_ACEOF #define WITH_PPM 1 @@ -21121,11 +21125,11 @@ if test "$TEXT" = "yes"; then DRIVERS="$DRIVERS drv_generic_text.o" fi -# Raster.lo depends on PPM or PNG -if test "$RASTER" = "yes"; then +# generic graphic driver +if test "$GRAPHIC" = "yes"; then : -# DRIVERS="$DRIVERS Raster.lo" -# DRIVERS="$DRIVERS Raster.o" +# DRIVERS="$DRIVERS + DRIVERS="$DRIVERS drv_generic_graphic.o" fi # generic parport driver diff --git a/configure.in b/configure.in index 731a3d5..cd157bc 100644 --- a/configure.in +++ b/configure.in @@ -142,7 +142,7 @@ AC_MSG_RESULT([done]) PARPORT="no" SERIAL="no" TEXT="no" -RASTER="no" +GRAPHIC="no" if test "$BECKMANNEGLE" = "yes"; then # DRIVERS="$DRIVERS BeckmannEgle.lo" @@ -175,6 +175,7 @@ if test "$HD44780" = "yes"; then fi if test "$M50530" = "yes"; then + TEXT="yes" PARPORT="yes" # DRIVERS="$DRIVERS drv_M50530.lo" DRIVERS="$DRIVERS drv_M50530.o" @@ -182,13 +183,16 @@ if test "$M50530" = "yes"; then fi if test "$T6963" = "yes"; then + GRAPHIC="yes" PARPORT="yes" -# DRIVERS="$DRIVERS T6963.lo" -# DRIVERS="$DRIVERS T6963.o" +# DRIVERS="$DRIVERS drv_T6963.lo" + DRIVERS="$DRIVERS drv_T6963.o" AC_DEFINE(WITH_T6963,1,[T6963 driver]) fi if test "$USBLCD" = "yes"; then + TEXT="yes" + SERIAL="yes" # DRIVERS="$DRIVERS drv_USBLCD.lo" DRIVERS="$DRIVERS drv_USBLCD.o" AC_DEFINE(WITH_USBLCD,1,[USBLCD driver]) @@ -215,7 +219,7 @@ fi if test "$PNG" = "yes"; then if test "$has_gd" = "true"; then - RASTER="yes" + GRAPHIC="yes" AC_DEFINE(WITH_PNG,1,[ driver]) DRVLIBS="$DRVLIBS -lgd" else @@ -225,7 +229,7 @@ fi if test "$PPM" = "yes"; then if test "$has_gd" = "true"; then - RASTER="yes" + GRAPHIC="yes" AC_DEFINE(WITH_PPM,1,[ driver]) else AC_MSG_WARN(gd.h not found: PNG driver disabled) @@ -265,11 +269,11 @@ if test "$TEXT" = "yes"; then DRIVERS="$DRIVERS drv_generic_text.o" fi -# Raster.lo depends on PPM or PNG -if test "$RASTER" = "yes"; then +# generic graphic driver +if test "$GRAPHIC" = "yes"; then : -# DRIVERS="$DRIVERS Raster.lo" -# DRIVERS="$DRIVERS Raster.o" +# DRIVERS="$DRIVERS + DRIVERS="$DRIVERS drv_generic_graphic.o" fi # generic parport driver diff --git a/drv.c b/drv.c index 0b0fd34..38d35b2 100644 --- a/drv.c +++ b/drv.c @@ -1,4 +1,4 @@ -/* $Id: drv.c,v 1.7 2004/02/15 08:22:47 reinelt Exp $ +/* $Id: drv.c,v 1.8 2004/02/15 21:43:43 reinelt Exp $ * * new framework for display drivers * @@ -23,6 +23,12 @@ * * * $Log: drv.c,v $ + * Revision 1.8 2004/02/15 21:43:43 reinelt + * T6963 driver nearly finished + * framework for graphic displays done + * i2c_sensors patch from Xavier + * some more old generation files removed + * * Revision 1.7 2004/02/15 08:22:47 reinelt * ported USBLCD driver to NextGeneration * added drv_M50530.c (I forgot yesterday, sorry) @@ -138,11 +144,9 @@ DRIVER *Driver[] = { #ifdef WITH_M50530 &drv_M50530, #endif - /* Fixme - #ifdef WITH_T6963 - &T6963, - #endif - */ +#ifdef WITH_T6963 + &drv_T6963, +#endif #ifdef WITH_USBLCD &drv_USBLCD, #endif diff --git a/drv_HD44780.c b/drv_HD44780.c index ece00c9..a942de7 100644 --- a/drv_HD44780.c +++ b/drv_HD44780.c @@ -1,4 +1,4 @@ -/* $Id: drv_HD44780.c,v 1.12 2004/02/14 11:56:17 reinelt Exp $ +/* $Id: drv_HD44780.c,v 1.13 2004/02/15 21:43:43 reinelt Exp $ * * new style driver for HD44780-based displays * @@ -29,6 +29,12 @@ * * * $Log: drv_HD44780.c,v $ + * Revision 1.13 2004/02/15 21:43:43 reinelt + * T6963 driver nearly finished + * framework for graphic displays done + * i2c_sensors patch from Xavier + * some more old generation files removed + * * Revision 1.12 2004/02/14 11:56:17 reinelt * M50530 driver ported * changed lots of 'char' to 'unsigned char' @@ -249,7 +255,7 @@ static void wait_for_busy_flag(int controller) // get the current time gettimeofday(&now, NULL); if (now.tv_sec==end.tv_sec?now.tv_usec>=end.tv_usec:now.tv_sec>=end.tv_sec) { - error ("HD44780: timeout waiting for busy flag on controller %x (%x)", controller, data); + error ("%s: timeout waiting for busy flag on controller %x (%x)", Name, controller, data); break; } diff --git a/drv_M50530.c b/drv_M50530.c index b33630e..7361855 100644 --- a/drv_M50530.c +++ b/drv_M50530.c @@ -1,4 +1,4 @@ -/* $Id: drv_M50530.c,v 1.1 2004/02/15 08:22:47 reinelt Exp $ +/* $Id: drv_M50530.c,v 1.2 2004/02/15 21:43:43 reinelt Exp $ * * new style driver for M50530-based displays * @@ -23,6 +23,12 @@ * * * $Log: drv_M50530.c,v $ + * Revision 1.2 2004/02/15 21:43:43 reinelt + * T6963 driver nearly finished + * framework for graphic displays done + * i2c_sensors patch from Xavier + * some more old generation files removed + * * Revision 1.1 2004/02/15 08:22:47 reinelt * ported USBLCD driver to NextGeneration * added drv_M50530.c (I forgot yesterday, sorry) @@ -64,7 +70,6 @@ static char Name[]="M50530"; static int Model; -static int Capabilities; static unsigned char SIGNAL_EX; static unsigned char SIGNAL_IOC1; @@ -79,12 +84,11 @@ static int GPOS; typedef struct { int type; char *name; - int capabilities; } MODEL; static MODEL Models[] = { - { 0x01, "generic", 0 }, - { 0xff, "Unknown", 0 } + { 0x01, "generic" }, + { 0xff, "Unknown" } }; @@ -182,7 +186,6 @@ static int drv_M5_start (char *section) return -1; } Model=i; - Capabilities=Models[Model].capabilities; info ("%s: using model '%s'", Name, Models[Model].name); } else { error ("%s: empty '%s.Model' entry from %s", Name, section, cfg_source()); diff --git a/drv_T6963.c b/drv_T6963.c new file mode 100644 index 0000000..2706805 --- /dev/null +++ b/drv_T6963.c @@ -0,0 +1,498 @@ +/* $Id: drv_T6963.c,v 1.1 2004/02/15 21:43:43 reinelt Exp $ + * + * new style driver for T6963-based displays + * + * Copyright 1999-2004 Michael Reinelt + * Copyright 2004 The LCD4Linux Team + * + * This file is part of LCD4Linux. + * + * LCD4Linux 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, or (at your option) + * any later version. + * + * LCD4Linux 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., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * + * $Log: drv_T6963.c,v $ + * Revision 1.1 2004/02/15 21:43:43 reinelt + * T6963 driver nearly finished + * framework for graphic displays done + * i2c_sensors patch from Xavier + * some more old generation files removed + * + */ + +/* + * + * exported fuctions: + * + * struct DRIVER drv_T6963 + * + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "debug.h" +#include "cfg.h" +#include "udelay.h" +#include "plugin.h" +#include "widget.h" +#include "widget_text.h" +#include "widget_icon.h" +#include "widget_bar.h" +#include "drv.h" +#include "drv_generic_graphic.h" +#include "drv_generic_parport.h" + +static char Name[]="T6963"; +static int Model; + +typedef struct { + int type; + char *name; +} MODEL; + +static MODEL Models[] = { + { 0x01, "generic" }, + { 0xff, "Unknown" } +}; + + +static unsigned char SIGNAL_CE; +static unsigned char SIGNAL_CD; +static unsigned char SIGNAL_RD; +static unsigned char SIGNAL_WR; + +// Fixme: +static int bug=0; + + +// **************************************** +// *** hardware dependant functions *** +// **************************************** + +// perform normal status check +static void drv_T6_status1 (void) +{ + int n; + + // turn off data line drivers + drv_generic_parport_direction (1); + + // lower CE and RD + drv_generic_parport_control (SIGNAL_CE | SIGNAL_RD, 0); + + // Access Time: 150 ns + ndelay(150); + + // wait for STA0=1 and STA1=1 + n=0; + do { + rep_nop(); + if (++n>1000) { + debug("hang in status1"); + bug=1; + break; + } + } while ((drv_generic_parport_read() & 0x03) != 0x03); + + // rise RD and CE + drv_generic_parport_control (SIGNAL_RD | SIGNAL_CE, SIGNAL_RD | SIGNAL_CE); + + // Output Hold Time: 50 ns + ndelay(50); + + // turn on data line drivers + drv_generic_parport_direction (0); +} + + +// perform status check in "auto mode" +static void drv_T6_status2 (void) +{ + int n; + + // turn off data line drivers + drv_generic_parport_direction (1); + + // lower RD and CE + drv_generic_parport_control (SIGNAL_RD | SIGNAL_CE, 0); + + // Access Time: 150 ns + ndelay(150); + + // wait for STA3=1 + n=0; + do { + rep_nop(); + if (++n>1000) { + debug("hang in status2"); + bug=1; + break; + } + } while ((drv_generic_parport_read() & 0x08) != 0x08); + + // rise RD and CE + drv_generic_parport_control (SIGNAL_RD | SIGNAL_CE, SIGNAL_RD | SIGNAL_CE); + + // Output Hold Time: 50 ns + ndelay(50); + + // turn on data line drivers + drv_generic_parport_direction (0); +} + + +static void drv_T6_write_cmd (unsigned char cmd) +{ + // wait until the T6963 is idle + drv_T6_status1(); + + // put data on DB1..DB8 + drv_generic_parport_data (cmd); + + // lower WR and CE + drv_generic_parport_control (SIGNAL_WR | SIGNAL_CE, 0); + + // Pulse width + ndelay(80); + + // rise WR and CE + drv_generic_parport_control (SIGNAL_WR | SIGNAL_CE, SIGNAL_WR | SIGNAL_CE); + + // Data Hold Time + ndelay(40); +} + + +static void drv_T6_write_data (unsigned char data) +{ + // wait until the T6963 is idle + drv_T6_status1(); + + // put data on DB1..DB8 + drv_generic_parport_data (data); + + // lower C/D + drv_generic_parport_control (SIGNAL_CD, 0); + + // C/D Setup Time + ndelay(20); + + // lower WR and CE + drv_generic_parport_control (SIGNAL_WR | SIGNAL_CE, 0); + + // Pulse Width + ndelay(80); + + // rise WR and CE + drv_generic_parport_control (SIGNAL_WR | SIGNAL_CE, SIGNAL_WR | SIGNAL_CE); + + // Data Hold Time + ndelay(40); + + // rise CD + drv_generic_parport_control (SIGNAL_CD, SIGNAL_CD); +} + + +static void drv_T6_write_auto (unsigned char data) +{ + // wait until the T6963 is idle + drv_T6_status2(); + + // put data on DB1..DB8 + drv_generic_parport_data (data); + + // lower C/D + drv_generic_parport_control (SIGNAL_CD, 0); + + // C/D Setup Time + ndelay(20); + + // lower WR and CE + drv_generic_parport_control (SIGNAL_WR | SIGNAL_CE, 0); + + // Pulse Width + ndelay(80); + + // rise WR and CE + drv_generic_parport_control (SIGNAL_WR | SIGNAL_CE, SIGNAL_WR | SIGNAL_CE); + + // Data Hold Time + ndelay(40); + + // rise CD + drv_generic_parport_control (SIGNAL_CD, SIGNAL_CD); +} + + +#if 0 // not used +static void drv_T6_send_byte (unsigned char cmd, unsigned char data) +{ + drv_T6_write_data(data); + drv_T6_write_cmd(cmd); +} +#endif + +static void drv_T6_send_word (unsigned char cmd, unsigned short data) +{ + drv_T6_write_data(data&0xff); + drv_T6_write_data(data>>8); + drv_T6_write_cmd(cmd); +} + + +static void drv_T6_memset(unsigned short addr, unsigned char data, int len) +{ + int i; + + drv_T6_send_word (0x24, addr); // Set Adress Pointer + drv_T6_write_cmd(0xb0); // Set Data Auto Write + for (i=0; i8) rows=8; + drv_T6_memset(0x0000, 0, cols*rows); // clear text area + drv_T6_memset(0x0200, 0, cols*rows*8); // clear graphic area + + // lower half + if (DROWS>8*8) { + rows=DROWS/8-8; + drv_T6_memset(0x8000, 0, cols*rows); // clear text area #2 + drv_T6_memset(0x8200, 0, cols*rows*8); // clear graphic area #2 + } + + return 0; +} + + +// **************************************** +// *** plugins *** +// **************************************** + +// none at the moment... + + +// **************************************** +// *** widget callbacks *** +// **************************************** + + +// using drv_generic_graphic_draw(W) +// using drv_generic_graphic_icon_draw(W) +// using drv_generic_graphic_bar_draw(W) + + +// **************************************** +// *** exported functions *** +// **************************************** + + +// list models +int drv_T6_list (void) +{ + int i; + + for (i=0; Models[i].type!=0xff; i++) { + printf ("%s ", Models[i].name); + } + return 0; +} + + +// initialize driver & display +int drv_T6_init (char *section) +{ + WIDGET_CLASS wc; + int ret; + + // display preferences + GOTO_COST = 2; // number of bytes a goto command requires + + // real worker functions + // Fixme: which one? + // drv_generic_text_real_write = drv_T6_write; + // drv_generic_text_real_goto = drv_T6_goto; + // drv_generic_text_real_defchar = drv_T6_defchar; + + // start display + if ((ret=drv_T6_start (section))!=0) + return ret; + + // initialize generic graphic driver + if ((ret=drv_generic_graphic_init(section, Name))!=0) + return ret; + + // register text widget + wc=Widget_Text; + wc.draw=drv_generic_graphic_draw; + widget_register(&wc); + + // register icon widget + wc=Widget_Icon; + wc.draw=drv_generic_graphic_icon_draw; + widget_register(&wc); + + // register bar widget + wc=Widget_Bar; + wc.draw=drv_generic_graphic_bar_draw; + widget_register(&wc); + + // register plugins + // none at the moment... + + + return 0; +} + + +// close driver & display +int drv_T6_quit (void) { + + info("%s: shutting down.", Name); + drv_generic_parport_close(); + drv_generic_graphic_quit(); + + return (0); +} + + +DRIVER drv_T6963 = { + name: Name, + list: drv_T6_list, + init: drv_T6_init, + quit: drv_T6_quit, +}; + + diff --git a/drv_generic_graphic.c b/drv_generic_graphic.c new file mode 100644 index 0000000..058b83c --- /dev/null +++ b/drv_generic_graphic.c @@ -0,0 +1,313 @@ +/* $Id + * + * generic driver helper for graphic displays + * + * Copyright 1999, 2000 Michael Reinelt + * Copyright 2004 The LCD4Linux Team + * + * This file is part of LCD4Linux. + * + * LCD4Linux 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, or (at your option) + * any later version. + * + * LCD4Linux 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., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * + * $Log: drv_generic_graphic.c,v $ + * Revision 1.1 2004/02/15 21:43:43 reinelt + * T6963 driver nearly finished + * framework for graphic displays done + * i2c_sensors patch from Xavier + * some more old generation files removed + * + */ + +/* + * + * exported fuctions: + * + * Fixme: document me! + * + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "debug.h" +#include "cfg.h" +#include "plugin.h" +#include "widget.h" +#include "widget_text.h" +#include "widget_icon.h" +#include "widget_bar.h" +#include "drv.h" +#include "drv_generic_graphic.h" +#include "font_6x8.h" + +#ifdef WITH_DMALLOC +#include +#endif + + +static char *Section=NULL; +static char *Driver=NULL; + +int DROWS, DCOLS; // display size (pixels!) +int LROWS, LCOLS; // layout size (pixels!) +int XRES, YRES; // pixels of one char cell +int GOTO_COST; // number of bytes a goto command requires + +static unsigned char *LayoutFB = NULL; +static unsigned char *DisplayFB = NULL; + + +// **************************************** +// *** generic Framebuffer stuff *** +// **************************************** + +static void drv_generic_graphic_resizeFB (int rows, int cols) +{ + char *newFB; + int row, col; + + // Layout FB is large enough + if (rows<=LROWS && cols<=LCOLS) + return; + + // get maximum values + if (rowsdata; + unsigned char *txt; + int row, col, len; + int x, y; + + row=YRES*W->row; + col=XRES*W->col; + txt=Text->buffer; + len=strlen(txt); + + // maybe grow layout framebuffer + drv_generic_graphic_resizeFB (row+YRES, col+XRES*len); + + // render text into layout FB + while (*txt!='\0') { + int c=*txt; + for (y=0; y>=1; + LayoutFB[(row+y)*LCOLS+col+x] = Font_6x8[c][y]&mask ? 1:0; + } + } + col+=XRES; + txt++; + } + + // flush area + drv_generic_graphic_flush (row, col, YRES, XRES*len); + + return 0; +} + + +// **************************************** +// *** generic icon handling *** +// **************************************** + +int drv_generic_graphic_icon_draw (WIDGET *W) +{ + WIDGET_ICON *Icon = W->data; + unsigned char *bitmap = Icon->bitmap+YRES*Icon->curmap; + int row, col; + int x, y; + + row = YRES*W->row; + col = XRES*W->col; + + // maybe grow layout framebuffer + drv_generic_graphic_resizeFB (row+YRES, col+XRES); + + // render icon + for (y=0; y>=1; + DisplayFB[(row+y)*LCOLS+col+x] = Icon->visible ? 0 : bitmap[y]&mask ? 1 : 0; + } + } + + // flush area + drv_generic_graphic_flush (row, col, YRES, XRES); + + return 0; + +} + + +// **************************************** +// *** generic bar handling *** +// **************************************** + +int drv_generic_graphic_bar_draw (WIDGET *W) +{ + WIDGET_BAR *Bar = W->data; + int row, col, len, res, rev, max, val1, val2; + int x, y; + DIRECTION dir; + + row = YRES*W->row; + col = XRES*W->col; + dir = Bar->direction; + len = Bar->length; + + // maybe grow layout framebuffer + if (dir & (DIR_EAST|DIR_WEST)) { + drv_generic_graphic_resizeFB (row+YRES, col+XRES*len); + } else { + drv_generic_graphic_resizeFB (row+YRES*len, col+XRES); + } + + res = dir & (DIR_EAST|DIR_WEST)?XRES:YRES; + max = len * res; + val1 = Bar->val1 * (double)(max); + val2 = Bar->val2 * (double)(max); + + if (val1<1) val1=1; + else if (val1>max) val1=max; + + if (val2<1) val2=1; + else if (val2>max) val2=max; + + rev=0; + + switch (dir) { + case DIR_WEST: + val1=max-val1; + val2=max-val2; + rev=1; + + case DIR_EAST: + for (y=0; y + * Copyright 2004 The LCD4Linux Team + * + * This file is part of LCD4Linux. + * + * LCD4Linux 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, or (at your option) + * any later version. + * + * LCD4Linux 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., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * + * $Log: drv_generic_graphic.h,v $ + * Revision 1.1 2004/02/15 21:43:43 reinelt + * T6963 driver nearly finished + * framework for graphic displays done + * i2c_sensors patch from Xavier + * some more old generation files removed + * + */ + +/* + * + * exported fuctions: + * + * Fixme: document me! + * + */ + +#ifndef _DRV_GENERIC_GRAPHIC_H_ +#define _DRV_GENERIC_GRAPHIC_H_ + + +#include +#include "widget.h" + + +extern int DROWS, DCOLS; // display size +extern int LROWS, LCOLS; // layout size +extern int XRES, YRES; // pixel width/height of one char +extern int GOTO_COST; // number of bytes a goto command requires + +// these functions must be implemented by the real driver +// Fixme: +void (*drv_generic_graphic_real_memcpy)(void); + + +int drv_generic_graphic_init (char *section, char *driver); +int drv_generic_graphic_draw (WIDGET *W); +int drv_generic_graphic_icon_draw (WIDGET *W); +int drv_generic_graphic_bar_draw (WIDGET *W); +int drv_generic_graphic_quit (void); + +#endif diff --git a/drv_generic_text.c b/drv_generic_text.c index e450ec6..60b7875 100644 --- a/drv_generic_text.c +++ b/drv_generic_text.c @@ -1,4 +1,4 @@ -/* $Id: drv_generic_text.c,v 1.10 2004/02/14 11:56:17 reinelt Exp $ +/* $Id: drv_generic_text.c,v 1.11 2004/02/15 21:43:43 reinelt Exp $ * * generic driver helper for text-based displays * @@ -23,6 +23,12 @@ * * * $Log: drv_generic_text.c,v $ + * Revision 1.11 2004/02/15 21:43:43 reinelt + * T6963 driver nearly finished + * framework for graphic displays done + * i2c_sensors patch from Xavier + * some more old generation files removed + * * Revision 1.10 2004/02/14 11:56:17 reinelt * M50530 driver ported * changed lots of 'char' to 'unsigned char' @@ -121,8 +127,8 @@ int CHARS, CHAR0; // number of user-defineable characters, ASCII of first char int ICONS; // number of user-defineable characters reserved for icons -static char *LayoutFB = NULL; -static char *DisplayFB = NULL; +static unsigned char *LayoutFB = NULL; +static unsigned char *DisplayFB = NULL; static int nSegment=0; static int fSegment=0; @@ -135,7 +141,7 @@ static BAR *BarFB = NULL; // *** generic Framebuffer stuff *** // **************************************** -void drv_generic_text_resizeFB (int rows, int cols) +static void drv_generic_text_resizeFB (int rows, int cols) { char *newFB; BAR *newBar; diff --git a/drv_generic_text.h b/drv_generic_text.h index ef8680c..f6c8099 100644 --- a/drv_generic_text.h +++ b/drv_generic_text.h @@ -1,4 +1,4 @@ -/* $Id: drv_generic_text.h,v 1.5 2004/02/14 11:56:17 reinelt Exp $ +/* $Id: drv_generic_text.h,v 1.6 2004/02/15 21:43:43 reinelt Exp $ * * generic driver helper for text-based displays * @@ -23,6 +23,12 @@ * * * $Log: drv_generic_text.h,v $ + * Revision 1.6 2004/02/15 21:43:43 reinelt + * T6963 driver nearly finished + * framework for graphic displays done + * i2c_sensors patch from Xavier + * some more old generation files removed + * * Revision 1.5 2004/02/14 11:56:17 reinelt * M50530 driver ported * changed lots of 'char' to 'unsigned char' @@ -73,7 +79,6 @@ void (*drv_generic_text_real_defchar)(int ascii, unsigned char *buffer); int drv_generic_text_init (char *section, char *driver); -void drv_generic_text_resizeFB (int rows, int cols); int drv_generic_text_draw (WIDGET *W); int drv_generic_text_icon_init (void); int drv_generic_text_icon_draw (WIDGET *W); diff --git a/font_6x8.h b/font_6x8.h new file mode 100644 index 0000000..da8f4d6 --- /dev/null +++ b/font_6x8.h @@ -0,0 +1,845 @@ +/* $Id: font_6x8.h,v 1.1 2004/02/15 21:43:43 reinelt Exp $ + * + * 6x8 font + * + * Copyright 1999, 2000, 2004 Michael Reinelt + * Copyright 2004 The LCD4Linux Team + * + * This file is part of LCD4Linux. + * + * LCD4Linux 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, or (at your option) + * any later version. + * + * LCD4Linux 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., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * + * $Log: font_6x8.h,v $ + * Revision 1.1 2004/02/15 21:43:43 reinelt + * T6963 driver nearly finished + * framework for graphic displays done + * i2c_sensors patch from Xavier + * some more old generation files removed + * + */ + +#define ______ 0x00 +#define _____O 0x01 +#define ____O_ 0x02 +#define ____OO 0x03 +#define ___O__ 0x04 +#define ___O_O 0x05 +#define ___OO_ 0x06 +#define ___OOO 0x07 +#define __O___ 0x08 +#define __O__O 0x09 +#define __O_O_ 0x0a +#define __O_OO 0x0b +#define __OO__ 0x0c +#define __OO_O 0x0d +#define __OOO_ 0x0e +#define __OOOO 0x0f +#define _O____ 0x10 +#define _O___O 0x11 +#define _O__O_ 0x12 +#define _O__OO 0x13 +#define _O_O__ 0x14 +#define _O_O_O 0x15 +#define _O_OO_ 0x16 +#define _O_OOO 0x17 +#define _OO___ 0x18 +#define _OO__O 0x19 +#define _OO_O_ 0x1a +#define _OO_OO 0x1b +#define _OOO__ 0x1c +#define _OOO_O 0x1d +#define _OOOO_ 0x1e +#define _OOOOO 0x1f + +unsigned char Font_6x8[256][8]={ + [0x20] { ______, + ______, + ______, + ______, + ______, + ______, + ______, + ______ }, + [0x21] { ___O__, + ___O__, + ___O__, + ___O__, + ______, + ______, + ___O__, + ______ }, + [0x22] { __O_O_, + __O_O_, + __O_O_, + ______, + ______, + ______, + ______, + ______ }, + [0x23] { __O_O_, + __O_O_, + _OOOOO, + __O_O_, + _OOOOO, + __O_O_, + __O_O_, + ______ }, + [0x24] { ___O__, + __OOOO, + _O_O__, + __OOO_, + ___O_O, + _OOOO_, + ___O__, + ______ }, + [0x25] { _OO___, + _OO__O, + ____O_, + ___O__, + __O___, + _O__OO, + ____OO, + ______ }, + [0x26] { __OO__, + _O__O_, + _O_O__, + __O___, + _O_O_O, + _O__O_, + __OO_O, + ______ }, + [0x27] { __OO__, + ___O__, + __O___, + ______, + ______, + ______, + ______, + ______ }, + [0x28] { ____O_, + ___O__, + __O___, + __O___, + __O___, + ___O__, + ____O_, + ______ }, + [0x29] { __O___, + ___O__, + ____O_, + ____O_, + ____O_, + ___O__, + __O___, + ______ }, + [0x2a] { ______, + ___O__, + _O_O_O, + __OOO_, + _O_O_O, + ___O__, + ______, + ______ }, + [0x2b] { ______, + ___O__, + ___O__, + _OOOOO, + ___O__, + ___O__, + ______, + ______ }, + [0x2c] { ______, + ______, + ______, + ______, + __OO__, + ___O__, + __O___, + ______ }, + [0x2d] { ______, + ______, + ______, + _OOOOO, + ______, + ______, + ______, + ______ }, + [0x2e] { ______, + ______, + ______, + ______, + ______, + __OO__, + __OO__, + ______ }, + [0x2f] { ______, + _____O, + ____O_, + ___O__, + __O___, + _O____, + ______, + ______ }, + [0x30] { __OOO_, + _O___O, + _O__OO, + _O_O_O, + _OO__O, + _O___O, + __OOO_, + ______ }, + [0x31] { ___O__, + __OO__, + ___O__, + ___O__, + ___O__, + ___O__, + __OOO_, + ______ }, + [0x32] { __OOO_, + _O___O, + _____O, + ____O_, + ___O__, + __O___, + _OOOOO, + ______ }, + [0x33] { _OOOOO, + ____O_, + ___O__, + ____O_, + _____O, + _O___O, + __OOO_, + ______ }, + [0x34] { ____O_, + ___OO_, + __O_O_, + _O__O_, + _OOOOO, + ____O_, + ____O_, + ______ }, + [0x35] { _OOOOO, + _O____, + _O____, + _OOOO_, + _____O, + _O___O, + __OOO_, + ______ }, + [0x36] { ___OO_, + __O___, + _O____, + _OOOO_, + _O___O, + _O___O, + __OOO_, + ______ }, + [0x37] { _OOOOO, + _____O, + ____O_, + ___O__, + __O___, + __O___, + __O___, + ______ }, + [0x38] { __OOO_, + _O___O, + _O___O, + __OOO_, + _O___O, + _O___O, + __OOO_, + ______ }, + [0x39] { __OOO_, + _O___O, + _O___O, + __OOOO, + _____O, + ____O_, + __OO__, + ______ }, + [0x3a] { ______, + __OO__, + __OO__, + ______, + __OO__, + __OO__, + ______, + ______ }, + [0x3b] { ______, + __OO__, + __OO__, + ______, + __OO__, + ___O__, + __O___, + ______ }, + [0x3c] { ____O_, + ___O__, + __O___, + _O____, + __O___, + ___O__, + ____O_, + ______ }, + [0x3d] { ______, + ______, + _OOOOO, + ______, + _OOOOO, + ______, + ______, + ______ }, + [0x3e] { _O____, + __O___, + ___O__, + ____O_, + ___O__, + __O___, + _O____, + ______ }, + [0x3f] { __OOO_, + _O___O, + _____O, + ____O_, + ___O__, + ______, + ___O__, + ______ }, + [0x40] { __OOO_, + _O___O, + _____O, + __OO_O, + _O_O_O, + _O_O_O, + __OOO_, + ______ }, + [0x41] { __OOO_, + _O___O, + _O___O, + _O___O, + _OOOOO, + _O___O, + _O___O, + ______ }, + [0x42] { _OOOO_, + _O___O, + _O___O, + _OOOO_, + _O___O, + _O___O, + _OOOO_, + ______ }, + [0x43] { __OOO_, + _O___O, + _O____, + _O____, + _O____, + _O___O, + __OOO_, + ______ }, + [0x44] { _OOO__, + _O__O_, + _O___O, + _O___O, + _O___O, + _O__O_, + _OOO__, + ______ }, + [0x45] { _OOOOO, + _O____, + _O____, + _OOOO_, + _O____, + _O____, + _OOOOO, + ______ }, + [0x46] { _OOOOO, + _O____, + _O____, + _OOOO_, + _O____, + _O____, + _O____, + ______ }, + [0x47] { __OOO_, + _O___O, + _O____, + _O_OOO, + _O___O, + _O___O, + __OOOO, + ______ }, + [0x48] { _O___O, + _O___O, + _O___O, + _OOOOO, + _O___O, + _O___O, + _O___O, + ______ }, + [0x49] { __OOO_, + ___O__, + ___O__, + ___O__, + ___O__, + ___O__, + __OOO_, + ______ }, + [0x4a] { ___OOO, + ____O_, + ____O_, + ____O_, + ____O_, + _O__O_, + __OO__, + ______ }, + [0x4b] { _O___O, + _O__O_, + _O_O__, + _OO___, + _O_O__, + _O__O_, + _O___O, + ______ }, + [0x4c] { _O____, + _O____, + _O____, + _O____, + _O____, + _O____, + _OOOOO, + ______ }, + [0x4d] { _O___O, + _OO_OO, + _O_O_O, + _O_O_O, + _O___O, + _O___O, + _O___O, + ______ }, + [0x4e] { _O___O, + _O___O, + _OO__O, + _O_O_O, + _O__OO, + _O___O, + _O___O, + ______ }, + [0x4f] { __OOO_, + _O___O, + _O___O, + _O___O, + _O___O, + _O___O, + __OOO_, + ______ }, + [0x50] { _OOOO_, + _O___O, + _O___O, + _OOOO_, + _O____, + _O____, + _O____, + ______ }, + [0x51] { __OOO_, + _O___O, + _O___O, + _O___O, + _O_O_O, + _O__O_, + __OO_O, + ______ }, + [0x52] { _OOOO_, + _O___O, + _O___O, + _OOOO_, + _O_O__, + _O__O_, + _O___O, + ______ }, + [0x53] { __OOOO, + _O____, + _O____, + __OOO_, + _____O, + _____O, + _OOOO_, + ______ }, + [0x54] { _OOOOO, + ___O__, + ___O__, + ___O__, + ___O__, + ___O__, + ___O__, + ______ }, + [0x55] { _O___O, + _O___O, + _O___O, + _O___O, + _O___O, + _O___O, + __OOO_, + ______ }, + [0x56] { _O___O, + _O___O, + _O___O, + _O___O, + _O___O, + __O_O_, + ___O__, + ______ }, + [0x57] { _O___O, + _O___O, + _O___O, + _O_O_O, + _O_O_O, + _O_O_O, + __O_O_, + ______ }, + [0x58] { _O___O, + _O___O, + __O_O_, + ___O__, + __O_O_, + _O___O, + _O___O, + ______ }, + [0x59] { _O___O, + _O___O, + _O___O, + __O_O_, + ___O__, + ___O__, + ___O__, + ______ }, + [0x5a] { _OOOOO, + _____O, + ____O_, + ___O__, + __O___, + _O____, + _OOOOO, + ______ }, + [0x5b] { __OOO_, + __O___, + __O___, + __O___, + __O___, + __O___, + __OOO_, + ______ }, + [0x5c] { _O___O, + __O_O_, + _OOOOO, + ___O__, + _OOOOO, + ___O__, + ___O__, + ______ }, + [0x5d] { __OOO_, + ____O_, + ____O_, + ____O_, + ____O_, + ____O_, + __OOO_, + ______ }, + [0x5e] { ___O__, + __O_O_, + _O___O, + ______, + ______, + ______, + ______, + ______ }, + [0x5f] { ______, + ______, + ______, + ______, + ______, + ______, + _OOOOO, + ______ }, + [0x60] { __O___, + ___O__, + ____O_, + ______, + ______, + ______, + ______, + ______ }, + [0x61] { ______, + ______, + __OOO_, + _____O, + __OOOO, + _O___O, + __OOOO, + ______ }, + [0x62] { _O____, + _O____, + _O____, + _O_OO_, + _OO__O, + _O___O, + _OOOO_, + ______ }, + [0x63] { ______, + ______, + __OOO_, + _O____, + _O____, + _O___O, + __OOO_, + ______ }, + [0x64] { _____O, + _____O, + _____O, + __OO_O, + _O__OO, + _O___O, + __OOOO, + ______ }, + [0x65] { ______, + ______, + __OOO_, + _O___O, + _OOOOO, + _O____, + __OOO_, + ______ }, + [0x66] { ___OO_, + __O__O, + __O___, + _OOO__, + __O___, + __O___, + __O___, + ______ }, + [0x67] { ______, + __OOOO, + _O___O, + _O___O, + __OOOO, + _____O, + __OOO_, + ______ }, + [0x68] { _O____, + _O____, + _O_OO_, + _OO__O, + _O___O, + _O___O, + _O___O, + ______ }, + [0x69] { ___O__, + ______, + __OO__, + ___O__, + ___O__, + ___O__, + __OOO_, + ______ }, + [0x6a] { ____O_, + ______, + ___OO_, + ____O_, + ____O_, + _O__O_, + __OO__, + ______ }, + [0x6b] { __O___, + __O___, + __O__O, + __O_O_, + __OO__, + __O_O_, + __O__O, + ______ }, + [0x6c] { __OO__, + ___O__, + ___O__, + ___O__, + ___O__, + ___O__, + __OOO_, + ______ }, + [0x6d] { ______, + ______, + _OO_O_, + _O_O_O, + _O_O_O, + _O___O, + _O___O, + ______ }, + [0x6e] { ______, + ______, + _OOOO_, + _O___O, + _O___O, + _O___O, + _O___O, + ______ }, + [0x6f] { ______, + ______, + __OOO_, + _O___O, + _O___O, + _O___O, + __OOO_, + ______ }, + [0x70] { ______, + ______, + _OOOO_, + _O___O, + _OOOO_, + _O____, + _O____, + ______ }, + [0x71] { ______, + ______, + __OO_O, + _O__OO, + __OOOO, + _____O, + _____O, + ______ }, + [0x72] { ______, + ______, + _O_OO_, + _OO__O, + _O____, + _O____, + _O____, + ______ }, + [0x73] { ______, + ______, + __OOO_, + _O____, + __OOO_, + _____O, + _OOOO_, + ______ }, + [0x74] { __O___, + _OOO__, + __O___, + __O___, + __O___, + __O__O, + ___OO_, + ______ }, + [0x75] { ______, + ______, + _O___O, + _O___O, + _O___O, + _O__OO, + __OO_O, + ______ }, + [0x76] { ______, + ______, + _O___O, + _O___O, + _O___O, + __O_O_, + ___O__, + ______ }, + [0x77] { ______, + ______, + _O___O, + _O___O, + _O___O, + _O_O_O, + __O_O_, + ______ }, + [0x78] { ______, + ______, + _O___O, + __O_O_, + ___O__, + __O_O_, + _O___O, + ______ }, + [0x79] { ______, + ______, + _O___O, + _O___O, + __OOOO, + _____O, + __OOO_, + ______ }, + [0x7a] { ______, + ______, + _OOOOO, + ____O_, + ___O__, + __O___, + _OOOOO, + ______ }, + [0x7b] { ____O_, + ___O__, + ___O__, + __O___, + ___O__, + ___O__, + ____O_, + ______ }, + [0x7c] { ___O__, + ___O__, + ___O__, + ___O__, + ___O__, + ___O__, + ___O__, + ______ }, + [0x7d] { __O___, + ___O__, + ___O__, + ____O_, + ___O__, + ___O__, + __O___, + ______ }, + [0x7e] { ______, + ___O__, + ____O_, + _OOOOO, + ____O_, + ___O__, + ______, + ______ }, + + [0x7f] { ______, + ___O__, + __O___, + _OOOOO, + __O___, + ___O__, + ______, + ______ }, + [0xb0] { __OOO_, + __O_O_, + __OOO_, + ______, + ______, + ______, + ______, + ______ }, +}; diff --git a/fontmap.c b/fontmap.c deleted file mode 100644 index 709632a..0000000 --- a/fontmap.c +++ /dev/null @@ -1,871 +0,0 @@ -/* $Id: fontmap.c,v 1.6 2004/01/29 04:40:02 reinelt Exp $ - * - * 5x8 font - * - * Copyright 1999, 2000 Michael Reinelt - * - * This file is part of LCD4Linux. - * - * LCD4Linux 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, or (at your option) - * any later version. - * - * LCD4Linux 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., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * - * $Log: fontmap.c,v $ - * Revision 1.6 2004/01/29 04:40:02 reinelt - * every .c file includes "config.h" now - * - * Revision 1.5 2003/10/05 17:58:50 reinelt - * libtool junk; copyright messages cleaned up - * - * Revision 1.4 2000/08/10 09:44:09 reinelt - * - * new debugging scheme: error(), info(), debug() - * uses syslog if in daemon mode - * - * Revision 1.3 2000/03/25 05:50:43 reinelt - * - * memory leak in Raster_flush closed - * driver family logic changed - * - * Revision 1.2 2000/03/24 11:36:56 reinelt - * - * new syntax for raster configuration - * changed XRES and YRES to be configurable - * PPM driver works nice - * - * Revision 1.1 2000/03/22 15:36:21 reinelt - * - * added '-l' switch (list drivers) - * generic pixmap driver added - * X11 Framework done - * - */ - -#include "config.h" - -#include "pixmap.h" -#include "fontmap.h" - -#define ______ 0x00 -#define _____O 0x01 -#define ____O_ 0x02 -#define ____OO 0x03 -#define ___O__ 0x04 -#define ___O_O 0x05 -#define ___OO_ 0x06 -#define ___OOO 0x07 -#define __O___ 0x08 -#define __O__O 0x09 -#define __O_O_ 0x0a -#define __O_OO 0x0b -#define __OO__ 0x0c -#define __OO_O 0x0d -#define __OOO_ 0x0e -#define __OOOO 0x0f -#define _O____ 0x10 -#define _O___O 0x11 -#define _O__O_ 0x12 -#define _O__OO 0x13 -#define _O_O__ 0x14 -#define _O_O_O 0x15 -#define _O_OO_ 0x16 -#define _O_OOO 0x17 -#define _OO___ 0x18 -#define _OO__O 0x19 -#define _OO_O_ 0x1a -#define _OO_OO 0x1b -#define _OOO__ 0x1c -#define _OOO_O 0x1d -#define _OOOO_ 0x1e -#define _OOOOO 0x1f - -unsigned char Fontmap[256][8]={ - [0x20] { ______, - ______, - ______, - ______, - ______, - ______, - ______, - ______ }, - [0x21] { ___O__, - ___O__, - ___O__, - ___O__, - ______, - ______, - ___O__, - ______ }, - [0x22] { __O_O_, - __O_O_, - __O_O_, - ______, - ______, - ______, - ______, - ______ }, - [0x23] { __O_O_, - __O_O_, - _OOOOO, - __O_O_, - _OOOOO, - __O_O_, - __O_O_, - ______ }, - [0x24] { ___O__, - __OOOO, - _O_O__, - __OOO_, - ___O_O, - _OOOO_, - ___O__, - ______ }, - [0x25] { _OO___, - _OO__O, - ____O_, - ___O__, - __O___, - _O__OO, - ____OO, - ______ }, - [0x26] { __OO__, - _O__O_, - _O_O__, - __O___, - _O_O_O, - _O__O_, - __OO_O, - ______ }, - [0x27] { __OO__, - ___O__, - __O___, - ______, - ______, - ______, - ______, - ______ }, - [0x28] { ____O_, - ___O__, - __O___, - __O___, - __O___, - ___O__, - ____O_, - ______ }, - [0x29] { __O___, - ___O__, - ____O_, - ____O_, - ____O_, - ___O__, - __O___, - ______ }, - [0x2a] { ______, - ___O__, - _O_O_O, - __OOO_, - _O_O_O, - ___O__, - ______, - ______ }, - [0x2b] { ______, - ___O__, - ___O__, - _OOOOO, - ___O__, - ___O__, - ______, - ______ }, - [0x2c] { ______, - ______, - ______, - ______, - __OO__, - ___O__, - __O___, - ______ }, - [0x2d] { ______, - ______, - ______, - _OOOOO, - ______, - ______, - ______, - ______ }, - [0x2e] { ______, - ______, - ______, - ______, - ______, - __OO__, - __OO__, - ______ }, - [0x2f] { ______, - _____O, - ____O_, - ___O__, - __O___, - _O____, - ______, - ______ }, - [0x30] { __OOO_, - _O___O, - _O__OO, - _O_O_O, - _OO__O, - _O___O, - __OOO_, - ______ }, - [0x31] { ___O__, - __OO__, - ___O__, - ___O__, - ___O__, - ___O__, - __OOO_, - ______ }, - [0x32] { __OOO_, - _O___O, - _____O, - ____O_, - ___O__, - __O___, - _OOOOO, - ______ }, - [0x33] { _OOOOO, - ____O_, - ___O__, - ____O_, - _____O, - _O___O, - __OOO_, - ______ }, - [0x34] { ____O_, - ___OO_, - __O_O_, - _O__O_, - _OOOOO, - ____O_, - ____O_, - ______ }, - [0x35] { _OOOOO, - _O____, - _O____, - _OOOO_, - _____O, - _O___O, - __OOO_, - ______ }, - [0x36] { ___OO_, - __O___, - _O____, - _OOOO_, - _O___O, - _O___O, - __OOO_, - ______ }, - [0x37] { _OOOOO, - _____O, - ____O_, - ___O__, - __O___, - __O___, - __O___, - ______ }, - [0x38] { __OOO_, - _O___O, - _O___O, - __OOO_, - _O___O, - _O___O, - __OOO_, - ______ }, - [0x39] { __OOO_, - _O___O, - _O___O, - __OOOO, - _____O, - ____O_, - __OO__, - ______ }, - [0x3a] { ______, - __OO__, - __OO__, - ______, - __OO__, - __OO__, - ______, - ______ }, - [0x3b] { ______, - __OO__, - __OO__, - ______, - __OO__, - ___O__, - __O___, - ______ }, - [0x3c] { ____O_, - ___O__, - __O___, - _O____, - __O___, - ___O__, - ____O_, - ______ }, - [0x3d] { ______, - ______, - _OOOOO, - ______, - _OOOOO, - ______, - ______, - ______ }, - [0x3e] { _O____, - __O___, - ___O__, - ____O_, - ___O__, - __O___, - _O____, - ______ }, - [0x3f] { __OOO_, - _O___O, - _____O, - ____O_, - ___O__, - ______, - ___O__, - ______ }, - [0x40] { __OOO_, - _O___O, - _____O, - __OO_O, - _O_O_O, - _O_O_O, - __OOO_, - ______ }, - [0x41] { __OOO_, - _O___O, - _O___O, - _O___O, - _OOOOO, - _O___O, - _O___O, - ______ }, - [0x42] { _OOOO_, - _O___O, - _O___O, - _OOOO_, - _O___O, - _O___O, - _OOOO_, - ______ }, - [0x43] { __OOO_, - _O___O, - _O____, - _O____, - _O____, - _O___O, - __OOO_, - ______ }, - [0x44] { _OOO__, - _O__O_, - _O___O, - _O___O, - _O___O, - _O__O_, - _OOO__, - ______ }, - [0x45] { _OOOOO, - _O____, - _O____, - _OOOO_, - _O____, - _O____, - _OOOOO, - ______ }, - [0x46] { _OOOOO, - _O____, - _O____, - _OOOO_, - _O____, - _O____, - _O____, - ______ }, - [0x47] { __OOO_, - _O___O, - _O____, - _O_OOO, - _O___O, - _O___O, - __OOOO, - ______ }, - [0x48] { _O___O, - _O___O, - _O___O, - _OOOOO, - _O___O, - _O___O, - _O___O, - ______ }, - [0x49] { __OOO_, - ___O__, - ___O__, - ___O__, - ___O__, - ___O__, - __OOO_, - ______ }, - [0x4a] { ___OOO, - ____O_, - ____O_, - ____O_, - ____O_, - _O__O_, - __OO__, - ______ }, - [0x4b] { _O___O, - _O__O_, - _O_O__, - _OO___, - _O_O__, - _O__O_, - _O___O, - ______ }, - [0x4c] { _O____, - _O____, - _O____, - _O____, - _O____, - _O____, - _OOOOO, - ______ }, - [0x4d] { _O___O, - _OO_OO, - _O_O_O, - _O_O_O, - _O___O, - _O___O, - _O___O, - ______ }, - [0x4e] { _O___O, - _O___O, - _OO__O, - _O_O_O, - _O__OO, - _O___O, - _O___O, - ______ }, - [0x4f] { __OOO_, - _O___O, - _O___O, - _O___O, - _O___O, - _O___O, - __OOO_, - ______ }, - [0x50] { _OOOO_, - _O___O, - _O___O, - _OOOO_, - _O____, - _O____, - _O____, - ______ }, - [0x51] { __OOO_, - _O___O, - _O___O, - _O___O, - _O_O_O, - _O__O_, - __OO_O, - ______ }, - [0x52] { _OOOO_, - _O___O, - _O___O, - _OOOO_, - _O_O__, - _O__O_, - _O___O, - ______ }, - [0x53] { __OOOO, - _O____, - _O____, - __OOO_, - _____O, - _____O, - _OOOO_, - ______ }, - [0x54] { _OOOOO, - ___O__, - ___O__, - ___O__, - ___O__, - ___O__, - ___O__, - ______ }, - [0x55] { _O___O, - _O___O, - _O___O, - _O___O, - _O___O, - _O___O, - __OOO_, - ______ }, - [0x56] { _O___O, - _O___O, - _O___O, - _O___O, - _O___O, - __O_O_, - ___O__, - ______ }, - [0x57] { _O___O, - _O___O, - _O___O, - _O_O_O, - _O_O_O, - _O_O_O, - __O_O_, - ______ }, - [0x58] { _O___O, - _O___O, - __O_O_, - ___O__, - __O_O_, - _O___O, - _O___O, - ______ }, - [0x59] { _O___O, - _O___O, - _O___O, - __O_O_, - ___O__, - ___O__, - ___O__, - ______ }, - [0x5a] { _OOOOO, - _____O, - ____O_, - ___O__, - __O___, - _O____, - _OOOOO, - ______ }, - [0x5b] { __OOO_, - __O___, - __O___, - __O___, - __O___, - __O___, - __OOO_, - ______ }, - [0x5c] { _O___O, - __O_O_, - _OOOOO, - ___O__, - _OOOOO, - ___O__, - ___O__, - ______ }, - [0x5d] { __OOO_, - ____O_, - ____O_, - ____O_, - ____O_, - ____O_, - __OOO_, - ______ }, - [0x5e] { ___O__, - __O_O_, - _O___O, - ______, - ______, - ______, - ______, - ______ }, - [0x5f] { ______, - ______, - ______, - ______, - ______, - ______, - _OOOOO, - ______ }, - [0x60] { __O___, - ___O__, - ____O_, - ______, - ______, - ______, - ______, - ______ }, - [0x61] { ______, - ______, - __OOO_, - _____O, - __OOOO, - _O___O, - __OOOO, - ______ }, - [0x62] { _O____, - _O____, - _O____, - _O_OO_, - _OO__O, - _O___O, - _OOOO_, - ______ }, - [0x63] { ______, - ______, - __OOO_, - _O____, - _O____, - _O___O, - __OOO_, - ______ }, - [0x64] { _____O, - _____O, - _____O, - __OO_O, - _O__OO, - _O___O, - __OOOO, - ______ }, - [0x65] { ______, - ______, - __OOO_, - _O___O, - _OOOOO, - _O____, - __OOO_, - ______ }, - [0x66] { ___OO_, - __O__O, - __O___, - _OOO__, - __O___, - __O___, - __O___, - ______ }, - [0x67] { ______, - __OOOO, - _O___O, - _O___O, - __OOOO, - _____O, - __OOO_, - ______ }, - [0x68] { _O____, - _O____, - _O_OO_, - _OO__O, - _O___O, - _O___O, - _O___O, - ______ }, - [0x69] { ___O__, - ______, - __OO__, - ___O__, - ___O__, - ___O__, - __OOO_, - ______ }, - [0x6a] { ____O_, - ______, - ___OO_, - ____O_, - ____O_, - _O__O_, - __OO__, - ______ }, - [0x6b] { __O___, - __O___, - __O__O, - __O_O_, - __OO__, - __O_O_, - __O__O, - ______ }, - [0x6c] { __OO__, - ___O__, - ___O__, - ___O__, - ___O__, - ___O__, - __OOO_, - ______ }, - [0x6d] { ______, - ______, - _OO_O_, - _O_O_O, - _O_O_O, - _O___O, - _O___O, - ______ }, - [0x6e] { ______, - ______, - _OOOO_, - _O___O, - _O___O, - _O___O, - _O___O, - ______ }, - [0x6f] { ______, - ______, - __OOO_, - _O___O, - _O___O, - _O___O, - __OOO_, - ______ }, - [0x70] { ______, - ______, - _OOOO_, - _O___O, - _OOOO_, - _O____, - _O____, - ______ }, - [0x71] { ______, - ______, - __OO_O, - _O__OO, - __OOOO, - _____O, - _____O, - ______ }, - [0x72] { ______, - ______, - _O_OO_, - _OO__O, - _O____, - _O____, - _O____, - ______ }, - [0x73] { ______, - ______, - __OOO_, - _O____, - __OOO_, - _____O, - _OOOO_, - ______ }, - [0x74] { __O___, - _OOO__, - __O___, - __O___, - __O___, - __O__O, - ___OO_, - ______ }, - [0x75] { ______, - ______, - _O___O, - _O___O, - _O___O, - _O__OO, - __OO_O, - ______ }, - [0x76] { ______, - ______, - _O___O, - _O___O, - _O___O, - __O_O_, - ___O__, - ______ }, - [0x77] { ______, - ______, - _O___O, - _O___O, - _O___O, - _O_O_O, - __O_O_, - ______ }, - [0x78] { ______, - ______, - _O___O, - __O_O_, - ___O__, - __O_O_, - _O___O, - ______ }, - [0x79] { ______, - ______, - _O___O, - _O___O, - __OOOO, - _____O, - __OOO_, - ______ }, - [0x7a] { ______, - ______, - _OOOOO, - ____O_, - ___O__, - __O___, - _OOOOO, - ______ }, - [0x7b] { ____O_, - ___O__, - ___O__, - __O___, - ___O__, - ___O__, - ____O_, - ______ }, - [0x7c] { ___O__, - ___O__, - ___O__, - ___O__, - ___O__, - ___O__, - ___O__, - ______ }, - [0x7d] { __O___, - ___O__, - ___O__, - ____O_, - ___O__, - ___O__, - __O___, - ______ }, - [0x7e] { ______, - ___O__, - ____O_, - _OOOOO, - ____O_, - ___O__, - ______, - ______ }, - - [0x7f] { ______, - ___O__, - __O___, - _OOOOO, - __O___, - ___O__, - ______, - ______ }, - [0xb0] { __OOO_, - __O_O_, - __OOO_, - ______, - ______, - ______, - ______, - ______ }, -}; diff --git a/fontmap.h b/fontmap.h deleted file mode 100644 index 7708832..0000000 --- a/fontmap.h +++ /dev/null @@ -1,39 +0,0 @@ -/* $Id: fontmap.h,v 1.2 2003/10/05 17:58:50 reinelt Exp $ - * - * 5x8 font - * - * Copyright 1999, 2000 Michael Reinelt - * - * This file is part of LCD4Linux. - * - * LCD4Linux 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, or (at your option) - * any later version. - * - * LCD4Linux 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., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * - * $Log: fontmap.h,v $ - * Revision 1.2 2003/10/05 17:58:50 reinelt - * libtool junk; copyright messages cleaned up - * - * Revision 1.1 2000/03/24 11:37:43 reinelt - * - * fontmap.h added - * - */ - -#ifndef _FONTMAP_H_ -#define _FONTMAP_H_ - -extern unsigned char Fontmap[256][8]; - -#endif diff --git a/lcd4linux.conf.sample b/lcd4linux.conf.sample index 164fff9..73cf1fc 100644 --- a/lcd4linux.conf.sample +++ b/lcd4linux.conf.sample @@ -71,6 +71,17 @@ Display USBLCD { } +Display T6963-240x64 { + Driver 'T6963' + Port '/dev/parports/0' + Size '240x64' + Wire.CE 'STROBE' + Wire.CD 'SELECT' + Wire.RD 'AUTOFD' + Wire.WR 'INIT' +} + + Widget OS { class 'Text' expression '*** '.uname('sysname').' '.uname('release').' ***' @@ -291,7 +302,8 @@ Layout L16x2 { #Display 'CF631' #Display 'CF632' #Display 'CF633' -Display 'USBLCD' +#Display 'USBLCD' +Display 'T6963-240x64' Layout 'Default' #Layout 'L16x2' diff --git a/libtool b/libtool index 1818a25..252dfd6 100755 --- a/libtool +++ b/libtool @@ -399,8 +399,8 @@ modename="$progname" # Constants. PROGRAM=ltmain.sh PACKAGE=libtool -VERSION=1.5.0a -TIMESTAMP=" (1.1220.2.35 2003/11/12 18:51:58) Debian$Rev: 179 $" +VERSION=1.5.2 +TIMESTAMP=" (1.1220.2.60 2004/01/25 12:25:08) Debian$Rev: 192 $" default_mode= help="Try \`$progname --help' for more information." @@ -1234,6 +1234,7 @@ EOF no_install=no objs= non_pic_objects= + precious_files_regex= prefer_static_libs=no preload=no prev= @@ -1397,6 +1398,11 @@ EOF prev= continue ;; + precious_regex) + precious_files_regex="$arg" + prev= + continue + ;; release) release="-$arg" prev= @@ -1763,6 +1769,11 @@ EOF -o) prev=output ;; + -precious-files-regex) + prev=precious_regex + continue + ;; + -release) prev=release continue @@ -2665,9 +2676,10 @@ EOF else $show "extracting exported symbol list from \`$soname'" save_ifs="$IFS"; IFS='~' - eval cmds=\"$extract_expsyms_cmds\" + cmds=$extract_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" + eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done @@ -2678,9 +2690,10 @@ EOF if test -f "$output_objdir/$newlib"; then :; else $show "generating import library for \`$soname'" save_ifs="$IFS"; IFS='~' - eval cmds=\"$old_archive_from_expsyms_cmds\" + cmds=$old_archive_from_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" + eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done @@ -2959,8 +2972,8 @@ EOF *" $path "*) ;; *) newlib_search_path="$newlib_search_path $path";; esac - path="" fi + path="" ;; *) path="-L$path" @@ -3428,6 +3441,10 @@ EOF *.$objext) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi removelist="$removelist $p" ;; *) ;; @@ -3937,10 +3954,11 @@ EOF $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols - eval cmds=\"$export_symbols_cmds\" + cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" + eval cmd=\"$cmd\" if len=`expr "X$cmd" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then $show "$cmd" @@ -4057,19 +4075,23 @@ EOF # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - eval cmds=\"$module_expsym_cmds\" + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds else - eval cmds=\"$module_cmds\" + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval cmds=\"$archive_expsym_cmds\" + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds else - eval cmds=\"$archive_cmds\" + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds fi fi - if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` && + if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else @@ -4154,6 +4176,7 @@ EOF save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" + eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done @@ -4170,19 +4193,28 @@ EOF # value of $libobjs for piecewise linking. # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds else - eval cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi fi # Append the command to remove the reloadable object files # to the just-reset $cmds. - eval cmds=\"\$cmds~$rm $delfiles\" + eval cmds=\"\$cmds~\$rm $delfiles\" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" + eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done @@ -4333,10 +4365,11 @@ EOF reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" - eval cmds=\"$reload_cmds\" + cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" + eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done @@ -4369,10 +4402,11 @@ EOF # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" - eval cmds=\"$reload_cmds\" + cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" + eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done @@ -5344,13 +5378,13 @@ fi\ # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then - eval cmds=\"$old_archive_from_new_cmds\" + cmds=$old_archive_from_new_cmds else eval cmds=\"$old_archive_cmds\" if len=`expr "X$cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - : + cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts $echo "using piecewise archive linking..." @@ -5402,12 +5436,13 @@ fi\ if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else - eval cmds=\"\$concat_cmds~$old_archive_cmds\" + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do + eval cmd=\"$cmd\" IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? @@ -5825,10 +5860,11 @@ relink_command=\"$relink_command\"" # Do each command in the postinstall commands. lib="$destdir/$realname" - eval cmds=\"$postinstall_cmds\" + cmds=$postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" + eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done @@ -6041,16 +6077,17 @@ relink_command=\"$relink_command\"" $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? - if test -n "$stripme" && test -n "$striplib"; then + if test -n "$stripme" && test -n "$old_striplib"; then $show "$old_striplib $oldlib" $run eval "$old_striplib $oldlib" || exit $? fi # Do each command in the postinstall commands. - eval cmds=\"$old_postinstall_cmds\" + cmds=$old_postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" + eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done @@ -6085,10 +6122,11 @@ relink_command=\"$relink_command\"" for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. - eval cmds=\"$finish_cmds\" + cmds=$finish_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" + eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || admincmds="$admincmds $cmd" @@ -6362,10 +6400,11 @@ relink_command=\"$relink_command\"" if test "$mode" = uninstall; then if test -n "$library_names"; then # Do each command in the postuninstall commands. - eval cmds=\"$postuninstall_cmds\" + cmds=$postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" + eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then @@ -6377,10 +6416,11 @@ relink_command=\"$relink_command\"" if test -n "$old_library"; then # Do each command in the old_postuninstall commands. - eval cmds=\"$old_postuninstall_cmds\" + cmds=$old_postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" + eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then @@ -6625,6 +6665,8 @@ The following components of LINK-COMMAND are treated specially: -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects + -precious-files-regex REGEX + don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries diff --git a/pixmap.c b/pixmap.c deleted file mode 100644 index d219a6d..0000000 --- a/pixmap.c +++ /dev/null @@ -1,330 +0,0 @@ -/* $Id: pixmap.c,v 1.14 2004/01/30 20:57:56 reinelt Exp $ - * - * generic pixmap driver - * - * Copyright 1999, 2000 Michael Reinelt - * - * This file is part of LCD4Linux. - * - * LCD4Linux 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, or (at your option) - * any later version. - * - * LCD4Linux 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., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * - * $Log: pixmap.c,v $ - * Revision 1.14 2004/01/30 20:57:56 reinelt - * HD44780 patch from Martin Hejl - * dmalloc integrated - * - * Revision 1.13 2004/01/29 04:40:02 reinelt - * every .c file includes "config.h" now - * - * Revision 1.12 2003/10/05 17:58:50 reinelt - * libtool junk; copyright messages cleaned up - * - * Revision 1.11 2003/09/10 14:01:53 reinelt - * icons nearly finished\! - * - * Revision 1.10 2002/08/19 04:41:20 reinelt - * introduced bar.c, moved bar stuff from display.h to bar.h - * - * Revision 1.9 2001/05/27 07:19:28 reinelt - * - * fixed a warning in pixmap.c - * temporarily fixed a bug in isdn.c (ISDN_MAX_CHANNELS is no longer defined?) - * fixed a bug in configure.in (--with-drivers=xyz did not work) - * - * Revision 1.8 2001/04/27 05:04:57 reinelt - * - * replaced OPEN_MAX with sysconf() - * replaced mktemp() with mkstemp() - * unlock serial port if open() fails - * - * Revision 1.7 2001/03/17 11:44:10 ltoetsch - * allow more than 1 BAR_T - * - * Revision 1.6 2001/03/16 16:40:17 ltoetsch - * implemented time bar - * - * Revision 1.5 2000/03/26 18:46:28 reinelt - * - * bug in pixmap.c that leaded to empty bars fixed - * name conflicts with X11 resolved - * - * Revision 1.4 2000/03/25 05:50:43 reinelt - * - * memory leak in Raster_flush closed - * driver family logic changed - * - * Revision 1.3 2000/03/24 11:36:56 reinelt - * - * new syntax for raster configuration - * changed XRES and YRES to be configurable - * PPM driver works nice - * - * Revision 1.2 2000/03/23 07:24:48 reinelt - * - * PPM driver up and running (but slow!) - * - * Revision 1.1 2000/03/22 15:36:21 reinelt - * - * added '-l' switch (list drivers) - * generic pixmap driver added - * X11 Framework done - * - */ - -/* - * exported functions: - * - * int pix_clear(void); - * clears the pixmap - * - * int pix_init (int rows, int cols, int XRES, int YRES); - * allocates & clears pixmap - * - * int pix_put (int row, int col, char *text); - * draws text into the pixmap - * - * int pix_bar (int type, int row, int col, int max, int len1, int len2); - * draws a bar into the pixmap - * - * void pix_icon (int ascii, char *buffer) - * used as the "define char" function for icons - * - */ - - -#include "config.h" - -#include -#include -#include - -#include "display.h" -#include "bar.h" -#include "icon.h" -#include "pixmap.h" -#include "fontmap.h" -#include "debug.h" - -#ifdef WITH_DMALLOC -#include -#endif - -static int ROWS=0; -static int COLS=0; -static int XRES=0; -static int YRES=0; - -unsigned char *LCDpixmap=NULL; - - -int pix_clear(void) -{ - int i; - - for (i=0; i>=1; - LCDpixmap[(row+y)*COLS+col+x]=Fontmap[c][y]&mask?1:0; - } - } - } - col+=XRES; - text++; - } - return 0; -} - - -#define N_BAR_T 10 - -int pix_bar (int type, int row, int col, int max, int len1, int len2) -{ - int x, y, len, rev; - static struct { - int row, col, len; - int *buf; - int init; - time_t old; - } vals[N_BAR_T]; - time_t now; - int i=0; - - row*=YRES; - col*=XRES; - - if (type & BAR_H) { - if (max>COLS-col) - max=COLS-col; - } else { - if (max>ROWS-row) - max=ROWS-row; - } - - if (len1<1) len1=1; - else if (len1>max) len1=max; - - if (type == BAR_T) { - for (i=0; i < N_BAR_T; i++) { - if (vals[i].init == 0 && vals[i].buf == 0) { - vals[i].buf = calloc(len2, sizeof(int)); - if (vals[i].buf == NULL) { - error("Couldn't allocte valbuf"); - vals[i].init = -1; - return -1; - } - vals[i].init = 1; - vals[i].len = len2; - vals[i].col = col; - vals[i].row = row; - time(&vals[i].old); - break; - } - else if (vals[i].init==1 && col==vals[i].col && row==vals[i].row) - break; - } - if (i == N_BAR_T) { - error("Too many $t, %d supported", N_BAR_T); - return -1; - } - } - else { - if (len2<1) len2=1; - else if (len2>max) len2=max; - } - - rev=0; - - switch (type) { - case BAR_L: - len1=max-len1; - len2=max-len2; - rev=1; - - case BAR_R: - for (y=0; y>=1; - LCDpixmap[(row*YRES+y)*COLS+col*XRES+x]=buffer[y]&mask?1:0; - } - } - } - } - -} diff --git a/pixmap.h b/pixmap.h deleted file mode 100644 index 694b68e..0000000 --- a/pixmap.h +++ /dev/null @@ -1,61 +0,0 @@ -/* $Id: pixmap.h,v 1.5 2003/10/05 17:58:50 reinelt Exp $ - * - * generic pixmap driver - * - * Copyright 1999, 2000 Michael Reinelt - * - * This file is part of LCD4Linux. - * - * LCD4Linux 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, or (at your option) - * any later version. - * - * LCD4Linux 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., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * - * $Log: pixmap.h,v $ - * Revision 1.5 2003/10/05 17:58:50 reinelt - * libtool junk; copyright messages cleaned up - * - * Revision 1.4 2003/09/10 14:01:53 reinelt - * icons nearly finished\! - * - * Revision 1.3 2000/03/26 19:03:52 reinelt - * - * more Pixmap renaming - * quoting of '#' in config file - * - * Revision 1.2 2000/03/24 11:36:56 reinelt - * - * new syntax for raster configuration - * changed XRES and YRES to be configurable - * PPM driver works nice - * - * Revision 1.1 2000/03/22 15:36:21 reinelt - * - * added '-l' switch (list drivers) - * generic pixmap driver added - * X11 Framework done - * - */ - -#ifndef _PIXMAP_H_ -#define _PIXMAP_H_ - -extern unsigned char *LCDpixmap; - -int pix_clear (void); -int pix_init (int rows, int cols, int xres, int yres); -int pix_put (int row, int col, char *text); -int pix_bar (int type, int row, int col, int max, int len1, int len2); -void pix_icon (int ascii, char *buffer); - -#endif diff --git a/plugin_i2c_sensors.c b/plugin_i2c_sensors.c index 0c08b81..662f6c2 100644 --- a/plugin_i2c_sensors.c +++ b/plugin_i2c_sensors.c @@ -1,8 +1,9 @@ -/* $Id: plugin_i2c_sensors.c,v 1.10 2004/02/14 12:07:27 nicowallmeier Exp $ +/* $Id: plugin_i2c_sensors.c,v 1.11 2004/02/15 21:43:43 reinelt Exp $ * * I2C sensors plugin * * Copyright 2003,2004 Xavier Vello + * Copyright 2004 The LCD4Linux Team * * This file is part of LCD4Linux. * @@ -22,6 +23,12 @@ * * * $Log: plugin_i2c_sensors.c,v $ + * Revision 1.11 2004/02/15 21:43:43 reinelt + * T6963 driver nearly finished + * framework for graphic displays done + * i2c_sensors patch from Xavier + * some more old generation files removed + * * Revision 1.10 2004/02/14 12:07:27 nicowallmeier * minor bugfix * @@ -41,7 +48,6 @@ * loadavg() uClibc replacement from Martin Heyl * round() uClibc replacement from Martin Hejl * warning in i2c_sensors fixed - * [ * * Revision 1.5 2004/01/29 05:55:30 reinelt * check for /sys mounted @@ -59,7 +65,6 @@ * * I2C Sensors plugin from Xavier added * - * */ /* @@ -67,22 +72,34 @@ * * int plugin_init_i2c_sensors (void) * adds function i2c_sensors() to retrieve informations from - * the i2c sensors via the sysfs interface of 2.6.x kernels + * the i2c sensors via sysfs or procfs interface * * -- WARNING -- - * This plugin is only for kernel series 2.5/2.6 and higher ! - * It uses the new sysfs pseudo-filesystem that you can mount with: - * mount -t sysfs none /sys - * - * -- WARNING #2 -- * This plugin should detect where your sensors are at startup. * If you can't get any token to work, ensure you don't get * an error message with "lcd4linux -Fvvv". * * If so, try to force the path to your sensors in the conf like this : - * i2c_sensors-path '/sys/bus/i2c/devices/0-6000/' - * (replace 0-6000 with the appropriate dir) - * + * for sysfs: i2c_sensors-path '/sys/bus/i2c/devices/0-6000/' + * for procfs: i2c_sensors-path '/proc/sys/dev/sensors/via686a-isa-6000' + * /!\ these path are for my system, change the last dir according to yours + */ + +/* + * Available tokens : # represents an int from 1 to 3 (or more) + * temp_input# -> temperature of sensor # (in °C) + * temp_max# and temp_hyst# -> max and min of sensor # + * in_input#, in_min# and in_max# -> voltages + * fan_input# -> speed (in RPM) of fan # + * fan_min# and fan_div# + * + * Tokens avaible only via sysfs if suported by your sensors: + * curr_input#, curr_min# and curr_max# -> value of current (in amps) + * pwm# + * temp_crit# -> critical value of sensor # + * vid -> cpu core voltage + * and maybe others + * (see /usr/src/linux/Documentation/i2c/sysfs-interface on linux 2.6) */ #include "config.h" @@ -104,25 +121,31 @@ #endif static char *path=NULL; +static int use_sysfs=0; static HASH I2Csensors = { 0, }; +static const char *procfs_tokens[4][3] = { + {"temp_hyst", "temp_max", "temp_input"}, // for temp# + {"in_min", "in_max", "in_input"}, // for in# + {"fan_div1", "fan_div2", "fan_div3"}, // for fan_div + {"fan_min", "fan_input", ""} // for fan# +}; + /***********************************************\ * Parsing for new 2.6 kernels 'sysfs' interface * \***********************************************/ -static int parse_i2c_sensors_sysfs(RESULT *arg) + +static int parse_i2c_sensors_sysfs(char *key) { double value; char val[32]; char buffer[32]; - char *key=R2S(arg); char file[64]; FILE *stream; - // construct absolute path to the file to read strcpy(file, path); strcat(file, key); - // read of file to buffer stream=fopen(file, "r"); if (stream==NULL) { error ("fopen(%s) failed",file); @@ -153,51 +176,52 @@ static int parse_i2c_sensors_sysfs(RESULT *arg) // we supress this nasty \n at the end val[strlen(val)-1]='\0'; } - + hash_set (&I2Csensors, key, val); - return 0; -} + return 0; -void my_i2c_sensors_sysfs(RESULT *result, RESULT *arg) -{ - int age; - char *val; - char *key=R2S(arg); - - age=hash_age(&I2Csensors, key, &val); - // refresh every 100msec - if (age<0 || age>100) { - parse_i2c_sensors_sysfs(arg); - val=hash_get(&I2Csensors, key); - } - if (val) { - SetResult(&result, R_STRING, val); - } else { - SetResult(&result, R_STRING, "??"); - } } - /************************************************\ * Parsing for old 2.4 kernels 'procfs' interface * \************************************************/ -static int parse_i2c_sensors_procfs(RESULT *arg) +static int parse_i2c_sensors_procfs(char *key) { - char *key=R2S(arg); - char file[64]; + char file[64]; FILE *stream; char buffer[32]; char *value; char *running; int pos=0; - const char delim[3]= " \n"; + const char delim[3]=" \n"; char final_key[32]; - + char *number = &key[strlen(key)-1]; + int tokens_index; + //debug("%s -> %s", key, number); strcpy(file, path); - strcat(file, key); + + if (!strncmp(key, "temp_", 5)) { + tokens_index=0; + strcat(file, "temp"); + strcat(file, number); + } else if (!strncmp(key, "in_", 3)) { + tokens_index=1; + strcat(file, "in"); + strcat(file, number); + } else if (!strncmp(key, "fan_div", 7)) { + tokens_index=2; + strcat(file, "fan_div"); + number = ""; + } else if (!strncmp(key, "fan_", 4)) { + tokens_index=3; + strcat(file, "fan"); + strcat(file, number); + } else { + return -1; + } stream=fopen(file, "r"); if (stream==NULL) { @@ -211,15 +235,17 @@ static int parse_i2c_sensors_procfs(RESULT *arg) error ("%s empty ?!",file); return -1; } - + running=strdupa(buffer); while(1) { value = strsep (&running, delim); - // debug("%s pos %i -> %s", key, pos , value); - if (!value) { + debug("%s pos %i -> %s", file, pos , value); + if (!value || !strcmp(value, "")) { + debug("%s pos %i -> BREAK", file, pos); break; } else { - sprintf (final_key, "%s.%i", key, pos); + sprintf (final_key, "%s%s", procfs_tokens[tokens_index][pos], number); + debug ("%s -> %s", final_key, value); hash_set (&I2Csensors, final_key, value); pos++; } @@ -227,29 +253,23 @@ static int parse_i2c_sensors_procfs(RESULT *arg) return 0; } -void my_i2c_sensors_procfs(RESULT *result, int argc, RESULT *argv[]) + /*****************************************\ + * Common functions (path search and init) * + \*****************************************/ + +void my_i2c_sensors(RESULT *result, RESULT *arg) { int age; char *val; - char *key; + char *key=R2S(arg); - switch (argc) { - case 1: - sprintf(key, "%s.0", R2S(argv[0])); - break; - case 2: - sprintf(key, "%s.%s", R2S(argv[0]), R2S(argv[1])); - break; - default: - return; - break; - } - age=hash_age(&I2Csensors, key, &val); - - // refresh every 100msec - if (age<0 || age>100) { - parse_i2c_sensors_procfs(argv[0]); + if (age<0 || age>250) { + if (use_sysfs) { + parse_i2c_sensors_sysfs(key); + } else { + parse_i2c_sensors_procfs(key); + } val=hash_get(&I2Csensors, key); } if (val) { @@ -259,10 +279,6 @@ void my_i2c_sensors_procfs(RESULT *result, int argc, RESULT *argv[]) } } - /*****************************************\ - * Common functions (path search and init) * - \*****************************************/ - void my_i2c_sensors_path(char *method) { struct dirent *dir; @@ -277,11 +293,10 @@ void my_i2c_sensors_path(char *method) base="/sys/bus/i2c/devices/"; } else if (!strcmp(method, "procfs")) { base="/proc/sys/dev/sensors/"; - //base="/sensors_2.4/"; // fake dir to test without rebooting 2.4 ;) + //base="/sensors_2.4/"; // fake dir to test without rebooting 2.4 ;) } else { return; } - fd1 = opendir(base); if (!fd1) { @@ -295,9 +310,9 @@ void my_i2c_sensors_path(char *method) while((dir = readdir(fd1))) { // Skip non-directories and '.' and '..' - if (dir->d_type!=DT_DIR || - strcmp(dir->d_name, "." )==0 || - strcmp(dir->d_name, "..")==0) { + if (dir->d_type!=DT_DIR || + strcmp(dir->d_name, "." )==0 || + strcmp(dir->d_name, "..")==0) { continue; } @@ -327,7 +342,7 @@ int plugin_init_i2c_sensors (void) char *path_cfg=cfg_get(NULL, "i2c_sensors-path", ""); if (strncmp(path_cfg, "/", 1)) { - debug("No path to i2c sensors found in the conf, calling my_i2c_sensors_path()"); + //debug("No path to i2c sensors found in the conf, calling my_i2c_sensors_path()"); my_i2c_sensors_path("sysfs"); if (!path) my_i2c_sensors_path("procfs"); @@ -358,11 +373,10 @@ int plugin_init_i2c_sensors (void) if (!path) { free(path); } else { - if (!strncmp(path, "/sys", 4)) { - AddFunction ("i2c_sensors", 1, my_i2c_sensors_sysfs); - } else if (!strncmp(path, "/proc", 5)) { - AddFunction ("i2c_sensors", -1, my_i2c_sensors_procfs); + if (strncmp(path, "/sys", 4)==0) { + use_sysfs=1; } + AddFunction ("i2c_sensors", 1, my_i2c_sensors); } return 0; diff --git a/widget_icon.c b/widget_icon.c index 3c631d9..a8d9738 100644 --- a/widget_icon.c +++ b/widget_icon.c @@ -1,4 +1,4 @@ -/* $Id: widget_icon.c,v 1.6 2004/02/07 13:45:23 reinelt Exp $ +/* $Id: widget_icon.c,v 1.7 2004/02/15 21:43:43 reinelt Exp $ * * icon widget handling * @@ -21,6 +21,12 @@ * * * $Log: widget_icon.c,v $ + * Revision 1.7 2004/02/15 21:43:43 reinelt + * T6963 driver nearly finished + * framework for graphic displays done + * i2c_sensors patch from Xavier + * some more old generation files removed + * * Revision 1.6 2004/02/07 13:45:23 reinelt * icon visibility patch #2 from Xavier * @@ -77,7 +83,7 @@ static void widget_icon_read_bitmap (char *section, WIDGET_ICON *Icon) int row, n; char key[15]; char *val, *v; - char *map; + unsigned char *map; for (row=0; row