sanei_lm983x.h File Reference

Interface files for the NS LM9831/2/3 USB chip. More...

Go to the source code of this file.

Defines

#define sanei_lm983x_read_byte(fd, reg, value)   sanei_lm983x_read (fd, reg, value, 1, 0)
 Read one data byte from a specific LM983x register.

Functions

void sanei_lm983x_init (void)
 Initialize sanei_lm983x.
SANE_Status sanei_lm983x_write_byte (SANE_Int fd, SANE_Byte reg, SANE_Byte value)
 Write one data byte to a specific LM983x register.
SANE_Status sanei_lm983x_write (SANE_Int fd, SANE_Byte reg, SANE_Byte *buffer, SANE_Word len, SANE_Bool increment)
 Write one or more data bytes to one or more specific LM983x registers.
SANE_Status sanei_lm983x_read (SANE_Int fd, SANE_Byte reg, SANE_Byte *buffer, SANE_Word len, SANE_Bool increment)
 Read one or more data bytes from one ore more specific LM983x registers.
SANE_Bool sanei_lm983x_reset (SANE_Int fd)
 Reset the LM983x chip.


Detailed Description

Interface files for the NS LM9831/2/3 USB chip.

The National Semiconductor LM9831, LM9832, and LM9833 chips are used in many USB scanners. Examples include Plustek and Mustek devices.

See also:
sanei_usb.h

Define Documentation

#define sanei_lm983x_read_byte ( fd,
reg,
value   )     sanei_lm983x_read (fd, reg, value, 1, 0)

Read one data byte from a specific LM983x register.

Parameters:
fd - device file descriptor (SANE_Int)
reg - number of register (SANE_Byte)
value - byte value to be written (SANE_Byte *)
Returns:
The SANE status code for the operation (SANE_Status):
  • SANE_STATUS_GOOD - on success
  • SANE_STATUS_IO_ERROR - system write function failed
  • SANE_STATUS_INVAL - register out of range


Function Documentation

void sanei_lm983x_init ( void   ) 

Initialize sanei_lm983x.

Currently, this function only enables the debugging functionality.

SANE_Status sanei_lm983x_write_byte ( SANE_Int  fd,
SANE_Byte  reg,
SANE_Byte  value 
)

Write one data byte to a specific LM983x register.

Parameters:
fd - device file descriptor
reg - number of register
value - byte value to be written
Returns:
  • SANE_STATUS_GOOD - on success
  • SANE_STATUS_IO_ERROR - system write function failed
  • SANE_STATUS_INVAL - register out of range

SANE_Status sanei_lm983x_write ( SANE_Int  fd,
SANE_Byte  reg,
SANE_Byte *  buffer,
SANE_Word  len,
SANE_Bool  increment 
)

Write one or more data bytes to one or more specific LM983x registers.

Parameters:
fd - device file descriptor
reg - number of start-register
buffer - buffer to be written
len - number of bytes to be written
increment - SANE_TRUE enables the autoincrement of the register value during the write cycle, SANE_FALSE disables this
Returns:
  • SANE_STATUS_GOOD - on success
  • SANE_STATUS_IO_ERROR - system read function failed
  • SANE_STATUS_INVAL - register out of range or len field was 0

SANE_Status sanei_lm983x_read ( SANE_Int  fd,
SANE_Byte  reg,
SANE_Byte *  buffer,
SANE_Word  len,
SANE_Bool  increment 
)

Read one or more data bytes from one ore more specific LM983x registers.

Parameters:
fd - device file descriptor
reg - number of start-register
buffer - buffer to receive the data
len - number of bytes to receive
increment - SANE_TRUE enables the autoincrement of the register value during the read cylce, SANE_FALSE disables this
Returns:
  • SANE_STATUS_GOOD - on success
  • SANE_STATUS_IO_ERROR - system read function failed
  • SANE_STATUS_INVAL - register out of range
  • SANE_STATUS_EOF - if nothing can't be read

SANE_Bool sanei_lm983x_reset ( SANE_Int  fd  ) 

Reset the LM983x chip.

Parameters:
fd - device file descriptor
Returns:
  • SANE_TRUE - reset successfuly done
  • SANE_FALSE - reset failed


Generated on Mon Jan 31 21:43:30 2011 for SANEI by  doxygen 1.5.6