PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
ps2cam.h File Reference
#include <types.h>
+ Include dependency graph for ps2cam.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  PS2CAM_DEVICE_INFO
 
struct  CAMERA_DEVICE
 
struct  PS2CAM_DEVICE_HANDLE
 
struct  PS2CAM_DEVICE_CONFIG
 
struct  EYETOY_FRAME_HEAD
 

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_VEND_SONY   0x054C
 
#define PS2CAM_VEND_DLINK   0x05A9
 
#define PS2CAM_VEND_LOGITECH   0x0000
 
#define PS2CAM_PROD_EYETOY   0x0154
 
#define PS2CAM_PROD_EYETOY2   0x0155
 
#define PS2CAM_PROD_EYETOY3   0x0156
 
#define PS2CAM_PROD_EYETOY4   0x0157
 
#define PS2CAM_PROD_VISUALSTREAM   0x8519
 
#define EYETOY_IREG_H_SIZE   0x10
 
#define EYETOY_IREG_V_SIZE   0x11
 
#define EYETOY_IREG_X_OFFSETL   0x12
 
#define EYETOY_IREG_X_OFFSETH   0x13
 
#define EYETOY_IREG_Y_OFFSETL   0x14
 
#define EYETOY_IREG_Y_OFFSETH   0x15
 
#define EYETOY_IREG_DIVIDER   0x16
 
#define EYETOY_IREG_DFR   0x20
 
#define EYETOY_IREG_SR   0x21
 
#define EYETOY_IREG_FRAR   0x22
 
#define EYETOY_IREG_FORMAT   0x25
 
#define EYETOY_CREG_RESET0   0x50
 
#define EYETOY_CREG_RESET1   0x51
 
#define EYETOY_CREG_EN_CLK0   0x53
 
#define EYETOY_CREG_EN_CLK1   0x54
 
#define EYETOY_CREG_AUDIO_CLK   0x55
 
#define EYETOY_CREG_SNAPSHOT   0x57
 
#define EYETOY_CREG_PONOFF   0x58
 
#define EYETOY_CREG_CAMERA_CLK   0x59
 
#define EYETOY_CREG_CTRL1   0x5A
 
#define EYETOY_CREG_DEB_CLK   0x5B
 
#define EYETOY_CREG_CLK   0x5C
 
#define EYETOY_CREG_PWDN   0x5D
 
#define EYETOY_CREG_USR_DFN   0x5E
 
#define EYETOY_CREG_CTRL2   0x5F
 
#define EYETOY_CREG_INTERRUPT0   0x60
 
#define EYETOY_CREG_INTERRUPT1   0x61
 
#define EYETOY_CREG_MASK0   0x62
 
#define EYETOY_CREG_MASK1   0x63
 
#define EYETOY_CREG_VCI_R0   0x64
 
#define EYETOY_CREG_VCI_R1   0x65
 
#define EYETOY_CREG_ADC_CTRL   0x68
 
#define EYETOY_CREG_UC_CTRL   0x6D
 
#define EYETOY_GPIO_DATA_OUT0   0x71
 
#define EYETOY_GPIO_IO_CTRL0   0x72
 
#define EYETOY_ALTERNATE_SIZE_0   0x00
 
#define EYETOY_ALTERNATE_SIZE_384   0x01
 
#define EYETOY_ALTERNATE_SIZE_512   0x02
 
#define EYETOY_ALTERNATE_SIZE_768   0x03
 
#define EYETOY_ALTERNATE_SIZE_896   0x04
 
#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)
 
#define camSetDIVIDER(p, hdiv, en_lpf, vdiv, en_sa)
 

Functions

void rpcMainThread (void *param)
 
void * rpcCommandHandler (u32 command, void *buffer, int size)
 
int PS2CamInitDriver ()
 
int PS2CamProbe (int devId)
 
int PS2CamConnect (int devId)
 
