• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /** @file plustek-pp_procs.h
2  *  @brief here are the prototypes of all exported functions
3  *
4  * based on sources acquired from Plustek Inc.
5  * Copyright (C) 1998 Plustek Inc.
6  * Copyright (C) 2000-2004 Gerhard Jaeger <gerhard@gjaeger.de>
7  * also based on the work done by Rick Bronson <rick@efn.org>
8  *
9  * History:
10  * 0.30 - initial version
11  * 0.31 - no changes
12  * 0.32 - no changes
13  * 0.33 - no changes
14  * 0.34 - added this history
15  * 0.35 - added Kevins´ changes to MiscRestorePort
16  *		  changed prototype of MiscReinitStruct
17  *		  added prototype for function PtDrvLegalRequested()
18  * 0.36 - added prototype for function MiscLongRand()
19  *		  removed PtDrvLegalRequested()
20  *		  changed prototype of function MiscInitPorts()
21  * 0.37 - added io.c and procfs.c
22  *        added MiscGetModelName()
23  *        added ModelSetA3I()
24  * 0.38 - added P12 stuff
25  *        removed prototype of IOScannerIdleMode()
26  *        removed prototype of IOSPPWrite()
27  * 0.39 - moved prototypes for the user space stuff to plustek-share.h
28  * 0.40 - no changes
29  * 0.41 - no changes
30  * 0.42 - added MapAdjust
31  * 0.43 - no changes
32  * .
33  * <hr>
34  * This file is part of the SANE package.
35  *
36  * This program is free software; you can redistribute it and/or
37  * modify it under the terms of the GNU General Public License as
38  * published by the Free Software Foundation; either version 2 of the
39  * License, or (at your option) any later version.
40  *
41  * This program is distributed in the hope that it will be useful, but
42  * WITHOUT ANY WARRANTY; without even the implied warranty of
43  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
44  * General Public License for more details.
45  *
46  * You should have received a copy of the GNU General Public License
47  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
48  *
49  * As a special exception, the authors of SANE give permission for
50  * additional uses of the libraries contained in this release of SANE.
51  *
52  * The exception is that, if you link a SANE library with other files
53  * to produce an executable, this does not by itself cause the
54  * resulting executable to be covered by the GNU General Public
55  * License.  Your use of that executable is in no way restricted on
56  * account of linking the SANE library code into it.
57  *
58  * This exception does not, however, invalidate any other reasons why
59  * the executable file might be covered by the GNU General Public
60  * License.
61  *
62  * If you submit changes to SANE to the maintainers to be included in
63  * a subsequent release, you agree by submitting the changes that
64  * those changes may be distributed with this exception intact.
65  *
66  * If you write modifications of your own for SANE, it is your choice
67  * whether to permit this exception to apply to your modifications.
68  * If you do not wish that, delete this exception notice.
69  * <hr>
70  */
71 #ifndef __PROCS_H__
72 #define __PROCS_H__
73 
74 #ifdef _BACKEND_ENABLED
75 # define _LOC	static
76 #else
77 # define _LOC
78 #endif
79 
80 /*
81  * implementation in plustek-pp_misc.c
82  */
83 _LOC pScanData MiscAllocAndInitStruct( void );
84 _LOC int       MiscReinitStruct      ( pScanData ps );
85 
86 _LOC int  MiscInitPorts  ( pScanData ps, int port );
87 _LOC void MiscRestorePort( pScanData ps );
88 _LOC void MiscStartTimer ( pTimerDef timer, unsigned long us );
89 _LOC int  MiscCheckTimer ( pTimerDef timer );
90 
91 _LOC int  MiscRegisterPort       ( pScanData ps, int portAddr );
92 _LOC void MiscUnregisterPort     ( pScanData ps );
93 _LOC int  MiscClaimPort          ( pScanData ps );
94 _LOC void MiscReleasePort        ( pScanData ps );
95 _LOC Long MiscLongRand           ( void );
96 _LOC const char *MiscGetModelName( UShort id );
97 
98 #ifdef DEBUG
99 _LOC Bool MiscAllPointersSet( pScanData ps );
100 #endif
101 
102 /*
103  * implementation in plustek-pp_detect.c
104  */
105 _LOC int DetectScanner( pScanData ps, int mode );
106 
107 /*
108  * implementation in plustek-pp_p48xx.c
109  */
110 _LOC int P48xxInitAsic( pScanData ps );
111 
112 /*
113  * implementation in plustek-pp_p9636.c
114  */
115 _LOC int P9636InitAsic( pScanData ps );
116 
117 /*
118  * implementation in plustek-pp_p12.c
119  */
120 _LOC int  P12InitAsic          ( pScanData ps );
121 _LOC void P12SetGeneralRegister( pScanData ps );
122 
123 /*
124  * implementation in plustek-pp_p12ccd.c
125  */
126 _LOC void P12InitCCDandDAC( pScanData ps, Bool shading );
127 
128 /*
129  * implementation in plustek-pp_models.c
130  */
131 _LOC void ModelSet4800 ( pScanData ps );
132 _LOC void ModelSet4830 ( pScanData ps );
133 _LOC void ModelSet600  ( pScanData ps );
134 _LOC void ModelSet12000( pScanData ps );
135 _LOC void ModelSetA3I  ( pScanData ps );
136 _LOC void ModelSet9630 ( pScanData ps );
137 _LOC void ModelSet9636 ( pScanData ps );
138 _LOC void ModelSetP12  ( pScanData ps );
139 
140 /*
141  * implementation in plustek-pp_dac.c
142  */
143 _LOC int  DacInitialize( pScanData ps );
144 
145 _LOC void DacP98AdjustDark					   ( pScanData ps );
146 _LOC void DacP98FillGainOutDirectPort		   ( pScanData ps );
147 _LOC void DacP98FillShadingDarkToShadingRegister( pScanData ps );
148 
149 _LOC void DacP96WriteBackToGammaShadingRAM( pScanData ps );
150 
151 _LOC void DacP98003FillToDAC (pScanData ps, pRGBByteDef regs, pColorByte data);
152 _LOC void DacP98003AdjustGain(pScanData ps, ULong color, Byte hilight );
153 _LOC Byte DacP98003SumGains  ( pUChar pb, ULong pixelsLine );
154 
155 /*
156  * implementation in plustek-pp_motor.c
157  */
158 _LOC int  MotorInitialize	 ( pScanData ps );
159 _LOC void MotorSetConstantMove( pScanData ps, Byte bMovePerStep );
160 _LOC void MotorToHomePosition ( pScanData ps );
161 
162 _LOC void MotorP98GoFullStep  ( pScanData ps, ULong dwStep );
163 
164 _LOC void MotorP96SetSpeedToStopProc( pScanData ps );
165 _LOC void MotorP96ConstantMoveProc  ( pScanData ps, ULong dwLines );
166 _LOC Bool MotorP96AheadToDarkArea   ( pScanData ps );
167 _LOC void MotorP96AdjustCurrentSpeed( pScanData ps, Byte bSpeed );
168 
169 _LOC void MotorP98003BackToHomeSensor     ( pScanData ps );
170 _LOC void MotorP98003ModuleForwardBackward( pScanData ps );
171 _LOC void MotorP98003ForceToLeaveHomePos  ( pScanData ps );
172 _LOC void MotorP98003PositionYProc        ( pScanData ps, ULong steps);
173 
174 /*
175  * implementation in plustek-pp_map.c
176  */
177 _LOC void MapInitialize ( pScanData ps );
178 _LOC void MapSetupDither( pScanData ps );
179 _LOC void MapAdjust     ( pScanData ps, int which );
180 
181 /*
182  * implementation in plustek-pp_image.c
183  */
184 _LOC int ImageInitialize( pScanData ps );
185 
186 /*
187  * implementation in plustek-pp_genericio.c
188  */
189 _LOC int  IOFuncInitialize      ( pScanData ps );
190 _LOC Byte IOSetToMotorRegister  ( pScanData ps );
191 _LOC Byte IOGetScanState        ( pScanData ps, Bool fOpenned );
192 _LOC Byte IOGetExtendedStatus   ( pScanData ps );
193 _LOC void IOGetCurrentStateCount( pScanData, pScanState pScanStep);
194 _LOC int  IOIsReadyForScan      ( pScanData ps );
195 
196 _LOC void  IOSetXStepLineScanTime( pScanData ps, Byte b );
197 _LOC void  IOSetToMotorStepCount ( pScanData ps );
198 _LOC void  IOSelectLampSource    ( pScanData ps );
199 _LOC Bool  IOReadOneShadingLine  ( pScanData ps, pUChar pBuf, ULong len );
200 _LOC ULong IOReadFifoLength      ( pScanData ps );
201 _LOC void  IOPutOnAllRegisters   ( pScanData ps );
202 _LOC void  IOReadColorData       ( pScanData ps, pUChar pBuf, ULong len );
203 
204 /*
205  * implementation in plustek-pp_io.c
206  */
207 _LOC int  IOInitialize        ( pScanData ps );
208 _LOC void IOMoveDataToScanner ( pScanData ps, pUChar pBuffer, ULong size );
209 _LOC void IODownloadScanStates( pScanData ps );
210 _LOC void IODataToScanner     ( pScanData, Byte bValue );
211 _LOC void IODataToRegister    ( pScanData ps, Byte bReg, Byte bData );
212 _LOC Byte IODataFromRegister  ( pScanData ps, Byte bReg );
213 _LOC void IORegisterToScanner ( pScanData ps, Byte bReg );
214 _LOC void IODataRegisterToDAC ( pScanData ps, Byte bReg, Byte bData );
215 
216 _LOC Byte IODataRegisterFromScanner( pScanData ps, Byte bReg );
217 _LOC void IOCmdRegisterToScanner   ( pScanData ps, Byte bReg, Byte bData );
218 _LOC void IORegisterDirectToScanner( pScanData, Byte bReg );
219 _LOC void IOSoftwareReset          ( pScanData ps );
220 _LOC void IOReadScannerImageData   ( pScanData ps, pUChar pBuf, ULong size );
221 
222 /*
223  * implementation in plustek-pp_tpa.c
224  */
225 _LOC void TPAP98001AverageShadingData( pScanData ps );
226 _LOC void TPAP98003FindCenterPointer ( pScanData ps );
227 _LOC void TPAP98003Reshading         ( pScanData ps );
228 
229 /*
230  * implementation in plustek-pp_scale.c
231  */
232 _LOC void ScaleX( pScanData ps, pUChar inBuf, pUChar outBuf );
233 
234 #endif	/* guard __PROCS_H__ */
235 
236 /* END PLUSTEK-PP_PROCS.H ...................................................*/
237