vitasdk
Documentation of the vitasdk

Detailed Description

Exports for Kernel.


Using this library in your project

Include the header file in your project:




Using this library in your project

Include the header file in your project:


Link the library to the executable:

SceUsbdForDriver_stub



Functions

 VITASDK_BUILD_ASSERT_EQ (0x12, SceUsbdDeviceDescriptor)
 
 VITASDK_BUILD_ASSERT_EQ (0xA, SceUsbdConfigurationDescriptor)
 
 VITASDK_BUILD_ASSERT_EQ (9, SceUsbdInterfaceDescriptor)
 
 VITASDK_BUILD_ASSERT_EQ (8, SceUsbdEndpointDescriptor)
 
 VITASDK_BUILD_ASSERT_EQ (2, SceUsbdStringDescriptor)
 
 VITASDK_BUILD_ASSERT_EQ (3, SceUsbdHidSubDescriptorInfo)
 
 VITASDK_BUILD_ASSERT_EQ (6, SceUsbdHidDescriptor)
 
struct SceUsbdDeviceAddress __attribute__ ((packed)) SceUsbdDeviceAddress
 
 VITASDK_BUILD_ASSERT_EQ (6, SceUsbdDeviceAddress)
 
 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)
 

Typedefs

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

Macros

#define SCE_USBD_CLASS_PER_INTERFACE   0x00
 
#define SCE_USBD_CLASS_AUDIO   0x01
 
#define SCE_USBD_CLASS_COMMUNICATIONS   0x02
 
#define SCE_USBD_CLASS_HID   0x03
 
#define SCE_USBD_CLASS_MONITOR   0x04
 
#define SCE_USBD_CLASS_PHYSICAL   0x05
 
#define SCE_USBD_CLASS_POWER   0x06
 
#define SCE_USBD_CLASS_PRINTER   0x07
 
#define SCE_USBD_CLASS_STORAGE   0x08
 
#define SCE_USBD_CLASS_HUB   0x09
 
#define SCE_USBD_CLASS_DATA   0x0a
 
#define SCE_USBD_CLASS_VENDOR_SPECIFIC   0xff
 
#define SCE_USBD_CONFIGURATION_RESERVED_ZERO   0x1f
 
#define SCE_USBD_CONFIGURATION_REMOTE_WAKEUP   0x20
 
#define SCE_USBD_CONFIGURATION_SELF_POWERED   0x40
 
#define SCE_USBD_CONFIGURATION_RESERVED_ONE   0x80
 
#define SCE_USBD_ENDPOINT_TRANSFER_TYPE_BITS   0x03
 
#define SCE_USBD_ENDPOINT_TRANSFER_TYPE_SHIFT   0
 
#define SCE_USBD_ENDPOINT_TRANSFER_TYPE_CONTROL   0x00
 
#define SCE_USBD_ENDPOINT_TRANSFER_TYPE_ISOCHRONOUS   0x01
 
#define SCE_USBD_ENDPOINT_TRANSFER_TYPE_BULK   0x02
 
#define SCE_USBD_ENDPOINT_TRANSFER_TYPE_INTERRUPT   0x03
 
#define SCE_USBD_ENDPOINT_NUMBER_BITS   0x1f
 
#define SCE_USBD_ENDPOINT_NUMBER_SHIFT   0
 
#define SCE_USBD_ENDPOINT_DIRECTION_BITS   0x80
 
#define SCE_USBD_ENDPOINT_DIRECTION_SHIFT   7
 
#define SCE_USBD_ENDPOINT_DIRECTION_OUT   0x00
 
#define SCE_USBD_ENDPOINT_DIRECTION_IN   0x80
 
#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 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 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
 

Data Structure Documentation

◆ SceUsbdDeviceDescriptor

struct SceUsbdDeviceDescriptor
Data Fields
uint8_t bLength
uint8_t bDescriptorType
uint16_t bcdUSB
uint8_t bDeviceClass
uint8_t bDeviceSubclass
uint8_t bDeviceProtocol
uint8_t bMaxPacketSize0
uint16_t idVendor
uint16_t idProduct
uint16_t bcdDevice
uint8_t iManufacturer
uint8_t iProduct
uint8_t iSerialNumber
uint8_t bNumConfigurations

◆ SceUsbdConfigurationDescriptor

struct SceUsbdConfigurationDescriptor
Data Fields
uint8_t bLength
uint8_t bDescriptorType
uint16_t wTotalLength
uint8_t bNumInterfaces
uint8_t bConfigurationValue
uint8_t iConfiguration
uint8_t bmAttributes
uint8_t MaxPower

◆ SceUsbdInterfaceDescriptor

struct SceUsbdInterfaceDescriptor
Data Fields
uint8_t bLength
uint8_t bDescriptorType
uint8_t bInterfaceNumber
uint8_t bAlternateSetting
uint8_t bNumEndpoints
uint8_t bInterfaceClass
uint8_t bInterfaceSubclass
uint8_t bInterfaceProtocol
uint8_t iInterface

