]> git.webhop.me Git - lcd4linux.git/commitdiff
[lcd4linux @ 2004-09-18 08:22:59 by reinelt]
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Sat, 18 Sep 2004 08:22:59 +0000 (08:22 +0000)
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Sat, 18 Sep 2004 08:22:59 +0000 (08:22 +0000)
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
drv_generic_parport.c
drv_generic_parport.h
lcd4linux.conf.sample

index 443ae6f4ac358b1a97aaddec66bc9b96d0db7bf6..30bb8ea79b3412f4783cf2cc40cf04b71c26972d 100644 (file)
@@ -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);
-  
+
 }
 
 
index c98b085a692782027e06113c6f9ac1d2b16ab73c..f008c46d82ff856b0e9acf20310db69f38af6fd9 100644 (file)
@@ -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;
index ba813f844e4410cf98e383b511bf032bdad4ca1d..0455951b2cfdc3321e569ec899b3300c66e61771 100644 (file)
@@ -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);
index d2f0927365714ae93fa640f39f52d32f6a35d52f..e1e00b75bb5fb342abcb80b157ad8859c1529f7e 100644 (file)
@@ -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'