Go to the source code of this file.
Defines | |
| #define | SANEI_PP_CTRL_STROBE 0x01 |
| Parallelport Control-Register definitions. | |
| #define | SANEI_PP_CTRL_AUTOLF 0x02 |
| Parallelport Control-Register definitions. | |
| #define | SANEI_PP_CTRL_NOT_INIT 0x04 |
| Parallelport Control-Register definitions. | |
| #define | SANEI_PP_CTRL_SELECT_IN 0x08 |
| Parallelport Control-Register definitions. | |
| #define | SANEI_PP_CTRL_ENABLE_IRQ 0x10 |
| Parallelport Control-Register definitions. | |
| #define | SANEI_PP_CTRL_DIRECTION 0x20 |
| Parallelport Control-Register definitions. | |
| #define | SANEI_PP_CTRL_RESERVED 0xc0 |
| Parallelport Control-Register definitions. | |
Enumerations | |
| enum | sanei_pp_mode { SANEI_PP_MODE_SPP = (1<<1), SANEI_PP_MODE_BIDI = (1<<2), SANEI_PP_MODE_EPP = (1<<4), SANEI_PP_MODE_ECP = (1<<8) } |
| some modes, we'd like to see/use. More... | |
Functions | |
| SANE_Status | sanei_pp_init (void) |
| Initialize sanei_pp. | |
| SANE_Status | sanei_pp_open (const char *dev, int *fd) |
| Open a parport device. | |
| SANE_Status | sanei_pp_claim (int fd) |
| Claim a parport device. | |
| SANE_Status | sanei_pp_release (int fd) |
| Release a previously claimed device. | |
| SANE_Status | sanei_pp_set_datadir (int fd, int rev) |
| Set the data direction. | |
| SANE_Bool | sanei_pp_uses_directio (void) |
| Check whether for libieee1284 usage. | |
| SANE_Status | sanei_pp_getmodes (int fd, int *mode) |
| Determine the available parallel port modes for a given device. | |
| SANE_Status | sanei_pp_setmode (int fd, int mode) |
| Set the operation mode for a given device. | |
| SANE_Status | sanei_pp_outb_data (int fd, SANE_Byte val) |
| Write data to ports (spp-data, ctrl, epp-address and epp-data). | |
| SANE_Byte | sanei_pp_inb_data (int fd) |
| Read data from ports (spp-data, status, ctrl and epp-data). | |
| void | sanei_pp_udelay (unsigned long usec) |
| Delay execution for some micro-seconds. | |
| enum sanei_pp_mode |
| SANE_Status sanei_pp_init | ( | void | ) |
Initialize sanei_pp.
This function must be called before any other sanei_pp function.
| SANE_Status sanei_pp_open | ( | const char * | dev, | |
| int * | fd | |||
| ) |
Open a parport device.
| dev | - name of device to open. | |
| fd | - pointer to variable that should revceive the handle. |
| SANE_Status sanei_pp_claim | ( | int | fd | ) |
Claim a parport device.
| fd | - handle of the device to claim |
| SANE_Status sanei_pp_release | ( | int | fd | ) |
Release a previously claimed device.
| fd | - handle of the device to release |
| SANE_Status sanei_pp_set_datadir | ( | int | fd, | |
| int | rev | |||
| ) |
Set the data direction.
| fd | - handle of the device, where to change the direction. | |
| rev | - |
| SANE_Bool sanei_pp_uses_directio | ( | void | ) |
Check whether for libieee1284 usage.
This function can be used to check if the lib uses libieee1284 or in/out functions directly.
| SANE_Status sanei_pp_getmodes | ( | int | fd, | |
| int * | mode | |||
| ) |
Determine the available parallel port modes for a given device.
| fd | - handle of the device, whose modes shall be checked for. | |
| mode | - pointer to variable, which should receive the modes. |
| SANE_Status sanei_pp_setmode | ( | int | fd, | |
| int | mode | |||
| ) |
Set the operation mode for a given device.
| fd | - handle of the device, whose modes shall be set. | |
| mode | - mode to set, see sanei_pp_mode. |
| SANE_Status sanei_pp_outb_data | ( | int | fd, | |
| SANE_Byte | val | |||
| ) |
Write data to ports (spp-data, ctrl, epp-address and epp-data).
| fd | - handle of device to which shall be written to. | |
| val | - data to write. |
| SANE_Byte sanei_pp_inb_data | ( | int | fd | ) |
Read data from ports (spp-data, status, ctrl and epp-data).
| fd | - handle of device who should be read from. |
| void sanei_pp_udelay | ( | unsigned long | usec | ) |
Delay execution for some micro-seconds.
Please not, that the accuracy highly depends on your system architechture and the time to delay. It is internally implemented as system calls to gettimeofday().
| usec | - number of micro-seconds to delay |
1.5.1