PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
ps2cam_rpc.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  EYETOY_FRAME_HEAD
 
struct  PS2CAM_DEVICE_INFO
 
struct  PS2CAM_DEVICE_CONFIG
 

Macros

#define PS2CAM_RPC_GETIRXVERSION   40
 
#define PS2CAM_RPC_INITIALIZE   41
 
#define PS2CAM_RPC_GETDEVCOUNT   42
 
#define PS2CAM_RPC_OPENDEVICE   43
 
#define PS2CAM_RPC_CLOSEDEVICE   44
 
#define PS2CAM_RPC_GETDEVSTATUS   45
 
#define PS2CAM_RPC_GETDEVINFO   46
 
#define PS2CAM_RPC_SETDEVBANDWIDTH   47
 
#define PS2CAM_RPC_READPACKET   48
 
#define PS2CAM_RPC_SETLEDMODE   49
 
#define PS2CAM_RPC_SETDEVCONFIG   50
 
#define PS2CAM_LED_MODE_OFF   0
 
#define PS2CAM_LED_MODE_ON   1
 
#define CAM_STATUS_NOTCONNECTED   0
 
#define CAM_STATUS_CONNECTED   1
 
#define CAM_STATUS_CONNECTEDREADY   2
 
#define CAM_CONFIG_MASK_DIMENSION   0x00000001
 
#define CAM_CONFIG_MASK_OFFSET   0x00000002
 
#define CAM_CONFIG_MASK_DIVIDER   0x00000004
 
#define CAM_CONFIG_MASK_FRAMERATE   0x00000008
 
#define CAM_ERROR_NONE   (00)
 
#define CAM_ERROR_NOTINIT   -(20)
 
#define CAM_ERROR_INVALIDDEVICE   -(21)
 
#define CAM_ERROR_COMMUNKNOWN   -(22)
 
#define CAM_ERROR_DEVNOTREADY   -(23)
 
#define CAM_ERROR_NODEVICE   -(24)
 
#define CAM_ERROR_BADRANGE   -(25)
 
#define CAM_ERROR_UNKNOWN   -(26)
 
#define CAM_ERROR_MAXHANDLE   -(27)
 
#define CAM_ERROR_BADHANDLE   -(28)
 
#define CAM_ERROR_DISCONNECTED   -(29)
 

Functions

int PS2CamInit (int mode)
 
int PS2CamGetIRXVersion (void)
 
int PS2CamGetDeviceCount (void)
 
int PS2CamOpenDevice (int device_index)
 
int PS2CamCloseDevice (int handle)
 
int PS2CamGetDeviceStatus (int handle)
 
int PS2CamGetDeviceInfo (int handle, PS2CAM_DEVICE_INFO *info)
 
int PS2CamSetDeviceBandwidth (int handle, char bandwidth)
 
int PS2CamReadPacket (int handle)
 
int PS2CamSetLEDMode (int handle, int mode)
 
int PS2CamSetDeviceConfig (int handle, PS2CAM_DEVICE_CONFIG *cfg)
 
int PS2CamExtractFrame (int handle, char *buffer, int bufsize)
 

Detailed Description

PS2Camera EE-IOP RPC CALLS

Definition in file ps2cam_rpc.h.


Data Structure Documentation

◆ EYETOY_FRAME_HEAD

struct EYETOY_FRAME_HEAD

Definition at line 77 of file ps2cam_rpc.h.

Data Fields
unsigned char magic1

0x01

unsigned char magic2

0xff

unsigned char magic3

0xff

unsigned char type

0x51:EOF 0x50:SOF

unsigned char uk1
unsigned char uk2
unsigned char uk3
unsigned char uk4
unsigned char uk5
unsigned char frame

0x01:framehead+no data, 0x00:framehead+data

unsigned char uk6
unsigned char uk7
unsigned char uk8
unsigned char uk9
unsigned char Lo

file size Lo byte (only in EOF)

unsigned char Hi

file size Hi byte (only in EOF)

◆ PS2CAM_DEVICE_INFO

struct PS2CAM_DEVICE_INFO

Definition at line 104 of file ps2cam_rpc.h.

Data Fields
unsigned int ssize

sizeof this struct

unsigned short vendor_id

vendor id extracted from device

unsigned short product_id

product id extracted from device

unsigned char vendor_name[32]

vender string

unsigned char product_name[32]

product string

unsigned char model[16]

device model

◆ PS2CAM_DEVICE_CONFIG

struct PS2CAM_DEVICE_CONFIG

Definition at line 121 of file ps2cam_rpc.h.

Data Fields
unsigned int ssize

structure size

unsigned int mask

CAM_CONFIG_MASK.....

unsigned short width

camera horizontal resolution

unsigned short height

camera vertical resolution

unsigned short x_offset

x offset of camera image

unsigned short y_offset

