Updated sanei_lm983x.[ch]...

DEVEL_2_0_BRANCH-1
Gerhard Jaeger 2002-01-12 14:00:58 +00:00
rodzic 4486a605b8
commit 1737ac83c6
2 zmienionych plików z 19 dodań i 8 usunięć

Wyświetl plik

@ -70,7 +70,7 @@ Sanei internal code:
Adrian Perez Jorge, Andreas Beck, Andreas Czechanowski, Christian Bucher, Adrian Perez Jorge, Andreas Beck, Andreas Czechanowski, Christian Bucher,
David Mosberger-Tang, Frank Zago, Henning Meier-Geinitz, Jeff Freedman, David Mosberger-Tang, Frank Zago, Henning Meier-Geinitz, Jeff Freedman,
Jochen Eisinger, Marcio Teixeira, Yuri Dario Jochen Eisinger, Marcio Teixeira, Yuri Dario, Gerhard Jaeger
Please also read the file PROJECTS for projects that are planned or Please also read the file PROJECTS for projects that are planned or
not yet included into the SANE distribution. not yet included into the SANE distribution.

Wyświetl plik

@ -54,7 +54,7 @@
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
#define BACKEND_NAME sanei_lm983x #define BACKEND_NAME sanei_lm983x /**< the name of this module for dbg */
#include "../include/sane/sane.h" #include "../include/sane/sane.h"
#include "../include/sane/sanei_debug.h" #include "../include/sane/sanei_debug.h"
@ -66,13 +66,23 @@
#define _MIN(a,b) ((a) < (b) ? (a) : (b)) #define _MIN(a,b) ((a) < (b) ? (a) : (b))
#define _MAX(a,b) ((a) > (b) ? (a) : (b)) #define _MAX(a,b) ((a) > (b) ? (a) : (b))
#define _CMD_BYTE_CNT 4 #define _CMD_BYTE_CNT 4 /**< header for LM983x transfers */
#define _MAX_RETRY 20 #define _MAX_RETRY 20 /**< number of tries for reset */
#define _LM9831_MAX_REG 0x7f #define _LM9831_MAX_REG 0x7f /**< number of LM983x bytes */
#define _MAX_TRANSFER_SIZE 60 #define _MAX_TRANSFER_SIZE 60 /**< max. number of bytes to transfer */
/******************************* the functions *******************************/ /******************************* the functions *******************************/
/**
* function to initialize this library, currently only enables the debugging
* functionality
*/
void
sanei_lm983x_init( void )
{
DBG_INIT();
}
/** /**
* function to write one data byte to a specific LM983x register * function to write one data byte to a specific LM983x register
* *
@ -87,7 +97,7 @@
SANE_Status SANE_Status
sanei_lm983x_write_byte( SANE_Int fd, SANE_Byte reg, SANE_Byte value ) sanei_lm983x_write_byte( SANE_Int fd, SANE_Byte reg, SANE_Byte value )
{ {
return sanei_lm983x_write( fd, reg, &value, 1, SANE_FALSE ); return sanei_lm983x_write( fd, reg, &value, 1, SANE_FALSE );
} }
/** /**
@ -292,7 +302,7 @@ SANE_Bool sanei_lm983x_reset( SANE_Int fd )
if( _CMD_BYTE_CNT == write( fd, cmd_buffer, _CMD_BYTE_CNT )) { if( _CMD_BYTE_CNT == write( fd, cmd_buffer, _CMD_BYTE_CNT )) {
/* Then read the register in question */ /* Then read the register in question */
u_long cbBytes = 1; unsigned long cbBytes = 1;
if( read( fd, &tmp, cbBytes )) { if( read( fd, &tmp, cbBytes )) {
@ -308,6 +318,7 @@ SANE_Bool sanei_lm983x_reset( SANE_Int fd )
wrt_buffer[2] = 0; wrt_buffer[2] = 0;
wrt_buffer[3] = 1; wrt_buffer[3] = 1;
wrt_buffer[4] = 0; /* <--- The data for the register */ wrt_buffer[4] = 0; /* <--- The data for the register */
/* should this be 0x20???? */
/* We will attempt to reset it but we really don't do /* We will attempt to reset it but we really don't do
* anything if this fails * anything if this fails