sanei_ab306.h File Reference

Support for the Mustek-proprietary SCSI-over-parallel-port interface AB306. More...

Go to the source code of this file.

Functions

SANE_Status sanei_ab306_open (const char *dev, int *fd)
 Open the connection to an AB306 device.
void sanei_ab306_close (int fd)
 Close the connection to an AB306 device.
void sanei_ab306_exit (void)
 Exit ab306.
SANE_Status sanei_ab306_get_io_privilege (int fd)
 Get the permission for direct access to the ports.
SANE_Status sanei_ab306_test_ready (int fd)
 Find out if the device is ready to accept new commands.
SANE_Status sanei_ab306_cmd (int fd, const void *src, size_t src_size, void *dst, size_t *dst_size)
 Send a command to the AB306 device.
SANE_Status sanei_ab306_rdata (int fd, int planes, SANE_Byte *buf, int lines, int bpl)
 Read scanned image data.


Detailed Description

Support for the Mustek-proprietary SCSI-over-parallel-port interface AB306.

This chip is used by the Mustek Paragon 600 II N. It's similar to a parport but has it's own ISA card and cable.

/dev/port access is used where available. If this doesn't work, inb/outb functions or inb/outb assembler code is used.

Depending on the operating system it may be necessary to run this code as root.

See also:
sanei_pio.h sanei_scsi.h sanei_usb.h

Function Documentation

SANE_Status sanei_ab306_open ( const char *  dev,
int *  fd 
)

Open the connection to an AB306 device.

The scanner is also turned on.

Parameters:
dev Port address as text.
fd Information about port address and I/O method. fd is not a file descriptor. The name and type are used for compatibility reasons.
Returns:
  • SANE_STATUS_GOOD - on success
  • SANE_STATUS_INVAL - if the port address can't be interpreted
  • SANE_STATUS_IO_ERROR - if the device file for a port couldn't be accessed

void sanei_ab306_close ( int  fd  ) 

Close the connection to an AB306 device.

Parameters:
fd Information about port address and I/O method.

void sanei_ab306_exit ( void   ) 

Exit ab306.

Also powers down all devices.

SANE_Status sanei_ab306_get_io_privilege ( int  fd  ) 

Get the permission for direct access to the ports.

The only occasion this function must be called, is when the I/O privilege was lost, e.g. after forking. Otherwise, it's called automatically by sanei_ab306_open().

Parameters:
fd Information about port address and I/O method.
Returns:
  • SANE_STATUS_GOOD - on success
  • SANE_STATUS_IO_ERROR - if the i/o privilege was denied by the operating system

SANE_Status sanei_ab306_test_ready ( int  fd  ) 

Find out if the device is ready to accept new commands.

Parameters:
fd Information about port address and I/O method.
Returns:
  • SANE_STATUS_GOOD - if the device is ready
  • SANE_STATUS_DEVICE_BUSY if the device is still busy (try again later)

SANE_Status sanei_ab306_cmd ( int  fd,
const void *  src,
size_t  src_size,
void *  dst,
size_t *  dst_size 
)

Send a command to the AB306 device.

Parameters:
fd Information about port address and I/O method.
src Data to be sent to the device.
src_size Size of data to be sent to the device.
dst Data to be received from the device.
dst_size Size of data to be received from the device
Returns:
  • SANE_STATUS_GOOD - on success
  • SANE_STATUS_IO_ERROR - if an error occured during the dialog with the device

SANE_Status sanei_ab306_rdata ( int  fd,
int  planes,
SANE_Byte *  buf,
int  lines,
int  bpl 
)

Read scanned image data.

Parameters:
fd Information about port address and I/O method.
planes Bytes per pixel (3 for color, 1 for all other modes)
buf Buffer for image data.
lines Number of lines
bpl Bytes per line
Returns:
  • SANE_STATUS_GOOD - on success
  • SANE_STATUS_IO_ERROR - if an error occured during the dialog with the device


Generated on Fri Oct 3 04:45:39 2008 for SANEI by  doxygen 1.5.1