vitasdk
Documentation of the vitasdk
|
Exports for Kernel.
Include the header file in your project:
Include the header file in your project:
Link the library to the executable:
Functions | |
VITASDK_BUILD_ASSERT_EQ (0x40, SceUdcdDeviceInfo) | |
VITASDK_BUILD_ASSERT_EQ (0x18, SceUdcdWaitParam) | |
VITASDK_BUILD_ASSERT_EQ (0x40, SceUdcdStringDescriptor) | |
struct | SCE_ALIGN (4) SceUdcdDeviceDescriptor |
USB device descriptor. More... | |
VITASDK_BUILD_ASSERT_EQ (0x14, SceUdcdDeviceDescriptor) | |
VITASDK_BUILD_ASSERT_EQ (0xC, SceUdcdDeviceQualifierDescriptor) | |
VITASDK_BUILD_ASSERT_EQ (0x18, SceUdcdConfigDescriptor) | |
VITASDK_BUILD_ASSERT_EQ (0xC, SceUdcdInterfaceSettings) | |
VITASDK_BUILD_ASSERT_EQ (0x18, SceUdcdInterfaceDescriptor) | |
VITASDK_BUILD_ASSERT_EQ (0x10, SceUdcdEndpointDescriptor) | |
VITASDK_BUILD_ASSERT_EQ (0xC, SceUdcdInterface) | |
VITASDK_BUILD_ASSERT_EQ (0x10, SceUdcdEndpoint) | |
VITASDK_BUILD_ASSERT_EQ (0x10, SceUdcdConfiguration) | |
VITASDK_BUILD_ASSERT_EQ (8, SceUdcdEP0DeviceRequest) | |
VITASDK_BUILD_ASSERT_EQ (0x54, SceUdcdDriver) | |
VITASDK_BUILD_ASSERT_EQ (0x2C, SceUdcdDeviceRequest) | |
struct | SCE_ALIGN (16) SceUdcdDriverName |
USB driver name. More... | |
VITASDK_BUILD_ASSERT_EQ (((0x28+(0x10 - 1)) &~(0x10 - 1)), SceUdcdDriverName) | |
int | ksceUdcdWaitBusInitialized (unsigned int timeout, int bus) |
Waits until an UDCD bus is initialized. More... | |
int | ksceUdcdStart (const char *driverName, int size, void *args) |
Start a USB driver. More... | |
int | ksceUdcdStartInternal (const char *driverName, int size, void *args, int bus) |
Start a USB driver for an UDCD bus. More... | |
int | ksceUdcdStartCurrentInternal (int unused, int bus) |
Starts the current USB driver for an UDCD bus. More... | |
int | ksceUdcdStop (const char *driverName, int size, void *args) |
Stop a USB driver. More... | |
int | ksceUdcdStopInternal (const char *driverName, int size, void *args, int bus) |
Stop a USB driver for an UDCD bus. More... | |
int | ksceUdcdStopCurrentInternal (int bus) |
Stops the current USB driver for an UDCD bus. More... | |
int | ksceUdcdActivate (unsigned int productId) |
Activate a USB driver. More... | |
int | ksceUdcdActivateInternal (unsigned int productId, unsigned int bus_powered, int bus) |
Activate a USB driver for an UDCD bus. More... | |
int | ksceUdcdDeactivate (void) |
Deactivate USB driver. More... | |
int | ksceUdcdDeactivateInternal (int bus) |
Deactivate USB driver for an UDCD bus. More... | |
int | ksceUdcdGetDeviceState (void) |
Get USB state. More... | |
int | ksceUdcdGetDeviceStateInternal (int bus) |
Get USB state for an UDCD bus. More... | |
int | ksceUdcdGetDeviceInfo (SceUdcdDeviceInfo *devInfo) |
Get device information. More... | |
int | ksceUdcdGetDeviceInfoInternal (SceUdcdDeviceInfo *devInfo, int bus) |
Get device information for an UDCD bus. More... | |
int | ksceUdcdGetDrvState (const char *driverName) |
Get state of a specific USB driver. More... | |
int | ksceUdcdGetDrvStateInternal (const char *driverName, int bus) |
Get state of a specific USB driver for an UDCD bus. More... | |
int | ksceUdcdWaitState (SceUdcdWaitParam *waitParam, unsigned int timeout) |
Wait for state. More... | |
int | ksceUdcdWaitStateInternal (SceUdcdWaitParam *waitParam, unsigned int timeout, int bus) |
Wait for state for an UDCD bus. More... | |
int | ksceUdcdRegister (SceUdcdDriver *drv) |
Register a USB driver. More... | |
int | ksceUdcdRegisterInternal (SceUdcdDriver *drv, int bus) |
Register a USB driver to a specific USB bus. More... | |
int | ksceUdcdUnregister (SceUdcdDriver *drv) |
Unregister a USB driver. More... | |
int | ksceUdcdUnregisterInternal (SceUdcdDriver *drv, int bus) |
Unregister a USB driver for an UDCD bus. More... | |
int | ksceUdcdClearFIFO (SceUdcdEndpoint *endp) |
Clear the FIFO on an endpoint. More... | |
int | ksceUdcdClearFIFOInternal (SceUdcdEndpoint *endp, int bus) |
Clear the FIFO on an endpoint for an UDCD bus. More... | |
int | ksceUdcdReqCancelAll (SceUdcdEndpoint *endp) |
Cancel any pending requests on an endpoint. More... | |
int | ksceUdcdStall (SceUdcdEndpoint *endp) |
Stall an endpoint. More... | |
int | ksceUdcdStallInternal (SceUdcdEndpoint *endp, int bus) |
Stall an endpoint for an UDCD bus. More... | |
int | ksceUdcdReqSend (SceUdcdDeviceRequest *req) |
Queue a send request (IN from host pov) More... | |
int | ksceUdcdReqSendInternal (SceUdcdDeviceRequest *req, int bus) |
Queue a send request (IN from host pov) for an UDCD bus. More... | |
int | ksceUdcdReqRecv (SceUdcdDeviceRequest *req) |
Queue a receive request (OUT from host pov) More... | |
int | ksceUdcdReqRecvInternal (SceUdcdDeviceRequest *req, int bus) |
Queue a receive request (OUT from host pov) for an UDCD bus. More... | |
struct SceUdcdWaitParam |
struct SceUdcdStringDescriptor |
struct SceUdcdConfigDescriptor |
USB configuration descriptor.
Data Fields | ||
---|---|---|
unsigned char | bLength | |
unsigned char | bDescriptorType | |
unsigned short | wTotalLength | |
unsigned char | bNumInterfaces | |
unsigned char | bConfigurationValue | |
unsigned char | iConfiguration | |
unsigned char | bmAttributes | |
unsigned char | bMaxPower | |
struct SceUdcdInterfaceSettings * | settings | |
unsigned char * | extra | Extra descriptors. |
int | extraLength |
struct SceUdcdInterfaceSettings |
USB driver interfaces structure.
Data Fields | ||
---|---|---|
struct SceUdcdInterfaceDescriptor * | descriptors | Pointers to the individual interface descriptors. |
unsigned int | alternateSetting | |
unsigned int | numDescriptors | Number of interface descriptors. |
struct SceUdcdInterfaceDescriptor |
USB Interface descriptor.
Data Fields | ||
---|---|---|
unsigned char | bLength | |
unsigned char | bDescriptorType | |
unsigned char | bInterfaceNumber | |
unsigned char | bAlternateSetting | |
unsigned char | bNumEndpoints | |
unsigned char | bInterfaceClass | |
unsigned char | bInterfaceSubClass | |
unsigned char | bInterfaceProtocol | |
unsigned char | iInterface | |
struct SceUdcdEndpointDescriptor * | endpoints | |
unsigned char * | extra | Extra descriptors. |
int | extraLength |
struct SceUdcdEndpointDescriptor |
struct SceUdcdInterface |
struct SceUdcdEndpoint |
struct SceUdcdConfiguration |
USB driver configuration.
Data Fields | ||
---|---|---|
SceUdcdConfigDescriptor * | configDescriptors | Pointer to the configuration descriptors. |
SceUdcdInterfaceSettings * | settings | USB driver interface settings. |
SceUdcdInterfaceDescriptor * | interfaceDescriptors | Pointer to the first interface descriptor. |
SceUdcdEndpointDescriptor * | endpointDescriptors | Pointer to the first endpoint descriptor. |
struct SceUdcdEP0DeviceRequest |
struct SceUdcdDriver |
USB driver structure.
Data Fields | |
const char * | driverName |
Name of the USB driver. More... | |
int | numEndpoints |
Number of endpoints in this driver (including default control) More... | |
SceUdcdEndpoint * | endpoints |
List of endpoint structures (used when calling other functions) More... | |
SceUdcdInterface * | interface |
Interface list. More... | |
SceUdcdDeviceDescriptor * | descriptor_hi |
Pointer to hi-speed device descriptor. More... | |
SceUdcdConfiguration * | configuration_hi |
Pointer to hi-speed device configuration. More... | |
SceUdcdDeviceDescriptor * | descriptor |
Pointer to full-speed device descriptor. More... | |
SceUdcdConfiguration * | configuration |
Pointer to full-speed device configuration. More... | |
SceUdcdStringDescriptor * | stringDescriptors |
Default string descriptors. More... | |
SceUdcdStringDescriptor * | stringDescriptorProduct |
Product string descriptor (iProduct has to be 2) More... | |
SceUdcdStringDescriptor * | stringDescriptorSerial |
Serial string descriptor (iSerial has to be 3) More... | |
int(* | processRequest )(int recipient, int arg, SceUdcdEP0DeviceRequest *req, void *user_data) |
Received a control request. More... | |
int(* | changeSetting )(int interfaceNumber, int alternateSetting, int bus) |
Change alternate setting. More... | |
int(* | attach )(int usb_version, void *user_data) |
Configuration set (attach) function. More... | |
void(* | detach )(void *user_data) |
Configuration unset (detach) function. More... | |
void(* | configure )(int usb_version, int desc_count, SceUdcdInterfaceSettings *settings, void *user_data) |
Configure the device. More... | |
int(* | start )(int size, void *args, void *user_data) |
Function called when the driver is started. More... | |
int(* | stop )(int size, void *args, void *user_data) |
Function called when the driver is stopped. More... | |
void * | user_data |
User data. More... | |
int | bus |
USB bus. More... | |
struct SceUdcdDriver * | link |
Link to next USB driver in the chain, set to NULL. More... | |
struct SceUdcdDeviceRequest |
USB device request.
Data Fields | |
SceUdcdEndpoint * | endpoint |
Pointer to the endpoint to queue request on. More... | |
void * | data |
Pointer to the data buffer to use in the request. More... | |
unsigned int | attributes |
Request attributes (See SceUdcdDeviceRequestAttr) More... | |
int | size |
Size of the data buffer. More... | |
int | isControlRequest |
Is a control request? More... | |
void(* | onComplete )(struct SceUdcdDeviceRequest *req) |
Pointer to the function to call on completion. More... | |
int | transmitted |
Number of transmitted bytes. More... | |
int | returnCode |
Return code of the request (See SceUdcdRetcode) More... | |
struct SceUdcdDeviceRequest * | next |
Link pointer to next request used by the driver, set it to NULL. More... | |
void * | unused |
An unused value (maybe an argument) More... | |
void * | physicalAddress |
Physical address. More... | |
#define USB_DT_DEVICE_SIZE 18 |
Descriptor sizes per descriptor type.
#define USB_DT_CONFIG_SIZE 9 |
#define USB_DT_INTERFACE_SIZE 9 |
#define USB_DT_ENDPOINT_SIZE 7 |
#define USB_DT_ENDPOINT_AUDIO_SIZE 9 |
Audio extension.
#define USB_DT_HUB_NONVAR_SIZE 7 |
#define USB_CTRLTYPE_DIR_MASK 0x80 |
Control message request type bitmask.
#define USB_CTRLTYPE_DIR_HOST2DEVICE (0 << 7) |
#define USB_CTRLTYPE_DIR_DEVICE2HOST (1 << 7) |
#define USB_CTRLTYPE_TYPE_MASK 0x60 |
#define USB_CTRLTYPE_TYPE_STANDARD (0 << 5) |
#define USB_CTRLTYPE_TYPE_CLASS (1 << 5) |
#define USB_CTRLTYPE_TYPE_VENDOR (2 << 5) |
#define USB_CTRLTYPE_TYPE_RESERVED (3 << 5) |
#define USB_CTRLTYPE_REC_MASK 0x1f |
#define USB_CTRLTYPE_REC_DEVICE 0 |
#define USB_CTRLTYPE_REC_INTERFACE 1 |
#define USB_CTRLTYPE_REC_ENDPOINT 2 |
#define USB_CTRLTYPE_REC_OTHER 3 |
#define USB_ENDPOINT_ADDRESS_MASK 0x0f /* in bEndpointAddress */ |
Endpoint types and masks.
#define USB_ENDPOINT_DIR_MASK 0x80 |
#define USB_FEATURE_ENDPOINT_HALT 0 |
#define USB_ENDPOINT_IN 0x80 |
#define USB_ENDPOINT_OUT 0x00 |
#define USB_ENDPOINT_TYPE_MASK 0x03 /* in bmAttributes */ |
#define USB_ENDPOINT_TYPE_CONTROL 0 |
#define USB_ENDPOINT_TYPE_ISOCHRONOUS 1 |
#define USB_ENDPOINT_TYPE_BULK 2 |
#define USB_ENDPOINT_TYPE_INTERRUPT 3 |
#define HID_INTF 0x03 |
HID Interface Class Code.
#define BOOT_INTF_SUBCLASS 0x01 |
HID Interface Class SubClass Codes.
#define SCE_UDCD_MAX_INTERFACES 8 |
USB limits.
#define SCE_UDCD_MAX_ENDPOINTS 9 |
#define SCE_UDCD_MAX_ALTERNATE 2 |
enum SceUdcdStatus |
enum SceUdcdStatusDriver |
enum SceUdcdUsbClass |
enum SceUdcdUsbDt |
enum SceUdcdUsbReq |
enum SceUdcdHidRequest |
enum SceUdcdHidDescriptor |
enum SceUdcdProtocol |
enum SceUdcdHidProtocol |
enum SceUdcdRetcode |
enum SceUdcdErrorCode |
Error codes.
SceUdcdDeviceRequest Flags.
Enumerator | |
---|---|
SCE_UDCD_DEVICE_REQUEST_ATTR_PHYCONT |
VITASDK_BUILD_ASSERT_EQ | ( | 0x40 | , |
SceUdcdDeviceInfo | |||
) |
VITASDK_BUILD_ASSERT_EQ | ( | 0x18 | , |
SceUdcdWaitParam | |||
) |
VITASDK_BUILD_ASSERT_EQ | ( | 0x40 | , |
SceUdcdStringDescriptor | |||
) |
struct SCE_ALIGN | ( | 4 | ) |
USB device descriptor.
USB device qualifier descriptor.
VITASDK_BUILD_ASSERT_EQ | ( | 0x14 | , |
SceUdcdDeviceDescriptor | |||
) |
VITASDK_BUILD_ASSERT_EQ | ( | 0xC | , |
SceUdcdDeviceQualifierDescriptor | |||
) |
VITASDK_BUILD_ASSERT_EQ | ( | 0x18 | , |
SceUdcdConfigDescriptor | |||
) |
VITASDK_BUILD_ASSERT_EQ | ( | 0xC | , |
SceUdcdInterfaceSettings | |||
) |
VITASDK_BUILD_ASSERT_EQ | ( | 0x18 | , |
SceUdcdInterfaceDescriptor | |||
) |
VITASDK_BUILD_ASSERT_EQ | ( | 0x10 | , |
SceUdcdEndpointDescriptor | |||
) |
VITASDK_BUILD_ASSERT_EQ | ( | 0xC | , |
SceUdcdInterface | |||
) |
VITASDK_BUILD_ASSERT_EQ | ( | 0x10 | , |
SceUdcdEndpoint | |||
) |
VITASDK_BUILD_ASSERT_EQ | ( | 0x10 | , |
SceUdcdConfiguration | |||
) |
VITASDK_BUILD_ASSERT_EQ | ( | 8 | , |
SceUdcdEP0DeviceRequest | |||
) |
VITASDK_BUILD_ASSERT_EQ | ( | 0x54 | , |
SceUdcdDriver | |||
) |
VITASDK_BUILD_ASSERT_EQ | ( | 0x2C | , |
SceUdcdDeviceRequest | |||
) |
struct SCE_ALIGN | ( | 16 | ) |
USB driver name.
VITASDK_BUILD_ASSERT_EQ | ( | ((0x28+(0x10 - 1)) &~(0x10 - 1)) | , |
SceUdcdDriverName | |||
) |
int ksceUdcdWaitBusInitialized | ( | unsigned int | timeout, |
int | bus | ||
) |
Waits until an UDCD bus is initialized.
[in] | timeout | - Timeout |
[in] | bus | - UDCD bus (default is 2) |
int ksceUdcdStart | ( | const char * | driverName, |
int | size, | ||
void * | args | ||
) |
Start a USB driver.
driverName | - Name of the USB driver to start |
size | - Size of arguments to pass to USB driver start |
args | - Arguments to pass to USB driver start |
int ksceUdcdStartInternal | ( | const char * | driverName, |
int | size, | ||
void * | args, | ||
int | bus | ||
) |
Start a USB driver for an UDCD bus.
driverName | - Name of the USB driver to start | |
size | - Size of arguments to pass to USB driver start | |
args | - Arguments to pass to USB driver start | |
[in] | bus | - UDCD bus (default is 2) |
int ksceUdcdStartCurrentInternal | ( | int | unused, |
int | bus | ||
) |
Starts the current USB driver for an UDCD bus.
[in] | unused | - Unused |
[in] | bus | - UDCD bus (default is 2) |
int ksceUdcdStop | ( | const char * | driverName, |
int | size, | ||
void * | args | ||
) |
Stop a USB driver.
driverName | - Name of the USB driver to stop |
size | - Size of arguments to pass to USB driver start |
args | - Arguments to pass to USB driver start |
int ksceUdcdStopInternal | ( | const char * | driverName, |
int | size, | ||
void * | args, | ||
int | bus | ||
) |
Stop a USB driver for an UDCD bus.
driverName | - Name of the USB driver to stop | |
size | - Size of arguments to pass to USB driver start | |
args | - Arguments to pass to USB driver start | |
[in] | bus | - UDCD bus (default is 2) |
int ksceUdcdStopCurrentInternal | ( | int | bus | ) |
Stops the current USB driver for an UDCD bus.
[in] | bus | - UDCD bus (default is 2) |
int ksceUdcdActivate | ( | unsigned int | productId | ) |
Activate a USB driver.
pid | - Product ID for the default USB Driver |
int ksceUdcdActivateInternal | ( | unsigned int | productId, |
unsigned int | bus_powered, | ||
int | bus | ||
) |
Activate a USB driver for an UDCD bus.
pid | - Product ID for the default USB Driver | |
[in] | bus_powered | - Enable USB bus power |
[in] | bus | - UDCD bus (default is 2) |
int ksceUdcdDeactivate | ( | void | ) |
Deactivate USB driver.
int ksceUdcdDeactivateInternal | ( | int | bus | ) |
Deactivate USB driver for an UDCD bus.
[in] | bus | - UDCD bus (default is 2) |
int ksceUdcdGetDeviceState | ( | void | ) |
Get USB state.
int ksceUdcdGetDeviceStateInternal | ( | int | bus | ) |
Get USB state for an UDCD bus.
[in] | bus | - UDCD bus (default is 2) |
int ksceUdcdGetDeviceInfo | ( | SceUdcdDeviceInfo * | devInfo | ) |
Get device information.
[out] | devInfo | - Device information |
int ksceUdcdGetDeviceInfoInternal | ( | SceUdcdDeviceInfo * | devInfo, |
int | bus | ||
) |
Get device information for an UDCD bus.
[out] | devInfo | - Device information |
[in] | bus | - UDCD bus (default is 2) |
int ksceUdcdGetDrvState | ( | const char * | driverName | ) |
Get state of a specific USB driver.
driverName | - name of USB driver to get status from |
int ksceUdcdGetDrvStateInternal | ( | const char * | driverName, |
int | bus | ||
) |
Get state of a specific USB driver for an UDCD bus.
driverName | - name of USB driver to get status from | |
[in] | bus | - UDCD bus (default is 2) |
int ksceUdcdWaitState | ( | SceUdcdWaitParam * | waitParam, |
unsigned int | timeout | ||
) |
Wait for state.
[in] | waitParam | - Wait parameter |
[in] | timeout | - Timeout |
int ksceUdcdWaitStateInternal | ( | SceUdcdWaitParam * | waitParam, |
unsigned int | timeout, | ||
int | bus | ||
) |
Wait for state for an UDCD bus.
[in] | waitParam | - Wait parameter |
[in] | timeout | - Timeout |
[in] | bus | - UDCD bus (default is 2) |
int ksceUdcdRegister | ( | SceUdcdDriver * | drv | ) |
Register a USB driver.
drv | - Pointer to a filled out USB driver |
int ksceUdcdRegisterInternal | ( | SceUdcdDriver * | drv, |
int | bus | ||
) |
Register a USB driver to a specific USB bus.
drv | - Pointer to a filled out USB driver |
bus | - The USB bus index (usually 2) |
int ksceUdcdUnregister | ( | SceUdcdDriver * | drv | ) |
Unregister a USB driver.
drv | - Pointer to a filled out USB driver |
int ksceUdcdUnregisterInternal | ( | SceUdcdDriver * | drv, |
int | bus | ||
) |
Unregister a USB driver for an UDCD bus.
drv | - Pointer to a filled out USB driver | |
[in] | bus | - UDCD bus (default is 2) |
int ksceUdcdClearFIFO | ( | SceUdcdEndpoint * | endp | ) |
Clear the FIFO on an endpoint.
endp | - The endpoint to clear |
int ksceUdcdClearFIFOInternal | ( | SceUdcdEndpoint * | endp, |
int | bus | ||
) |
Clear the FIFO on an endpoint for an UDCD bus.
endp | - The endpoint to clear | |
[in] | bus | - UDCD bus (default is 2) |
int ksceUdcdReqCancelAll | ( | SceUdcdEndpoint * | endp | ) |
Cancel any pending requests on an endpoint.
endp | - The endpoint to cancel |
int ksceUdcdStall | ( | SceUdcdEndpoint * | endp | ) |
Stall an endpoint.
endp | - The endpoint to stall |
int ksceUdcdStallInternal | ( | SceUdcdEndpoint * | endp, |
int | bus | ||
) |
Stall an endpoint for an UDCD bus.
endp | - The endpoint to stall | |
[in] | bus | - UDCD bus (default is 2) |
int ksceUdcdReqSend | ( | SceUdcdDeviceRequest * | req | ) |
Queue a send request (IN from host pov)
req | - Pointer to a filled out SceUdcdDeviceRequest structure. |
int ksceUdcdReqSendInternal | ( | SceUdcdDeviceRequest * | req, |
int | bus | ||
) |
Queue a send request (IN from host pov) for an UDCD bus.
req | - Pointer to a filled out SceUdcdDeviceRequest structure. | |
[in] | bus | - UDCD bus (default is 2) |
int ksceUdcdReqRecv | ( | SceUdcdDeviceRequest * | req | ) |
Queue a receive request (OUT from host pov)
req | - Pointer to a filled out SceUdcdDeviceRequest structure |
int ksceUdcdReqRecvInternal | ( | SceUdcdDeviceRequest * | req, |
int | bus | ||
) |
Queue a receive request (OUT from host pov) for an UDCD bus.
req | - Pointer to a filled out SceUdcdDeviceRequest structure | |
[in] | bus | - UDCD bus (default is 2) |