int PS2CamDisconnect (int devId)
 
void PS2CamGetDeviceSring (CAMERA_DEVICE *dev, int index, char *str, int strmax)
 
void PS2CamCallback (int resultCode, int bytes, void *arg)
 
void PS2CamSetDeviceConfiguration (CAMERA_DEVICE *dev, int id)
 
void PS2CamInitializeNewDevice (CAMERA_DEVICE *argv)
 
void PS2CamSetDeviceDefaults (CAMERA_DEVICE *dev)
 
int PS2CamGetIRXVersion (void)
 
int PS2CamInit (int mode)
 
int PS2CamGetDeviceCount (void)
 
int PS2CamOpenDevice (int device_index)
 
int PS2CamCloseDevice (int handle)
 
int PS2CamGetDeviceInfo (int handle, int *info)
 
int setReg8 (CAMERA_DEVICE *dev, unsigned char reg_id, unsigned char value)
 
int getReg8 (CAMERA_DEVICE *dev, unsigned char reg_id, unsigned char *value)
 
int setReg8Mask (CAMERA_DEVICE *dev, unsigned char reg_id, unsigned char value, unsigned char mask)
 
int setReg16 (CAMERA_DEVICE *dev, unsigned char reg_id, unsigned short value)
 
int PS2CamSelectInterface (CAMERA_DEVICE *dev, int interface, int altSetting)
 
void camResetDevice (CAMERA_DEVICE *dev)
 
void camEnableAutoLaunch (CAMERA_DEVICE *dev)
 
void camDisableAutoLaunch (CAMERA_DEVICE *dev)
 
void camClearSnapButton (CAMERA_DEVICE *dev)
 
int camCheckAutoLaunch (CAMERA_DEVICE *dev)
 
void camEnableSystem (CAMERA_DEVICE *dev)
 
void camDisableSystem (CAMERA_DEVICE *dev)
 
void camResetUsb (CAMERA_DEVICE *dev)
 
void camSetUsbInit (CAMERA_DEVICE *dev)
 
void camSetUsbWork (CAMERA_DEVICE *dev)
 
void camTurnOnRedLed (CAMERA_DEVICE *dev)
 
void camTurnOffRedLed (CAMERA_DEVICE *dev)
 
void camBlockStream (CAMERA_DEVICE *dev)
 
void camStartStream (CAMERA_DEVICE *dev)
 
void camStopStream (CAMERA_DEVICE *dev)
 
int PS2CamReadPacket (int device_id)
 
int PS2CamGetDeviceStatus (int device_id)
 
int PS2CamSetDeviceBandwidth (int device_id, char bandwidth)
 
int PS2CamSetLEDMode (int device_id, int mode)
 
int PS2CamSetDeviceConfig (int handle, void *config)
 

Detailed Description

PS2Camera driver irx

Definition in file ps2cam.h.


Data Structure Documentation

◆ 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

◆ CAMERA_DEVICE

struct CAMERA_DEVICE

Definition at line 155 of file ps2cam.h.

Data Fields
int device_id
int config_id
int status
int bandwidth
int stream_pocket_size
int controll

controll endpoint

int stream

stream endpoint

int result

info extracted from callback

int bytes
void * arg

◆ PS2CAM_DEVICE_HANDLE

struct PS2CAM_DEVICE_HANDLE

Definition at line 174 of file ps2cam.h.

+ Collaboration diagram for PS2CAM_DEVICE_HANDLE:
Data Fields
int fd
int status
CAMERA_DEVICE * cam

◆ 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

◆ 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)

Macro Definition Documentation

◆ PS2CAM_RPC_GETIRXVERSION

#define PS2CAM_RPC_GETIRXVERSION   40

get irx version

Definition at line 19 of file ps2cam.h.

◆ PS2CAM_RPC_INITIALIZE

#define PS2CAM_RPC_INITIALIZE   41

PS2CamInit