y offset of camera image

unsigned char h_divider

Horizontal Divider

unsigned char v_divider

Vertical Divider

unsigned short framerate

framerate

Macro Definition Documentation

◆ PS2CAM_RPC_GETIRXVERSION

#define PS2CAM_RPC_GETIRXVERSION   40

get irx version

Definition at line 16 of file ps2cam_rpc.h.

◆ PS2CAM_RPC_INITIALIZE

#define PS2CAM_RPC_INITIALIZE   41

PS2CamInit

Definition at line 18 of file ps2cam_rpc.h.

◆ PS2CAM_RPC_GETDEVCOUNT

#define PS2CAM_RPC_GETDEVCOUNT   42

PS2CamGetDeviceCount

Definition at line 20 of file ps2cam_rpc.h.

◆ PS2CAM_RPC_OPENDEVICE

#define PS2CAM_RPC_OPENDEVICE   43

Definition at line 21 of file ps2cam_rpc.h.

◆ PS2CAM_RPC_CLOSEDEVICE

#define PS2CAM_RPC_CLOSEDEVICE   44

Definition at line 22 of file ps2cam_rpc.h.

◆ PS2CAM_RPC_GETDEVSTATUS

#define PS2CAM_RPC_GETDEVSTATUS   45

PS2CamGetStatus

Definition at line 24 of file ps2cam_rpc.h.

◆ PS2CAM_RPC_GETDEVINFO

#define PS2CAM_RPC_GETDEVINFO   46

PS2CamGetInfo

Definition at line 26 of file ps2cam_rpc.h.

◆ PS2CAM_RPC_SETDEVBANDWIDTH

#define PS2CAM_RPC_SETDEVBANDWIDTH   47

PS2CamSetDeviceBandwidth

Definition at line 28 of file ps2cam_rpc.h.

◆ PS2CAM_RPC_READPACKET

#define PS2CAM_RPC_READPACKET   48

PS2CamReadPacketCOMMAND

Definition at line 30 of file ps2cam_rpc.h.

◆ PS2CAM_RPC_SETLEDMODE

#define PS2CAM_RPC_SETLEDMODE   49

PS2CamSetLEDMode

Definition at line 32 of file ps2cam_rpc.h.

◆ PS2CAM_RPC_SETDEVCONFIG

#define PS2CAM_RPC_SETDEVCONFIG   50

Definition at line 34 of file ps2cam_rpc.h.

◆ PS2CAM_LED_MODE_OFF

#define PS2CAM_LED_MODE_OFF   0

Definition at line 37 of file ps2cam_rpc.h.

◆ PS2CAM_LED_MODE_ON

#define PS2CAM_LED_MODE_ON   1

Definition at line 38 of file ps2cam_rpc.h.

◆ CAM_STATUS_NOTCONNECTED

#define CAM_STATUS_NOTCONNECTED   0

device not connected

Definition at line 43 of file ps2cam_rpc.h.

◆ CAM_STATUS_CONNECTED

#define CAM_STATUS_CONNECTED   1

connected but initializing

Definition at line 45 of file ps2cam_rpc.h.

◆ CAM_STATUS_CONNECTEDREADY

#define CAM_STATUS_CONNECTEDREADY   2

connect & ready for commands

Definition at line 47 of file ps2cam_rpc.h.

◆ CAM_CONFIG_MASK_DIMENSION

#define CAM_CONFIG_MASK_DIMENSION   0x00000001

Definition at line 50 of file ps2cam_rpc.h.

◆ CAM_CONFIG_MASK_OFFSET

#define CAM_CONFIG_MASK_OFFSET   0x00000002

Definition at line 51 of file ps2cam_rpc.h.

◆ CAM_CONFIG_MASK_DIVIDER

#define CAM_CONFIG_MASK_DIVIDER   0x00000004

Definition at line 52 of file ps2cam_rpc.h.

◆ CAM_CONFIG_MASK_FRAMERATE

#define CAM_CONFIG_MASK_FRAMERATE   0x00000008

Definition at line 53 of file ps2cam_rpc.h.

◆ CAM_ERROR_NONE

#define CAM_ERROR_NONE   (00)

ok

Definition at line 57 of file ps2cam_rpc.h.

◆ CAM_ERROR_NOTINIT

#define CAM_ERROR_NOTINIT   -(20)

Definition at line 58 of file ps2cam_rpc.h.

◆ CAM_ERROR_INVALIDDEVICE

#define CAM_ERROR_INVALIDDEVICE   -(21)

Definition at line 59 of file ps2cam_rpc.h.

◆ CAM_ERROR_COMMUNKNOWN

#define CAM_ERROR_COMMUNKNOWN   -(22)

unknown command

Definition at line 61 of file ps2cam_rpc.h.

◆ CAM_ERROR_DEVNOTREADY