◆ SceUsbdEndpointDescriptor

struct SceUsbdEndpointDescriptor
Data Fields
uint8_t bLength
uint8_t bDescriptorType
uint8_t bEndpointAddress
uint8_t bmAttributes
uint16_t wMaxPacketSize
uint8_t bInterval

◆ SceUsbdStringDescriptor

struct SceUsbdStringDescriptor
Data Fields
uint8_t bLength
uint8_t bDescriptorType
uint8_t bString[0]

◆ SceUsbdHidSubDescriptorInfo

struct SceUsbdHidSubDescriptorInfo
Data Fields
uint8_t bDescriptorType
uint8_t wDescriptorLength0
uint8_t wDescriptorLength1

◆ SceUsbdHidDescriptor

struct SceUsbdHidDescriptor
Data Fields
uint8_t bLength
uint8_t bDescriptorType
uint8_t bcdHID0
uint8_t bcdHID1
uint8_t bCountryCode
uint8_t bNumDescriptors
SceUsbdHidSubDescriptorInfo SubDescriptorInfo[0]

◆ SceUsbdDeviceAddress

struct SceUsbdDeviceAddress
Data Fields
unsigned int unk0
unsigned short unk1

◆ SceUsbdDriver

struct SceUsbdDriver

Data Fields

const char * name
 
int(* probe )(int device_id)
 
int(* attach )(int device_id)
 
int(* detach )(int device_id)
 

◆ SceUsbdCompositeDriver

struct SceUsbdCompositeDriver

Data Fields

const char * name
 
int(* probe )(int device_id, SceUsbdEndpointDescriptor *desc)
 
int(* attach )(int device_id)
 
int(* detach )(int device_id)
 

◆ SceUsbdDeviceRequest

struct SceUsbdDeviceRequest
Data Fields
uint8_t bmRequestType
uint8_t bRequest
uint16_t wValue
uint16_t wIndex
uint16_t wLength

◆ ksceUsbdIsochPswLen

struct ksceUsbdIsochPswLen
Data Fields
uint16_t len:12
uint16_t PSW:4

◆ ksceUsbdIsochTransfer

struct ksceUsbdIsochTransfer
Data Fields
void * buffer_base
int32_t relative_start_frame
int32_t num_packets
ksceUsbdIsochPswLen packets[8]

Macro Definition Documentation

◆ SCE_USBD_CLASS_PER_INTERFACE

#define SCE_USBD_CLASS_PER_INTERFACE   0x00

◆ SCE_USBD_CLASS_AUDIO

#define SCE_USBD_CLASS_AUDIO   0x01

◆ SCE_USBD_CLASS_COMMUNICATIONS

#define SCE_USBD_CLASS_COMMUNICATIONS   0x02

◆ SCE_USBD_CLASS_HID

#define SCE_USBD_CLASS_HID   0x03

◆ SCE_USBD_CLASS_MONITOR

#define SCE_USBD_CLASS_MONITOR   0x04

◆ SCE_USBD_CLASS_PHYSICAL

#define SCE_USBD_CLASS_PHYSICAL   0x05

◆ SCE_USBD_CLASS_POWER

#define SCE_USBD_CLASS_POWER   0x06

◆ SCE_USBD_CLASS_PRINTER

#define SCE_USBD_CLASS_PRINTER   0x07

◆ SCE_USBD_CLASS_STORAGE

#define SCE_USBD_CLASS_STORAGE   0x08

◆ SCE_USBD_CLASS_HUB

#define SCE_USBD_CLASS_HUB   0x09

◆ SCE_USBD_CLASS_DATA

#define SCE_USBD_CLASS_DATA   0x0a

◆ SCE_USBD_CLASS_VENDOR_SPECIFIC

#define SCE_USBD_CLASS_VENDOR_SPECIFIC   0xff

◆ SCE_USBD_CONFIGURATION_RESERVED_ZERO

#define SCE_USBD_CONFIGURATION_RESERVED_ZERO   0x1f

◆ SCE_USBD_CONFIGURATION_REMOTE_WAKEUP

#define SCE_USBD_CONFIGURATION_REMOTE_WAKEUP   0x20

◆ SCE_USBD_CONFIGURATION_SELF_POWERED

#define SCE_USBD_CONFIGURATION_SELF_POWERED   0x40

◆ SCE_USBD_CONFIGURATION_RESERVED_ONE

#define SCE_USBD_CONFIGURATION_RESERVED_ONE   0x80

◆ SCE_USBD_ENDPOINT_TRANSFER_TYPE_BITS

#define SCE_USBD_ENDPOINT_TRANSFER_TYPE_BITS   0x03

◆ SCE_USBD_ENDPOINT_TRANSFER_TYPE_SHIFT

#define SCE_USBD_ENDPOINT_TRANSFER_TYPE_SHIFT   0

◆ SCE_USBD_ENDPOINT_TRANSFER_TYPE_CONTROL

#define SCE_USBD_ENDPOINT_TRANSFER_TYPE_CONTROL   0x00