Definition at line 21 of file ps2cam.h.

◆ PS2CAM_RPC_GETDEVCOUNT

#define PS2CAM_RPC_GETDEVCOUNT   42

PS2CamGetDeviceCount

Definition at line 23 of file ps2cam.h.

◆ PS2CAM_RPC_OPENDEVICE

#define PS2CAM_RPC_OPENDEVICE   43

Definition at line 24 of file ps2cam.h.

◆ PS2CAM_RPC_CLOSEDEVICE

#define PS2CAM_RPC_CLOSEDEVICE   44

Definition at line 25 of file ps2cam.h.

◆ PS2CAM_RPC_GETDEVSTATUS

#define PS2CAM_RPC_GETDEVSTATUS   45

PS2CamGetStatus

Definition at line 27 of file ps2cam.h.

◆ PS2CAM_RPC_GETDEVINFO

#define PS2CAM_RPC_GETDEVINFO   46

PS2CamGetInfo

Definition at line 29 of file ps2cam.h.

◆ PS2CAM_RPC_SETDEVBANDWIDTH

#define PS2CAM_RPC_SETDEVBANDWIDTH   47

PS2CamSetDeviceBandwidth

Definition at line 31 of file ps2cam.h.

◆ PS2CAM_RPC_READPACKET

#define PS2CAM_RPC_READPACKET   48

PS2CamReadPacketCOMMAND

Definition at line 33 of file ps2cam.h.

◆ PS2CAM_RPC_SETLEDMODE

#define PS2CAM_RPC_SETLEDMODE   49

PS2CamSetLEDMode

Definition at line 35 of file ps2cam.h.

◆ PS2CAM_RPC_SETDEVCONFIG

#define PS2CAM_RPC_SETDEVCONFIG   50

Definition at line 37 of file ps2cam.h.

◆ PS2CAM_VEND_SONY

#define PS2CAM_VEND_SONY   0x054C

Sony

Definition at line 41 of file ps2cam.h.

◆ PS2CAM_VEND_DLINK

#define PS2CAM_VEND_DLINK   0x05A9

D-Link

Definition at line 43 of file ps2cam.h.

◆ PS2CAM_VEND_LOGITECH

#define PS2CAM_VEND_LOGITECH   0x0000

Logitech

Definition at line 45 of file ps2cam.h.

◆ PS2CAM_PROD_EYETOY

#define PS2CAM_PROD_EYETOY   0x0154

SLEH-00030

Definition at line 49 of file ps2cam.h.

◆ PS2CAM_PROD_EYETOY2

#define PS2CAM_PROD_EYETOY2   0x0155

SLEH-00031

Definition at line 51 of file ps2cam.h.

◆ PS2CAM_PROD_EYETOY3

#define PS2CAM_PROD_EYETOY3   0x0156

SLEH-000?? rinco thinks its japan

Definition at line 53 of file ps2cam.h.

◆ PS2CAM_PROD_EYETOY4

#define PS2CAM_PROD_EYETOY4   0x0157

SLEH-000?? ,, ,, ,,

Definition at line 55 of file ps2cam.h.

◆ PS2CAM_PROD_VISUALSTREAM

#define PS2CAM_PROD_VISUALSTREAM   0x8519

D-Link VisualStream DSB-C310

Definition at line 58 of file ps2cam.h.

◆ EYETOY_IREG_H_SIZE

#define EYETOY_IREG_H_SIZE   0x10

Definition at line 61 of file ps2cam.h.

◆ EYETOY_IREG_V_SIZE

#define EYETOY_IREG_V_SIZE   0x11

Definition at line 62 of file ps2cam.h.

◆ EYETOY_IREG_X_OFFSETL

#define EYETOY_IREG_X_OFFSETL   0x12

Definition at line 63 of file ps2cam.h.

◆ EYETOY_IREG_X_OFFSETH

#define EYETOY_IREG_X_OFFSETH   0x13

