00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
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
00090
00091
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