◆ SCE_USBD_ENDPOINT_TRANSFER_TYPE_ISOCHRONOUS

#define SCE_USBD_ENDPOINT_TRANSFER_TYPE_ISOCHRONOUS   0x01

◆ SCE_USBD_ENDPOINT_TRANSFER_TYPE_BULK

#define SCE_USBD_ENDPOINT_TRANSFER_TYPE_BULK   0x02

◆ SCE_USBD_ENDPOINT_TRANSFER_TYPE_INTERRUPT

#define SCE_USBD_ENDPOINT_TRANSFER_TYPE_INTERRUPT   0x03

◆ SCE_USBD_ENDPOINT_NUMBER_BITS

#define SCE_USBD_ENDPOINT_NUMBER_BITS   0x1f

◆ SCE_USBD_ENDPOINT_NUMBER_SHIFT

#define SCE_USBD_ENDPOINT_NUMBER_SHIFT   0

◆ SCE_USBD_ENDPOINT_DIRECTION_BITS

#define SCE_USBD_ENDPOINT_DIRECTION_BITS   0x80

◆ SCE_USBD_ENDPOINT_DIRECTION_SHIFT

#define SCE_USBD_ENDPOINT_DIRECTION_SHIFT   7

◆ SCE_USBD_ENDPOINT_DIRECTION_OUT

#define SCE_USBD_ENDPOINT_DIRECTION_OUT   0x00

◆ SCE_USBD_ENDPOINT_DIRECTION_IN

#define SCE_USBD_ENDPOINT_DIRECTION_IN   0x80

◆ SCE_USBD_PROBE_SUCCEEDED

#define SCE_USBD_PROBE_SUCCEEDED   (0)

◆ SCE_USBD_PROBE_FAILED

#define SCE_USBD_PROBE_FAILED   (-1)

◆ SCE_USBD_ATTACH_SUCCEEDED

#define SCE_USBD_ATTACH_SUCCEEDED   (0)

◆ SCE_USBD_ATTACH_FAILED

#define SCE_USBD_ATTACH_FAILED   (-1)

◆ SCE_USBD_DETACH_SUCCEEDED

#define SCE_USBD_DETACH_SUCCEEDED   (0)

◆ SCE_USBD_DETACH_FAILED

#define SCE_USBD_DETACH_FAILED   (-1)

◆ SCE_USBD_MAX_LS_CONTROL_PACKET_SIZE

#define SCE_USBD_MAX_LS_CONTROL_PACKET_SIZE   8

◆ SCE_USBD_MAX_FS_CONTROL_PACKET_SIZE

#define SCE_USBD_MAX_FS_CONTROL_PACKET_SIZE   64

◆ SCE_USBD_MAX_ISOCHRONOUS_PACKET_SIZE

#define SCE_USBD_MAX_ISOCHRONOUS_PACKET_SIZE   1023

◆ SCE_USBD_MAX_LS_INTERRUPT_PACKET_SIZE

#define SCE_USBD_MAX_LS_INTERRUPT_PACKET_SIZE   8

◆ SCE_USBD_MAX_FS_INTERRUPT_PACKET_SIZE

#define SCE_USBD_MAX_FS_INTERRUPT_PACKET_SIZE   64

◆ SCE_USBD_MAX_BULK_PACKET_SIZE

#define SCE_USBD_MAX_BULK_PACKET_SIZE   64

◆ SCE_USBD_FEATURE_ENDPOINT_HALT

#define SCE_USBD_FEATURE_ENDPOINT_HALT   0x00

◆ SCE_USBD_FEATURE_DEVICE_REMOTE_WAKEUP

#define SCE_USBD_FEATURE_DEVICE_REMOTE_WAKEUP   0x01

◆ SCE_USBD_DEVICE_SPEED_LS

#define SCE_USBD_DEVICE_SPEED_LS   (0)

◆ SCE_USBD_DEVICE_SPEED_FS

#define SCE_USBD_DEVICE_SPEED_FS   (1)

◆ SCE_USBD_DEVICE_SPEED_HS

#define SCE_USBD_DEVICE_SPEED_HS   (2)

◆ ksceUsbdSetConfiguration [1/2]

#define ksceUsbdSetConfiguration (   pid,
  config,
  cb,
  arg 
)
Value:
({ \
SceUsbdDeviceRequest _dr; \
_dr.bmRequestType = 0x00; \
_dr.wValue = (config); \
_dr.wIndex = 0; \
_dr.wLength = 0; \
ksceUsbdControlTransfer((pid), (&_dr), NULL, (cb), (arg)); })
SceUID pid
Definition: debug.h:1
@ SCE_USBD_REQUEST_SET_CONFIGURATION
Definition: usbd.h:85

◆ ksceUsbdSetConfiguration [2/2]

#define ksceUsbdSetConfiguration (   pid,
  config,
  cb,
  arg 
)
Value:
({ \
SceUsbdDeviceRequest _dr; \
_dr.bmRequestType = 0x00; \
_dr.wValue = (config); \
_dr.wIndex = 0; \
_dr.wLength = 0; \
ksceUsbdControlTransfer((pid), (&_dr), NULL, (cb), (arg)); })