Definition at line 64 of file ps2cam.h.

◆ EYETOY_IREG_Y_OFFSETL

#define EYETOY_IREG_Y_OFFSETL   0x14

Definition at line 65 of file ps2cam.h.

◆ EYETOY_IREG_Y_OFFSETH

#define EYETOY_IREG_Y_OFFSETH   0x15

Definition at line 66 of file ps2cam.h.

◆ EYETOY_IREG_DIVIDER

#define EYETOY_IREG_DIVIDER   0x16

Definition at line 67 of file ps2cam.h.

◆ EYETOY_IREG_DFR

#define EYETOY_IREG_DFR   0x20

Definition at line 68 of file ps2cam.h.

◆ EYETOY_IREG_SR

#define EYETOY_IREG_SR   0x21

Definition at line 69 of file ps2cam.h.

◆ EYETOY_IREG_FRAR

#define EYETOY_IREG_FRAR   0x22

Definition at line 70 of file ps2cam.h.

◆ EYETOY_IREG_FORMAT

#define EYETOY_IREG_FORMAT   0x25

Definition at line 71 of file ps2cam.h.

◆ EYETOY_CREG_RESET0

#define EYETOY_CREG_RESET0   0x50

Definition at line 73 of file ps2cam.h.

◆ EYETOY_CREG_RESET1

#define EYETOY_CREG_RESET1   0x51

Definition at line 74 of file ps2cam.h.

◆ EYETOY_CREG_EN_CLK0

#define EYETOY_CREG_EN_CLK0   0x53

Definition at line 75 of file ps2cam.h.

◆ EYETOY_CREG_EN_CLK1

#define EYETOY_CREG_EN_CLK1   0x54

Definition at line 76 of file ps2cam.h.

◆ EYETOY_CREG_AUDIO_CLK

#define EYETOY_CREG_AUDIO_CLK   0x55

Definition at line 77 of file ps2cam.h.

◆ EYETOY_CREG_SNAPSHOT

#define EYETOY_CREG_SNAPSHOT   0x57

Definition at line 78 of file ps2cam.h.

◆ EYETOY_CREG_PONOFF

#define EYETOY_CREG_PONOFF   0x58

Definition at line 79 of file ps2cam.h.

◆ EYETOY_CREG_CAMERA_CLK

#define EYETOY_CREG_CAMERA_CLK   0x59

Definition at line 80 of file ps2cam.h.

◆ EYETOY_CREG_CTRL1

#define EYETOY_CREG_CTRL1   0x5A

Definition at line 81 of file ps2cam.h.

◆ EYETOY_CREG_DEB_CLK

#define EYETOY_CREG_DEB_CLK   0x5B

Definition at line 82 of file ps2cam.h.

◆ EYETOY_CREG_CLK

#define EYETOY_CREG_CLK   0x5C

Definition at line 83 of file ps2cam.h.

◆ EYETOY_CREG_PWDN

#define EYETOY_CREG_PWDN   0x5D

Definition at line 84 of file ps2cam.h.

◆ EYETOY_CREG_USR_DFN

#define EYETOY_CREG_USR_DFN   0x5E

Definition at line 85 of file ps2cam.h.

◆ EYETOY_CREG_CTRL2

#define EYETOY_CREG_CTRL2   0x5F

Definition at line 86 of file ps2cam.h.

◆ EYETOY_CREG_INTERRUPT0

#define EYETOY_CREG_INTERRUPT0   0x60

Definition at line 87 of file ps2cam.h.

◆ EYETOY_CREG_INTERRUPT1

#define EYETOY_CREG_INTERRUPT1   0x61

Definition at line 88 of file ps2cam.h.

◆ EYETOY_CREG_MASK0

#define EYETOY_CREG_MASK0   0x62

Definition at line 89 of file ps2cam.h.

◆ EYETOY_CREG_MASK1

#define EYETOY_CREG_MASK1   0x63

