vitasdk
Documentation of the vitasdk
usbd.h File Reference

Go to the source code of this file.

Data Structures

struct  SceUsbdDriver
 
struct  SceUsbdCompositeDriver
 
struct  SceUsbdDeviceRequest
 
struct  ksceUsbdIsochPswLen
 
struct  ksceUsbdIsochTransfer
 

Macros

#define SCE_USBD_PROBE_SUCCEEDED   (0)
 
#define SCE_USBD_PROBE_FAILED   (-1)
 
#define SCE_USBD_ATTACH_SUCCEEDED   (0)
 
#define SCE_USBD_ATTACH_FAILED   (-1)
 
#define SCE_USBD_DETACH_SUCCEEDED   (0)
 
#define SCE_USBD_DETACH_FAILED   (-1)
 
#define SCE_USBD_MAX_LS_CONTROL_PACKET_SIZE   8
 
#define SCE_USBD_MAX_FS_CONTROL_PACKET_SIZE   64
 
#define SCE_USBD_MAX_ISOCHRONOUS_PACKET_SIZE   1023
 
#define SCE_USBD_MAX_LS_INTERRUPT_PACKET_SIZE   8
 
#define SCE_USBD_MAX_FS_INTERRUPT_PACKET_SIZE   64
 
#define SCE_USBD_MAX_BULK_PACKET_SIZE   64
 
#define SCE_USBD_FEATURE_ENDPOINT_HALT   0x00
 
#define SCE_USBD_FEATURE_DEVICE_REMOTE_WAKEUP   0x01
 
#define SCE_USBD_DEVICE_SPEED_LS   (0)
 
#define SCE_USBD_DEVICE_SPEED_FS   (1)
 
#define SCE_USBD_DEVICE_SPEED_HS   (2)
 
#define ksceUsbdSetConfiguration(pid, config, cb, arg)
 
#define ksceUsbdClearDeviceFeature(pid, fs, cb, arg)
 
#define ksceUsbdClearInterfaceFeature(pid, fs, interface, cb, arg)
 
#define ksceUsbdClearEndpointFeature(pid, fs, endpoint, cb, arg)
 
#define ksceUsbdGetConfiguration(pid, ptr, cb, arg)
 
#define ksceUsbdGetDescriptor(pid, type, index, lang_id, ptr, len, cb, arg)
 
#define ksceUsbdGetInterface(pid, interface, ptr, cb, arg)
 
#define ksceUsbdGetDeviceStatus(pid, ptr, cb, arg)
 
#define ksceUsbdGetInterfaceStatus(pid, interface, ptr, cb, arg)
 
#define ksceUsbdGetEndpointStatus(pid, endpoint, ptr, cb, arg)
 
#define ksceUsbdSetAddress(pid, address, cb, arg)
 
#define ksceUsbdSetConfiguration(pid, config, cb, arg)
 
#define ksceUsbdSetDeviceDescriptor(pid, type, index, lang_id, ptr, len, cb, arg)
 
#define ksceUsbdSetInterfaceDescriptor(pid, type, index, lang_id, ptr, len, cb, arg)
 
#define ksceUsbdSetEndpointDescriptor(pid, type, index, lang_id, ptr, len, cb, arg)
 
#define ksceUsbdSetDeviceFeature(pid, fs, cb, arg)
 
#define ksceUsbdSetInterfaceFeature(pid, fs, interface, cb, arg)
 
#define ksceUsbdSetEndpointFeature(pid, fs, endpoint, cb, arg)
 
#define ksceUsbdSetInterface(pid, interface, alt_setting, cb, arg)
 
#define ksceUsbdSynchFrame(pid, endpoint, pfn, cb, arg)
 
#define OHCI_CC_NO_ERROR   0x0
 
#define OHCI_CC_CRC   0x1
 
#define OHCI_CC_BIT_STUFFING   0x2
 
#define OHCI_CC_DATA_TOGGLE_MISMATCH   0x3
 
#define OHCI_CC_STALL   0x4
 
#define OHCI_CC_DEVICE_NOT_RESPONDING   0x5
 
#define OHCI_CC_PID_CHECK_FAILURE   0x6
 
#define OHCI_CC_UNEXPECTED_PID   0x7
 
#define OHCI_CC_DATA_OVERRUN   0x8
 
#define OHCI_CC_DATA_UNDERRUN   0x9
 
#define OHCI_CC_BUFFER_OVERRUN   0xc
 
#define OHCI_CC_BUFFER_UNDERRUN   0xd
 
#define OHCI_CC_NOT_ACCESSED1   0xe
 
#define OHCI_CC_NOT_ACCESSED2   0xf
 
#define EHCI_CC_MISSED_MICRO_FRAME   0x10
 
#define EHCI_CC_XACT   0x20
 
#define EHCI_CC_BABBLE   0x30
 
#define EHCI_CC_DATABUF   0x40
 
#define EHCI_CC_HALTED   0x50
 
#define USBD_CC_NOERR   0x0
 
#define USBD_CC_MISSED_MICRO_FRAME   0x1
 
#define USBD_CC_XACTERR   0x2
 
#define USBD_CC_BABBLE   0x4
 
#define USBD_CC_DATABUF   0x8
 

Typedefs

typedef void(* ksceUsbdDoneCallback) (int32_t result, int32_t count, void *arg)
 