◆ ksceUsbdClearDeviceFeature

#define ksceUsbdClearDeviceFeature (   pid,
  fs,
  cb,
  arg 
)
Value:
({ \
SceUsbdDeviceRequest _dr; \
_dr.bmRequestType = 0x00; \
_dr.wValue = (fs); \
_dr.wIndex = 0; \
_dr.wLength = 0; \
ksceUsbdControlTransfer((pid), (&_dr), NULL, (cb), (arg)); })
@ SCE_USBD_REQUEST_CLEAR_FEATURE
Definition: usbd.h:79

◆ ksceUsbdClearInterfaceFeature

#define ksceUsbdClearInterfaceFeature (   pid,
  fs,
  interface,
  cb,
  arg 
)
Value:
({ \
SceUsbdDeviceRequest _dr; \
_dr.bmRequestType = 0x01; \
_dr.wValue = (fs); \
_dr.wIndex = (interface); \
_dr.wLength = 0; \
ksceUsbdControlTransfer((pid), (&_dr), NULL, (cb), (arg)); })

◆ ksceUsbdClearEndpointFeature

#define ksceUsbdClearEndpointFeature (   pid,
  fs,
  endpoint,
  cb,
  arg 
)
Value:
({ \
SceUsbdDeviceRequest _dr; \
_dr.bmRequestType = 0x02; \
_dr.wValue = (fs); \
_dr.wIndex = (endpoint); \
_dr.wLength = 0; \
ksceUsbdControlTransfer((pid), (&_dr), NULL, (cb), (arg)); })

◆ ksceUsbdGetConfiguration

#define ksceUsbdGetConfiguration (   pid,
  ptr,
  cb,
  arg 
)
Value:
({ \
SceUsbdDeviceRequest _dr; \
_dr.bmRequestType = 0x80; \
_dr.wValue = 0; \
_dr.wIndex = 0; \
_dr.wLength = 1; \
ksceUsbdControlTransfer((pid), (&_dr), (ptr), (cb), (arg)); })
@ SCE_USBD_REQUEST_GET_CONFIGURATION
Definition: usbd.h:84

◆ ksceUsbdGetDescriptor

#define ksceUsbdGetDescriptor (   pid,
  type,
  index,
  lang_id,
  ptr,
  len,
  cb,
  arg 
)
Value:
({ \
SceUsbdDeviceRequest _dr; \
_dr.bmRequestType = 0x80; \
_dr.wValue = ((type) << 8) | (index); \
_dr.wIndex = (lang_id); \
_dr.wLength = (len); \
ksceUsbdControlTransfer((pid), (&_dr), (ptr), (cb), (arg)); })
uint8_t type
0 = read?, 1 = write?, 2 = feature?, 3 = ?
Definition: bt.h:2
@ SCE_USBD_REQUEST_GET_DESCRIPTOR
Definition: usbd.h:82

◆ ksceUsbdGetInterface

#define ksceUsbdGetInterface (   pid,
  interface,
  ptr,
  cb,
  arg 
)
Value:
({ \
SceUsbdDeviceRequest _dr; \
_dr.bmRequestType = 0x81; \
_dr.wValue = 0; \
_dr.wIndex = (interface); \
_dr.wLength = 1; \
ksceUsbdControlTransfer((pid), (&_dr), (ptr), (cb), (arg)); })
@ SCE_USBD_REQUEST_GET_INTERFACE
Definition: usbd.h:86

◆ ksceUsbdGetDeviceStatus

#define ksceUsbdGetDeviceStatus (   pid,
  ptr,
  cb,
  arg 
)
Value:
({ \
SceUsbdDeviceRequest _dr; \
_dr.bmRequestType = 0x80; \
_dr.bRequest = SCE_USBD_REQUEST_GET_STATUS; \
_dr.wValue = 0; \
_dr.wIndex = 0; \
_dr.wLength = 2; \
ksceUsbdControlTransfer((pid), (&_dr), (ptr), (cb), (arg)); })
@ SCE_USBD_REQUEST_GET_STATUS
Definition: usbd.h:78

◆ ksceUsbdGetInterfaceStatus

#define ksceUsbdGetInterfaceStatus (   pid,
  interface,
  ptr,
  cb,
  arg 
)
Value:
({ \
SceUsbdDeviceRequest _dr; \
_dr.bmRequestType = 0x81; \
_dr.bRequest = SCE_USBD_REQUEST_GET_STATUS; \
_dr.wValue = 0; \
_dr.wIndex = (interface); \
_dr.wLength = 2; \
ksceUsbdControlTransfer((pid), (&_dr), (ptr), (cb), (arg)); })

◆ ksceUsbdGetEndpointStatus

