19#define PS2CAM_RPC_GETIRXVERSION 40
21#define PS2CAM_RPC_INITIALIZE 41
23#define PS2CAM_RPC_GETDEVCOUNT 42
24#define PS2CAM_RPC_OPENDEVICE 43
25#define PS2CAM_RPC_CLOSEDEVICE 44
27#define PS2CAM_RPC_GETDEVSTATUS 45
29#define PS2CAM_RPC_GETDEVINFO 46
31#define PS2CAM_RPC_SETDEVBANDWIDTH 47
33#define PS2CAM_RPC_READPACKET 48
35#define PS2CAM_RPC_SETLEDMODE 49
37#define PS2CAM_RPC_SETDEVCONFIG 50
41#define PS2CAM_VEND_SONY 0x054C
43#define PS2CAM_VEND_DLINK 0x05A9
45#define PS2CAM_VEND_LOGITECH 0x0000
49#define PS2CAM_PROD_EYETOY 0x0154
51#define PS2CAM_PROD_EYETOY2 0x0155
53#define PS2CAM_PROD_EYETOY3 0x0156
55#define PS2CAM_PROD_EYETOY4 0x0157
58#define PS2CAM_PROD_VISUALSTREAM 0x8519
61#define EYETOY_IREG_H_SIZE 0x10
62#define EYETOY_IREG_V_SIZE 0x11
63#define EYETOY_IREG_X_OFFSETL 0x12
64#define EYETOY_IREG_X_OFFSETH 0x13
65#define EYETOY_IREG_Y_OFFSETL 0x14
66#define EYETOY_IREG_Y_OFFSETH 0x15
67#define EYETOY_IREG_DIVIDER 0x16
68#define EYETOY_IREG_DFR 0x20
69#define EYETOY_IREG_SR 0x21
70#define EYETOY_IREG_FRAR 0x22
71#define EYETOY_IREG_FORMAT 0x25
73#define EYETOY_CREG_RESET0 0x50
74#define EYETOY_CREG_RESET1 0x51
75#define EYETOY_CREG_EN_CLK0 0x53
76#define EYETOY_CREG_EN_CLK1 0x54
77#define EYETOY_CREG_AUDIO_CLK 0x55
78#define EYETOY_CREG_SNAPSHOT 0x57
79#define EYETOY_CREG_PONOFF 0x58
80#define EYETOY_CREG_CAMERA_CLK 0x59
81#define EYETOY_CREG_CTRL1 0x5A
82#define EYETOY_CREG_DEB_CLK 0x5B
83#define EYETOY_CREG_CLK 0x5C
84#define EYETOY_CREG_PWDN 0x5D
85#define EYETOY_CREG_USR_DFN 0x5E
86#define EYETOY_CREG_CTRL2 0x5F
87#define EYETOY_CREG_INTERRUPT0 0x60
88#define EYETOY_CREG_INTERRUPT1 0x61
89#define EYETOY_CREG_MASK0 0x62
90#define EYETOY_CREG_MASK1 0x63
91#define EYETOY_CREG_VCI_R0 0x64
92#define EYETOY_CREG_VCI_R1 0x65
93#define EYETOY_CREG_ADC_CTRL 0x68
94#define EYETOY_CREG_UC_CTRL 0x6D
97#define EYETOY_GPIO_DATA_OUT0 0x71
98#define EYETOY_GPIO_IO_CTRL0 0x72
102#define EYETOY_ALTERNATE_SIZE_0 0x00
103#define EYETOY_ALTERNATE_SIZE_384 0x01
104#define EYETOY_ALTERNATE_SIZE_512 0x02
105#define EYETOY_ALTERNATE_SIZE_768 0x03
106#define EYETOY_ALTERNATE_SIZE_896 0x04
110#define CAM_STATUS_NOTCONNECTED 0
112#define CAM_STATUS_CONNECTED 1
114#define CAM_STATUS_CONNECTEDREADY 2
117#define CAM_CONFIG_MASK_DIMENSION 0x00000001
118#define CAM_CONFIG_MASK_OFFSET 0x00000002
119#define CAM_CONFIG_MASK_DIVIDER 0x00000004
120#define CAM_CONFIG_MASK_FRAMERATE 0x00000008
124#define CAM_ERROR_NONE (00)
125#define CAM_ERROR_NOTINIT -(20)
126#define CAM_ERROR_INVALIDDEVICE -(21)
128#define CAM_ERROR_COMMUNKNOWN -(22)
130#define CAM_ERROR_DEVNOTREADY -(23)
132#define CAM_ERROR_NODEVICE -(24)
134#define CAM_ERROR_BADRANGE -(25)
136#define CAM_ERROR_UNKNOWN -(26)
138#define CAM_ERROR_MAXHANDLE -(27)
140#define CAM_ERROR_BADHANDLE -(28)
142#define CAM_ERROR_DISCONNECTED -(29)
148 unsigned short vendor_id;
149 unsigned short product_id;
150 unsigned char vendor_name[32];
151 unsigned char product_name[32];
152 unsigned char model[16];
161 int stream_pocket_size;
187 unsigned short width;
189 unsigned short height;
191 unsigned short x_offset;
193 unsigned short y_offset;
195 unsigned char h_divider;
197 unsigned char v_divider;
199 unsigned short framerate;
206 unsigned char magic1;
208 unsigned char magic2;
210 unsigned char magic3;
230#define camSetDIVIDER(p, hdiv, en_lpf, vdiv, en_sa) setReg8((p), EYETOY_IREG_DIVIDER, \
231 ((unsigned char)(hdiv) <<0)|\
232 ((unsigned char)(en_lpf) <<3)|\
233 ((unsigned char)(vdiv) <<4)|\
234 ((unsigned char)(en_sa) <<7));
236void rpcMainThread(
void* param);
237void *rpcCommandHandler(u32 command,
void *buffer,
int size);
262int setReg16(
CAMERA_DEVICE *dev,
unsigned char reg_id,
unsigned short value);
void PS2CamSetDeviceConfiguration(CAMERA_DEVICE *dev, int id)
void camResetDevice(CAMERA_DEVICE *dev)
void PS2CamCallback(int resultCode, int bytes, void *arg)
int PS2CamDisconnect(int devId)
void PS2CamInitializeNewDevice(CAMERA_DEVICE *argv)
int getReg8(CAMERA_DEVICE *dev, unsigned char reg_id, unsigned char *value)
void camStartStream(CAMERA_DEVICE *dev)
int PS2CamGetDeviceStatus(int device_id)
int PS2CamGetDeviceCount(void)
int PS2CamSetLEDMode(int device_id, int mode)
int PS2CamConnect(int devId)
int PS2CamGetDeviceInfo(int handle, int *info)
int setReg8Mask(CAMERA_DEVICE *dev, unsigned char reg_id, unsigned char value, unsigned char mask)
int PS2CamCloseDevice(int handle)
int PS2CamProbe(int devId)
void PS2CamSetDeviceDefaults(CAMERA_DEVICE *dev)
void camTurnOffRedLed(CAMERA_DEVICE *dev)
int PS2CamSelectInterface(CAMERA_DEVICE *dev, int interface, int altSetting)
int PS2CamSetDeviceBandwidth(int device_id, char bandwidth)
void camResetUsb(CAMERA_DEVICE *dev)
int PS2CamGetIRXVersion(void)
void camDisableSystem(CAMERA_DEVICE *dev)
void camEnableSystem(CAMERA_DEVICE *dev)
void camTurnOnRedLed(CAMERA_DEVICE *dev)
void camSetUsbInit(CAMERA_DEVICE *dev)
int PS2CamSetDeviceConfig(int handle, void *config)
int PS2CamOpenDevice(int device_index)
void PS2CamGetDeviceSring(CAMERA_DEVICE *dev, int index, char *str, int strmax)
int PS2CamReadPacket(int device_id)
void camSetUsbWork(CAMERA_DEVICE *dev)
int setReg8(CAMERA_DEVICE *dev, unsigned char reg_id, unsigned char value)