SANEI 1.3.1.76-0750
sanei_pa4s2.h File Reference

This file implements an interface for the Mustek PP chipset A4S2. More...

Go to the source code of this file.

Options to control interface operations

#define SANEI_PA4S2_OPT_DEFAULT   0 /* normal mode */
 Get list of possibly available devices. More...
 
#define SANEI_PA4S2_OPT_TRY_MODE_UNI   1 /* enable UNI protocol */
 Get list of possibly available devices. More...
 
#define SANEI_PA4S2_OPT_ALT_LOCK   2 /* use alternative lock cmd */
 Get list of possibly available devices. More...
 
#define SANEI_PA4S2_OPT_NO_EPP   4 /* do not try to use EPP */
 Get list of possibly available devices. More...
 
const char ** sanei_pa4s2_devices (void)
 Get list of possibly available devices. More...
 
SANE_Status sanei_pa4s2_open (const char *dev, int *fd)
 Open pa4s2 device. More...
 
SANE_Status sanei_pa4s2_scsi_pp_open (const char *dev, int *fd)
 Open pa4s2 SCSI-over-parallel device. More...
 
void sanei_pa4s2_close (int fd)
 Close pa4s2 device. More...
 
SANE_Status sanei_pa4s2_options (u_int *options, int set)
 Set/get options. More...
 
SANE_Status sanei_pa4s2_enable (int fd, int enable)
 Enables/disable device. More...
 
SANE_Status sanei_pa4s2_readbegin (int fd, u_char reg)
 Select a register. More...
 
SANE_Status sanei_pa4s2_scsi_pp_get_status (int fd, u_char *status)
 Return port status information. More...
 
SANE_Status sanei_pa4s2_scsi_pp_reg_select (int fd, int reg)
 Selects a register number on a SCSI-over-parallel scanner. More...
 
SANE_Status sanei_pa4s2_readbyte (int fd, u_char *val)
 Read a register. More...
 
SANE_Status sanei_pa4s2_readend (int fd)
 Terminate reading sequence. More...
 
SANE_Status sanei_pa4s2_writebyte (int fd, u_char reg, u_char val)
 Write a register. More...
 

Detailed Description

This file implements an interface for the Mustek PP chipset A4S2.

See also
sanei_usb.h, sanei_ab306.h, sanei_lm983x.h, sanei_scsi.h, sanei_pio.h

Macro Definition Documentation

◆ SANEI_PA4S2_OPT_DEFAULT

#define SANEI_PA4S2_OPT_DEFAULT   0 /* normal mode */

Get list of possibly available devices.

Returns a list of arguments accepted as *dev by sanei_pa4s2_open

Returns
  • array of known *devs. The last entry is marked as NULL pointer. The user has to make sure, the array, but not the entries are freed.
See also
sanei_pa4s2_open

◆ SANEI_PA4S2_OPT_TRY_MODE_UNI

#define SANEI_PA4S2_OPT_TRY_MODE_UNI   1 /* enable UNI protocol */

Get list of possibly available devices.

Returns a list of arguments accepted as *dev by sanei_pa4s2_open

Returns
  • array of known *devs. The last entry is marked as NULL pointer. The user has to make sure, the array, but not the entries are freed.
See also
sanei_pa4s2_open

◆ SANEI_PA4S2_OPT_ALT_LOCK

#define SANEI_PA4S2_OPT_ALT_LOCK   2 /* use alternative lock cmd */

Get list of possibly available devices.

Returns a list of arguments accepted as *dev by sanei_pa4s2_open

Returns
  • array of known *devs. The last entry is marked as NULL pointer. The user has to make sure, the array, but not the entries are freed.
See also
sanei_pa4s2_open

◆ SANEI_PA4S2_OPT_NO_EPP

#define SANEI_PA4S2_OPT_NO_EPP   4 /* do not try to use EPP */

Get list of possibly available devices.

Returns a list of arguments accepted as *dev by sanei_pa4s2_open

Returns
  • array of known *devs. The last entry is marked as NULL pointer. The user has to make sure, the array, but not the entries are freed.
See also
sanei_pa4s2_open

Function Documentation

◆ sanei_pa4s2_devices()

const char ** sanei_pa4s2_devices ( void  )

Get list of possibly available devices.

Returns a list of arguments accepted as *dev by sanei_pa4s2_open

Returns
  • array of known *devs. The last entry is marked as NULL pointer. The user has to make sure, the array, but not the entries are freed.
See also
sanei_pa4s2_open

◆ sanei_pa4s2_open()

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

Open pa4s2 device.

Opens *dev as pa4s2 device.