#define ksceUsbdGetEndpointStatus (   pid,
  endpoint,
  ptr,
  cb,
  arg 
)
Value:
({ \
SceUsbdDeviceRequest _dr; \
_dr.bmRequestType = 0x82; \
_dr.bRequest = SCE_USBD_REQUEST_GET_STATUS; \
_dr.wValue = 0; \
_dr.wIndex = (endpoint); \
_dr.wLength = 2; \
ksceUsbdControlTransfer((pid), (&_dr), (ptr), (cb), (arg)); })

◆ ksceUsbdSetAddress

#define ksceUsbdSetAddress (   pid,
  address,
  cb,
  arg 
)
Value:
({ \
SceUsbdDeviceRequest _dr; \
_dr.bmRequestType = 0x00; \
_dr.bRequest = SCE_USBD_REQUEST_SET_ADDRESS; \
_dr.wValue = (address); \
_dr.wIndex = 0; \
_dr.wLength = 0; \
ksceUsbdControlTransfer((pid), (&_dr), NULL, (cb), (arg)); })
@ SCE_USBD_REQUEST_SET_ADDRESS
Definition: usbd.h:81

◆ ksceUsbdSetDeviceDescriptor

#define ksceUsbdSetDeviceDescriptor (   pid,
  type,
  index,
  lang_id,
  ptr,
  len,
  cb,
  arg 
)
Value:
({ \
SceUsbdDeviceRequest _dr; \
_dr.bmRequestType = 0x00; \
_dr.wValue = ((type) << 8) | (index); \
_dr.wIndex = (lang_id); \
_dr.wLength = (len); \
ksceUsbdControlTransfer((pid), (&_dr), (ptr), (cb), (arg)); })
@ SCE_USBD_REQUEST_SET_DESCRIPTOR
Definition: usbd.h:83

◆ ksceUsbdSetInterfaceDescriptor

#define ksceUsbdSetInterfaceDescriptor (   pid,
  type,
  index,
  lang_id,
  ptr,
  len,
  cb,
  arg 
)
Value:
({ \
SceUsbdDeviceRequest _dr; \
_dr.bmRequestType = 0x01; \
_dr.wValue = ((type) << 8) | (index); \
_dr.wIndex = (lang_id); \
_dr.wLength = (len); \
ksceUsbdControlTransfer((pid), (&_dr), (ptr), (cb), (arg)); })

◆ ksceUsbdSetEndpointDescriptor

#define ksceUsbdSetEndpointDescriptor (   pid,
  type,
  index,
  lang_id,
  ptr,
  len,
  cb,
  arg 
)
Value:
({ \
SceUsbdDeviceRequest _dr; \
_dr.bmRequestType = 0x02; \
_dr.wValue = ((type) << 8) | (index); \
_dr.wIndex = (lang_id); \
_dr.wLength = (len); \
ksceUsbdControlTransfer((pid), (&_dr), (ptr), (cb), (arg)); })

◆ ksceUsbdSetDeviceFeature

#define ksceUsbdSetDeviceFeature (   pid,
  fs,
  cb,
  arg 
)
Value:
({ \
SceUsbdDeviceRequest _dr; \
_dr.bmRequestType = 0x00; \
_dr.bRequest = SCE_USBD_REQUEST_SET_FEATURE; \
_dr.wValue = (fs); \
_dr.wIndex = 0; \
_dr.wLength = 0; \
ksceUsbdControlTransfer((pid), (&_dr), NULL, (cb), (arg)); })
@ SCE_USBD_REQUEST_SET_FEATURE
Definition: usbd.h:80

◆ ksceUsbdSetInterfaceFeature

#define ksceUsbdSetInterfaceFeature (   pid,
  fs,
  interface,
  cb,
  arg 
)
Value:
({ \
SceUsbdDeviceRequest _dr; \
_dr.bmRequestType = 0x01; \
_dr.bRequest = SCE_USBD_REQUEST_SET_FEATURE; \
_dr.wValue = (fs); \
_dr.wIndex = (interface); \
_dr.wLength = 0; \
ksceUsbdControlTransfer((pid), (&_dr), NULL, (cb), (arg)); })

◆ ksceUsbdSetEndpointFeature

#define ksceUsbdSetEndpointFeature (   pid,
  fs,
  endpoint,
  cb,
  arg 
)
Value:
({ \
SceUsbdDeviceRequest _dr; \
_dr.bmRequestType = 0x02; \
_dr.bRequest = SCE_USBD_REQUEST_SET_FEATURE; \
_dr.wValue = (fs); \
_dr.wIndex = (endpoint); \
_dr.wLength = 0; \
ksceUsbdControlTransfer((pid), (&_dr), NULL, (cb), (arg)); })

◆ ksceUsbdSetInterface

#define ksceUsbdSetInterface (   pid,
  interface,
  alt_setting,
  cb,
  arg 
)
Value:
({ \
SceUsbdDeviceRequest _dr; \
_dr.bmRequestType = 0x01; \
_dr.wValue = (alt_setting); \
_dr.wIndex = (interface); \
_dr.wLength = 0; \
ksceUsbdControlTransfer((pid), (&_dr), NULL, (cb), (arg)); })
@ SCE_USBD_REQUEST_SET_INTERFACE
Definition: usbd.h:87

