From 14db580bf4076724e0385c3fc2e3464111a26c33 Mon Sep 17 00:00:00 2001 From: reinelt Date: Sat, 18 Sep 2004 08:22:59 +0000 Subject: [lcd4linux @ 2004-09-18 08:22:59 by reinelt] drv_generic_parport_status() to read status lines git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@487 3ae390bd-cb1e-0410-b409-cd5a39f66f1f --- drv_HD44780.c | 7 +++++-- drv_generic_parport.c | 32 ++++++++++++++++++++++++++++++- drv_generic_parport.h | 9 ++++++++- lcd4linux.conf.sample | 53 ++++++++++++++++++++++++++++++++++++++++++--------- 4 files changed, 88 insertions(+), 13 deletions(-) diff --git a/drv_HD44780.c b/drv_HD44780.c index 443ae6f..30bb8ea 100644 --- a/drv_HD44780.c +++ b/drv_HD44780.c @@ -1,4 +1,4 @@ -/* $Id: drv_HD44780.c,v 1.33 2004/08/29 13:03:41 reinelt Exp $ +/* $Id: drv_HD44780.c,v 1.34 2004/09/18 08:22:59 reinelt Exp $ * * new style driver for HD44780-based displays * @@ -29,6 +29,9 @@ * * * $Log: drv_HD44780.c,v $ + * Revision 1.34 2004/09/18 08:22:59 reinelt + * drv_generic_parport_status() to read status lines + * * Revision 1.33 2004/08/29 13:03:41 reinelt * * added RouterBoard driver @@ -464,7 +467,7 @@ static void drv_HD_command (const unsigned char controller, const unsigned char /* wait for command completion */ if (!UseBusy) udelay(delay); - + } diff --git a/drv_generic_parport.c b/drv_generic_parport.c index c98b085..f008c46 100644 --- a/drv_generic_parport.c +++ b/drv_generic_parport.c @@ -1,4 +1,4 @@ -/* $Id: drv_generic_parport.c,v 1.8 2004/06/26 12:04:59 reinelt Exp $ +/* $Id: drv_generic_parport.c,v 1.9 2004/09/18 08:22:59 reinelt Exp $ * * generic driver helper for serial and parport access * @@ -23,6 +23,9 @@ * * * $Log: drv_generic_parport.c,v $ + * Revision 1.9 2004/09/18 08:22:59 reinelt + * drv_generic_parport_status() to read status lines + * * Revision 1.8 2004/06/26 12:04:59 reinelt * * uh-oh... the last CVS log message messed up things a lot... @@ -334,6 +337,33 @@ void drv_generic_parport_direction (const int direction) } +unsigned char drv_generic_parport_status (void) +{ + unsigned char mask = + PARPORT_STATUS_ERROR | + PARPORT_STATUS_SELECT | + PARPORT_STATUS_PAPEROUT | + PARPORT_STATUS_ACK | + PARPORT_STATUS_BUSY; + + unsigned char data; + +#ifdef WITH_PPDEV + if (PPdev) { + ioctl (PPfd, PPRSTATUS, &data); + } else +#endif + { + data = inb (Port+1); + } + + /* clear unused bits */ + data &= mask; + + return data; +} + + void drv_generic_parport_control (const unsigned char mask, const unsigned char value) { unsigned char val; diff --git a/drv_generic_parport.h b/drv_generic_parport.h index ba813f8..0455951 100644 --- a/drv_generic_parport.h +++ b/drv_generic_parport.h @@ -1,4 +1,4 @@ -/* $Id: drv_generic_parport.h,v 1.5 2004/06/26 12:04:59 reinelt Exp $ +/* $Id: drv_generic_parport.h,v 1.6 2004/09/18 08:22:59 reinelt Exp $ * * generic driver helper for parallel port displays * @@ -23,6 +23,9 @@ * * * $Log: drv_generic_parport.h,v $ + * Revision 1.6 2004/09/18 08:22:59 reinelt + * drv_generic_parport_status() to read status lines + * * Revision 1.5 2004/06/26 12:04:59 reinelt * * uh-oh... the last CVS log message messed up things a lot... @@ -71,6 +74,9 @@ * 0 - write to parport * 1 - read from parport * + * unsigned char drv_generic_parport_status (void) + * reads control lines + * * void drv_generic_parport_control (unsigned char mask, unsigned char value) * frobs control line and takes care of inverted signals * @@ -96,6 +102,7 @@ int drv_generic_parport_close (void); unsigned char drv_generic_parport_wire_ctrl (const char *name, const char *deflt); unsigned char drv_generic_parport_wire_data (const char *name, const char *deflt); void drv_generic_parport_direction (const int direction); +unsigned char drv_generic_parport_status (void); void drv_generic_parport_control (const unsigned char mask, const unsigned char value); void drv_generic_parport_toggle (const unsigned char bit, const int level, const int delay); void drv_generic_parport_data (const unsigned char data); diff --git a/lcd4linux.conf.sample b/lcd4linux.conf.sample index d2f0927..e1e00b7 100644 --- a/lcd4linux.conf.sample +++ b/lcd4linux.conf.sample @@ -77,6 +77,38 @@ Display HD44780-20x4 { } +Display SC1602D { + Driver 'HD44780' + Port '/dev/parports/0' + Bits '8' + Size '16x2' + asc255bug 0 + Icons 1 + Wire { + RW 'GND' + RS 'AUTOFD' + ENABLE 'STROBE' + GPO 'INIT' + } +} + + +Display LCM-162 { + Driver 'HD44780' + Port '/dev/parports/0' + Bits '8' + Size '16x2' + UseBusy 1 + asc255bug 0 + Icons 1 + Wire { + RW 'INIT' + RS 'SELECT' + ENABLE 'AUTOFD' + } +} + + Display M50530-24x8 { Driver 'M50530' Port '/dev/parports/0' @@ -351,12 +383,12 @@ Widget BarTest { # delta= step to change value by each time it's read. # barno - ten different test bar values can be set up, with barno=0..9 # if delta=0, just returns the value of bar n instead of changing it. - expression test::bar(0,100,50,1) - expression2 test::bar(1,100,0,1) - length 10 - max 100 + expression test::bar(0,30,25,1) + expression2 test::bar(1,30,0,1) + length 6 + max 50 direction 'E' - update 200 + update 10 } Widget BarTestVal { @@ -568,7 +600,8 @@ Layout L16x2 { } Row2 { Col1 'Disk' - Col11 'DiskBar' + #Col11 'DiskBar' + Col11 'BarTest' } # Row2 { # Col1 'Heartbeat' @@ -626,6 +659,8 @@ Layout testMySQL { #Display 'MI240' #Display 'CW12232' #Display 'HD44780-20x4' +#Display 'SC1602D' +Display 'LCM-162' #Display 'CF631' #Display 'CF632' #Display 'CF633' @@ -634,11 +669,11 @@ Layout testMySQL { #Display 'CT20x4' #Display 'T6963-240x64' #Display 'XWindow' -Display 'USBLCD' +#Display 'USBLCD' #Display 'Image' -Layout 'Default' -#Layout 'L16x2' +#Layout 'Default' +Layout 'L16x2' #Layout 'L20x2' #Layout 'Test' -- cgit v1.2.3