1141cc406Sopenharmony_ci/** @file plustek-pp_procs.h 2141cc406Sopenharmony_ci * @brief here are the prototypes of all exported functions 3141cc406Sopenharmony_ci * 4141cc406Sopenharmony_ci * based on sources acquired from Plustek Inc. 5141cc406Sopenharmony_ci * Copyright (C) 1998 Plustek Inc. 6141cc406Sopenharmony_ci * Copyright (C) 2000-2004 Gerhard Jaeger <gerhard@gjaeger.de> 7141cc406Sopenharmony_ci * also based on the work done by Rick Bronson <rick@efn.org> 8141cc406Sopenharmony_ci * 9141cc406Sopenharmony_ci * History: 10141cc406Sopenharmony_ci * 0.30 - initial version 11141cc406Sopenharmony_ci * 0.31 - no changes 12141cc406Sopenharmony_ci * 0.32 - no changes 13141cc406Sopenharmony_ci * 0.33 - no changes 14141cc406Sopenharmony_ci * 0.34 - added this history 15141cc406Sopenharmony_ci * 0.35 - added Kevins´ changes to MiscRestorePort 16141cc406Sopenharmony_ci * changed prototype of MiscReinitStruct 17141cc406Sopenharmony_ci * added prototype for function PtDrvLegalRequested() 18141cc406Sopenharmony_ci * 0.36 - added prototype for function MiscLongRand() 19141cc406Sopenharmony_ci * removed PtDrvLegalRequested() 20141cc406Sopenharmony_ci * changed prototype of function MiscInitPorts() 21141cc406Sopenharmony_ci * 0.37 - added io.c and procfs.c 22141cc406Sopenharmony_ci * added MiscGetModelName() 23141cc406Sopenharmony_ci * added ModelSetA3I() 24141cc406Sopenharmony_ci * 0.38 - added P12 stuff 25141cc406Sopenharmony_ci * removed prototype of IOScannerIdleMode() 26141cc406Sopenharmony_ci * removed prototype of IOSPPWrite() 27141cc406Sopenharmony_ci * 0.39 - moved prototypes for the user space stuff to plustek-share.h 28141cc406Sopenharmony_ci * 0.40 - no changes 29141cc406Sopenharmony_ci * 0.41 - no changes 30141cc406Sopenharmony_ci * 0.42 - added MapAdjust 31141cc406Sopenharmony_ci * 0.43 - no changes 32141cc406Sopenharmony_ci * . 33141cc406Sopenharmony_ci * <hr> 34141cc406Sopenharmony_ci * This file is part of the SANE package. 35141cc406Sopenharmony_ci * 36141cc406Sopenharmony_ci * This program is free software; you can redistribute it and/or 37141cc406Sopenharmony_ci * modify it under the terms of the GNU General Public License as 38141cc406Sopenharmony_ci * published by the Free Software Foundation; either version 2 of the 39141cc406Sopenharmony_ci * License, or (at your option) any later version. 40141cc406Sopenharmony_ci * 41141cc406Sopenharmony_ci * This program is distributed in the hope that it will be useful, but 42141cc406Sopenharmony_ci * WITHOUT ANY WARRANTY; without even the implied warranty of 43141cc406Sopenharmony_ci * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 44141cc406Sopenharmony_ci * General Public License for more details. 45141cc406Sopenharmony_ci * 46141cc406Sopenharmony_ci * You should have received a copy of the GNU General Public License 47141cc406Sopenharmony_ci * along with this program. If not, see <https://www.gnu.org/licenses/>. 48141cc406Sopenharmony_ci * 49141cc406Sopenharmony_ci * As a special exception, the authors of SANE give permission for 50141cc406Sopenharmony_ci * additional uses of the libraries contained in this release of SANE. 51141cc406Sopenharmony_ci * 52141cc406Sopenharmony_ci * The exception is that, if you link a SANE library with other files 53141cc406Sopenharmony_ci * to produce an executable, this does not by itself cause the 54141cc406Sopenharmony_ci * resulting executable to be covered by the GNU General Public 55141cc406Sopenharmony_ci * License. Your use of that executable is in no way restricted on 56141cc406Sopenharmony_ci * account of linking the SANE library code into it. 57141cc406Sopenharmony_ci * 58141cc406Sopenharmony_ci * This exception does not, however, invalidate any other reasons why 59141cc406Sopenharmony_ci * the executable file might be covered by the GNU General Public 60141cc406Sopenharmony_ci * License. 61141cc406Sopenharmony_ci * 62141cc406Sopenharmony_ci * If you submit changes to SANE to the maintainers to be included in 63141cc406Sopenharmony_ci * a subsequent release, you agree by submitting the changes that 64141cc406Sopenharmony_ci * those changes may be distributed with this exception intact. 65141cc406Sopenharmony_ci * 66141cc406Sopenharmony_ci * If you write modifications of your own for SANE, it is your choice 67141cc406Sopenharmony_ci * whether to permit this exception to apply to your modifications. 68141cc406Sopenharmony_ci * If you do not wish that, delete this exception notice. 69141cc406Sopenharmony_ci * <hr> 70141cc406Sopenharmony_ci */ 71141cc406Sopenharmony_ci#ifndef __PROCS_H__ 72141cc406Sopenharmony_ci#define __PROCS_H__ 73141cc406Sopenharmony_ci 74141cc406Sopenharmony_ci#ifdef _BACKEND_ENABLED 75141cc406Sopenharmony_ci# define _LOC static 76141cc406Sopenharmony_ci#else 77141cc406Sopenharmony_ci# define _LOC 78141cc406Sopenharmony_ci#endif 79141cc406Sopenharmony_ci 80141cc406Sopenharmony_ci/* 81141cc406Sopenharmony_ci * implementation in plustek-pp_misc.c 82141cc406Sopenharmony_ci */ 83141cc406Sopenharmony_ci_LOC pScanData MiscAllocAndInitStruct( void ); 84141cc406Sopenharmony_ci_LOC int MiscReinitStruct ( pScanData ps ); 85141cc406Sopenharmony_ci 86141cc406Sopenharmony_ci_LOC int MiscInitPorts ( pScanData ps, int port ); 87141cc406Sopenharmony_ci_LOC void MiscRestorePort( pScanData ps ); 88141cc406Sopenharmony_ci_LOC void MiscStartTimer ( pTimerDef timer, unsigned long us ); 89141cc406Sopenharmony_ci_LOC int MiscCheckTimer ( pTimerDef timer ); 90141cc406Sopenharmony_ci 91141cc406Sopenharmony_ci_LOC int MiscRegisterPort ( pScanData ps, int portAddr ); 92141cc406Sopenharmony_ci_LOC void MiscUnregisterPort ( pScanData ps ); 93141cc406Sopenharmony_ci_LOC int MiscClaimPort ( pScanData ps ); 94141cc406Sopenharmony_ci_LOC void MiscReleasePort ( pScanData ps ); 95141cc406Sopenharmony_ci_LOC Long MiscLongRand ( void ); 96141cc406Sopenharmony_ci_LOC const char *MiscGetModelName( UShort id ); 97141cc406Sopenharmony_ci 98141cc406Sopenharmony_ci#ifdef DEBUG 99141cc406Sopenharmony_ci_LOC Bool MiscAllPointersSet( pScanData ps ); 100141cc406Sopenharmony_ci#endif 101141cc406Sopenharmony_ci 102141cc406Sopenharmony_ci/* 103141cc406Sopenharmony_ci * implementation in plustek-pp_detect.c 104141cc406Sopenharmony_ci */ 105141cc406Sopenharmony_ci_LOC int DetectScanner( pScanData ps, int mode ); 106141cc406Sopenharmony_ci 107141cc406Sopenharmony_ci/* 108141cc406Sopenharmony_ci * implementation in plustek-pp_p48xx.c 109141cc406Sopenharmony_ci */ 110141cc406Sopenharmony_ci_LOC int P48xxInitAsic( pScanData ps ); 111141cc406Sopenharmony_ci 112141cc406Sopenharmony_ci/* 113141cc406Sopenharmony_ci * implementation in plustek-pp_p9636.c 114141cc406Sopenharmony_ci */ 115141cc406Sopenharmony_ci_LOC int P9636InitAsic( pScanData ps ); 116141cc406Sopenharmony_ci 117141cc406Sopenharmony_ci/* 118141cc406Sopenharmony_ci * implementation in plustek-pp_p12.c 119141cc406Sopenharmony_ci */ 120141cc406Sopenharmony_ci_LOC int P12InitAsic ( pScanData ps ); 121141cc406Sopenharmony_ci_LOC void P12SetGeneralRegister( pScanData ps ); 122141cc406Sopenharmony_ci 123141cc406Sopenharmony_ci/* 124141cc406Sopenharmony_ci * implementation in plustek-pp_p12ccd.c 125141cc406Sopenharmony_ci */ 126141cc406Sopenharmony_ci_LOC void P12InitCCDandDAC( pScanData ps, Bool shading ); 127141cc406Sopenharmony_ci 128141cc406Sopenharmony_ci/* 129141cc406Sopenharmony_ci * implementation in plustek-pp_models.c 130141cc406Sopenharmony_ci */ 131141cc406Sopenharmony_ci_LOC void ModelSet4800 ( pScanData ps ); 132141cc406Sopenharmony_ci_LOC void ModelSet4830 ( pScanData ps ); 133141cc406Sopenharmony_ci_LOC void ModelSet600 ( pScanData ps ); 134141cc406Sopenharmony_ci_LOC void ModelSet12000( pScanData ps ); 135141cc406Sopenharmony_ci_LOC void ModelSetA3I ( pScanData ps ); 136141cc406Sopenharmony_ci_LOC void ModelSet9630 ( pScanData ps ); 137141cc406Sopenharmony_ci_LOC void ModelSet9636 ( pScanData ps ); 138141cc406Sopenharmony_ci_LOC void ModelSetP12 ( pScanData ps ); 139141cc406Sopenharmony_ci 140141cc406Sopenharmony_ci/* 141141cc406Sopenharmony_ci * implementation in plustek-pp_dac.c 142141cc406Sopenharmony_ci */ 143141cc406Sopenharmony_ci_LOC int DacInitialize( pScanData ps ); 144141cc406Sopenharmony_ci 145141cc406Sopenharmony_ci_LOC void DacP98AdjustDark ( pScanData ps ); 146141cc406Sopenharmony_ci_LOC void DacP98FillGainOutDirectPort ( pScanData ps ); 147141cc406Sopenharmony_ci_LOC void DacP98FillShadingDarkToShadingRegister( pScanData ps ); 148141cc406Sopenharmony_ci 149141cc406Sopenharmony_ci_LOC void DacP96WriteBackToGammaShadingRAM( pScanData ps ); 150141cc406Sopenharmony_ci 151141cc406Sopenharmony_ci_LOC void DacP98003FillToDAC (pScanData ps, pRGBByteDef regs, pColorByte data); 152141cc406Sopenharmony_ci_LOC void DacP98003AdjustGain(pScanData ps, ULong color, Byte hilight ); 153141cc406Sopenharmony_ci_LOC Byte DacP98003SumGains ( pUChar pb, ULong pixelsLine ); 154141cc406Sopenharmony_ci 155141cc406Sopenharmony_ci/* 156141cc406Sopenharmony_ci * implementation in plustek-pp_motor.c 157141cc406Sopenharmony_ci */ 158141cc406Sopenharmony_ci_LOC int MotorInitialize ( pScanData ps ); 159141cc406Sopenharmony_ci_LOC void MotorSetConstantMove( pScanData ps, Byte bMovePerStep ); 160141cc406Sopenharmony_ci_LOC void MotorToHomePosition ( pScanData ps ); 161141cc406Sopenharmony_ci 162141cc406Sopenharmony_ci_LOC void MotorP98GoFullStep ( pScanData ps, ULong dwStep ); 163141cc406Sopenharmony_ci 164141cc406Sopenharmony_ci_LOC void MotorP96SetSpeedToStopProc( pScanData ps ); 165141cc406Sopenharmony_ci_LOC void MotorP96ConstantMoveProc ( pScanData ps, ULong dwLines ); 166141cc406Sopenharmony_ci_LOC Bool MotorP96AheadToDarkArea ( pScanData ps ); 167141cc406Sopenharmony_ci_LOC void MotorP96AdjustCurrentSpeed( pScanData ps, Byte bSpeed ); 168141cc406Sopenharmony_ci 169141cc406Sopenharmony_ci_LOC void MotorP98003BackToHomeSensor ( pScanData ps ); 170141cc406Sopenharmony_ci_LOC void MotorP98003ModuleForwardBackward( pScanData ps ); 171141cc406Sopenharmony_ci_LOC void MotorP98003ForceToLeaveHomePos ( pScanData ps ); 172141cc406Sopenharmony_ci_LOC void MotorP98003PositionYProc ( pScanData ps, ULong steps); 173141cc406Sopenharmony_ci 174141cc406Sopenharmony_ci/* 175141cc406Sopenharmony_ci * implementation in plustek-pp_map.c 176141cc406Sopenharmony_ci */ 177141cc406Sopenharmony_ci_LOC void MapInitialize ( pScanData ps ); 178141cc406Sopenharmony_ci_LOC void MapSetupDither( pScanData ps ); 179141cc406Sopenharmony_ci_LOC void MapAdjust ( pScanData ps, int which ); 180141cc406Sopenharmony_ci 181141cc406Sopenharmony_ci/* 182141cc406Sopenharmony_ci * implementation in plustek-pp_image.c 183141cc406Sopenharmony_ci */ 184141cc406Sopenharmony_ci_LOC int ImageInitialize( pScanData ps ); 185141cc406Sopenharmony_ci 186141cc406Sopenharmony_ci/* 187141cc406Sopenharmony_ci * implementation in plustek-pp_genericio.c 188141cc406Sopenharmony_ci */ 189141cc406Sopenharmony_ci_LOC int IOFuncInitialize ( pScanData ps ); 190141cc406Sopenharmony_ci_LOC Byte IOSetToMotorRegister ( pScanData ps ); 191141cc406Sopenharmony_ci_LOC Byte IOGetScanState ( pScanData ps, Bool fOpenned ); 192141cc406Sopenharmony_ci_LOC Byte IOGetExtendedStatus ( pScanData ps ); 193141cc406Sopenharmony_ci_LOC void IOGetCurrentStateCount( pScanData, pScanState pScanStep); 194141cc406Sopenharmony_ci_LOC int IOIsReadyForScan ( pScanData ps ); 195141cc406Sopenharmony_ci 196141cc406Sopenharmony_ci_LOC void IOSetXStepLineScanTime( pScanData ps, Byte b ); 197141cc406Sopenharmony_ci_LOC void IOSetToMotorStepCount ( pScanData ps ); 198141cc406Sopenharmony_ci_LOC void IOSelectLampSource ( pScanData ps ); 199141cc406Sopenharmony_ci_LOC Bool IOReadOneShadingLine ( pScanData ps, pUChar pBuf, ULong len ); 200141cc406Sopenharmony_ci_LOC ULong IOReadFifoLength ( pScanData ps ); 201141cc406Sopenharmony_ci_LOC void IOPutOnAllRegisters ( pScanData ps ); 202141cc406Sopenharmony_ci_LOC void IOReadColorData ( pScanData ps, pUChar pBuf, ULong len ); 203141cc406Sopenharmony_ci 204141cc406Sopenharmony_ci/* 205141cc406Sopenharmony_ci * implementation in plustek-pp_io.c 206141cc406Sopenharmony_ci */ 207141cc406Sopenharmony_ci_LOC int IOInitialize ( pScanData ps ); 208141cc406Sopenharmony_ci_LOC void IOMoveDataToScanner ( pScanData ps, pUChar pBuffer, ULong size ); 209141cc406Sopenharmony_ci_LOC void IODownloadScanStates( pScanData ps ); 210141cc406Sopenharmony_ci_LOC void IODataToScanner ( pScanData, Byte bValue ); 211141cc406Sopenharmony_ci_LOC void IODataToRegister ( pScanData ps, Byte bReg, Byte bData ); 212141cc406Sopenharmony_ci_LOC Byte IODataFromRegister ( pScanData ps, Byte bReg ); 213141cc406Sopenharmony_ci_LOC void IORegisterToScanner ( pScanData ps, Byte bReg ); 214141cc406Sopenharmony_ci_LOC void IODataRegisterToDAC ( pScanData ps, Byte bReg, Byte bData ); 215141cc406Sopenharmony_ci 216141cc406Sopenharmony_ci_LOC Byte IODataRegisterFromScanner( pScanData ps, Byte bReg ); 217141cc406Sopenharmony_ci_LOC void IOCmdRegisterToScanner ( pScanData ps, Byte bReg, Byte bData ); 218141cc406Sopenharmony_ci_LOC void IORegisterDirectToScanner( pScanData, Byte bReg ); 219141cc406Sopenharmony_ci_LOC void IOSoftwareReset ( pScanData ps ); 220141cc406Sopenharmony_ci_LOC void IOReadScannerImageData ( pScanData ps, pUChar pBuf, ULong size ); 221141cc406Sopenharmony_ci 222141cc406Sopenharmony_ci/* 223141cc406Sopenharmony_ci * implementation in plustek-pp_tpa.c 224141cc406Sopenharmony_ci */ 225141cc406Sopenharmony_ci_LOC void TPAP98001AverageShadingData( pScanData ps ); 226141cc406Sopenharmony_ci_LOC void TPAP98003FindCenterPointer ( pScanData ps ); 227141cc406Sopenharmony_ci_LOC void TPAP98003Reshading ( pScanData ps ); 228141cc406Sopenharmony_ci 229141cc406Sopenharmony_ci/* 230141cc406Sopenharmony_ci * implementation in plustek-pp_scale.c 231141cc406Sopenharmony_ci */ 232141cc406Sopenharmony_ci_LOC void ScaleX( pScanData ps, pUChar inBuf, pUChar outBuf ); 233141cc406Sopenharmony_ci 234141cc406Sopenharmony_ci#endif /* guard __PROCS_H__ */ 235141cc406Sopenharmony_ci 236141cc406Sopenharmony_ci/* END PLUSTEK-PP_PROCS.H ...................................................*/ 237