typedef void(* ksceUsbdIsochDoneCallback) (int32_t result, ksceUsbdIsochTransfer *req, void *arg)
 

Enumerations

enum  SceUsbdReqtype {
  SCE_USBD_REQTYPE_DIR_BITS = 0x80 , SCE_USBD_REQTYPE_DIR_TO_DEVICE = 0x00 , SCE_USBD_REQTYPE_DIR_TO_HOST = 0x80 , SCE_USBD_REQTYPE_TYPE_BITS = 0x60 ,
  SCE_USBD_REQTYPE_TYPE_STANDARD = 0x00 , SCE_USBD_REQTYPE_TYPE_CLASS = 0x20 , SCE_USBD_REQTYPE_TYPE_VENDOR = 0x40 , SCE_USBD_REQTYPE_TYPE_RESERVED = 0x60 ,
  SCE_USBD_REQTYPE_RECIP_BITS = 0x1f , SCE_USBD_REQTYPE_RECIP_DEVICE = 0x00 , SCE_USBD_REQTYPE_RECIP_INTERFACE = 0x01 , SCE_USBD_REQTYPE_RECIP_ENDPOINT = 0x02 ,
  SCE_USBD_REQTYPE_RECIP_OTHER = 0x03
}
 
enum  SceUsbdRequest {
  SCE_USBD_REQUEST_GET_STATUS = 0x00 , SCE_USBD_REQUEST_CLEAR_FEATURE = 0x01 , SCE_USBD_REQUEST_SET_FEATURE = 0x03 , SCE_USBD_REQUEST_SET_ADDRESS = 0x05 ,
  SCE_USBD_REQUEST_GET_DESCRIPTOR = 0x06 , SCE_USBD_REQUEST_SET_DESCRIPTOR = 0x07 , SCE_USBD_REQUEST_GET_CONFIGURATION = 0x08 , SCE_USBD_REQUEST_SET_CONFIGURATION = 0x09 ,
  SCE_USBD_REQUEST_GET_INTERFACE = 0x0a , SCE_USBD_REQUEST_SET_INTERFACE = 0x0b , SCE_USBD_REQUEST_SYNCH_FRAME = 0x0c
}
 

Functions

 VITASDK_BUILD_ASSERT_EQ (0x10, SceUsbdDriver)
 
 VITASDK_BUILD_ASSERT_EQ (0x10, SceUsbdCompositeDriver)
 
 VITASDK_BUILD_ASSERT_EQ (8, SceUsbdDeviceRequest)
 
 VITASDK_BUILD_ASSERT_EQ (2, ksceUsbdIsochPswLen)
 
 VITASDK_BUILD_ASSERT_EQ (0x1C, ksceUsbdIsochTransfer)
 
int ksceUsbdRegisterDriver (const SceUsbdDriver *driver)
 Register USB driver. More...
 
int ksceUsbdRegisterCompositeLdd (const SceUsbdCompositeDriver *driver)
 Register USB driver for composite devices. More...
 
int ksceUsbdUnregisterDriver (const SceUsbdDriver *driver)
 De-register USB driver. More...
 
int ksceUsbdUnregisterCompositeLdd (const SceUsbdCompositeDriver *driver)
 De-register USB driver for composite devices. More...
 
void * ksceUsbdScanStaticDescriptor (SceUID device_id, void *start, SceUsbdDescriptorType type)
 Return usb descriptor. More...
 
SceUID ksceUsbdOpenPipe (int device_id, SceUsbdEndpointDescriptor *endpoint)
 Open communication pipe to endpoint. More...
 
int ksceUsbdClosePipe (SceUID pipe_id)
 Close communication pipe to endpoint. More...
 
int ksceUsbdControlTransfer (SceUID pipe_id, const SceUsbdDeviceRequest *req, unsigned char *buffer, ksceUsbdDoneCallback cb, void *user_data)
 Transfer data to/from endpoint. More...
 
int ksceUsbdInterruptTransfer (SceUID pipe_id, unsigned char *buffer, SceSize length, ksceUsbdDoneCallback cb, void *user_data)
 Transfer data to/from interrupt endpoint. More...
 
int ksceUsbdIsochronousTransfer (SceUID pipe_id, ksceUsbdIsochTransfer *transfer, ksceUsbdIsochDoneCallback cb, void *user_data)
 Transfer isochronous data to/from endpoint. More...
 
int ksceUsbdBulkTransfer (SceUID pipe_id, unsigned char *buffer, unsigned int length, ksceUsbdDoneCallback cb, void *user_data)
 Transfer data to/from endpoint. More...
 
int ksceUsbdBulkTransfer2 (int pipe_id, unsigned char *buffer, unsigned int length, ksceUsbdDoneCallback cb, void *user_data)
 Transfer data to/from endpoint. More...
 
int ksceUsbdGetDeviceLocation (SceUID device_id, uint8_t *location)
 Get device location. More...
 
int ksceUsbdSuspend (int port)
 
int ksceUsbdSuspendPhase2 (int port, int flag)
 
int ksceUsbdResume (int port)
 
int ksceUsbdHostStop (int port)
 
int ksceUsbdHostStart (int port)
 
int ksceUsbdGetDeviceSpeed (int device_id, uint8_t *speed)
 Get device speed. More...
 
int ksceUsbd_05073925 (SceUID device_id, int *unk1, int *unk2)
 
int ksceUsbd_7938DAC7 (SceUID pipe_id)