diff options
| author | reinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2004-09-18 08:22:59 +0000 | 
|---|---|---|
| committer | reinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2004-09-18 08:22:59 +0000 | 
| commit | 14db580bf4076724e0385c3fc2e3464111a26c33 (patch) | |
| tree | 434ac37937adc68c9544175425cf0d809639e345 /drv_generic_parport.c | |
| parent | bc25a5d78138b33ba1eaa6348f61424d155adb6d (diff) | |
| download | lcd4linux-14db580bf4076724e0385c3fc2e3464111a26c33.tar.gz | |
[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
Diffstat (limited to 'drv_generic_parport.c')
| -rw-r--r-- | drv_generic_parport.c | 32 | 
1 files changed, 31 insertions, 1 deletions
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;  | 
