PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
ps2cam_rpc.h
Go to the documentation of this file.
1/*
2 PSX2 OpenSource Project
3 (C)2004-2005 Lion[PS2Dev]
4 (C)2004-2005 PS2Dev.org
5*/
6
12#ifndef __PS2CAM_RPC_H__
13#define __PS2CAM_RPC_H__
14
16#define PS2CAM_RPC_GETIRXVERSION 40
18#define PS2CAM_RPC_INITIALIZE 41
20#define PS2CAM_RPC_GETDEVCOUNT 42
21#define PS2CAM_RPC_OPENDEVICE 43
22#define PS2CAM_RPC_CLOSEDEVICE 44
24#define PS2CAM_RPC_GETDEVSTATUS 45
26#define PS2CAM_RPC_GETDEVINFO 46
28#define PS2CAM_RPC_SETDEVBANDWIDTH 47
30#define PS2CAM_RPC_READPACKET 48
32#define PS2CAM_RPC_SETLEDMODE 49
33
34#define PS2CAM_RPC_SETDEVCONFIG 50
35
36/* led modes */
37#define PS2CAM_LED_MODE_OFF 0
38#define PS2CAM_LED_MODE_ON 1
39//#define PS2CAM_LED_MODE_FLASH 2
40
41/* device status */
43#define CAM_STATUS_NOTCONNECTED 0
45#define CAM_STATUS_CONNECTED 1
47#define CAM_STATUS_CONNECTEDREADY 2
48
49/* used with PS2CAM_DEVICE_CONFIG->mask */
50#define CAM_CONFIG_MASK_DIMENSION 0x00000001
51#define CAM_CONFIG_MASK_OFFSET 0x00000002
52#define CAM_CONFIG_MASK_DIVIDER 0x00000004
53#define CAM_CONFIG_MASK_FRAMERATE 0x00000008
54
55/* error codes */
57#define CAM_ERROR_NONE (00)
58#define CAM_ERROR_NOTINIT -(20)
59#define CAM_ERROR_INVALIDDEVICE -(21)
61#define CAM_ERROR_COMMUNKNOWN -(22)
63#define CAM_ERROR_DEVNOTREADY -(23)
65#define CAM_ERROR_NODEVICE -(24)
67#define CAM_ERROR_BADRANGE -(25)
69#define CAM_ERROR_UNKNOWN -(26)
71#define CAM_ERROR_MAXHANDLE -(27)
73#define CAM_ERROR_BADHANDLE -(28)
75#define CAM_ERROR_DISCONNECTED -(29)
76
77typedef struct
78{
80 unsigned char magic1;
82 unsigned char magic2;
84 unsigned char magic3;
86 unsigned char type;
87 unsigned char uk1;
88 unsigned char uk2;
89 unsigned char uk3;
90 unsigned char uk4;
91 unsigned char uk5;
93 unsigned char frame;
94 unsigned char uk6;
95 unsigned char uk7;
96 unsigned char uk8;
97 unsigned char uk9;
99 unsigned char Lo;
101 unsigned char Hi;
103
104typedef struct
105{
107 unsigned int ssize;
109 unsigned short vendor_id;
111 unsigned short product_id;
113 unsigned char vendor_name[32];
115 unsigned char product_name[32];
117 unsigned char model[16];
119
120
121typedef struct
122{
124 unsigned int ssize;
126 unsigned int mask;
128 unsigned short width;
130 unsigned short height;
132 unsigned short x_offset;
134 unsigned short y_offset;
136 unsigned char h_divider;
138 unsigned char v_divider;
140 unsigned short framerate;
142
143//extern char campacket[]; //data is stored here when PS2CamReadPacket(...) is called. Still not used anywhere
144
145#ifdef __cplusplus
146extern "C" {
147#endif
148
149int PS2CamInit(int mode);
150int PS2CamGetIRXVersion(void);
151int PS2CamGetDeviceCount(void);
152int PS2CamOpenDevice(int device_index);
153int PS2CamCloseDevice(int handle);
154int PS2CamGetDeviceStatus(int handle);
155int PS2CamGetDeviceInfo(int handle, PS2CAM_DEVICE_INFO *info);
156int PS2CamSetDeviceBandwidth(int handle, char bandwidth);
157int PS2CamReadPacket(int handle);
158int PS2CamSetLEDMode(int handle, int mode);
159int PS2CamSetDeviceConfig(int handle, PS2CAM_DEVICE_CONFIG *cfg);
160
161int PS2CamExtractFrame(int handle, char *buffer, int bufsize);
162
163#ifdef __cplusplus
164}
165#endif
166
167#endif /* __PS2CAM_RPC_H__ */
unsigned short framerate
Definition ps2cam_rpc.h:140
unsigned short x_offset
Definition ps2cam_rpc.h:132
unsigned short width
Definition ps2cam_rpc.h:128
unsigned char v_divider
Definition ps2cam_rpc.h:138
unsigned short vendor_id
Definition ps2cam_rpc.h:109
unsigned int mask
Definition ps2cam_rpc.h:126
unsigned char magic3
Definition ps2cam_rpc.h:84
unsigned int ssize
Definition ps2cam_rpc.h:107
unsigned short product_id
Definition ps2cam_rpc.h:111
unsigned char magic1
Definition ps2cam_rpc.h:80
unsigned char Hi
Definition ps2cam_rpc.h:101
unsigned char type
Definition ps2cam_rpc.h:86
unsigned int ssize
Definition ps2cam_rpc.h:124
unsigned char h_divider
Definition ps2cam_rpc.h:136
unsigned char Lo
Definition ps2cam_rpc.h:99
unsigned char frame
Definition ps2cam_rpc.h:93
unsigned short y_offset
Definition ps2cam_rpc.h:134
unsigned char magic2
Definition ps2cam_rpc.h:82
unsigned short height
Definition ps2cam_rpc.h:130
int PS2CamReadPacket(int handle)
Definition ps2cam_rpc.c:216
int PS2CamGetDeviceCount(void)
Definition ps2cam_rpc.c:102
int PS2CamSetLEDMode(int handle, int mode)
Definition ps2cam_rpc.c:251
int PS2CamInit(int mode)
Definition ps2cam_rpc.c:37
int PS2CamCloseDevice(int handle)
Definition ps2cam_rpc.c:134
int PS2CamSetDeviceBandwidth(int handle, char bandwidth)
Definition ps2cam_rpc.c:194
int PS2CamGetIRXVersion(void)
Definition ps2cam_rpc.c:86
int PS2CamOpenDevice(int device_index)
Definition ps2cam_rpc.c:118
int PS2CamGetDeviceStatus(int handle)
Definition ps2cam_rpc.c:151