Definition at line 90 of file ps2cam.h.

◆ EYETOY_CREG_VCI_R0

#define EYETOY_CREG_VCI_R0   0x64

Definition at line 91 of file ps2cam.h.

◆ EYETOY_CREG_VCI_R1

#define EYETOY_CREG_VCI_R1   0x65

Definition at line 92 of file ps2cam.h.

◆ EYETOY_CREG_ADC_CTRL

#define EYETOY_CREG_ADC_CTRL   0x68

Definition at line 93 of file ps2cam.h.

◆ EYETOY_CREG_UC_CTRL

#define EYETOY_CREG_UC_CTRL   0x6D

Definition at line 94 of file ps2cam.h.

◆ EYETOY_GPIO_DATA_OUT0

#define EYETOY_GPIO_DATA_OUT0   0x71

Definition at line 97 of file ps2cam.h.

◆ EYETOY_GPIO_IO_CTRL0

#define EYETOY_GPIO_IO_CTRL0   0x72

Definition at line 98 of file ps2cam.h.

◆ EYETOY_ALTERNATE_SIZE_0

#define EYETOY_ALTERNATE_SIZE_0   0x00

xfer disable

Definition at line 102 of file ps2cam.h.

◆ EYETOY_ALTERNATE_SIZE_384

#define EYETOY_ALTERNATE_SIZE_384   0x01

Definition at line 103 of file ps2cam.h.

◆ EYETOY_ALTERNATE_SIZE_512

#define EYETOY_ALTERNATE_SIZE_512   0x02

Definition at line 104 of file ps2cam.h.

◆ EYETOY_ALTERNATE_SIZE_768

#define EYETOY_ALTERNATE_SIZE_768   0x03

Definition at line 105 of file ps2cam.h.

◆ EYETOY_ALTERNATE_SIZE_896

#define EYETOY_ALTERNATE_SIZE_896   0x04

Definition at line 106 of file ps2cam.h.

◆ CAM_STATUS_NOTCONNECTED

#define CAM_STATUS_NOTCONNECTED   0

device not connected

Definition at line 110 of file ps2cam.h.

◆ CAM_STATUS_CONNECTED

#define CAM_STATUS_CONNECTED   1

connected but initializing

Definition at line 112 of file ps2cam.h.

◆ CAM_STATUS_CONNECTEDREADY

#define CAM_STATUS_CONNECTEDREADY   2

connect & ready for commands

Definition at line 114 of file ps2cam.h.

◆ CAM_CONFIG_MASK_DIMENSION

#define CAM_CONFIG_MASK_DIMENSION   0x00000001

Definition at line 117 of file ps2cam.h.

◆ CAM_CONFIG_MASK_OFFSET

#define CAM_CONFIG_MASK_OFFSET   0x00000002

Definition at line 118 of file ps2cam.h.

◆ CAM_CONFIG_MASK_DIVIDER

#define CAM_CONFIG_MASK_DIVIDER   0x00000004

Definition at line 119 of file ps2cam.h.

◆ CAM_CONFIG_MASK_FRAMERATE

#define CAM_CONFIG_MASK_FRAMERATE   0x00000008

Definition at line 120 of file ps2cam.h.

◆ CAM_ERROR_NONE

#define CAM_ERROR_NONE   (00)

ok

Definition at line 124 of file ps2cam.h.

◆ CAM_ERROR_NOTINIT

#define CAM_ERROR_NOTINIT   -(20)

Definition at line 125 of file ps2cam.h.

◆ CAM_ERROR_INVALIDDEVICE

#define CAM_ERROR_INVALIDDEVICE   -(21)

Definition at line 126 of file ps2cam.h.

◆ CAM_ERROR_COMMUNKNOWN

#define CAM_ERROR_COMMUNKNOWN   -(22)

unknown command

Definition at line 128 of file ps2cam.h.