#define CAM_ERROR_DEVNOTREADY   -(23)

device not ready

Definition at line 63 of file ps2cam_rpc.h.

◆ CAM_ERROR_NODEVICE

#define CAM_ERROR_NODEVICE   -(24)

no compatible device connected

Definition at line 65 of file ps2cam_rpc.h.

◆ CAM_ERROR_BADRANGE

#define CAM_ERROR_BADRANGE   -(25)

a value was out of range

Definition at line 67 of file ps2cam_rpc.h.

◆ CAM_ERROR_UNKNOWN

#define CAM_ERROR_UNKNOWN   -(26)

unknown error

Definition at line 69 of file ps2cam_rpc.h.

◆ CAM_ERROR_MAXHANDLE

#define CAM_ERROR_MAXHANDLE   -(27)

out of free device handle(s)

Definition at line 71 of file ps2cam_rpc.h.

◆ CAM_ERROR_BADHANDLE

#define CAM_ERROR_BADHANDLE   -(28)

invalid device handle

Definition at line 73 of file ps2cam_rpc.h.

◆ CAM_ERROR_DISCONNECTED

#define CAM_ERROR_DISCONNECTED   -(29)

device was removed

Definition at line 75 of file ps2cam_rpc.h.

Function Documentation

◆ PS2CamInit()

int PS2CamInit ( int  mode)

initalize the camera driver. must be called 1st

Definition at line 37 of file ps2cam_rpc.c.

References PS2CAM_RPC_INITIALIZE, and PS2CamInit().

Referenced by PS2CamInit().

◆ PS2CamGetIRXVersion()

int PS2CamGetIRXVersion ( void  )

Return the current version of the 'ps2cam.irx'

Definition at line 86 of file ps2cam_rpc.c.

References PS2CAM_RPC_GETIRXVERSION, and PS2CamGetIRXVersion().

Referenced by PS2CamGetIRXVersion().

◆ PS2CamGetDeviceCount()

int PS2CamGetDeviceCount ( void  )

get the number of compatible camera connected

Definition at line 102 of file ps2cam_rpc.c.

References PS2CAM_RPC_GETDEVCOUNT, and PS2CamGetDeviceCount().

Referenced by PS2CamGetDeviceCount().

◆ PS2CamOpenDevice()

int PS2CamOpenDevice ( int  device_index)

open one of the compatible camera for reading

Definition at line 118 of file ps2cam_rpc.c.

References PS2CamOpenDevice().

Referenced by PS2CamOpenDevice().

◆ PS2CamCloseDevice()

int PS2CamCloseDevice ( int  handle)

close the device if it is no longer needed or disconnected

Definition at line 134 of file ps2cam_rpc.c.

References PS2CamCloseDevice().

Referenced by PS2CamCloseDevice().

◆ PS2CamGetDeviceStatus()

int PS2CamGetDeviceStatus ( int  handle)

get the status of the compatible camera

Definition at line 151 of file ps2cam_rpc.c.

References PS2CAM_RPC_GETDEVSTATUS, and PS2CamGetDeviceStatus().

Referenced by PS2CamGetDeviceStatus().

◆ PS2CamGetDeviceInfo()

int PS2CamGetDeviceInfo ( int  handle,
PS2CAM_DEVICE_INFO info 
)

Definition at line 170 of file ps2cam_rpc.c.

◆ PS2CamSetDeviceBandwidth()

int PS2CamSetDeviceBandwidth ( int  handle,
char  bandwidth 
)

before reading you must set the camera's bandwidth

Definition at line 194 of file ps2cam_rpc.c.

References PS2CAM_RPC_SETDEVBANDWIDTH, and PS2CamSetDeviceBandwidth().

Referenced by PS2CamSetDeviceBandwidth().

◆ PS2CamReadPacket()

int PS2CamReadPacket ( int  handle)

read some data from the camera based on bandwidth

Definition at line 216 of file ps2cam_rpc.c.

References PS2CAM_RPC_READPACKET, and PS2CamReadPacket().

Referenced by PS2CamReadPacket().

◆ PS2CamSetLEDMode()

int PS2CamSetLEDMode ( int  handle,
int  mode 
)

set the mode for the red led

Definition at line 251 of file ps2cam_rpc.c.

References PS2CAM_RPC_SETLEDMODE, and PS2CamSetLEDMode().

Referenced by PS2CamSetLEDMode().

◆ PS2CamSetDeviceConfig()

int PS2CamSetDeviceConfig ( int  handle,
PS2CAM_DEVICE_CONFIG cfg 
)

Definition at line 267 of file ps2cam_rpc.c.

◆ PS2CamExtractFrame()

int PS2CamExtractFrame ( int  handle,
char *  buffer,
int  bufsize 
)

Definition at line 284 of file ps2cam_rpc.c.