00001 #ifndef __KSJ_API_A_H__
00002 #define __KSJ_API_A_H__
00003 
00004 // #pragma message("Include KSJApiInternal.h") 
00005 
00006 #include "KSJApiUserZone.h"
00007 
00008 
00009 #ifdef KSJAPI_EXPORTS
00010     #define KSJ_API __declspec(dllexport)
00011 #elif defined KSJAPI_STATIC
00012     #define KSJ_API
00013 #else
00014     #define KSJ_API __declspec(dllimport)
00015 #endif
00016 
00017 /*-----------------------------------------------------------------------------------------------------
00018     Supper Command for Internal only. 
00019   ====================================================================================================*/
00020 #ifdef __cplusplus
00021 extern "C"{
00022 #endif
00023 
00030 
00038 #pragma pack ( 1 )
00039     typedef struct _tagUSBCmd
00040     {
00041         unsigned char  bmRequest;
00042         unsigned char  bRequest;
00043         unsigned short wValue;
00044         unsigned short wIndex;
00045         unsigned short wLength;                 
00046     }USBCMD, *PUSBCMD;
00047 #pragma pack ( 8 )
00048 
00049     KSJ_API  int __stdcall KSJ_VendorCmd(int nIndex, PUSBCMD pUsbCmd, unsigned char *pBuf);
00050 
00053     KSJ_API  int __stdcall KSJ_WrSensorReg(int nIndex, unsigned char btRegAddress, unsigned short wValue);
00054     KSJ_API  int __stdcall KSJ_RdSensorReg(int nIndex, unsigned char btRegAddress, unsigned short *pwValue);
00055     KSJ_API  int __stdcall KSJ_WrSensorRegX(int nIndex, unsigned short wRegAdress, unsigned short wValue);
00056     KSJ_API  int __stdcall KSJ_RdSensorRegX(int nIndex, unsigned short wRegAdress, unsigned short *pwValue);
00057     KSJ_API  int __stdcall KSJ_FrameRestart(int nIndex);    
00058     KSJ_API  int __stdcall KSJ_WrFpgaReg(int nIndex, unsigned char btRegAddress, unsigned short wValue);
00059     KSJ_API  int __stdcall KSJ_RdFpgaReg(int nIndex, unsigned char btRegAddress, unsigned short *pwValue);
00060     KSJ_API  int __stdcall KSJ_ResetFpga(int nIndex, bool bReset);
00061     KSJ_API  int __stdcall KSJ_WrFx2Sfr(int nIndex, unsigned short uRegAdress, unsigned char btValue);
00062     KSJ_API  int __stdcall KSJ_RdFx2Sfr(int nIndex, unsigned short uRegAdress, unsigned char *pbtValue);
00063     KSJ_API  int __stdcall KSJ_WrFx2Reg(int nIndex, unsigned short uRegAdress, unsigned char btValue);
00064     KSJ_API  int __stdcall KSJ_RdFx2Reg(int nIndex, unsigned short uRegAdress, unsigned char *pbtValue);
00065     KSJ_API  int __stdcall KSJ_ResetFx2(int nIndex, bool bReset);
00066     KSJ_API  int __stdcall KSJ_WrAD9923A(int nIndex, unsigned short wRegAddress, unsigned long dwValue);
00067     KSJ_API  int __stdcall KSJ_WrTMP101(int nIndex, unsigned char btRegAddress, unsigned short wValue);
00068     KSJ_API  int __stdcall KSJ_RdTMP101(int nIndex, unsigned char btRegAddress, unsigned short *pwValue);
00069 
00070     KSJ_API  int __stdcall KSJ_ResetDevice( int nIndex );
00071     KSJ_API  int __stdcall KSJ_ReconnectDevice( int nIndex );
00072     KSJ_API  int __stdcall KSJ_ResetHost( int nIndex );
00073     KSJ_API  int __stdcall KSJ_CancelIo(int nIndex);
00074 
00075 
00085     KSJ_API  int __stdcall KSJ_RebootDevice(int nIndex);
00086     //返回-10表示恢复成功
00087     KSJ_API  int __stdcall KSJ_RecoverDevice(int nIndex);
00089     KSJ_API  int __stdcall KSJ_Open(int nIndex);
00091     KSJ_API  int __stdcall KSJ_Close(int nIndex);
00092 
00093     KSJ_API  int __stdcall KSJ_ClearFeature(int nIndex);
00094     KSJ_API  int __stdcall KSJ_ResetPipe(int nIndex);
00095     KSJ_API  int __stdcall KSJ_UsbHostResetDevice(int nIndex);
00096 
00097     KSJ_API  int __stdcall KSJ_WorkingModeProgram(int nIndex, unsigned short wValue);
00098     KSJ_API  int __stdcall KSJ_WorkingModeReadout(int nIndex, unsigned short *pValue);
00099 
00100     KSJ_API  int __stdcall KSJ_WorkingModeExProgram(int nIndex, unsigned short wValue);
00101     KSJ_API  int __stdcall KSJ_WorkingModeExReadout(int nIndex, unsigned short *pValue);
00102 
00103     KSJ_API  int __stdcall KSJ_ColorModeProgram(int nIndex, unsigned short wValue);
00104     KSJ_API  int __stdcall KSJ_ColorModeReadout(int nIndex, unsigned short *pValue);
00105 
00106     KSJ_API  int __stdcall KSJ_SerialsDescProgram(int nIndex, unsigned char btDesc[16]);
00107     KSJ_API  int __stdcall KSJ_HardwareVersionProgram(int nIndex, unsigned char btVersion[64]);
00108 
00110 
00111 #ifdef __cplusplus
00112 }
00113 #endif
00114 
00115 #endif