sanei_pp.h

Go to the documentation of this file.
00001 /* sane - Scanner Access Now Easy.
00002    Copyright (C) 2003 Gerhard Jaeger <gerhard@gjaeger.de>
00003    This file is part of the SANE package.
00004 
00005    This program is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU General Public License as
00007    published by the Free Software Foundation; either version 2 of the
00008    License, or (at your option) any later version.
00009 
00010    This program is distributed in the hope that it will be useful, but
00011    WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    General Public License for more details.
00014 
00015    You should have received a copy of the GNU General Public License
00016    along with this program; if not, write to the Free Software
00017    Foundation, Inc., 59 Temple Place - Suite 330, Boston,
00018    MA 02111-1307, USA.
00019 
00020    As a special exception, the authors of SANE give permission for
00021    additional uses of the libraries contained in this release of SANE.
00022 
00023    The exception is that, if you link a SANE library with other files
00024    to produce an executable, this does not by itself cause the
00025    resulting executable to be covered by the GNU General Public
00026    License.  Your use of that executable is in no way restricted on
00027    account of linking the SANE library code into it.
00028 
00029    This exception does not, however, invalidate any other reasons why
00030    the executable file might be covered by the GNU General Public
00031    License.
00032 
00033    If you submit changes to SANE to the maintainers to be included in
00034    a subsequent release, you agree by submitting the changes that
00035    those changes may be distributed with this exception intact.
00036 
00037    If you write modifications of your own for SANE, it is your choice
00038    whether to permit this exception to apply to your modifications.
00039    If you do not wish that, delete this exception notice. 
00040 */
00041 
00047 #ifndef sanei_pp_h
00048 #define sanei_pp_h
00049 
00050 #include <sys/types.h>
00051 #include <sane/sane.h>
00052 
00054 enum sanei_pp_mode {
00055         SANEI_PP_MODE_SPP  = (1<<1),            
00056         SANEI_PP_MODE_BIDI = (1<<2),            
00057         SANEI_PP_MODE_EPP  = (1<<4),            
00058         SANEI_PP_MODE_ECP  = (1<<8)             
00059 };
00060 
00061 #define SANEI_PP_DATAIN  1
00062 #define SANEI_PP_DATAOUT 0
00063 
00064 /* @{ */
00066 #define SANEI_PP_CTRL_STROBE        0x01
00067 #define SANEI_PP_CTRL_AUTOLF        0x02
00068 #define SANEI_PP_CTRL_NOT_INIT      0x04
00069 #define SANEI_PP_CTRL_SELECT_IN     0x08
00070 #define SANEI_PP_CTRL_ENABLE_IRQ    0x10
00071 #define SANEI_PP_CTRL_DIRECTION     0x20
00072 #define SANEI_PP_CTRL_RESERVED      0xc0
00073 /* @} */
00074 
00079 extern SANE_Status sanei_pp_init( void );
00080 
00087 extern SANE_Status sanei_pp_open( const char *dev, int *fd );
00088 
00089 /* Close a previously opened parport device.
00090  *
00091  * @param fd - handle of the device to close
00092  */
00093 extern void sanei_pp_close( int fd );
00094 
00100 extern SANE_Status sanei_pp_claim( int fd );
00101 
00107 extern SANE_Status sanei_pp_release( int fd );
00108 
00115 extern SANE_Status sanei_pp_set_datadir( int fd, int rev );
00116 
00125 extern SANE_Bool sanei_pp_uses_directio( void );
00126 
00133 extern SANE_Status sanei_pp_getmodes( int fd, int *mode );
00134 
00141 extern SANE_Status sanei_pp_setmode( int fd, int mode );
00142 
00149 extern SANE_Status sanei_pp_outb_data( int fd, SANE_Byte val );
00150 extern SANE_Status sanei_pp_outb_ctrl( int fd, SANE_Byte val );
00151 extern SANE_Status sanei_pp_outb_addr( int fd, SANE_Byte val );
00152 extern SANE_Status sanei_pp_outb_epp ( int fd, SANE_Byte val );
00153 
00158 extern SANE_Byte sanei_pp_inb_data( int fd );
00159 extern SANE_Byte sanei_pp_inb_stat( int fd );
00160 extern SANE_Byte sanei_pp_inb_ctrl( int fd );
00161 extern SANE_Byte sanei_pp_inb_epp ( int fd );
00162 
00170 extern void sanei_pp_udelay( unsigned long usec );
00171 
00172 #endif

Generated on Wed Nov 5 02:30:50 2008 for SANEI by  doxygen 1.5.1