◆ CAM_ERROR_DEVNOTREADY

#define CAM_ERROR_DEVNOTREADY   -(23)

device not ready

Definition at line 130 of file ps2cam.h.

◆ CAM_ERROR_NODEVICE

#define CAM_ERROR_NODEVICE   -(24)

no compatible device connected

Definition at line 132 of file ps2cam.h.

◆ CAM_ERROR_BADRANGE

#define CAM_ERROR_BADRANGE   -(25)

a value was out of range

Definition at line 134 of file ps2cam.h.

◆ CAM_ERROR_UNKNOWN

#define CAM_ERROR_UNKNOWN   -(26)

unknown error

Definition at line 136 of file ps2cam.h.

◆ CAM_ERROR_MAXHANDLE

#define CAM_ERROR_MAXHANDLE   -(27)

out of free device handle(s)

Definition at line 138 of file ps2cam.h.

◆ CAM_ERROR_BADHANDLE

#define CAM_ERROR_BADHANDLE   -(28)

invalid device handle

Definition at line 140 of file ps2cam.h.

◆ CAM_ERROR_DISCONNECTED

#define CAM_ERROR_DISCONNECTED   -(29)

device was removed

Definition at line 142 of file ps2cam.h.

◆ camSetDIVIDER

#define camSetDIVIDER (   p,
  hdiv,
  en_lpf,
  vdiv,
  en_sa 
)
Value:
setReg8((p), EYETOY_IREG_DIVIDER, \
((unsigned char)(hdiv) <<0)|\
((unsigned char)(en_lpf) <<3)|\
((unsigned char)(vdiv) <<4)|\
((unsigned char)(en_sa) <<7));
int setReg8(CAMERA_DEVICE *dev, unsigned char reg_id, unsigned char value)
Definition ps2cam.c:580

Definition at line 230 of file ps2cam.h.

Function Documentation

◆ rpcMainThread()

void rpcMainThread ( void *  param)

Definition at line 128 of file ps2mouse.c.

◆ rpcCommandHandler()

void * rpcCommandHandler ( u32  command,
void *  buffer,
int  size 
)

Definition at line 757 of file ps2mouse.c.

◆ PS2CamInitDriver()

int PS2CamInitDriver ( void  )

Register This driver with usbd.irx

Definition at line 109 of file ps2cam.c.

◆ PS2CamProbe()

int PS2CamProbe ( int  devId)

◆ PS2CamConnect()

int PS2CamConnect ( int  devId)

this is executed when a compatible camera is detected

Definition at line 213 of file ps2cam.c.

References CAM_STATUS_CONNECTED, CAMERA_DEVICE::controll, PS2CamInitializeNewDevice(), and CAMERA_DEVICE::stream.

◆ PS2CamDisconnect()

int PS2CamDisconnect ( int  devId)

this is executed when a compatible camera is unplugged

Definition at line 297 of file ps2cam.c.

References CAM_STATUS_NOTCONNECTED, CAMERA_DEVICE::controll, and CAMERA_DEVICE::stream.

◆ PS2CamGetDeviceSring()

void PS2CamGetDeviceSring ( CAMERA_DEVICE dev,
int  index,
char *  str,
int  strmax 
)

Get a string descriptor from device

Definition at line 674 of file ps2cam.c.

References CAMERA_DEVICE::controll, PS2CamCallback(), and USB_RC_OK.

Referenced by PS2CamGetDeviceInfo(), and PS2CamInitializeNewDevice().

◆ PS2CamCallback()

void PS2CamCallback ( int  resultCode,
int  bytes,
void *  arg 
)

call back for most lowlevel usb funtions

Definition at line 570 of file ps2cam.c.

Referenced by getReg8(), PS2CamGetDeviceSring(), PS2CamSelectInterface(), PS2CamSetDeviceConfiguration(), and setReg8().

◆ PS2CamSetDeviceConfiguration()