Parameters
devIO port address ("0x378", "0x278", or "0x3BC")
fdfile descriptor
Returns
  • SANE_STATUS_GOOD - on success
  • SANE_STATUS_INVAL - if no scanner was found or the port number was wrong
  • SANE_STATUS_DEVICE_BUSY - if the device is already in use
  • SANE_STATUS_IO_ERROR - if the port couldn't be accessed

◆ sanei_pa4s2_scsi_pp_open()

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

Open pa4s2 SCSI-over-parallel device.

Opens *dev as pa4s2 SCSI-over-parallel device.

Parameters
devIO port address ("0x378", "0x278", or "0x3BC")
fdfile descriptor
Returns
  • SANE_STATUS_GOOD - on success
  • SANE_STATUS_INVAL - if no scanner was found or the port number was wrong
  • SANE_STATUS_DEVICE_BUSY - if the device is already in use
  • SANE_STATUS_IO_ERROR - if the port couldn't be accessed

◆ sanei_pa4s2_close()

void sanei_pa4s2_close ( int  fd)

Close pa4s2 device.

Parameters
fdfile descriptor

◆ sanei_pa4s2_options()

SANE_Status sanei_pa4s2_options ( u_int *  options,
int  set 
)

Set/get options.

Sets/gets interface options. Options will be taken over, when set is SANE_TRUE. These options should be set before the first device is opened

Parameters
optionspointer to options
setset (SANE_TRUE) or get (SANE_FALSE) options
Returns
  • SANE_STATUS_GOOD - on success

◆ sanei_pa4s2_enable()

SANE_Status sanei_pa4s2_enable ( int  fd,
int  enable 
)

Enables/disable device.

When the device is disabled, the printer can be accessed, when it's enabled data can be read/written.

Parameters
fdfile descriptor
enableenable (SANE_TRUE) or disable (SANE_FALSE) device
Returns
  • SANE_STATUS_GOOD - on success
  • SANE_STATUS_INVAL - if fd is invalid or device not in use

◆ sanei_pa4s2_readbegin()

SANE_Status sanei_pa4s2_readbegin ( int  fd,
u_char  reg 
)

Select a register.

The function to read a register is split up in three parts, so a register can be read more than once.

Parameters
fdfile descriptor
regregister
Returns
  • SANE_STATUS_GOOD - on success
  • SANE_STATUS_INVAL - if fd is invalid or device not in use
See also
sanei_pa4s2_readbyte(), sanei_pa4s2_readend()

◆ sanei_pa4s2_scsi_pp_get_status()

SANE_Status sanei_pa4s2_scsi_pp_get_status ( int  fd,
u_char *  status 
)

Return port status information.

Parameters
fdfile descriptor
statusvariable to receive status
Returns
  • SANE_STATUS_GOOD - on success
  • SANE_STATUS_INVAL - if fd is invalid or device not in use

◆ sanei_pa4s2_scsi_pp_reg_select()

SANE_Status sanei_pa4s2_scsi_pp_reg_select ( int  fd,
int  reg 
)

Selects a register number on a SCSI-over-parallel scanner.

Parameters
fdfile descriptor
regregister number
Returns
  • SANE_STATUS_GOOD - on success
  • SANE_STATUS_INVAL - if fd is invalid

◆ sanei_pa4s2_readbyte()

SANE_Status sanei_pa4s2_readbyte ( int  fd,
u_char *  val 
)

Read a register.

The function to read a register is split up in three parts, so a register can be read more than once.

Parameters
fdfile descriptor
valpointer to value
Returns
  • SANE_STATUS_GOOD - on success
  • SANE_STATUS_INVAL - if fd is invalid or device not in use
See also
sanei_pa4s2_readbegin(), sanei_pa4s2_readend()

◆ sanei_pa4s2_readend()

SANE_Status sanei_pa4s2_readend ( int  fd)

Terminate reading sequence.

The function to read a register is split up in three parts, so a register can be read more than once.

Parameters
fdfile descriptor
Returns
  • SANE_STATUS_GOOD - on success
  • SANE_STATUS_INVAL - if fd is invalid or device not in use
See also
sanei_pa4s2_readbegin(), sanei_pa4s2_readbyte()

◆ sanei_pa4s2_writebyte()

SANE_Status sanei_pa4s2_writebyte ( int  fd,
u_char  reg,
u_char  val 
)

Write a register.

Parameters
fdfile descriptor
regregister
valvalue to be written
Returns
  • SANE_STATUS_GOOD - on success
  • SANE_STATUS_INVAL - if fd is invalid or device not in use