diff options
author | reinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2004-01-20 15:32:49 +0000 |
---|---|---|
committer | reinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2004-01-20 15:32:49 +0000 |
commit | d29b8c45e95d99709234fb6632574d38fa472321 (patch) | |
tree | 811d8fc7e4d57b9874599653185e1487cea4c5d2 | |
parent | d198bf228c98434578920e7301fb9edf13a37d3b (diff) | |
download | lcd4linux-d29b8c45e95d99709234fb6632574d38fa472321.tar.gz |
[lcd4linux @ 2004-01-20 15:32:48 by reinelt]
first version of Next Generation HD44780 (untested! but it compiles...)
some cleanup in the other drivers
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@327 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
-rw-r--r-- | config.h.in | 388 | ||||
-rwxr-xr-x | configure | 118 | ||||
-rw-r--r-- | configure.in | 6 | ||||
-rw-r--r-- | drv.c | 14 | ||||
-rw-r--r-- | drv.h | 16 | ||||
-rw-r--r-- | drv_HD44780.c | 483 | ||||
-rw-r--r-- | drv_MatrixOrbital.c | 8 | ||||
-rw-r--r-- | drv_generic_parport.c | 65 | ||||
-rw-r--r-- | drv_generic_parport.h | 8 | ||||
-rw-r--r-- | lcd4linux.conf.sample | 25 |
10 files changed, 724 insertions, 407 deletions
diff --git a/config.h.in b/config.h.in index 8247105..33c0a5d 100644 --- a/config.h.in +++ b/config.h.in @@ -1,473 +1,302 @@ /* config.h.in. Generated from configure.in by autoheader. */ -/* - Found some version of curses that we're going - to use */ +/* Found some version of curses that we're going to use */ #undef HAS_CURSES -/* - Define to 1 if you have the <asm/io.h> - header file. */ +/* Define to 1 if you have the <asm/io.h> header file. */ #undef HAVE_ASM_IO_H -/* - Define to 1 if you have the <asm/msr.h> - header file. */ +/* Define to 1 if you have the <asm/msr.h> header file. */ #undef HAVE_ASM_MSR_H -/* - Define to 1 if you have the `atexit' - function. */ +/* Define to 1 if you have the `atexit' function. */ #undef HAVE_ATEXIT -/* - Define to 1 if you have the <dlfcn.h> - header file. */ +/* Define to 1 if you have the <dlfcn.h> header file. */ #undef HAVE_DLFCN_H -/* - Define to 1 if you have the `dup2' - function. */ +/* Define to 1 if you have the `dup2' function. */ #undef HAVE_DUP2 -/* - Define to 1 if you have the <fcntl.h> - header file. */ +/* Define to 1 if you have the <fcntl.h> header file. */ #undef HAVE_FCNTL_H -/* - Define to 1 if you have the `fork' - function. */ +/* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK -/* - Define to 1 if you have the <gd/gd.h> - header file. */ +/* Define to 1 if you have the <gd/gd.h> header file. */ #undef HAVE_GD_GD_H -/* - Define to 1 if you have the <gd.h> - header file. */ +/* Define to 1 if you have the <gd.h> header file. */ #undef HAVE_GD_H -/* - Define to 1 if you have the `gethostbyname' - function. */ +/* Define to 1 if you have the `gethostbyname' function. */ #undef HAVE_GETHOSTBYNAME -/* - Define to 1 if you have the `gettimeofday' - function. */ +/* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY -/* - Define to 1 if you have the <inttypes.h> - header file. */ +/* Define to 1 if you have the <inttypes.h> header file. */ #undef HAVE_INTTYPES_H -/* - Define to 1 if you have the `m' - library (-lm). */ +/* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM -/* - Define to 1 if you have the <linux/dvb/frontend.h> - header file. */ +/* Define to 1 if you have the <linux/dvb/frontend.h> header file. */ #undef HAVE_LINUX_DVB_FRONTEND_H -/* - Define to 1 if you have the <linux/parport.h> - header file. */ +/* Define to 1 if you have the <linux/parport.h> header file. */ #undef HAVE_LINUX_PARPORT_H -/* - Define to 1 if you have the <linux/ppdev.h> - header file. */ +/* Define to 1 if you have the <linux/ppdev.h> header file. */ #undef HAVE_LINUX_PPDEV_H -/* - Define to 1 if you have the <malloc.h> - header file. */ +/* Define to 1 if you have the <malloc.h> header file. */ #undef HAVE_MALLOC_H -/* - Define to 1 if you have the `memmove' - function. */ +/* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE -/* - Define to 1 if you have the <memory.h> - header file. */ +/* Define to 1 if you have the <memory.h> header file. */ #undef HAVE_MEMORY_H -/* - Define to 1 if you have the `memset' - function. */ +/* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET -/* - Define to 1 if you have the <netdb.h> - header file. */ +/* Define to 1 if you have the <netdb.h> header file. */ #undef HAVE_NETDB_H -/* - Define to 1 if you have the <netinet/in.h> - header file. */ +/* Define to 1 if you have the <netinet/in.h> header file. */ #undef HAVE_NETINET_IN_H -/* - Define to 1 if you have the <net/if_ppp.h> - header file. */ +/* Define to 1 if you have the <net/if_ppp.h> header file. */ #undef HAVE_NET_IF_PPP_H -/* - Define to 1 if you have the `pow' - function. */ +/* Define to 1 if you have the `pow' function. */ #undef HAVE_POW -/* - Define to 1 if you have the `putenv' - function. */ +/* Define to 1 if you have the `putenv' function. */ #undef HAVE_PUTENV -/* - Define to 1 if you have the `select' - function. */ +/* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT -/* - Define to 1 if you have the `socket' - function. */ +/* Define to 1 if you have the `socket' function. */ #undef HAVE_SOCKET -/* - Define to 1 if you have the `sqrt' - function. */ +/* Define to 1 if you have the `sqrt' function. */ #undef HAVE_SQRT -/* - Define to 1 if `stat' has the bug - that it succeeds when given the zero-length file name - argument. */ +/* Define to 1 if `stat' has the bug that it succeeds when given the + zero-length file name argument. */ #undef HAVE_STAT_EMPTY_STRING_BUG -/* - Define to 1 if you have the <stdint.h> - header file. */ +/* Define to 1 if you have the <stdint.h> header file. */ #undef HAVE_STDINT_H -/* - Define to 1 if you have the <stdlib.h> - header file. */ +/* Define to 1 if you have the <stdlib.h> header file. */ #undef HAVE_STDLIB_H -/* - Define to 1 if you have the `strcasecmp' - function. */ +/* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP -/* - Define to 1 if you have the `strchr' - function. */ +/* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR -/* - Define to 1 if you have the `strdup' - function. */ +/* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP -/* - Define to 1 if you have the `strerror' - function. */ +/* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR -/* - Define to 1 if you have the <strings.h> - header file. */ +/* Define to 1 if you have the <strings.h> header file. */ #undef HAVE_STRINGS_H -/* - Define to 1 if you have the <string.h> - header file. */ +/* Define to 1 if you have the <string.h> header file. */ #undef HAVE_STRING_H -/* - Define to 1 if you have the `strncasecmp' - function. */ +/* Define to 1 if you have the `strncasecmp' function. */ #undef HAVE_STRNCASECMP -/* - Define to 1 if you have the `strndup' - function. */ +/* Define to 1 if you have the `strndup' function. */ #undef HAVE_STRNDUP -/* - Define to 1 if you have the `strpbrk' - function. */ +/* Define to 1 if you have the `strpbrk' function. */ #undef HAVE_STRPBRK -/* - Define to 1 if you have the `strstr' - function. */ +/* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR -/* - Define to 1 if you have the `strtol' - function. */ +/* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL -/* - Define to 1 if you have the <syslog.h> - header file. */ +/* Define to 1 if you have the <syslog.h> header file. */ #undef HAVE_SYSLOG_H -/* - Define to 1 if you have the <sys/ioctl.h> - header file. */ +/* Define to 1 if you have the <sys/ioctl.h> header file. */ #undef HAVE_SYS_IOCTL_H -/* - Define to 1 if you have the <sys/io.h> - header file. */ +/* Define to 1 if you have the <sys/io.h> header file. */ #undef HAVE_SYS_IO_H -/* - Define to 1 if you have the <sys/param.h> - header file. */ +/* Define to 1 if you have the <sys/param.h> header file. */ #undef HAVE_SYS_PARAM_H -/* - Define to 1 if you have the <sys/select.h> - header file. */ +/* Define to 1 if you have the <sys/select.h> header file. */ #undef HAVE_SYS_SELECT_H -/* - Define to 1 if you have the <sys/socket.h> - header file. */ +/* Define to 1 if you have the <sys/socket.h> header file. */ #undef HAVE_SYS_SOCKET_H -/* - Define to 1 if you have the <sys/stat.h> - header file. */ +/* Define to 1 if you have the <sys/stat.h> header file. */ #undef HAVE_SYS_STAT_H -/* - Define to 1 if you have the <sys/time.h> - header file. */ +/* Define to 1 if you have the <sys/time.h> header file. */ #undef HAVE_SYS_TIME_H -/* - Define to 1 if you have the <sys/types.h> - header file. */ +/* Define to 1 if you have the <sys/types.h> header file. */ #undef HAVE_SYS_TYPES_H -/* - Define to 1 if you have <sys/wait.h> that - is POSIX.1 compatible. */ +/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H -/* - Define to 1 if you have the <termios.h> - header file. */ +/* Define to 1 if you have the <termios.h> header file. */ #undef HAVE_TERMIOS_H -/* - Define to 1 if you have the `uname' - function. */ +/* Define to 1 if you have the `uname' function. */ #undef HAVE_UNAME -/* - Define to 1 if you have the <unistd.h> - header file. */ +/* Define to 1 if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H -/* - Define to 1 if you have the `vfork' - function. */ +/* Define to 1 if you have the `vfork' function. */ #undef HAVE_VFORK -/* - Define to 1 if you have the <vfork.h> - header file. */ +/* Define to 1 if you have the <vfork.h> header file. */ #undef HAVE_VFORK_H -/* - Define to 1 if `fork' works. */ +/* Define to 1 if `fork' works. */ #undef HAVE_WORKING_FORK -/* - Define to 1 if `vfork' works. */ +/* Define to 1 if `vfork' works. */ #undef HAVE_WORKING_VFORK -/* - Define to 1 if `lstat' dereferences a symlink - specified with a trailing slash. */ +/* Define to 1 if `lstat' dereferences a symlink specified with a trailing + slash. */ #undef LSTAT_FOLLOWS_SLASHED_SYMLINK -/* - Set to reflect version of ncurses */ +/* Set to reflect version of ncurses */ #undef NCURSES_970530 -/* - If you Curses does not have color define - this one */ +/* If you Curses does not have color define this one */ #undef NO_COLOR_CURSES -/* - Name of package */ +/* Name of package */ #undef PACKAGE -/* - Define to the address where bug reports for - this package should be sent. */ +/* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT -/* - Define to the full name of this package. - */ +/* Define to the full name of this package. */ #undef PACKAGE_NAME -/* - Define to the full name and version of - this package. */ +/* Define to the full name and version of this package. */ #undef PACKAGE_STRING -/* - Define to the one symbol short name of - this package. */ +/* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME -/* - Define to the version of this package. */ +/* Define to the version of this package. */ #undef PACKAGE_VERSION -/* - Define as the return type of signal handlers - (`int' or `void'). */ +/* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE -/* - Define if you want to turn on SCO-specific - code */ +/* Define if you want to turn on SCO-specific code */ #undef SCO_FLAVOR -/* - Define to the type of arg 1 for - `select'. */ +/* Define to the type of arg 1 for `select'. */ #undef SELECT_TYPE_ARG1 -/* - Define to the type of args 2, 3 - and 4 for `select'. */ +/* Define to the type of args 2, 3 and 4 for `select'. */ #undef SELECT_TYPE_ARG234 -/* - Define to the type of arg 5 for - `select'. */ +/* Define to the type of arg 5 for `select'. */ #undef SELECT_TYPE_ARG5 -/* - Define to 1 if you have the ANSI - C header files. */ +/* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS -/* - Define to 1 if you can safely include - both <sys/time.h> and <time.h>. */ +/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ #undef TIME_WITH_SYS_TIME -/* - Use Ncurses? */ +/* Use Ncurses? */ #undef USE_NCURSES -/* - Use SunOS SysV curses? */ +/* Use SunOS SysV curses? */ #undef USE_SUNOS_CURSES -/* - Use SystemV curses? */ +/* Use SystemV curses? */ #undef USE_SYSV_CURSES -/* - Version number of package */ +/* Version number of package */ #undef VERSION -/* - junk */ +/* junk */ #undef WITH_BECKMANNEGLE -/* - junk */ +/* junk */ #undef WITH_CRYSTALFONTZ -/* - junk */ +/* junk */ #undef WITH_CWLINUX -/* - junk */ +/* junk */ #undef WITH_HD44780 -/* - junk */ +/* junk */ #undef WITH_M50530 -/* - junk */ +/* junk */ #undef WITH_MATRIXORBITAL -/* - junk */ +/* junk */ #undef WITH_MILINST -/* - junk */ +/* junk */ #undef WITH_PALMPILOT -/* - junk */ +/* junk */ #undef WITH_PNG -/* - junk */ +/* junk */ #undef WITH_PPM -/* - junk */ +/* junk */ #undef WITH_SIN -/* - junk */ +/* junk */ #undef WITH_SKELETON -/* - junk */ +/* junk */ #undef WITH_T6963 -/* - junk */ +/* junk */ #undef WITH_TEXT -/* - junk */ +/* junk */ #undef WITH_USBLCD -/* - junk */ +/* junk */ #undef WITH_X11 -/* - Define to 1 if the X Window System - is missing or not being used. */ +/* Define to 1 if the X Window System is missing or not being used. */ #undef X_DISPLAY_MISSING -/* - Define to empty if `const' does not conform - to ANSI C. */ +/* Define to empty if `const' does not conform to ANSI C. */ #undef const -/* - Define to `int' if <sys/types.h> doesn't define. */ +/* Define to `int' if <sys/types.h> doesn't define. */ #undef gid_t /* Define to `__inline__' or `__inline' if that's what the C compiler @@ -476,21 +305,14 @@ #undef inline #endif -/* - Define to `int' if <sys/types.h> does not define. - */ +/* Define to `int' if <sys/types.h> does not define. */ #undef pid_t -/* - Define to `unsigned' if <sys/types.h> does not define. - */ +/* Define to `unsigned' if <sys/types.h> does not define. */ #undef size_t -/* - Define to `int' if <sys/types.h> doesn't define. */ +/* Define to `int' if <sys/types.h> doesn't define. */ #undef uid_t -/* - Define as `fork' if `vfork' does not work. - */ +/* Define as `fork' if `vfork' does not work. */ #undef vfork @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.58 for LCD4Linux 0.9.12. +# Generated by GNU Autoconf 2.59 for LCD4Linux 0.9.12. # # Report bugs to <reinelt@eunet.at>. # @@ -1037,16 +1037,14 @@ Optional Features: build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] - --disable-libtool-lock - avoid locking (might break parallel builds) + --disable-libtool-lock avoid locking (might break parallel builds) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-gnu-ld - assume the C compiler uses GNU ld [default=no] - --with-pic - try to use only PIC/non-PIC objects [default=use both] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-pic try to use only PIC/non-PIC objects [default=use + both] --with-tags[=TAGS] include additional configurations [automatic] --with-sco Use this to turn on SCO-specific code @@ -1066,28 +1064,18 @@ Optional Packages: MilfordInstruments, PalmPilot, PNG, PPM, X11, Text Some influential environment variables: - CXX - C++ compiler command - CXXFLAGS - C++ compiler flags - LDFLAGS - linker flags, e.g. -L<lib dir> if you have - libraries in a nonstandard directory <lib dir> - CPPFLAGS - C/C++ preprocessor flags, e.g. -I<include dir> if you - have headers in a nonstandard directory <include dir> - CC - C compiler command - CFLAGS - C compiler flags - CPP - C preprocessor - CXXCPP - C++ preprocessor - F77 - Fortran 77 compiler command - FFLAGS - Fortran 77 compiler flags + CXX C++ compiler command + CXXFLAGS C++ compiler flags + LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a + nonstandard directory <lib dir> + CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have + headers in a nonstandard directory <include dir> + CC C compiler command + CFLAGS C compiler flags + CPP C preprocessor + CXXCPP C++ preprocessor + F77 Fortran 77 compiler command + FFLAGS Fortran 77 compiler flags Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -1189,7 +1177,7 @@ test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF LCD4Linux configure 0.9.12 -generated by GNU Autoconf 2.58 +generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation @@ -1203,7 +1191,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by LCD4Linux $as_me 0.9.12, which was -generated by GNU Autoconf 2.58. Invocation command line was +generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ @@ -4056,7 +4044,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 4059 "configure"' > conftest.$ac_ext + echo '#line 4047 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -4926,7 +4914,7 @@ fi # Provide some information about the compiler. -echo "$as_me:4929:" \ +echo "$as_me:4917:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5 @@ -5958,11 +5946,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:5961: $lt_compile\"" >&5) + (eval echo "\"\$as_me:5949: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:5965: \$? = $ac_status" >&5 + echo "$as_me:5953: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -6191,11 +6179,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6194: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6182: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6198: \$? = $ac_status" >&5 + echo "$as_me:6186: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -6258,11 +6246,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6261: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6249: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:6265: \$? = $ac_status" >&5 + echo "$as_me:6253: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -8433,7 +8421,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 8436 "configure" +#line 8424 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -8531,7 +8519,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 8534 "configure" +#line 8522 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10708,11 +10696,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:10711: $lt_compile\"" >&5) + (eval echo "\"\$as_me:10699: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:10715: \$? = $ac_status" >&5 + echo "$as_me:10703: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -10775,11 +10763,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:10778: $lt_compile\"" >&5) + (eval echo "\"\$as_me:10766: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:10782: \$? = $ac_status" >&5 + echo "$as_me:10770: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -12129,7 +12117,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 12132 "configure" +#line 12120 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12227,7 +12215,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 12230 "configure" +#line 12218 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13054,11 +13042,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13057: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13045: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:13061: \$? = $ac_status" >&5 + echo "$as_me:13049: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -13121,11 +13109,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13124: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13112: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13128: \$? = $ac_status" >&5 + echo "$as_me:13116: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -15153,11 +15141,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15156: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15144: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15160: \$? = $ac_status" >&5 + echo "$as_me:15148: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -15386,11 +15374,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15389: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15377: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15393: \$? = $ac_status" >&5 + echo "$as_me:15381: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -15453,11 +15441,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15456: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15444: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:15460: \$? = $ac_status" >&5 + echo "$as_me:15448: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -17628,7 +17616,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 17631 "configure" +#line 17619 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -17726,7 +17714,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 17729 "configure" +#line 17717 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -19265,7 +19253,7 @@ echo "${ECHO_T}Please note that some screen refreshs may fail" >&6 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6 ncurses_version=unknown cat > conftest.$ac_ext <<EOF -#line 19268 "configure" +#line 19256 "configure" #include "confdefs.h" #ifdef RENAMED_NCURSES #include <curses.h> @@ -20978,8 +20966,8 @@ fi if test "$HD44780" = "yes"; then PARPORT="yes" -# DRIVERS="$DRIVERS HD44780.lo" - DRIVERS="$DRIVERS HD44780.o" +# DRIVERS="$DRIVERS HD44780.lo drv_HD44780.lo" + DRIVERS="$DRIVERS HD44780.o drv_HD44780.o" cat >>confdefs.h <<\_ACEOF #define WITH_HD44780 1 @@ -21021,7 +21009,7 @@ fi if test "$MATRIXORBITAL" = "yes"; then # DRIVERS="$DRIVERS MatrixOrbital.lo drv_MatrixOrbital.lo" - DRIVERS="$DRIVERS MatrixOrbital.o drv_MatrixOrbital.o" + DRIVERS="$DRIVERS MatrixOrbital.o drv_MatrixOrbital.o" cat >>confdefs.h <<\_ACEOF #define WITH_MATRIXORBITAL 1 @@ -24334,7 +24322,7 @@ _ASBOX cat >&5 <<_CSEOF This file was extended by LCD4Linux $as_me 0.9.12, which was -generated by GNU Autoconf 2.58. Invocation command line was +generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -24397,7 +24385,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ LCD4Linux config.status 0.9.12 -configured by $0, generated by GNU Autoconf 2.58, +configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. diff --git a/configure.in b/configure.in index fd1271d..3b6ee0a 100644 --- a/configure.in +++ b/configure.in @@ -159,8 +159,8 @@ fi if test "$HD44780" = "yes"; then PARPORT="yes" -# DRIVERS="$DRIVERS HD44780.lo" - DRIVERS="$DRIVERS HD44780.o" +# DRIVERS="$DRIVERS HD44780.lo drv_HD44780.lo" + DRIVERS="$DRIVERS HD44780.o drv_HD44780.o" AC_DEFINE(WITH_HD44780,1,[junk]) fi @@ -186,7 +186,7 @@ fi if test "$MATRIXORBITAL" = "yes"; then # DRIVERS="$DRIVERS MatrixOrbital.lo drv_MatrixOrbital.lo" - DRIVERS="$DRIVERS MatrixOrbital.o drv_MatrixOrbital.o" + DRIVERS="$DRIVERS MatrixOrbital.o drv_MatrixOrbital.o" AC_DEFINE(WITH_MATRIXORBITAL,1,[junk]) fi @@ -1,4 +1,4 @@ -/* $Id: drv.c,v 1.2 2004/01/10 10:20:22 reinelt Exp $ +/* $Id: drv.c,v 1.3 2004/01/20 15:32:49 reinelt Exp $ * * new framework for display drivers * @@ -23,6 +23,10 @@ * * * $Log: drv.c,v $ + * Revision 1.3 2004/01/20 15:32:49 reinelt + * first version of Next Generation HD44780 (untested! but it compiles...) + * some cleanup in the other drivers + * * Revision 1.2 2004/01/10 10:20:22 reinelt * new MatrixOrbital changes * @@ -112,9 +116,11 @@ DRIVER *Driver[] = { #ifdef WITH_CWLINUX &Cwlinux, #endif - #ifdef WITH_HD44780 - &HD44780, - #endif + */ +#ifdef WITH_HD44780 + &drv_HD44780, +#endif + /* Fixme #ifdef WITH_M50530 &M50530, #endif @@ -1,4 +1,4 @@ -/* $Id: drv.h,v 1.2 2004/01/10 20:22:33 reinelt Exp $ +/* $Id: drv.h,v 1.3 2004/01/20 15:32:49 reinelt Exp $ * * new framework for display drivers * @@ -23,6 +23,10 @@ * * * $Log: drv.h,v $ + * Revision 1.3 2004/01/20 15:32:49 reinelt + * first version of Next Generation HD44780 (untested! but it compiles...) + * some cleanup in the other drivers + * * Revision 1.2 2004/01/10 20:22:33 reinelt * added new function 'cfg_list()' (not finished yet) * added layout.c (will replace processor.c someday) @@ -58,14 +62,4 @@ int drv_list (void); int drv_init (char *section, char *driver); int drv_quit (void); -/* - int drv_query (int *rows, int *cols, int *xres, int *yres, int *bars, int *icons, int *gpos); - int drv_clear (int full); - int drv_put (int row, int col, char *text); - int drv_bar (int type, int row, int col, int max, int len1, int le2); - int drv_icon (int num, int seq, int row, int col); - int drv_gpo (int num, int val); - int drv_flush (void); -*/ - #endif diff --git a/drv_HD44780.c b/drv_HD44780.c new file mode 100644 index 0000000..d841a7b --- /dev/null +++ b/drv_HD44780.c @@ -0,0 +1,483 @@ +/* $Id: drv_HD44780.c,v 1.1 2004/01/20 15:32:49 reinelt Exp $ + * + * new style driver for HD44780-based displays + * + * Copyright 1999-2004 Michael Reinelt <reinelt@eunet.at> + * Copyright 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> + * + * Modification for 4-Bit mode + * Copyright 2003 Martin Hejl (martin@hejl.de) + * + * Modification for 2nd controller support + * Copyright 2003 Jesse Brook Kovach <jkovach@wam.umd.edu> + * + * 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_HD44780.c,v $ + * Revision 1.1 2004/01/20 15:32:49 reinelt + * first version of Next Generation HD44780 (untested! but it compiles...) + * some cleanup in the other drivers + * + */ + +/* + * + * exported fuctions: + * + * struct DRIVER drv_HD44780 + * + */ + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <errno.h> +#include <unistd.h> +#include <termios.h> +#include <fcntl.h> + +#include "debug.h" +#include "cfg.h" +#include "udelay.h" +#include "plugin.h" +#include "widget.h" +#include "widget_text.h" +#include "widget_bar.h" +#include "drv.h" +#include "drv_generic_text.h" +#include "drv_generic_parport.h" + +static char Name[]="HD44780"; + + +/* low level communication timings [nanoseconds] + * as these values differ from spec to spec, + * we use the worst-case values. + */ + +#define T_CYCLE 1000 // Enable cycle time +#define T_PW 450 // Enable pulse width +#define T_AS 60 // Address setup time +#define T_H 40 // Data hold time + + +/* HD44780 execution timings [microseconds] + * as these values differ from spec to spec, + * we use the worst-case values. + */ + +#define T_INIT1 4100 // first init sequence: 4.1 msec +#define T_INIT2 100 // second init sequence: 100 usec +#define T_EXEC 80 // normal execution time +#define T_WRCG 120 // CG RAM Write +#define T_CLEAR 1640 // Clear Display + + +static int Icons; +static int Bits=0; +static int GPO=0; +static int Controllers = 0; +static int Controller = 0; + +static unsigned char SIGNAL_RW; +static unsigned char SIGNAL_RS; +static unsigned char SIGNAL_ENABLE; +static unsigned char SIGNAL_ENABLE2; +static unsigned char SIGNAL_GPO; + +// Fixme +static int GPOS; + +// **************************************** +// *** hardware dependant functions *** +// **************************************** + +static void drv_HD_nibble(unsigned char controller, unsigned char nibble) +{ + unsigned char enable; + + // enable signal: 'controller' is a bitmask + // bit 0 .. send to controller #0 + // bit 1 .. send to controller #1 + // so we can send a byte to both controllers at the same time! + enable=0; + if (controller&0x01) enable|=SIGNAL_ENABLE; + if (controller&0x02) enable|=SIGNAL_ENABLE2; + + // clear ENABLE + // put data on DB1..DB4 + // nibble already contains RS bit! + drv_generic_parport_data(nibble); + + // Address set-up time + ndelay(T_AS); + + // rise ENABLE + drv_generic_parport_data(nibble | enable); + + // Enable pulse width + ndelay(T_PW); + + // lower ENABLE + drv_generic_parport_data(nibble); +} + + +static void drv_HD_byte (unsigned char controller, unsigned char data, unsigned char RS) +{ + // send high nibble of the data + drv_HD_nibble (controller, ((data>>4)&0x0f)|RS); + + // Make sure we honour T_CYCLE + ndelay(T_CYCLE-T_AS-T_PW); + + // send low nibble of the data + drv_HD_nibble(controller, (data&0x0f)|RS); +} + + +static void drv_HD_command (unsigned char controller, unsigned char cmd, int delay) +{ + unsigned char enable; + + if (Bits==8) { + + // enable signal: 'controller' is a bitmask + // bit 0 .. send to controller #0 + // bit 1 .. send to controller #1 + // so we can send a byte to both controllers at the same time! + enable=0; + if (controller&0x01) enable|=SIGNAL_ENABLE; + if (controller&0x02) enable|=SIGNAL_ENABLE2; + + // put data on DB1..DB8 + drv_generic_parport_data (cmd); + + // clear RW and RS + drv_generic_parport_control (SIGNAL_RW | SIGNAL_RS, 0); + + // Address set-up time + ndelay(T_AS); + + // send command + drv_generic_parport_toggle (enable, 1, T_PW); + + } else { + + drv_HD_byte (controller, cmd, 0); + + } + + // wait for command completion + udelay(delay); + +} + + +static void drv_HD_data (unsigned char controller, char *string, int len, int delay) +{ + unsigned char enable; + + // sanity check + if (len<=0) return; + + if (Bits==8) { + + // enable signal: 'controller' is a bitmask + // bit 0 .. send to controller #0 + // bit 1 .. send to controller #1 + // so we can send a byte to both controllers at the same time! + enable=0; + if (controller&0x01) enable|=SIGNAL_ENABLE; + if (controller&0x02) enable|=SIGNAL_ENABLE2; + + // clear RW, set RS + drv_generic_parport_control (SIGNAL_RW | SIGNAL_RS, SIGNAL_RS); + + // Address set-up time + ndelay(T_AS); + + while (len--) { + + // put data on DB1..DB8 + drv_generic_parport_data (*(string++)); + + // send command + drv_generic_parport_toggle (enable, 1, T_PW); + + // wait for command completion + udelay(delay); + } + + } else { // 4 bit mode + + while (len--) { + + // send data with RS enabled + drv_HD_byte (controller, *(string++), SIGNAL_RS); + + // wait for command completion + udelay(delay); + } + } +} + + +static void drv_HD_goto (int row, int col) +{ + int pos; + + // handle multiple displays/controllers + if (Controllers>1 && row>=DROWS/2) { + row -= DROWS/2; + Controller = 2; + } else { + Controller = 1; + } + + // 16x1 Displays are organized as 8x2 :-( + if (DCOLS==16 && DROWS==1 && col>7) { + row++; + col-=8; + } + + // 16x4 Displays use a slightly different layout + if (DCOLS==16 && DROWS==4) { + pos=(row%2)*64+(row/2)*16+col; + } else { + pos=(row%2)*64+(row/2)*20+col; + } + + drv_HD_command (Controller, (0x80|pos), T_EXEC); +} + + +static int drv_HD_start (char *section) +{ + int rows=-1, cols=-1, gpos=-1; + char *s; + + s=cfg_get(section, "Size", NULL); + if (s==NULL || *s=='\0') { + error ("%s: no '%s.Size' entry from %s", Name, section, cfg_source()); + return -1; + } + if (sscanf(s,"%dx%d",&cols,&rows)!=2 || rows<1 || cols<1) { + error ("%s: bad size '%s'", Name, s); + return -1; + } + + if (cfg_number(section, "GPOs", 0, 0, 8, &gpos)<0) return -1; + info ("%s: controlling %d GPO's", Name, gpos); + + if (cfg_number(section, "Controllers", 1, 1, 2, &Controllers)<0) return -1; + info ("%s: using display with %d controllers", Name, Controllers); + + // current controller + Controller=1; + + DROWS = rows; + DCOLS = cols; + GPOS = gpos; + + if (cfg_number(section, "Bits", 8, 4, 8, &Bits)<0) return -1; + if (Bits!=4 && Bits!=8) { + error ("%s: bad %s.Bits '%s' from %s, should be '4' or '8'", Name, section, s, cfg_source()); + return -1; + } + info ("%s: using %d bit mode", Name, Bits); + + if (drv_generic_parport_open(section, Name) != 0) { + error ("%s: could not initialize parallel port!", Name); + return -1; + } + + if (Bits==8) { + if ((SIGNAL_RS = drv_generic_parport_wire_ctrl ("RS", "AUTOFD"))==0xff) return -1; + if ((SIGNAL_RW = drv_generic_parport_wire_ctrl ("RW", "GND" ))==0xff) return -1; + if ((SIGNAL_ENABLE = drv_generic_parport_wire_ctrl ("ENABLE", "STROBE"))==0xff) return -1; + if ((SIGNAL_ENABLE2 = drv_generic_parport_wire_ctrl ("ENABLE2", "GND" ))==0xff) return -1; + if ((SIGNAL_GPO = drv_generic_parport_wire_ctrl ("GPO", "GND" ))==0xff) return -1; + } else { + if ((SIGNAL_RS = drv_generic_parport_wire_data ("RS", "DB4"))==0xff) return -1; + if ((SIGNAL_RW = drv_generic_parport_wire_data ("RW", "DB5"))==0xff) return -1; + if ((SIGNAL_ENABLE = drv_generic_parport_wire_data ("ENABLE", "DB6"))==0xff) return -1; + if ((SIGNAL_ENABLE2 = drv_generic_parport_wire_data ("ENABLE2", "GND"))==0xff) return -1; + if ((SIGNAL_GPO = drv_generic_parport_wire_data ("GPO", "GND"))==0xff) return -1; + } + + // clear all signals + if (Bits==8) { + drv_generic_parport_control (SIGNAL_RS|SIGNAL_RW|SIGNAL_ENABLE|SIGNAL_ENABLE2|SIGNAL_GPO, 0); + } else { + drv_generic_parport_data (0); + } + + // set direction: write + drv_generic_parport_direction (0); + + // initialize *both* displays + if (Bits==8) { + drv_HD_command (0x03, 0x30, T_INIT1); // 8 Bit mode, wait 4.1 ms + drv_HD_command (0x03, 0x30, T_INIT2); // 8 Bit mode, wait 100 us + drv_HD_command (0x03, 0x38, T_EXEC); // 8 Bit mode, 1/16 duty cycle, 5x8 font + } else { + drv_HD_nibble(0x03, 0x03); udelay(T_INIT1); // 4 Bit mode, wait 4.1 ms + drv_HD_nibble(0x03, 0x03); udelay(T_INIT2); // 4 Bit mode, wait 100 us + drv_HD_nibble(0x03, 0x03); udelay(T_INIT1); // 4 Bit mode, wait 4.1 ms + drv_HD_nibble(0x03, 0x02); udelay(T_INIT2); // 4 Bit mode, wait 100 us + drv_HD_command (0x03, 0x28, T_EXEC); // 4 Bit mode, 1/16 duty cycle, 5x8 font + } + + drv_HD_command (0x03, 0x08, T_EXEC); // Display off, cursor off, blink off + drv_HD_command (0x03, 0x0c, T_CLEAR); // Display on, cursor off, blink off, wait 1.64 ms + drv_HD_command (0x03, 0x06, T_EXEC); // curser moves to right, no shift + + return 0; +} + + +static void drv_HD_write (char *string, int len) +{ + drv_HD_data (Controller, string, len, T_EXEC); +} + + +static void drv_HD_define_char (int ascii, char *buffer) +{ + // define chars on *both* controllers! + drv_HD_command (0x03, 0x40|8*ascii, T_EXEC); + drv_HD_data (0x03, buffer, 8, T_WRCG); +} + + +// Fixme +#if 0 +static void drv_HD_setGPO (int bits) +{ + if (Lcd.gpos>0) { + + // put data on DB1..DB8 + drv_generic_parport_data (bits); + + // 74HCT573 set-up time + ndelay(20); + + // send data + // 74HCT573 enable pulse width = 24ns + drv_generic_parport_toggle (SIGNAL_GPO, 1, 230); + } +} +#endif + +// **************************************** +// *** plugins *** +// **************************************** + + +// **************************************** +// *** widget callbacks *** +// **************************************** + + +int drv_HD_draw_text (WIDGET *W) +{ + return drv_generic_text_draw_text(W, 2, drv_HD_goto, drv_HD_write); +} + + +int drv_HD_draw_bar (WIDGET *W) +{ + return drv_generic_text_draw_bar(W, 2, drv_HD_define_char, drv_HD_goto, drv_HD_write); +} + + +// **************************************** +// *** exported functions *** +// **************************************** + + +// list models +int drv_HD_list (void) +{ + printf ("any"); + return 0; +} + + +// initialize driver & display +int drv_HD_init (char *section) +{ + WIDGET_CLASS wc; + int ret; + + XRES=5; + YRES=8; + CHARS=8; + + // start display + if ((ret=drv_HD_start (section))!=0) + return ret; + + // initialize generic text driver + if ((ret=drv_generic_text_init(Name))!=0) + return ret; + + // initialize generic bar driver + if ((ret=drv_generic_text_bar_init())!=0) + return ret; + + // add fixed chars to the bar driver + drv_generic_text_bar_add_segment ( 0, 0,255, 32); // ASCII 32 = blank + drv_generic_text_bar_add_segment (255,255,255,255); // ASCII 255 = block + + // register text widget + wc=Widget_Text; + wc.draw=drv_HD_draw_text; + widget_register(&wc); + + // register bar widget + wc=Widget_Bar; + wc.draw=drv_HD_draw_bar; + widget_register(&wc); + + // register plugins + // Fixme: plugins for HD44780? + + return 0; +} + + +// close driver & display +int drv_HD_quit (void) { + + info("%s: shutting down.", Name); + drv_generic_parport_close(); + drv_generic_text_quit(); + + return (0); +} + + +DRIVER drv_HD44780 = { + name: Name, + list: drv_HD_list, + init: drv_HD_init, + quit: drv_HD_quit, +}; + diff --git a/drv_MatrixOrbital.c b/drv_MatrixOrbital.c index 2a8be1f..5c916e1 100644 --- a/drv_MatrixOrbital.c +++ b/drv_MatrixOrbital.c @@ -1,4 +1,4 @@ -/* $Id: drv_MatrixOrbital.c,v 1.13 2004/01/20 14:25:12 reinelt Exp $ +/* $Id: drv_MatrixOrbital.c,v 1.14 2004/01/20 15:32:49 reinelt Exp $ * * new style driver for Matrix Orbital serial display modules * @@ -23,6 +23,10 @@ * * * $Log: drv_MatrixOrbital.c,v $ + * Revision 1.14 2004/01/20 15:32:49 reinelt + * first version of Next Generation HD44780 (untested! but it compiles...) + * some cleanup in the other drivers + * * Revision 1.13 2004/01/20 14:25:12 reinelt * some reorganization * moved drv_generic to drv_generic_serial @@ -100,8 +104,8 @@ #include "widget_text.h" #include "widget_bar.h" #include "drv.h" -#include "drv_generic_serial.h" #include "drv_generic_text.h" +#include "drv_generic_serial.h" static char Name[]="MatrixOrbital"; diff --git a/drv_generic_parport.c b/drv_generic_parport.c index 416e79c..68d537f 100644 --- a/drv_generic_parport.c +++ b/drv_generic_parport.c @@ -1,4 +1,4 @@ -/* $Id: drv_generic_parport.c,v 1.1 2004/01/20 14:35:38 reinelt Exp $ +/* $Id: drv_generic_parport.c,v 1.2 2004/01/20 15:32:49 reinelt Exp $ * * generic driver helper for serial and parport access * @@ -23,6 +23,10 @@ * * * $Log: drv_generic_parport.c,v $ + * Revision 1.2 2004/01/20 15:32:49 reinelt + * first version of Next Generation HD44780 (untested! but it compiles...) + * some cleanup in the other drivers + * * Revision 1.1 2004/01/20 14:35:38 reinelt * drv_generic_parport added, code from parport.c * @@ -83,6 +87,8 @@ #include "drv_generic_parport.h" +static char *Driver=""; +static char *Section=""; static unsigned short Port=0; static char *PPdev=NULL; @@ -94,19 +100,18 @@ static int PPfd=-1; #endif -int drv_generic_parport_open (void) +int drv_generic_parport_open (char *section, char *driver) { char *s, *e; -#ifdef USE_OLD_UDELAY - if (cfg_number(NULL, "Delay", 0, 1, 1000000000, &loops_per_usec)<0) return -1; -#else + Section=section; + Driver=driver; + udelay_init(); -#endif - s=cfg_get (NULL, "Port", NULL); + s=cfg_get (Section, "Port", NULL); if (s==NULL || *s=='\0') { - error ("parport: no 'Port' entry in %s", cfg_source()); + error ("%s: no '%s.Port' entry from %s", Driver, Section, cfg_source()); return -1; } PPdev=NULL; @@ -115,7 +120,7 @@ int drv_generic_parport_open (void) Port=0; PPdev=s; #else - error ("parport: bad Port '%s' in %s", s, cfg_source()); + error ("%s: bad %s.Port '%s' from %s", Driver, Section, s, cfg_source()); return -1; #endif } @@ -127,7 +132,7 @@ int drv_generic_parport_open (void) debug ("using ppdev %s", PPdev); PPfd=open(PPdev, O_RDWR); if (PPfd==-1) { - error ("parport: open(%s) failed: %s", PPdev, strerror(errno)); + error ("%s: open(%s) failed: %s", Driver, PPdev, strerror(errno)); return -1; } @@ -141,7 +146,7 @@ int drv_generic_parport_open (void) #endif if (ioctl(PPfd, PPCLAIM)) { - error ("parport: ioctl(%s, PPCLAIM) failed: %d %s", PPdev, errno, strerror(errno)); + error ("%s: ioctl(%s, PPCLAIM) failed: %d %s", Driver, PPdev, errno, strerror(errno)); return -1; } } else @@ -152,12 +157,12 @@ int drv_generic_parport_open (void) debug ("using raw port 0x%x", Port); if ((Port+3)<=0x3ff) { if (ioperm(Port, 3, 1)!=0) { - error ("parport: ioperm(0x%x) failed: %s", Port, strerror(errno)); + error ("%s: ioperm(0x%x) failed: %s", Driver, Port, strerror(errno)); return -1; } } else { if (iopl(3)!=0) { - error ("parport: iopl(1) failed: %s", strerror(errno)); + error ("%s: iopl(1) failed: %s", Driver, strerror(errno)); return -1; } } @@ -172,10 +177,10 @@ int drv_generic_parport_close (void) if (PPdev) { debug ("closing ppdev %s", PPdev); if (ioctl(PPfd, PPRELEASE)) { - error ("parport: ioctl(%s, PPRELEASE) failed: %s", PPdev, strerror(errno)); + error ("%s: ioctl(%s, PPRELEASE) failed: %s", Driver, PPdev, strerror(errno)); } if (close(PPfd)==-1) { - error ("parport: close(%s) failed: %s", PPdev, strerror(errno)); + error ("%s: close(%s) failed: %s", Driver, PPdev, strerror(errno)); return -1; } } else @@ -184,12 +189,12 @@ int drv_generic_parport_close (void) debug ("closing raw port 0x%x", Port); if ((Port+3)<=0x3ff) { if (ioperm(Port, 3, 0)!=0) { - error ("parport: ioperm(0x%x) failed: %s", Port, strerror(errno)); + error ("%s: ioperm(0x%x) failed: %s", Driver, Port, strerror(errno)); return -1; } } else { if (iopl(0)!=0) { - error ("parport: iopl(0) failed: %s", strerror(errno)); + error ("%s: iopl(0) failed: %s", Driver, strerror(errno)); return -1; } } @@ -205,7 +210,7 @@ unsigned char drv_generic_parport_wire_ctrl (char *name, unsigned char *deflt) char *s; snprintf (wire, sizeof(wire), "Wire.%s", name); - s=cfg_get (NULL, wire, deflt); + s=cfg_get (Section, wire, deflt); if (strcasecmp(s,"STROBE")==0) { w=PARPORT_CONTROL_STROBE; } else if(strcasecmp(s,"AUTOFD")==0) { @@ -217,25 +222,25 @@ unsigned char drv_generic_parport_wire_ctrl (char *name, unsigned char *deflt) } else if(strcasecmp(s,"GND")==0) { w=0; } else { - error ("parport: unknown signal <%s> for wire <%s>", s, name); - error (" should be STROBE, AUTOFD, INIT, SELECT or GND"); + error ("%s: unknown signal <%s> for wire <%s>", Driver, s, name); + error ("%s: should be STROBE, AUTOFD, INIT, SELECT or GND", Driver); return 0xff; } if (w&PARPORT_CONTROL_STROBE) { - info ("wiring: [DISPLAY:%s]<==>[PARPORT:STROBE]", name); + info ("%s: wiring: [DISPLAY:%s]<==>[PARPORT:STROBE]", Driver, name); } if (w&PARPORT_CONTROL_AUTOFD) { - info ("wiring: [DISPLAY:%s]<==>[PARPORT:AUTOFD]", name); + info ("%s: wiring: [DISPLAY:%s]<==>[PARPORT:AUTOFD]", Driver, name); } if (w&PARPORT_CONTROL_INIT) { - info ("wiring: [DISPLAY:%s]<==>[PARPORT:INIT]", name); + info ("%s: wiring: [DISPLAY:%s]<==>[PARPORT:INIT]", Driver, name); } if (w&PARPORT_CONTROL_SELECT) { - info ("wiring: [DISPLAY:%s]<==>[PARPORT:SELECT]", name); + info ("%s: wiring: [DISPLAY:%s]<==>[PARPORT:SELECT]", Driver, name); } if (w==0) { - info ("wiring: [DISPLAY:%s]<==>[PARPORT:GND]", name); + info ("%s: wiring: [DISPLAY:%s]<==>[PARPORT:GND]", Driver, name); } return w; @@ -249,21 +254,21 @@ unsigned char drv_generic_parport_wire_data (char *name, unsigned char *deflt) char *s; snprintf (wire, sizeof(wire), "Wire.%s", name); - s=cfg_get (NULL, wire, deflt); + s=cfg_get (Section, wire, deflt); if(strlen(s)==3 && strncasecmp(s,"DB",2)==0 && s[2]>='0' && s[2]<='7') { w=s[2]-'0'; } else if(strcasecmp(s,"GND")==0) { w=0; } else { - error ("parport: unknown signal <%s> for wire <%s>", s, name); - error (" should be DB0..7 or GND"); + error ("%s: unknown signal <%s> for wire <%s>", Driver, s, name); + error ("%s: should be DB0..7 or GND", Driver); return 0xff; } if (w==0) { - info ("wiring: [DISPLAY:%s]<==>[PARPORT:GND]", name); + info ("%s: wiring: [DISPLAY:%s]<==>[PARPORT:GND]", Driver, name); } else { - info ("wiring: [DISPLAY:%s]<==>[PARPORT:DB%d]", name, w); + info ("%s: wiring: [DISPLAY:%s]<==>[PARPORT:DB%d]", Driver, name, w); } w=1<<w; diff --git a/drv_generic_parport.h b/drv_generic_parport.h index 6decaa7..5e35ca6 100644 --- a/drv_generic_parport.h +++ b/drv_generic_parport.h @@ -1,4 +1,4 @@ -/* $Id: drv_generic_parport.h,v 1.1 2004/01/20 14:35:38 reinelt Exp $ +/* $Id: drv_generic_parport.h,v 1.2 2004/01/20 15:32:49 reinelt Exp $ * * generic driver helper for parallel port displays * @@ -23,6 +23,10 @@ * * * $Log: drv_generic_parport.h,v $ + * Revision 1.2 2004/01/20 15:32:49 reinelt + * first version of Next Generation HD44780 (untested! but it compiles...) + * some cleanup in the other drivers + * * Revision 1.1 2004/01/20 14:35:38 reinelt * drv_generic_parport added, code from parport.c * @@ -73,7 +77,7 @@ #ifndef _DRV_GENERIC_PARPORT_H_ #define _DRV_GENERIC_PARPORT_H_ -int drv_generic_parport_open (void); +int drv_generic_parport_open (char *section, char *driver); int drv_generic_parport_close (void); unsigned char drv_generic_parport_wire_ctrl (char *name, unsigned char *deflt); unsigned char drv_generic_parport_wire_data (char *name, unsigned char *deflt); diff --git a/lcd4linux.conf.sample b/lcd4linux.conf.sample index 029e94c..37beb54 100644 --- a/lcd4linux.conf.sample +++ b/lcd4linux.conf.sample @@ -2,11 +2,27 @@ Display LK204 { Driver 'MatrixOrbital' Model 'LK204-24-USB' Port '/dev/usb/tts/0' -# Port '/dev/tts/0' +# Port '/dev/tts/0' Speed 19200 Contrast 256/2 } + +Display myHD44780 { + Driver 'HD44780' + Port '/dev/parports/0' +# Port '0x378' + Bits '8' + Size '20x4' + Wire { + RW 'GND' + RS 'AUTOFD' + ENABLE 'STROBE' + GPO 'INIT' + } +} + + Widget OS { class 'Text' expression '*** '.uname('sysname').' '.uname('release').' ***' @@ -95,14 +111,9 @@ Layout Default { } -Display 'LK204' +Display 'myHD44780' Layout 'Default' -#Row1 "*** %o %v ***" -#Row2 "%p CPU %r MB RAM" -#Row3 "Busy %cb%% $r10cs+cb" -#Row4 "Load%l1%L$r10l1" - Variables { tick 500 tack 100 |