void PS2CamSetDeviceConfiguration ( CAMERA_DEVICE dev,
int  id 
)

select the configuration for the device

Definition at line 429 of file ps2cam.c.

References CAMERA_DEVICE::controll, PS2CamCallback(), and USB_RC_OK.

Referenced by PS2CamInitializeNewDevice().

◆ PS2CamInitializeNewDevice()

void PS2CamInitializeNewDevice ( CAMERA_DEVICE cam)

◆ PS2CamSetDeviceDefaults()

void PS2CamSetDeviceDefaults ( CAMERA_DEVICE dev)

set the defaults for the camera

Definition at line 453 of file ps2cam.c.

References camEnableSystem(), camResetDevice(), camSetUsbInit(), camStartStream(), camTurnOffRedLed(), setReg8(), and setReg8Mask().

Referenced by PS2CamInitializeNewDevice().

◆ PS2CamGetIRXVersion()

int PS2CamGetIRXVersion ( void  )

Return the current version of the 'ps2cam.irx'

Definition at line 86 of file ps2cam_rpc.c.

◆ PS2CamInit()

int PS2CamInit ( int  mode)

initalize the camera driver. must be called 1st

Definition at line 37 of file ps2cam_rpc.c.

◆ PS2CamGetDeviceCount()

int PS2CamGetDeviceCount ( void  )

get the number of compatible camera connected

Definition at line 102 of file ps2cam_rpc.c.

References count.

◆ PS2CamOpenDevice()

int PS2CamOpenDevice ( int  device_index)

open one of the compatible camera for reading

Definition at line 118 of file ps2cam_rpc.c.

References CAM_ERROR_BADRANGE, CAM_ERROR_MAXHANDLE, CAM_ERROR_NODEVICE, and CAM_ERROR_UNKNOWN.

◆ 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 CAM_ERROR_BADHANDLE.

◆ PS2CamGetDeviceInfo()

◆ setReg8()

int setReg8 ( CAMERA_DEVICE dev,
unsigned char  reg_id,
unsigned char  value 
)

◆ getReg8()

int getReg8 ( CAMERA_DEVICE dev,
unsigned char  reg_id,
unsigned char *  value 
)

Read the camera's 8bit register and return the value

Definition at line 606 of file ps2cam.c.

References CAMERA_DEVICE::controll, PS2CamCallback(), and USB_RC_OK.

Referenced by setReg8Mask().

◆ setReg8Mask()

int setReg8Mask ( CAMERA_DEVICE dev,
unsigned char  reg_id,
unsigned char  value,
unsigned char  mask 
)

Set the value in a 8bit register using a mask

Definition at line 633 of file ps2cam.c.

References getReg8(), and setReg8().

Referenced by camDisableSystem(), camTurnOffRedLed(), camTurnOnRedLed(), and PS2CamSetDeviceDefaults().

◆ setReg16()

int setReg16 ( CAMERA_DEVICE dev,
unsigned char  reg_id,
unsigned short  value 
)

Definition at line 650 of file ps2cam.c.

◆ PS2CamSelectInterface()

int PS2CamSelectInterface ( CAMERA_DEVICE dev,
int  interface,
int  altSetting 
)

Select the interface and alternet settting to use

Definition at line 712 of file ps2cam.c.

References CAMERA_DEVICE::controll, PS2CamCallback(), and USB_RC_OK.

Referenced by PS2CamInitializeNewDevice(), and PS2CamSetDeviceBandwidth().

◆ camResetDevice()

void camResetDevice ( CAMERA_DEVICE dev)

Reset the eyetoy

Definition at line 743 of file ps2cam.c.

References setReg8().

Referenced by PS2CamSetDeviceDefaults().

◆ camEnableAutoLaunch()

void camEnableAutoLaunch ( CAMERA_DEVICE dev)

Definition at line 750 of file ps2cam.c.

◆ camDisableAutoLaunch()