◆ ksceUsbdSynchFrame

#define ksceUsbdSynchFrame (   pid,
  endpoint,
  pfn,
  cb,
  arg 
)
Value:
({ \
SceUsbdDeviceRequest _dr; \
_dr.bmRequestType = 0x82; \
_dr.bRequest = SCE_USBD_REQUEST_SYNCH_FRAME; \
_dr.wValue = 0; \
_dr.wIndex = (endpoint); \
_dr.wLength = 2; \
ksceUsbdControlTransfer((pid), (&_dr), pfn, (cb), (arg)); })
@ SCE_USBD_REQUEST_SYNCH_FRAME
Definition: usbd.h:88

◆ OHCI_CC_NO_ERROR

#define OHCI_CC_NO_ERROR   0x0

◆ OHCI_CC_CRC

#define OHCI_CC_CRC   0x1

◆ OHCI_CC_BIT_STUFFING

#define OHCI_CC_BIT_STUFFING   0x2

◆ OHCI_CC_DATA_TOGGLE_MISMATCH

#define OHCI_CC_DATA_TOGGLE_MISMATCH   0x3

◆ OHCI_CC_STALL

#define OHCI_CC_STALL   0x4

◆ OHCI_CC_DEVICE_NOT_RESPONDING

#define OHCI_CC_DEVICE_NOT_RESPONDING   0x5

◆ OHCI_CC_PID_CHECK_FAILURE

#define OHCI_CC_PID_CHECK_FAILURE   0x6

◆ OHCI_CC_UNEXPECTED_PID

#define OHCI_CC_UNEXPECTED_PID   0x7

◆ OHCI_CC_DATA_OVERRUN

#define OHCI_CC_DATA_OVERRUN   0x8

◆ OHCI_CC_DATA_UNDERRUN

#define OHCI_CC_DATA_UNDERRUN   0x9

◆ OHCI_CC_BUFFER_OVERRUN

#define OHCI_CC_BUFFER_OVERRUN   0xc

◆ OHCI_CC_BUFFER_UNDERRUN

#define OHCI_CC_BUFFER_UNDERRUN   0xd

◆ OHCI_CC_NOT_ACCESSED1

#define OHCI_CC_NOT_ACCESSED1   0xe

◆ OHCI_CC_NOT_ACCESSED2

#define OHCI_CC_NOT_ACCESSED2   0xf

◆ EHCI_CC_MISSED_MICRO_FRAME

#define EHCI_CC_MISSED_MICRO_FRAME   0x10

◆ EHCI_CC_XACT

#define EHCI_CC_XACT   0x20

◆ EHCI_CC_BABBLE

#define EHCI_CC_BABBLE   0x30

◆ EHCI_CC_DATABUF

#define EHCI_CC_DATABUF   0x40

◆ EHCI_CC_HALTED

#define EHCI_CC_HALTED   0x50

◆ USBD_CC_NOERR

#define USBD_CC_NOERR   0x0

◆ USBD_CC_MISSED_MICRO_FRAME

#define USBD_CC_MISSED_MICRO_FRAME   0x1

◆ USBD_CC_XACTERR

#define USBD_CC_XACTERR   0x2

◆ USBD_CC_BABBLE

#define USBD_CC_BABBLE   0x4

◆ USBD_CC_DATABUF

#define USBD_CC_DATABUF   0x8

Typedef Documentation

◆ ksceUsbdDoneCallback

typedef void(* ksceUsbdDoneCallback) (int32_t result, int32_t count, void *arg)

◆ ksceUsbdIsochDoneCallback

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

Enumeration Type Documentation

◆ SceUsbdErrorCode

Enumerator
SCE_USBD_ERROR_NOT_INITIALIZED 
SCE_USBD_ERROR_ALREADY_INITIALIZED 
SCE_USBD_ERROR_INVALID_PARAM 
SCE_USBD_ERROR_PIPE_NOT_FOUND 
SCE_USBD_ERROR_NO_MEMORY 
SCE_USBD_ERROR_DEVICE_NOT_FOUND 
SCE_USBD_ERROR_80240007 
SCE_USBD_ERROR_80240009 
SCE_USBD_ERROR_8024000A 
SCE_USBD_ERROR_FATAL 

◆ SceUsbdDescriptorType

Enumerator
SCE_USBD_DESCRIPTOR_DEVICE 
SCE_USBD_DESCRIPTOR_CONFIGURATION 
SCE_USBD_DESCRIPTOR_STRING 
SCE_USBD_DESCRIPTOR_INTERFACE 
SCE_USBD_DESCRIPTOR_ENDPOINT 
SCE_USBD_DESCRIPTOR_DEVICE_QUALIFIER 
SCE_USBD_DESCRIPTOR_OTHER_SPEED 
SCE_USBD_DESCRIPTOR_INTERFACE_POWER 
SCE_USBD_DESCRIPTOR_OTG 
SCE_USBD_DESCRIPTOR_HID 
SCE_USBD_DESCRIPTOR_REPORT 

