PS2SDK
PS2 Homebrew Libraries
|
#include <types.h>
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 |
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) |
PS2Camera driver irx
Definition in file ps2cam.h.
struct PS2CAM_DEVICE_INFO |
Definition at line 104 of file ps2cam_rpc.h.
struct CAMERA_DEVICE |
struct PS2CAM_DEVICE_HANDLE |
struct PS2CAM_DEVICE_CONFIG |
Definition at line 121 of file ps2cam_rpc.h.
struct EYETOY_FRAME_HEAD |
Definition at line 77 of file ps2cam_rpc.h.
#define PS2CAM_RPC_SETDEVBANDWIDTH 47 |
#define PS2CAM_PROD_EYETOY3 0x0156 |
#define PS2CAM_PROD_VISUALSTREAM 0x8519 |
#define CAM_STATUS_CONNECTEDREADY 2 |
#define CAM_ERROR_NODEVICE -(24) |
#define CAM_ERROR_MAXHANDLE -(27) |
#define camSetDIVIDER | ( | p, | |
hdiv, | |||
en_lpf, | |||
vdiv, | |||
en_sa | |||
) |
void rpcMainThread | ( | void * | param | ) |
Definition at line 128 of file ps2mouse.c.
void * rpcCommandHandler | ( | u32 | command, |
void * | buffer, | ||
int | size | ||
) |
Definition at line 757 of file ps2mouse.c.
int PS2CamInitDriver | ( | void | ) |
int PS2CamProbe | ( | int | devId | ) |
check if the device is pluged in
Definition at line 143 of file ps2cam.c.
References count, PS2CAM_PROD_EYETOY, PS2CAM_PROD_EYETOY2, PS2CAM_PROD_EYETOY3, PS2CAM_PROD_EYETOY4, PS2CAM_PROD_VISUALSTREAM, PS2CAM_VEND_DLINK, and PS2CAM_VEND_SONY.
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.
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.
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().
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().
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().
void PS2CamInitializeNewDevice | ( | CAMERA_DEVICE * | cam | ) |
called after a camera is accepted
Definition at line 382 of file ps2cam.c.
References CAM_STATUS_CONNECTEDREADY, camStartStream(), PS2CamGetDeviceSring(), PS2CamSelectInterface(), PS2CamSetDeviceConfiguration(), and PS2CamSetDeviceDefaults().
Referenced by PS2CamConnect().
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().
int PS2CamGetIRXVersion | ( | void | ) |
Return the current version of the 'ps2cam.irx'
Definition at line 86 of file ps2cam_rpc.c.
int PS2CamInit | ( | int | mode | ) |
initalize the camera driver. must be called 1st
Definition at line 37 of file ps2cam_rpc.c.
int PS2CamGetDeviceCount | ( | void | ) |
get the number of compatible camera connected
Definition at line 102 of file ps2cam_rpc.c.
References count.
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.
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.
int PS2CamGetDeviceInfo | ( | int | handle, |
int * | info | ||
) |
get information about the compatible device
Definition at line 1113 of file ps2cam.c.
References CAM_ERROR_BADHANDLE, CAM_ERROR_DISCONNECTED, PS2CAM_DEVICE_INFO::model, PS2CAM_DEVICE_INFO::product_id, PS2CAM_DEVICE_INFO::product_name, PS2CAM_PROD_EYETOY, PS2CAM_PROD_EYETOY2, PS2CamGetDeviceSring(), PS2CAM_DEVICE_INFO::ssize, PS2CAM_DEVICE_INFO::vendor_id, and PS2CAM_DEVICE_INFO::vendor_name.
int setReg8 | ( | CAMERA_DEVICE * | dev, |
unsigned char | reg_id, | ||
unsigned char | value | ||
) |
Set the value in a 8bit register
Definition at line 580 of file ps2cam.c.
References CAMERA_DEVICE::controll, PS2CamCallback(), and USB_RC_OK.
Referenced by camEnableSystem(), camResetDevice(), camResetUsb(), camSetUsbInit(), camSetUsbWork(), camStartStream(), PS2CamSetDeviceBandwidth(), PS2CamSetDeviceConfig(), PS2CamSetDeviceDefaults(), and setReg8Mask().
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().
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().
int setReg16 | ( | CAMERA_DEVICE * | dev, |
unsigned char | reg_id, | ||
unsigned short | value | ||
) |
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().
void camResetDevice | ( | CAMERA_DEVICE * | dev | ) |
Reset the eyetoy
Definition at line 743 of file ps2cam.c.
References setReg8().
Referenced by PS2CamSetDeviceDefaults().
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 | ) |
Enable some setting that make the cam capture
Definition at line 778 of file ps2cam.c.
References setReg8().
Referenced by PS2CamSetDeviceDefaults().
void camDisableSystem | ( | CAMERA_DEVICE * | dev | ) |
void camResetUsb | ( | CAMERA_DEVICE * | dev | ) |
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().
void camSetUsbWork | ( | CAMERA_DEVICE * | dev | ) |
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().
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().
void camStartStream | ( | CAMERA_DEVICE * | dev | ) |
restart stream
Definition at line 837 of file ps2cam.c.
References setReg8().
Referenced by PS2CamInitializeNewDevice(), PS2CamSetDeviceConfig(), and PS2CamSetDeviceDefaults().
void camStopStream | ( | CAMERA_DEVICE * | dev | ) |
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.
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.
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.
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().
int PS2CamSetDeviceConfig | ( | int | handle, |
void * | config | ||
) |
activate setting that is in config struct
Definition at line 1353 of file ps2cam.c.
References CAM_ERROR_BADHANDLE, CAM_ERROR_DEVNOTREADY, CAM_ERROR_DISCONNECTED, camStartStream(), PS2CAM_DEVICE_CONFIG::framerate, PS2CAM_DEVICE_CONFIG::h_divider, PS2CAM_DEVICE_CONFIG::height, PS2CAM_DEVICE_CONFIG::mask, setReg8(), PS2CAM_DEVICE_CONFIG::v_divider, PS2CAM_DEVICE_CONFIG::width, PS2CAM_DEVICE_CONFIG::x_offset, and PS2CAM_DEVICE_CONFIG::y_offset.