void camDisableAutoLaunch ( CAMERA_DEVICE dev)

Definition at line 756 of file ps2cam.c.

◆ camClearSnapButton()

void camClearSnapButton ( CAMERA_DEVICE dev)

Definition at line 762 of file ps2cam.c.

◆ camCheckAutoLaunch()

int camCheckAutoLaunch ( CAMERA_DEVICE dev)

Definition at line 768 of file ps2cam.c.

◆ camEnableSystem()

void camEnableSystem ( CAMERA_DEVICE dev)

Enable some setting that make the cam capture

Definition at line 778 of file ps2cam.c.

References setReg8().

Referenced by PS2CamSetDeviceDefaults().

◆ camDisableSystem()

void camDisableSystem ( CAMERA_DEVICE dev)

Disable some stuff

Definition at line 790 of file ps2cam.c.

References setReg8Mask().

◆ camResetUsb()

void camResetUsb ( CAMERA_DEVICE dev)

This is just a reguler reset to jpeg stuff

Definition at line 797 of file ps2cam.c.

References setReg8().

◆ camSetUsbInit()

void camSetUsbInit ( CAMERA_DEVICE dev)

reset jpeg and clear the frame reg

Definition at line 805 of file ps2cam.c.

References setReg8().

Referenced by PS2CamSetDeviceDefaults().

◆ camSetUsbWork()

void camSetUsbWork ( CAMERA_DEVICE dev)

reset jpeg and set the frame default value

Definition at line 814 of file ps2cam.c.

References setReg8().

◆ camTurnOnRedLed()

void camTurnOnRedLed ( CAMERA_DEVICE dev)

turn on the red leg on the GPIO pin

Definition at line 823 of file ps2cam.c.

References setReg8Mask().

Referenced by PS2CamSetLEDMode().

◆ camTurnOffRedLed()

void camTurnOffRedLed ( CAMERA_DEVICE dev)

turn off the red leg on the GPIO pin

Definition at line 830 of file ps2cam.c.

References setReg8Mask().

Referenced by PS2CamSetDeviceDefaults(), and PS2CamSetLEDMode().

◆ camStartStream()

void camStartStream ( CAMERA_DEVICE dev)

restart stream

Definition at line 837 of file ps2cam.c.

References setReg8().

Referenced by PS2CamInitializeNewDevice(), PS2CamSetDeviceConfig(), and PS2CamSetDeviceDefaults().

◆ camStopStream()

void camStopStream ( CAMERA_DEVICE dev)

Definition at line 844 of file ps2cam.c.

◆ PS2CamReadPacket()

int PS2CamReadPacket ( int  handle)

read some data from the camera based on bandwidth

Definition at line 216 of file ps2cam_rpc.c.

References CAM_ERROR_BADHANDLE, CAM_ERROR_DEVNOTREADY, CAM_ERROR_DISCONNECTED, and EYETOY_ALTERNATE_SIZE_0.

◆ PS2CamGetDeviceStatus()

int PS2CamGetDeviceStatus ( int  handle)

get the status of the compatible camera

Definition at line 151 of file ps2cam_rpc.c.

References CAM_ERROR_BADHANDLE, and CAM_ERROR_DISCONNECTED.

◆ 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 CAM_ERROR_BADHANDLE, CAM_ERROR_DISCONNECTED, EYETOY_ALTERNATE_SIZE_0, PS2CamSelectInterface(), setReg8(), and CAMERA_DEVICE::stream.

◆ PS2CamSetLEDMode()

int PS2CamSetLEDMode ( int  handle,
int  mode 
)

set the mode for the red led

Definition at line 251 of file ps2cam_rpc.c.

References CAM_ERROR_BADHANDLE, CAM_ERROR_DEVNOTREADY, CAM_ERROR_DISCONNECTED, camTurnOffRedLed(), and camTurnOnRedLed().

◆ PS2CamSetDeviceConfig()