◆ SceUsbdReqtype

Enumerator
SCE_USBD_REQTYPE_DIR_BITS 
SCE_USBD_REQTYPE_DIR_TO_DEVICE 
SCE_USBD_REQTYPE_DIR_TO_HOST 
SCE_USBD_REQTYPE_TYPE_BITS 
SCE_USBD_REQTYPE_TYPE_STANDARD 
SCE_USBD_REQTYPE_TYPE_CLASS 
SCE_USBD_REQTYPE_TYPE_VENDOR 
SCE_USBD_REQTYPE_TYPE_RESERVED 
SCE_USBD_REQTYPE_RECIP_BITS 
SCE_USBD_REQTYPE_RECIP_DEVICE 
SCE_USBD_REQTYPE_RECIP_INTERFACE 
SCE_USBD_REQTYPE_RECIP_ENDPOINT 
SCE_USBD_REQTYPE_RECIP_OTHER 

◆ SceUsbdRequest

Enumerator
SCE_USBD_REQUEST_GET_STATUS 
SCE_USBD_REQUEST_CLEAR_FEATURE 
SCE_USBD_REQUEST_SET_FEATURE 
SCE_USBD_REQUEST_SET_ADDRESS 
SCE_USBD_REQUEST_GET_DESCRIPTOR 
SCE_USBD_REQUEST_SET_DESCRIPTOR 
SCE_USBD_REQUEST_GET_CONFIGURATION 
SCE_USBD_REQUEST_SET_CONFIGURATION 
SCE_USBD_REQUEST_GET_INTERFACE 
SCE_USBD_REQUEST_SET_INTERFACE 
SCE_USBD_REQUEST_SYNCH_FRAME 

Function Documentation

◆ VITASDK_BUILD_ASSERT_EQ() [1/13]

VITASDK_BUILD_ASSERT_EQ ( 0x12  ,
SceUsbdDeviceDescriptor   
)

◆ VITASDK_BUILD_ASSERT_EQ() [2/13]

VITASDK_BUILD_ASSERT_EQ ( 0xA  ,
SceUsbdConfigurationDescriptor   
)

◆ VITASDK_BUILD_ASSERT_EQ() [3/13]

VITASDK_BUILD_ASSERT_EQ ( ,
SceUsbdInterfaceDescriptor   
)

◆ VITASDK_BUILD_ASSERT_EQ() [4/13]

VITASDK_BUILD_ASSERT_EQ ( ,
SceUsbdEndpointDescriptor   
)

◆ VITASDK_BUILD_ASSERT_EQ() [5/13]

VITASDK_BUILD_ASSERT_EQ ( ,
SceUsbdStringDescriptor   
)

◆ VITASDK_BUILD_ASSERT_EQ() [6/13]

VITASDK_BUILD_ASSERT_EQ ( ,
SceUsbdHidSubDescriptorInfo   
)

◆ VITASDK_BUILD_ASSERT_EQ() [7/13]

VITASDK_BUILD_ASSERT_EQ ( ,
SceUsbdHidDescriptor   
)

◆ __attribute__()

struct SceKernelDebugEventLog __attribute__ ( (packed)  )

◆ VITASDK_BUILD_ASSERT_EQ() [8/13]

VITASDK_BUILD_ASSERT_EQ ( ,
SceUsbdDeviceAddress   
)

◆ VITASDK_BUILD_ASSERT_EQ() [9/13]

VITASDK_BUILD_ASSERT_EQ ( 0x10  ,
SceUsbdDriver   
)

◆ VITASDK_BUILD_ASSERT_EQ() [10/13]

VITASDK_BUILD_ASSERT_EQ ( 0x10  ,
SceUsbdCompositeDriver   
)

◆ VITASDK_BUILD_ASSERT_EQ() [11/13]

VITASDK_BUILD_ASSERT_EQ ( ,
SceUsbdDeviceRequest   
)

◆ VITASDK_BUILD_ASSERT_EQ() [12/13]

VITASDK_BUILD_ASSERT_EQ ( ,
ksceUsbdIsochPswLen   
)

◆ VITASDK_BUILD_ASSERT_EQ() [13/13]

VITASDK_BUILD_ASSERT_EQ ( 0x1C  ,
ksceUsbdIsochTransfer   
)

◆ ksceUsbdRegisterDriver()

int ksceUsbdRegisterDriver ( const SceUsbdDriver driver)

Register USB driver.

Returns
0 on success, < 0 on error
Parameters
driverdriver struct

◆ ksceUsbdRegisterCompositeLdd()

int ksceUsbdRegisterCompositeLdd ( const SceUsbdCompositeDriver driver)

Register USB driver for composite devices.

Returns
0 on success, < 0 on error
Parameters
driverdriver struct

◆ ksceUsbdUnregisterDriver()

int ksceUsbdUnregisterDriver ( const SceUsbdDriver driver)

