From eba1b69ca09ac69949ae0d76fd7d1738c680c70a Mon Sep 17 00:00:00 2001 From: reinelt <> Date: Sun, 19 Mar 2000 08:41:28 +0000 Subject: [lcd4linux @ 2000-03-19 08:41:28 by reinelt] documentation available! README, README.MatrixOrbital, README.Drivers added Skeleton.c as a starting point for new drivers --- Makefile.am | 1 + Makefile.in | 12 ++--- MatrixOrbital.c | 9 +++- README | 130 ++++++++++++++++++++++++++++++++++++++++++++++++++ README.Drivers | 47 ++++++++++++++++++ README.MatrixOrbital | 40 ++++++++++++++++ Skeleton.c | 78 ++++++++++++++++++++++++++++++ display.c | 9 +++- lcd4linux.c | 19 +++++--- lcd4linux.conf.sample | 1 + parser.c | 9 +++- parser.h | 9 +++- 12 files changed, 344 insertions(+), 20 deletions(-) create mode 100644 README create mode 100644 README.Drivers create mode 100644 README.MatrixOrbital create mode 100644 Skeleton.c diff --git a/Makefile.am b/Makefile.am index 38b15bf..8500ce5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -14,6 +14,7 @@ lcd4linux_SOURCES = \ isdn.c isdn.h \ filter.c filter.h \ display.c display.h \ + Skeleton.c \ MatrixOrbital.c diff --git a/Makefile.in b/Makefile.in index a500dd9..508d87f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -68,7 +68,7 @@ CLEANFILES = *~ AM_CFLAGS = -Wall bin_PROGRAMS = lcd4linux -lcd4linux_SOURCES = lcd4linux.c cfg.c cfg.h parser.c parser.h system.c system.h isdn.c isdn.h filter.c filter.h display.c display.h MatrixOrbital.c +lcd4linux_SOURCES = lcd4linux.c cfg.c cfg.h parser.c parser.h system.c system.h isdn.c isdn.h filter.c filter.h display.c display.h Skeleton.c MatrixOrbital.c ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -81,7 +81,7 @@ CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ lcd4linux_OBJECTS = lcd4linux.o cfg.o parser.o system.o isdn.o filter.o \ -display.o MatrixOrbital.o +display.o Skeleton.o MatrixOrbital.o lcd4linux_LDADD = $(LDADD) lcd4linux_DEPENDENCIES = lcd4linux_LDFLAGS = @@ -89,7 +89,7 @@ CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -DIST_COMMON = COPYING INSTALL Makefile.am Makefile.in aclocal.m4 \ +DIST_COMMON = README COPYING INSTALL Makefile.am Makefile.in aclocal.m4 \ configure configure.in install-sh missing mkinstalldirs @@ -97,9 +97,9 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = tar GZIP_ENV = --best -DEP_FILES = .deps/MatrixOrbital.P .deps/cfg.P .deps/display.P \ -.deps/filter.P .deps/isdn.P .deps/lcd4linux.P .deps/parser.P \ -.deps/system.P +DEP_FILES = .deps/MatrixOrbital.P .deps/Skeleton.P .deps/cfg.P \ +.deps/display.P .deps/filter.P .deps/isdn.P .deps/lcd4linux.P \ +.deps/parser.P .deps/system.P SOURCES = $(lcd4linux_SOURCES) OBJECTS = $(lcd4linux_OBJECTS) diff --git a/MatrixOrbital.c b/MatrixOrbital.c index 0762b87..3ecefe4 100644 --- a/MatrixOrbital.c +++ b/MatrixOrbital.c @@ -1,6 +1,6 @@ -/* $Id: MatrixOrbital.c,v 1.7 2000/03/18 08:07:04 reinelt Exp $ +/* $Id: MatrixOrbital.c,v 1.8 2000/03/19 08:41:28 reinelt Exp $ * - * driver for Matrix Orbital serial display modules + * driver for Matrix Orbital serial display modules * * Copyright 1999, 2000 by Michael Reinelt (reinelt@eunet.at) * @@ -20,6 +20,11 @@ * * * $Log: MatrixOrbital.c,v $ + * Revision 1.8 2000/03/19 08:41:28 reinelt + * + * documentation available! README, README.MatrixOrbital, README.Drivers + * added Skeleton.c as a starting point for new drivers + * * Revision
# automatically generated from http://www.digitv.fi/sivu.asp?path=1;8224;9519
# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
T 506000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE
T 546000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE
T 698000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE
T 562000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE
d4linux.conf). + +* include "display.h" in your driver, to get the DISPLAY structure and various + BAR_ definitions + +* include "cfg.h" if you need to access settings in the config file. + +* create a DISPLAY table at the bottom of your driver, and fill it with the + appropriate values. Take care that you specify the correct bar capabilities + of your display or driver! + +* edit display.c and create a reference to your DISPLAY table: + + external DISPLAY YourDriver[]; + +* extend the FAMILY table in display.c with your driver: + + FAMILY Driver[] = { + { "Skeleton", Skeleton }, + { "MatrixOrbital", MatrixOrbital }, + { "YourFamily", YourDriver }, + { "" } + }; + +* write the correspondig init(), clear(), put(), bar() and flush()-functions. + There's no need to use a framebuffer and display its contents with the flush()- + call (as in MatrixOrbital.c), you can directly write to the display in the put()- + and bar()-functions, and use an empty flush()-function. But if you have a limited + number of user-defined characters, and therefore you have to do some sort of + 'character reduction' or similar stuff, you will have to use a framebuffer and + the flush()-call. diff --git a/README.MatrixOrbital b/README.MatrixOrbital new file mode 100644 index 0000000..1138b49 --- /dev/null +++ b/README.MatrixOrbital @@ -0,0 +1,40 @@ +# +# $Id: README.MatrixOrbital,v 1.1 2000/03/19 08:41:28 reinelt Exp $ +# + +This is the README file for the MatrixOrbital display driver for lcd4linux + +This driver supports the serial interface alphanumeric display modules by +Matrix Orbital Corporation (http://www.matrixorbital.com). + +I could only test it with the LCD2041 model, but I think every other (LCD) model +should work. These displays are supported: + + LCD0821: 2 lines by 8 characters + LCD1621: 2 lines by 16 characters + LCD2021: 2 lines by 20 characters + LCD2041: 4 lines by 20 characters (tested) + LCD4021: 2 lines by 40 characters + +I could not test the vacuum fluorescent display models, but I think they should work, too. +There are no entries for this models in the driver table (at the bottom of MatrixOrbital.c), +but they could be easily added. + +The displays come with an RS-232 and an I2C interface. The driver supports the RS-232 interface +only (because I have no idea how to find the I2C bus on my motherboard). + +Power can be applied either via an external DC power supply, a modified floppy power connector +(be aware that you can destroy your display if you get the pins wrong!) or via the RI (ring) +signal of the RS-232 port. I choosed the latter, and modified a serial card so that it supplies ++5V from the ISA bus to this pin (again, be aware that this is dangerous if you connect any other +serial device to this modified port). + +The driver supports vertical, horizontal and split bars (two independent bars in one line), +all bar types can be used simultanously. As the displays only have 8 user-defined characters, +the needed characters to display all the bars must be reduced to 8. This is done by replacing +characters with similar ones. To reduce flicker, a character which is displayed at the moment, +will not be redefined, even if it's not used in this run. Only if the character compaction +fails, this characters will be redefined, too. + +The displays have a GPO (general purpose output), where you can connect a LED or something. +The driver supports controlling this GPO, but this function is unused by now. diff --git a/Skeleton.c b/Skeleton.c new file mode 100644 index 0000000..6522f34 --- /dev/null +++ b/Skeleton.c @@ -0,0 +1,78 @@ +/* $Id: Skeleton.c,v 1.1 2000/03/19 08:41:28 reinelt Exp $ + * + * skeleton driver for new display modules + * + * Copyright 1999, 2000 by Michael Reinelt (reinelt@eunet.at) + * + * 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, 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., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * + * $Log: Skeleton.c,v $ + * Revision 1.1 2000/03/19 08:41:28 reinelt + * + * documentation available! README, README.MatrixOrbital, README.Drivers + * added Skeleton.c as a starting point for new drivers + * + */ + +/* + * + * exported fuctions: + * + * struct DISPLAY Skeleton[] + * + */ + +#include +#include + +#include "cfg.h" +#include "display.h" + +static DISPLAY Display; + +int Skel_clear (void) +{ + return 0; +} + +int Skel_init (DISPLAY *Self) +{ + Display=*Self; + + Skel_clear(); + return 0; +} + +int Skel_put (int row, int col, char *text) +{ + return 0; +} + +int Skel_bar (int type, int row, int col, int max, int len1, int len2) +{ + return 0; +} + +int Skel_flush (void) +{ + return 0; +} + + +DISPLAY Skeleton[] = { + { "Skeleton", 4, 20, 5, 8, BAR_L | BAR_R, Skel_init, Skel_clear, Skel_put, Skel_bar, Skel_flush }, + { "" } +}; diff --git a/display.c b/display.c index 96580c6..113babc 100644 --- a/display.c +++ b/display.c @@ -1,4 +1,4 @@ -/* $Id: display.c,v 1.7 2000/03/18 08:07:04 reinelt Exp $ +/* $Id: display.c,v 1.8 2000/03/19 08:41:28 reinelt Exp $ * * framework for device drivers * @@ -20,6 +20,11 @@ * * * $Log: display.c,v $ + * Revision 1.8 2000/03/19 08:41:28 reinelt + * + * documentation available! README, README.MatrixOrbital, README.Drivers + * added Skeleton.c as a starting point for new drivers + * * Revision 1.7 2000/03/18 08:07:04 reinelt * * vertical bars implemented @@ -80,9 +85,11 @@ #include "cfg.h" #include "display.h" +extern DISPLAY Skeleton[]; extern DISPLAY MatrixOrbital[]; FAMILY Driver[] = { + { "Skeleton", Skeleton }, { "MatrixOrbital", MatrixOrbital }, { "" } }; diff --git a/lcd4linux.c b/lcd4linux.c index f006f97..f065022 100644 --- a/lcd4linux.c +++ b/lcd4linux.c @@ -1,4 +1,4 @@ -/* $Id: lcd4linux.c,v 1.6 2000/03/18 10:31:06 reinelt Exp $ +/* $Id: lcd4linux.c,v 1.7 2000/03/19 08:41:28 reinelt Exp $ * * LCD4Linux * @@ -20,6 +20,11 @@ * * * $Log: lcd4linux.c,v $ + * Revision 1.7 2000/03/19 08:41:28 reinelt + * + * documentation available! README, README.MatrixOrbital, README.Drivers + * added Skeleton.c as a starting point for new drivers + * * Revision 1.6 2000/03/18 10:31:06 reinelt * * added sensor handling (for temperature etc.) @@ -69,7 +74,7 @@ int rows, cols, xres, yres, supported_bars; int token_usage[256]={0,}; -struct { int total, used, free, shared, buffer, cache, apps; } ram; +struct { int total, used, free, shared, buffer, cache, avail; } ram; struct { double load1, load2, load3, overload; } load; struct { double user, nice, system, idle; } busy; struct { int read, write, total, max, peak; } disk; @@ -90,7 +95,7 @@ static void collect_data (void) if (token_usage[C_MEM]) { Ram (&ram.total, &ram.free, &ram.shared, &ram.buffer, &ram.cache); ram.used=ram.total-ram.free; - ram.apps=ram.used-ram.buffer-ram.cache; + ram.avail=ram.free+ram.buffer+ram.cache; } if (token_usage[C_LOAD]) { @@ -145,8 +150,8 @@ static double query (int token) return ram.buffer; case T_MEM_CACHE: return ram.cache; - case T_MEM_APP: - return ram.apps; + case T_MEM_AVAIL: + return ram.avail; case T_LOAD_1: return load.load1; @@ -220,7 +225,7 @@ static double query_bar (int token) case T_MEM_SHARED: case T_MEM_BUFFER: case T_MEM_CACHE: - case T_MEM_APP: + case T_MEM_AVAIL: return value/ram.total; case T_LOAD_1: @@ -296,7 +301,7 @@ void print_token (int token, char **p) case T_MEM_SHARED: case T_MEM_BUFFER: case T_MEM_CACHE: - case T_MEM_APP: + case T_MEM_AVAIL: *p+=sprintf (*p, "%6.0f", query(token)); break; case T_LOAD_1: diff --git a/lcd4linux.conf.sample b/lcd4linux.conf.sample index efcbe78..688cc23 100644 --- a/lcd4linux.conf.sample +++ b/lcd4linux.conf.sample @@ -26,6 +26,7 @@ Row4 "Net %nm $R10nr+nw" Tick 100 Tack 400 Tau 500 + Overload 2.0 Sensor1 /proc/sys/dev/sensors/w83781d-isa-0290/temp1 diff --git a/parser.c b/parser.c index 2c7ac66..4d9346d 100644 --- a/parser.c +++ b/parser.c @@ -1,4 +1,4 @@ -/* $Id: parser.c,v 1.3 2000/03/18 10:31:06 reinelt Exp $ +/* $Id: parser.c,v 1.4 2000/03/19 08:41:28 reinelt Exp $ * * row definition parser * @@ -20,6 +20,11 @@ * * * $Log: parser.c,v $ + * Revision 1.4 2000/03/19 08:41:28 reinelt + * + * documentation available! README, README.MatrixOrbital, README.Drivers + * added Skeleton.c as a starting point for new drivers + * * Revision 1.3 2000/03/18 10:31:06 reinelt * * added sensor handling (for temperature etc.) @@ -76,7 +81,7 @@ static SYMTAB Symtab[] = {{ "%", T_PERCENT, C_GENERIC, 0 }, { "ms", T_MEM_SHARED, C_MEM, 1 }, { "mb", T_MEM_BUFFER, C_MEM, 1 }, { "mc", T_MEM_CACHE, C_MEM, 1 }, - { "ma", T_MEM_APP, C_MEM, 1 }, + { "ma", T_MEM_AVAIL, C_MEM, 1 }, { "l1", T_LOAD_1, C_LOAD, 1 }, { "l2", T_LOAD_2, C_LOAD, 1 }, { "l3", T_LOAD_3, C_LOAD, 1 }, diff --git a/parser.h b/parser.h index 8f42218..877f253 100644 --- a/parser.h +++ b/parser.h @@ -1,4 +1,4 @@ -/* $Id: parser.h,v 1.3 2000/03/18 10:31:06 reinelt Exp $ +/* $Id: parser.h,v 1.4 2000/03/19 08:41:28 reinelt Exp $ * * row definition parser * @@ -20,6 +20,11 @@ * * * $Log: parser.h,v $ + * Revision 1.4 2000/03/19 08:41:28 reinelt + * + * documentation available! README, README.MatrixOrbital, README.Drivers + * added Skeleton.c as a starting point for new drivers + * * Revision 1.3 2000/03/18 10:31:06 reinelt * * added sensor handling (for temperature etc.) @@ -45,7 +50,7 @@ typedef enum { T_PERCENT=128, T_DOLLAR, T_OS, T_RELEASE, T_CPU, T_RAM, - T_MEM_TOTAL, T_MEM_USED, T_MEM_FREE, T_MEM_SHARED, T_MEM_BUFFER, T_MEM_CACHE, T_MEM_APP, + T_MEM_TOTAL, T_MEM_USED, T_MEM_FREE, T_MEM_SHARED, T_MEM_BUFFER, T_MEM_CACHE, T_MEM_AVAIL, T_LOAD_1, T_LOAD_2, T_LOAD_3, T_OVERLOAD, T_CPU_USER, T_CPU_NICE, T_CPU_SYSTEM, T_CPU_BUSY, T_CPU_IDLE, T_DISK_READ, T_DISK_WRITE, T_DISK_TOTAL, T_DISK_MAX, -- cgit v1.2.3