[lcd4linux @ 2002-04-29 11:00:25 by reinelt]

added Toshiba T6963 driver
added ndelay() with nanosecond resolution

git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@152 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
This commit is contained in:
reinelt
2002-04-29 11:00:28 +00:00
parent c9a403a836
commit e0bc8f47b9
14 changed files with 5064 additions and 2303 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4 from Makefile.am
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
+8 -1
View File
@@ -1,5 +1,5 @@
#
# $Id: README,v 1.22 2001/09/05 09:38:52 reinelt Exp $
# $Id: README,v 1.23 2002/04/29 11:00:26 reinelt Exp $
#
This is the README file for lcd4linux
@@ -83,6 +83,13 @@ SUPPORTED DISPLAYS
Unfortunately, the driver is not finished yet.
* Toshiba T6963
I got another real cool display (240x128 pixel!) from
Carsten Nau (info@cnau.de). Thanks again!
Unfortunately, the driver is not finished yet.
* PalmOrb
I was told that lcd4linux works fine with PalmOrb, a small program that
+464
View File
@@ -0,0 +1,464 @@
/* $Id: T6963.c,v 1.1 2002/04/29 11:00:26 reinelt Exp $
*
* driver for display modules based on the Toshiba T6963 chip
*
* 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: T6963.c,v $
* 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 <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <time.h>
#include <errno.h>
#include <sys/ioctl.h>
#if defined (HAVE_LINUX_PARPORT_H) && defined (HAVE_LINUX_PPDEV_H)
#define WITH_PPDEV
#include <linux/parport.h>
#include <linux/ppdev.h>
#else
#error The T6963 driver needs ppdev
#error cannot compile T6963 driver
#endif
#include "debug.h"
#include "cfg.h"
#include "display.h"
#include "udelay.h"
#include "pixmap.h"
/*
* /CE (Chip Enable) <==> /Strobe
* C/D (Command/Data) <==> /Select
* /RD (Read) <==> /AutoFeed
* /WR (Write) <==> Init
*
*/
#define CE_L PARPORT_CONTROL_STROBE
#define CE_H 0
#define CD_L PARPORT_CONTROL_SELECT
#define CD_H 0
#define RD_L PARPORT_CONTROL_AUTOFD
#define RD_H 0
#define WR_L 0
#define WR_H PARPORT_CONTROL_INIT
#define XRES 6
#define YRES 8
#define BARS ( BAR_L | BAR_R | BAR_U | BAR_D | BAR_H2 | BAR_V2 | BAR_T)
static LCD Lcd;
static char *PPdev=NULL;
static int PPfd=-1;
unsigned char *Buffer1, *Buffer2;
// perform normal status check
void T6_status1 (void)
{
int direction;
int n;
unsigned char ctrl, data;
// turn off data line drivers
direction=1;
ioctl (PPfd, PPDATADIR, &direction);
// lower RD and CE
ctrl = RD_L | WR_H | CE_L | CD_H;
ioctl (PPfd, PPWCONTROL, &ctrl);
ndelay(150); // Access Time: 150 ns
// wait for STA0=1 and STA1=1
n=0;
do {
rep_nop();
if (++n>1000) {
debug("hang in status1");
break;
}
ioctl (PPfd, PPRDATA, &data);
} while ((data & 0x03) != 0x03);
// rise RD and CE
ctrl = RD_H | WR_H | CE_H | CD_H;
ioctl (PPfd, PPWCONTROL, &ctrl);
// turn on data line drivers
direction=0;
ioctl (PPfd, PPDATADIR, &direction);
}
// perform status check in "auto mode"
void T6_status2 (void)
{
int direction;
int n;
unsigned char ctrl, data;
// turn off data line drivers
direction=1;
ioctl (PPfd, PPDATADIR, &direction);
// lower RD and CE
ctrl = RD_L | WR_H | CE_L | CD_H;
ioctl (PPfd, PPWCONTROL, &ctrl);
ndelay(150); // Access Time: 150 ns
// wait for STA3=1
n=0;
do {
rep_nop();
if (++n>1000) {
debug("hang in status2");
break;
}
ioctl (PPfd, PPRDATA, &data);
} while ((data & 0x08) == 0);
// rise RD and CE
ctrl = RD_H | WR_H | CE_H | CD_H;
ioctl (PPfd, PPWCONTROL, &ctrl);
// turn on data line drivers
direction=0;
ioctl (PPfd, PPDATADIR, &direction);
}
static void T6_write_cmd (unsigned char cmd)
{
unsigned char ctrl;
// wait until the T6963 is idle
T6_status1();
// put data on DB1..DB8
ioctl(PPfd, PPWDATA, &cmd);
// lower WR and CE
ctrl = RD_H | WR_L | CE_L | CD_H;
ioctl (PPfd, PPWCONTROL, &ctrl);
ndelay(80); // Pulse width
// rise WR and CE
ctrl = RD_H | WR_H | CE_H | CD_H;
ioctl (PPfd, PPWCONTROL, &ctrl);
}
static void T6_write_data (unsigned char data)
{
unsigned char ctrl;
// wait until the T6963 is idle
T6_status1();
// put data on DB1..DB8
ioctl(PPfd, PPWDATA, &data);
// lower C/D
ctrl = RD_H | WR_H | CE_H | CD_L;
ioctl (PPfd, PPWCONTROL, &ctrl);
ndelay(20); // C/D Setup Time
// lower WR and CE
ctrl = RD_H | WR_L | CE_L | CD_L;
ioctl (PPfd, PPWCONTROL, &ctrl);
ndelay(80); // Pulse Width
// rise WR and CE
ctrl = RD_H | WR_H | CE_H | CD_L;
ioctl (PPfd, PPWCONTROL, &ctrl);
ndelay(10); // C/D Hold Time
// rise CD
ctrl = RD_H | WR_H | CE_H | CD_H;
ioctl (PPfd, PPWCONTROL, &ctrl);
}
static void T6_write_auto (unsigned char data)
{
unsigned char ctrl;
// wait until the T6963 is idle
T6_status2();
// put data on DB1..DB8
ioctl(PPfd, PPWDATA, &data);
// lower C/D
ctrl = RD_H | WR_H | CE_H | CD_L;
ioctl (PPfd, PPWCONTROL, &ctrl);
ndelay(20); // C/D Setup Time
// lower WR and CE
ctrl = RD_H | WR_L | CE_L | CD_L;
ioctl (PPfd, PPWCONTROL, &ctrl);
ndelay(80); // Pulse Width
// rise WR and CE
ctrl = RD_H | WR_H | CE_H | CD_L;
ioctl (PPfd, PPWCONTROL, &ctrl);
ndelay(10); // C/D Hold Time
// rise CD
ctrl = RD_H | WR_H | CE_H | CD_H;
ioctl (PPfd, PPWCONTROL, &ctrl);
}
static void T6_send_byte (unsigned char cmd, unsigned char data)
{
T6_write_data(data);
T6_write_cmd(cmd);
}
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; i<len; i++) {
T6_write_auto(data);
}
T6_status2();
T6_write_cmd(0xb2); // Auto Reset
}
static void T6_memcpy(unsigned short addr, unsigned char *data, int len)
{
int i;
T6_send_word (0x24, 0x0200+addr); // Set Adress Pointer
T6_write_cmd(0xb0); // Set Data Auto Write
for (i=0; i<len; i++) {
T6_write_auto(*(data++));
}
T6_status2();
T6_write_cmd(0xb2); // Auto Reset
}
static int T6_open (void)
{
debug ("using ppdev %s", PPdev);
PPfd=open(PPdev, O_RDWR);
if (PPfd==-1) {
error ("open(%s) failed: %s", PPdev, strerror(errno));
return -1;
}
#if 0
if (ioctl(PPfd, PPEXCL)) {
debug ("ioctl(%s, PPEXCL) failed: %s", PPdev, strerror(errno));
} else {
debug ("ioctl(%s, PPEXCL) succeded.");
}
#endif
if (ioctl(PPfd, PPCLAIM)) {
error ("ioctl(%s, PPCLAIM) failed: %d %s", PPdev, errno, strerror(errno));
return -1;
}
return 0;
}
int T6_clear (void)
{
int rows;
rows=(Lcd.rows>8 ? 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)
{
char *port;
Lcd=*Self;
if (PPdev) {
free (PPdev);
PPdev=NULL;
}
port=cfg_get ("Port");
if (port==NULL || *port=='\0') {
error ("T6963: no 'Port' entry in %s", cfg_file());
return -1;
}
PPdev=strdup(port);
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;
}
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;
}
udelay_init();
if (T6_open()!=0)
return -1;
debug ("setting %d columns", Lcd.cols);
T6_send_word (0x40, 0x0000); // Set Text Home Address
T6_send_word (0x41, 40); // Set Text Area
T6_send_word (0x42, 0x0200); // Set Graphic Home Address
T6_send_word (0x43, 40); // 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();
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_flush (void)
{
int i, j, e;
memset(Buffer1,0,Lcd.cols*Lcd.rows*Lcd.yres*sizeof(*Buffer1));
for (i=0; i<Lcd.cols*Lcd.rows*Lcd.yres; i++) {
for (j=0; j<Lcd.xres; j++) {
Buffer1[i]<<=1;
if (LCDpixmap[i*Lcd.xres+j]) Buffer1[i]|=1;
}
}
for (i=0; i<Lcd.cols*Lcd.rows*Lcd.yres; i++) {
if (Buffer1[i]==Buffer2[i]) continue;
for (j=i, e=0; i<Lcd.cols*Lcd.rows*Lcd.yres; i++) {
if (Buffer1[i]==Buffer2[i]) {
if (++e>4) 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)
{
debug ("closing ppdev %s", PPdev);
if (ioctl(PPfd, PPRELEASE)) {
error ("ioctl(%s, PPRELEASE) failed: %s", PPdev, strerror(errno));
}
if (close(PPfd)==-1) {
error ("close(%s) failed: %s", PPdev, strerror(errno));
return -1;
}
return 0;
}
LCD T6963[] = {
{ "TLC1091",16,40,XRES,YRES,BARS,0,T6_init,T6_clear,T6_put,T6_bar,NULL,T6_flush,T6_quit },
{ NULL }
};
+4
View File
@@ -120,3 +120,7 @@ do not disable mail check in first error
instead use a number of retries
errors can occur in case of short disconnects, but normal operation
should resume
2002-02-15 Udo Altmann (udo.altmann@web.de)
support for inversed/blinking text
don't know if displays support this feature...
+3
View File
@@ -10,6 +10,9 @@
/* Define if you want the M50530 driver compiled */
#undef WITH_M50530
/* Define if you want the T6963 driver compiled */
#undef WITH_T6963
/* Define if you want the Matrix Orbital driver compiled */
#undef WITH_MATRIXORBITAL
Vendored
+6 -6
View File
@@ -1,6 +1,6 @@
dnl aclocal.m4 generated automatically by aclocal 1.4
dnl aclocal.m4 generated automatically by aclocal 1.4-p5
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -19,7 +19,7 @@ dnl PARTICULAR PURPOSE.
dnl Usage:
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
AC_DEFUN(AM_INIT_AUTOMAKE,
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_REQUIRE([AC_PROG_INSTALL])
PACKAGE=[$1]
AC_SUBST(PACKAGE)
@@ -47,7 +47,7 @@ AC_REQUIRE([AC_PROG_MAKE_SET])])
# Check to make sure that the build environment is sane.
#
AC_DEFUN(AM_SANITY_CHECK,
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
@@ -88,7 +88,7 @@ AC_MSG_RESULT(yes)])
dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
dnl The program must properly implement --version.
AC_DEFUN(AM_MISSING_PROG,
AC_DEFUN([AM_MISSING_PROG],
[AC_MSG_CHECKING(for working $2)
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
@@ -104,7 +104,7 @@ AC_SUBST($1)])
# Like AC_CONFIG_HEADER, but automatically create stamp file.
AC_DEFUN(AM_CONFIG_HEADER,
AC_DEFUN([AM_CONFIG_HEADER],
[AC_PREREQ([2.12])
AC_CONFIG_HEADER([$1])
dnl When config.status generates a header, we must update the stamp-h file.
+121 -96
View File
@@ -1,41 +1,4 @@
/* config.h.in. Generated automatically from configure.in by autoheader. */
/* Define to empty if the keyword does not work. */
#undef const
/* Define to `int' if <sys/types.h> doesn't define. */
#undef gid_t
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
#undef HAVE_SYS_WAIT_H
/* Define as __inline if that's what the C compiler calls it. */
#undef inline
/* Define to `int' if <sys/types.h> doesn't define. */
#undef pid_t
/* Define as the return type of signal handlers (int or void). */
#undef RETSIGTYPE
/* Define to `unsigned' if <sys/types.h> doesn't define. */
#undef size_t
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
/* Define if your <sys/time.h> declares struct tm. */
#undef TM_IN_SYS_TIME
/* Define to `int' if <sys/types.h> doesn't define. */
#undef uid_t
/* Define if the X Window System is missing or not being used. */
#undef X_DISPLAY_MISSING
/* Define if you want the Beckmann&Egle driver compiled */
#undef WITH_BECKMANNEGLE
@@ -48,6 +11,9 @@
/* Define if you want the M50530 driver compiled */
#undef WITH_M50530
/* Define if you want the T6963 driver compiled */
#undef WITH_T6963
/* Define if you want the Matrix Orbital driver compiled */
#undef WITH_MATRIXORBITAL
@@ -75,11 +41,13 @@
/*=== Curses version detection defines ===*/
/* Found some version of curses that we're going to use */
#undef HAS_CURSES
/* Use SunOS SysV curses? */
#undef USE_SUNOS_CURSES
/* Use old BSD curses - not used right now */
#undef USE_BSD_CURSES
/* Use SystemV curses? */
#undef USE_SYSV_CURSES
@@ -98,96 +66,153 @@
* 2 = version 4.0/4.1 */
#undef NCURSES_970530
/* Define if you have the gettimeofday function. */
#undef HAVE_GETTIMEOFDAY
/* Define if you have the putenv function. */
#undef HAVE_PUTENV
/* Define if you have the select function. */
#undef HAVE_SELECT
/* Define if you have the socket function. */
#undef HAVE_SOCKET
/* Define if you have the strdup function. */
#undef HAVE_STRDUP
/* Define if you have the strerror function. */
#undef HAVE_STRERROR
/* Define if you have the strstr function. */
#undef HAVE_STRSTR
/* Define if you have the strtol function. */
#undef HAVE_STRTOL
/* Define if you have the uname function. */
#undef HAVE_UNAME
/* Define if you have the <asm/io.h> header file. */
/* Define if you have the <asm/io.h> header file. */
#undef HAVE_ASM_IO_H
/* Define if you have the <asm/msr.h> header file. */
/* Define if you have the <asm/msr.h> header file. */
#undef HAVE_ASM_MSR_H
/* Define if you have the <dirent.h> header file. */
/* Define if you have the <dirent.h> header file, and it defines `DIR'. */
#undef HAVE_DIRENT_H
/* Define if you have the <fcntl.h> header file. */
/* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define if you have the <gd.h> header file. */
#undef HAVE_GD_H
/* Define if you have the <gd/gd.h> header file. */
/* Define if you have the <gd/gd.h> header file. */
#undef HAVE_GD_GD_H
/* Define if you have the <limits.h> header file. */
/* Define if you have the <gd.h> header file. */
#undef HAVE_GD_H
/* Define if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY
/* Define if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define if you have the `m' library (-lm). */
#undef HAVE_LIBM
/* Define if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
/* Define if you have the <linux/parport.h> header file. */
/* Define if you have the <linux/parport.h> header file. */
#undef HAVE_LINUX_PARPORT_H
/* Define if you have the <linux/ppdev.h> header file. */
/* Define if you have the <linux/ppdev.h> header file. */
#undef HAVE_LINUX_PPDEV_H
/* Define if you have the <ndir.h> header file. */
/* Define if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define if you have the <ndir.h> header file, and it defines `DIR'. */
#undef HAVE_NDIR_H
/* Define if you have the <net/if_ppp.h> header file. */
/* Define if you have the <net/if_ppp.h> header file. */
#undef HAVE_NET_IF_PPP_H
/* Define if you have the <strings.h> header file. */
/* Define if you have the `putenv' function. */
#undef HAVE_PUTENV
/* Define if you have the `select' function. */
#undef HAVE_SELECT
/* Define if you have the `socket' function. */
#undef HAVE_SOCKET
/* Define if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define if you have the `strdup' function. */
#undef HAVE_STRDUP
/* Define if you have the `strerror' function. */
#undef HAVE_STRERROR
/* Define if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define if you have the <sys/dir.h> header file. */
#undef HAVE_SYS_DIR_H
/* Define if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define if you have the <sys/io.h> header file. */
#undef HAVE_SYS_IO_H
/* Define if you have the `strstr' function. */
#undef HAVE_STRSTR
/* Define if you have the <sys/ioctl.h> header file. */
#undef HAVE_SYS_IOCTL_H
/* Define if you have the `strtol' function. */
#undef HAVE_STRTOL
/* Define if you have the <sys/ndir.h> header file. */
#undef HAVE_SYS_NDIR_H
/* Define if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define if you have the <syslog.h> header file. */
/* Define if you have the <syslog.h> header file. */
#undef HAVE_SYSLOG_H
/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define if you have the <sys/dir.h> header file, and it defines `DIR'. */
#undef HAVE_SYS_DIR_H
/* Define if you have the m library (-lm). */
#undef HAVE_LIBM
/* Define if you have the <sys/ioctl.h> header file. */
#undef HAVE_SYS_IOCTL_H
/* Define if you have the <sys/io.h> header file. */
#undef HAVE_SYS_IO_H
/* Define if you have the <sys/ndir.h> header file, and it defines `DIR'. */
#undef HAVE_SYS_NDIR_H
/* Define if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
#undef HAVE_SYS_WAIT_H
/* Define if you have the `uname' function. */
#undef HAVE_UNAME
/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Name of package */
#undef PACKAGE
/* Define as the return type of signal handlers (`int' or `void'). */
#undef RETSIGTYPE
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
/* Define if your <sys/time.h> declares `struct tm'. */
#undef TM_IN_SYS_TIME
/* Version number of package */
#undef VERSION
/* Define 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. */
#undef const
/* Define to `int' if <sys/types.h> doesn't define. */
#undef gid_t
/* Define as `__inline' if that's what the C compiler calls it, or to nothing
if it is not supported. */
#undef inline
/* Define to `int' if <sys/types.h> does not define. */
#undef pid_t
/* Define to `unsigned' if <sys/types.h> does not define. */
#undef size_t
/* Define to `int' if <sys/types.h> doesn't define. */
#undef uid_t
Vendored
+4382 -2175
View File
File diff suppressed because it is too large Load Diff
+11 -2
View File
@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(lcd4linux.c)
AM_INIT_AUTOMAKE(lcd4linux, 0.98)
AM_INIT_AUTOMAKE(lcd4linux, 0.99)
AM_CONFIG_HEADER(config.h)
dnl Checks for programs.
@@ -29,7 +29,7 @@ AC_ARG_WITH(
[ drivers may be excluded with 'all,!<driver>',]
[ (try 'all,\!<driver>' if your shell complains...)]
[ possible drivers are:]
[ BeckmannEgle, CrystalFontz, HD44780, M50530]
[ BeckmannEgle, CrystalFontz, HD44780, M50530, T6963]
[ MatrixOrbital, PalmPilot, PNG, PPM, X11, Text],
drivers=$withval,
drivers=all
@@ -55,6 +55,7 @@ for driver in $drivers; do
CRYSTALFONTZ="yes"
HD44780="yes"
M50530="yes"
T6963="yes"
MATRIXORBITAL="yes"
PALMPILOT="yes"
PNG="yes"
@@ -74,6 +75,9 @@ for driver in $drivers; do
M50530)
M50530=$val
;;
T6963)
T6963=$val
;;
MatrixOrbital)
MATRIXORBITAL=$val
;;
@@ -128,6 +132,11 @@ if test "$M50530" = "yes"; then
AC_DEFINE(WITH_M50530)
fi
if test "$T6963" = "yes"; then
DRIVERS="$DRIVERS T6963.o"
AC_DEFINE(WITH_T6963)
fi
if test "$MATRIXORBITAL" = "yes"; then
DRIVERS="$DRIVERS MatrixOrbital.o"
AC_DEFINE(WITH_MATRIXORBITAL)
+10 -1
View File
@@ -1,4 +1,4 @@
/* $Id: display.c,v 1.29 2001/09/10 13:55:53 reinelt Exp $
/* $Id: display.c,v 1.30 2002/04/29 11:00:28 reinelt Exp $
*
* framework for device drivers
*
@@ -20,6 +20,11 @@
*
*
* $Log: display.c,v $
* Revision 1.30 2002/04/29 11:00:28 reinelt
*
* added Toshiba T6963 driver
* added ndelay() with nanosecond resolution
*
* Revision 1.29 2001/09/10 13:55:53 reinelt
* M50530 driver
*
@@ -188,6 +193,7 @@ extern LCD BeckmannEgle[];
extern LCD Crystalfontz[];
extern LCD HD44780[];
extern LCD M50530[];
extern LCD T6963[];
extern LCD MatrixOrbital[];
extern LCD PalmPilot[];
extern LCD Raster[];
@@ -209,6 +215,9 @@ FAMILY Driver[] = {
#ifdef WITH_M50530
{ "M50530 based", M50530 },
#endif
#ifdef WITH_T6963
{ "T6963 based", T6963 },
#endif
#ifdef WITH_MATRIXORBITAL
{ "Matrix Orbital", MatrixOrbital },
#endif
+9 -2
View File
@@ -1,4 +1,4 @@
/* $Id: exec.c,v 1.6 2001/03/15 09:13:22 ltoetsch Exp $
/* $Id: exec.c,v 1.7 2002/04/29 11:00:28 reinelt Exp $
*
* exec ('x*') functions
*
@@ -20,6 +20,11 @@
*
*
* $Log: exec.c,v $
* Revision 1.7 2002/04/29 11:00:28 reinelt
*
* added Toshiba T6963 driver
* added ndelay() with nanosecond resolution
*
* Revision 1.6 2001/03/15 09:13:22 ltoetsch
* delay first exec for faster start
*
@@ -95,8 +100,10 @@ int Exec(int index, char buff[EXEC_TXT_LEN], double *val)
else {
sprintf(xn, "Delay_x%d", index);
/* delay in Delay_x* sec ? */
if (time(NULL) <= now[index] + atoi(cfg_get(xn)?:"1"))
debug ("%s=%s",xn,cfg_get(xn));
if (time(NULL) <= now[index] + atoi(cfg_get(xn)?:"1")) {
return 0;
}
}
}
time(&now[index]);
+9 -4
View File
@@ -1,8 +1,8 @@
/* $Id: lcd4linux.c,v 1.33 2001/04/27 05:04:57 reinelt Exp $
/* $Id: lcd4linux.c,v 1.34 2002/04/29 11:00:28 reinelt Exp $
*
* LCD4Linux
*
* Copyright 1999, 2000 by Michael Reinelt (reinelt@eunet.at)
* Copyright 1999-2002 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
@@ -20,6 +20,11 @@
*
*
* $Log: lcd4linux.c,v $
* Revision 1.34 2002/04/29 11:00:28 reinelt
*
* added Toshiba T6963 driver
* added ndelay() with nanosecond resolution
*
* Revision 1.33 2001/04/27 05:04:57 reinelt
*
* replaced OPEN_MAX with sysconf()
@@ -196,7 +201,7 @@
#include "display.h"
#include "processor.h"
char *release="LCD4Linux " VERSION " (c) 2000 Michael Reinelt <reinelt@eunet.at>";
char *release="LCD4Linux " VERSION " (c) 2002 Michael Reinelt <reinelt@eunet.at>";
char **my_argv;
char *output=NULL;
int got_signal=0;
@@ -224,7 +229,7 @@ int hello (void)
"L4Linux",
NULL };
char *line2[] = { "(c) 2000 M.Reinelt",
char *line2[] = { "(c) 2002 M.Reinelt",
"(c) M.Reinelt",
NULL };
+16 -10
View File
@@ -1,4 +1,4 @@
/* $Id: udelay.c,v 1.6 2001/08/08 05:40:24 reinelt Exp $
/* $Id: udelay.c,v 1.7 2002/04/29 11:00:28 reinelt Exp $
*
* short delays
*
@@ -20,6 +20,11 @@
*
*
* $Log: udelay.c,v $
* Revision 1.7 2002/04/29 11:00:28 reinelt
*
* added Toshiba T6963 driver
* added ndelay() with nanosecond resolution
*
* Revision 1.6 2001/08/08 05:40:24 reinelt
*
* renamed CLK_TCK to CLOCKS_PER_SEC
@@ -102,9 +107,9 @@
unsigned long loops_per_usec;
void udelay (unsigned long usec)
void ndelay (unsigned long nsec)
{
unsigned long loop=usec*loops_per_usec;
unsigned long loop=(nsec*loops_per_usec+999)/1000;
__asm__ (".align 16\n"
"1:\tdecl %0\n"
@@ -113,7 +118,6 @@ void udelay (unsigned long usec)
:"a" (loop));
}
/* adopted from /usr/src/linux/init/main.c */
void udelay_calibrate (void)
@@ -126,7 +130,7 @@ void udelay_calibrate (void)
tick=clock();
while (clock()==tick);
tick=clock();
udelay(1000000/CLOCKS_PER_SEC);
ndelay(1000000000/CLOCKS_PER_SEC);
if (clock()>tick)
break;
}
@@ -138,7 +142,7 @@ void udelay_calibrate (void)
tick=clock();
while (clock()==tick);
tick=clock();
udelay(1000000/CLOCKS_PER_SEC);
ndelay(1000000000/CLOCKS_PER_SEC);
if (clock()>tick)
loops_per_usec&=~bit;
}
@@ -223,31 +227,33 @@ void udelay_init (void)
}
void udelay (unsigned long usec)
void ndelay (unsigned long nsec)
{
if (ticks_per_usec) {
unsigned int t1, t2;
usec*=ticks_per_usec;
nsec=(nsec*ticks_per_usec+999)/1000;
rdtscl(t1);
do {
rep_nop();
rdtscl(t2);
} while ((t2-t1)<usec);
} while ((t2-t1)<nsec);
} else {
struct timeval now, end;
gettimeofday (&end, NULL);
end.tv_usec+=usec;
end.tv_usec+=(nsec+999)/1000;
while (end.tv_usec>1000000) {
end.tv_usec-=1000000;
end.tv_sec++;
}
do {
rep_nop();
gettimeofday(&now, NULL);
} while (now.tv_sec==end.tv_sec?now.tv_usec<end.tv_usec:now.tv_sec<end.tv_sec);
}
+19 -4
View File
@@ -1,4 +1,4 @@
/* $Id: udelay.h,v 1.3 2001/03/12 13:44:58 reinelt Exp $
/* $Id: udelay.h,v 1.4 2002/04/29 11:00:28 reinelt Exp $
*
* short delays
*
@@ -20,6 +20,11 @@
*
*
* $Log: udelay.h,v $
* Revision 1.4 2002/04/29 11:00:28 reinelt
*
* added Toshiba T6963 driver
* added ndelay() with nanosecond resolution
*
* Revision 1.3 2001/03/12 13:44:58 reinelt
*
* new udelay() using Time Stamp Counters
@@ -41,17 +46,27 @@
#ifndef _UDELAY_H_
#define _UDELAY_H_
/* stolen from linux/asm-i386/processor.h */
/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
static inline void rep_nop(void)
{
__asm__ __volatile__("rep;nop");
}
#ifdef USE_OLD_UDELAY
extern unsigned long loops_per_usec;
void udelay (unsigned long usec);
void udelay_calibrate (void);
#else
void udelay_init (void);
void udelay (unsigned long usec);
#endif
void ndelay (unsigned long nsec);
#define udelay(usec) ndelay(usec*1000)
#endif