De-register USB driver.

Returns
0 on success, < 0 on error
Parameters
driverdriver struct

◆ ksceUsbdUnregisterCompositeLdd()

int ksceUsbdUnregisterCompositeLdd ( const SceUsbdCompositeDriver driver)

De-register USB driver for composite devices.

Returns
0 on success, < 0 on error
Parameters
driverdriver struct

◆ ksceUsbdScanStaticDescriptor()

void* ksceUsbdScanStaticDescriptor ( SceUID  device_id,
void *  start,
SceUsbdDescriptorType  type 
)

Return usb descriptor.

Returns
descriptor data on success, NULL on error
Parameters
device_iddevice id
startpointer to descriptor to start scanning from (may be NULL)
typedescriptor type

◆ ksceUsbdOpenPipe()

SceUID ksceUsbdOpenPipe ( int  device_id,
SceUsbdEndpointDescriptor endpoint 
)

Open communication pipe to endpoint.

Returns
pipe uid on success, < 0 on error
Parameters
device_iddevice id
endpointendpoint (may be null for default configuration endpoint)

◆ ksceUsbdClosePipe()

int ksceUsbdClosePipe ( SceUID  pipe_id)

Close communication pipe to endpoint.

Returns
0 on success, < 0 on error
Parameters
pipe_idpipe id

◆ ksceUsbdControlTransfer()

int ksceUsbdControlTransfer ( SceUID  pipe_id,
const SceUsbdDeviceRequest req,
unsigned char *  buffer,
ksceUsbdDoneCallback  cb,
void *  user_data 
)

Transfer data to/from endpoint.

Returns
0 on success, < 0 on error
Parameters
pipe_idpipe id
reqtransfer request
bufferdata
cbtransfer callback
user_datauserdata to pass to callback

◆ ksceUsbdInterruptTransfer()

int ksceUsbdInterruptTransfer ( SceUID  pipe_id,
unsigned char *  buffer,
SceSize  length,
ksceUsbdDoneCallback  cb,
void *  user_data 
)

Transfer data to/from interrupt endpoint.

Returns
0 on success, < 0 on error
Parameters
pipe_idpipe id
bufferdata
lengthdata length
cbtransfer callback
user_datauserdata to pass to callback

◆ ksceUsbdIsochronousTransfer()

int ksceUsbdIsochronousTransfer ( SceUID  pipe_id,
ksceUsbdIsochTransfer transfer,
ksceUsbdIsochDoneCallback  cb,
void *  user_data 
)

Transfer isochronous data to/from endpoint.

Returns
0 on success, < 0 on error
Parameters
pipe_idpipe id
transfertransfer request
cbtransfer callback
user_datauserdata to pass to callback

◆ ksceUsbdBulkTransfer()

int ksceUsbdBulkTransfer ( SceUID  pipe_id,
unsigned char *  buffer,
unsigned int  length,
ksceUsbdDoneCallback  cb,
void *  user_data 
)

Transfer data to/from endpoint.

Returns
0 on success, < 0 on error
Parameters
pipe_idpipe id
bufferdata
lengthdata length
cbtransfer callback
user_datauserdata to pass to callback
Note
buffer pointer must be 64b aligned

◆ ksceUsbdBulkTransfer2()

int ksceUsbdBulkTransfer2 ( int  pipe_id,
unsigned char *  buffer,
unsigned int  length,
ksceUsbdDoneCallback  cb,
void *  user_data 
)

Transfer data to/from endpoint.

Returns
0 on success, < 0 on error
Parameters
pipe_idpipe id
bufferdata
lengthdata length
cbtransfer callback
user_datauserdata to pass to callback
Note
buffer pointer must be 64b aligned

◆ ksceUsbdGetDeviceLocation()

int ksceUsbdGetDeviceLocation ( SceUID  device_id,
uint8_t *  location 
)

Get device location.

Returns
0 on success, < 0 on error
Parameters
device_iddevice id
[out]locationdevice location data (port)

◆ ksceUsbdSuspend()

int ksceUsbdSuspend ( int  port)

◆ ksceUsbdSuspendPhase2()

int ksceUsbdSuspendPhase2 ( int  port,
int  flag 
)

◆ ksceUsbdResume()

int ksceUsbdResume ( int  port)

◆ ksceUsbdHostStop()

int ksceUsbdHostStop ( int  port)

◆ ksceUsbdHostStart()

int ksceUsbdHostStart ( int  port)

◆ ksceUsbdGetDeviceSpeed()

int ksceUsbdGetDeviceSpeed ( int  device_id,
uint8_t *  speed 
)

Get device speed.

Returns
0 on success, < 0 on error
Parameters
device_iddevice id
[out]speeddevice speed

◆ ksceUsbd_05073925()

int ksceUsbd_05073925 ( SceUID  device_id,
int *  unk1,
int *  unk2 
)

◆ ksceUsbd_7938DAC7()

int ksceUsbd_7938DAC7 ( SceUID  pipe_id)