vitasdk
Documentation of the vitasdk
usbd.h
Go to the documentation of this file.
6#ifndef _PSP2COMMON_USBD_H_
7#define _PSP2COMMON_USBD_H_
8
10#include <psp2common/types.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16
29
30
31
32
33#define SCE_USBD_CLASS_PER_INTERFACE 0x00
34#define SCE_USBD_CLASS_AUDIO 0x01
35#define SCE_USBD_CLASS_COMMUNICATIONS 0x02
36#define SCE_USBD_CLASS_HID 0x03
37#define SCE_USBD_CLASS_MONITOR 0x04
38#define SCE_USBD_CLASS_PHYSICAL 0x05
39#define SCE_USBD_CLASS_POWER 0x06
40#define SCE_USBD_CLASS_PRINTER 0x07
41#define SCE_USBD_CLASS_STORAGE 0x08
42#define SCE_USBD_CLASS_HUB 0x09
43#define SCE_USBD_CLASS_DATA 0x0a
44#define SCE_USBD_CLASS_VENDOR_SPECIFIC 0xff
45
47 SCE_USBD_DESCRIPTOR_DEVICE = 0x01, // bDescriptorType for a Device Descriptor.
48 SCE_USBD_DESCRIPTOR_CONFIGURATION = 0x02, // bDescriptorType for a Configuration Descriptor.
49 SCE_USBD_DESCRIPTOR_STRING = 0x03, // bDescriptorType for a String Descriptor.
50 SCE_USBD_DESCRIPTOR_INTERFACE = 0x04, // bDescriptorType for an Interface Descriptor.
51 SCE_USBD_DESCRIPTOR_ENDPOINT = 0x05, // bDescriptorType for an Endpoint Descriptor.
52
53 SCE_USBD_DESCRIPTOR_DEVICE_QUALIFIER = 0x06, // bDescriptorType for a Device Qualifier.
54 SCE_USBD_DESCRIPTOR_OTHER_SPEED = 0x07, // bDescriptorType for a Other Speed Configuration.
55 SCE_USBD_DESCRIPTOR_INTERFACE_POWER = 0x08, // bDescriptorType for Interface Power.
56 SCE_USBD_DESCRIPTOR_OTG = 0x09, // bDescriptorType for an OTG Descriptor.
57 SCE_USBD_DESCRIPTOR_HID = 0x21, // bDescriptorType for an HID descriptor.
58 SCE_USBD_DESCRIPTOR_REPORT = 0x22 // bDescriptorType for an HID report descriptor.
60
61#define SCE_USBD_CONFIGURATION_RESERVED_ZERO 0x1f
62#define SCE_USBD_CONFIGURATION_REMOTE_WAKEUP 0x20
63#define SCE_USBD_CONFIGURATION_SELF_POWERED 0x40
64#define SCE_USBD_CONFIGURATION_RESERVED_ONE 0x80
65
66/* bmAttributes */
67#define SCE_USBD_ENDPOINT_TRANSFER_TYPE_BITS 0x03
68#define SCE_USBD_ENDPOINT_TRANSFER_TYPE_SHIFT 0
69#define SCE_USBD_ENDPOINT_TRANSFER_TYPE_CONTROL 0x00
70
71#define SCE_USBD_ENDPOINT_TRANSFER_TYPE_ISOCHRONOUS 0x01
72#define SCE_USBD_ENDPOINT_TRANSFER_TYPE_BULK 0x02
73#define SCE_USBD_ENDPOINT_TRANSFER_TYPE_INTERRUPT 0x03
74
75/* bEndpointAddress */
76#define SCE_USBD_ENDPOINT_NUMBER_BITS 0x1f
77#define SCE_USBD_ENDPOINT_NUMBER_SHIFT 0
78#define SCE_USBD_ENDPOINT_DIRECTION_BITS 0x80
79#define SCE_USBD_ENDPOINT_DIRECTION_SHIFT 7
80#define SCE_USBD_ENDPOINT_DIRECTION_OUT 0x00
81#define SCE_USBD_ENDPOINT_DIRECTION_IN 0x80
82
83
101
113
126
136
143
150
167
168#ifdef __cplusplus
169}
170#endif
171
172#endif /* _PSP2COMMON_USBD_H_ */
#define VITASDK_BUILD_ASSERT_EQ(__size__, __name__)
Definition build_utils.h:13
uint16_t bcdUSB
Definition usbd.h:87
uint8_t bInterfaceSubclass
Definition usbd.h:121
uint8_t bEndpointAddress
Definition usbd.h:130
SceUsbdDescriptorType
Definition usbd.h:46
uint8_t bDeviceSubclass
Definition usbd.h:89
uint8_t iInterface
Definition usbd.h:123
uint8_t bLength
Definition usbd.h:152
uint8_t bmAttributes
Definition usbd.h:109
uint8_t bInterfaceClass
Definition usbd.h:120
uint8_t bLength
Definition usbd.h:138
uint16_t bcdDevice
Definition usbd.h:94
uint8_t bNumInterfaces
Definition usbd.h:106
uint8_t bLength
Definition usbd.h:103
uint8_t bDescriptorType
Definition usbd.h:139
uint8_t bInterfaceProtocol
Definition usbd.h:122
unsigned int unk0
Definition usbd.h:163
uint8_t bInterfaceNumber
Definition usbd.h:117
uint8_t bLength
Definition usbd.h:115
uint8_t bLength
Definition usbd.h:85
uint8_t bMaxPacketSize0
Definition usbd.h:91
uint8_t bcdHID0
Definition usbd.h:154
uint16_t idVendor
Definition usbd.h:92
uint8_t iSerialNumber
Definition usbd.h:97
uint8_t bInterval
Definition usbd.h:133
uint8_t bDescriptorType
Definition usbd.h:145
uint16_t wMaxPacketSize
Definition usbd.h:132
uint8_t bDescriptorType
Definition usbd.h:116
uint16_t idProduct
Definition usbd.h:93
struct SceUsbdDeviceAddress __attribute__((packed)) SceUsbdDeviceAddress
uint8_t bDescriptorType
Definition usbd.h:129
uint8_t bAlternateSetting
Definition usbd.h:118
uint8_t bcdHID1
Definition usbd.h:155
uint8_t bNumConfigurations
Definition usbd.h:98
uint8_t wDescriptorLength1
Definition usbd.h:147
uint8_t bDescriptorType
Definition usbd.h:86
uint8_t wDescriptorLength0
Definition usbd.h:146
uint8_t bDescriptorType
Definition usbd.h:153
uint8_t bDeviceProtocol
Definition usbd.h:90
uint8_t iConfiguration
Definition usbd.h:108
uint8_t bCountryCode
Definition usbd.h:156
uint8_t bNumDescriptors
Definition usbd.h:157
uint16_t wTotalLength
Definition usbd.h:105
uint8_t iProduct
Definition usbd.h:96
uint8_t bDescriptorType
Definition usbd.h:104
uint8_t bString[0]
Definition usbd.h:140
SceUsbdErrorCode
Definition usbd.h:17
uint8_t bDeviceClass
Definition usbd.h:88
unsigned short unk1
Definition usbd.h:164
uint8_t bNumEndpoints
Definition usbd.h:119
uint8_t bLength
Definition usbd.h:128
uint8_t bmAttributes
Definition usbd.h:131
uint8_t iManufacturer
Definition usbd.h:95
SceUsbdHidSubDescriptorInfo SubDescriptorInfo[0]
Definition usbd.h:158
uint8_t bConfigurationValue
Definition usbd.h:107
uint8_t MaxPower
Definition usbd.h:110
@ SCE_USBD_DESCRIPTOR_ENDPOINT
Definition usbd.h:51
@ SCE_USBD_DESCRIPTOR_OTHER_SPEED
Definition usbd.h:54
@ SCE_USBD_DESCRIPTOR_INTERFACE_POWER
Definition usbd.h:55
@ SCE_USBD_DESCRIPTOR_OTG
Definition usbd.h:56
@ SCE_USBD_DESCRIPTOR_STRING
Definition usbd.h:49
@ SCE_USBD_DESCRIPTOR_CONFIGURATION
Definition usbd.h:48
@ SCE_USBD_DESCRIPTOR_DEVICE
Definition usbd.h:47
@ SCE_USBD_DESCRIPTOR_INTERFACE
Definition usbd.h:50
@ SCE_USBD_DESCRIPTOR_REPORT
Definition usbd.h:58
@ SCE_USBD_DESCRIPTOR_DEVICE_QUALIFIER
Definition usbd.h:53
@ SCE_USBD_DESCRIPTOR_HID
Definition usbd.h:57
@ SCE_USBD_ERROR_DEVICE_NOT_FOUND
Definition usbd.h:23
@ SCE_USBD_ERROR_80240009
Definition usbd.h:25
@ SCE_USBD_ERROR_NO_MEMORY
Definition usbd.h:22
@ SCE_USBD_ERROR_8024000A
Definition usbd.h:26
@ SCE_USBD_ERROR_NOT_INITIALIZED
Definition usbd.h:18
@ SCE_USBD_ERROR_ALREADY_INITIALIZED
Definition usbd.h:19
@ SCE_USBD_ERROR_PIPE_NOT_FOUND
Definition usbd.h:21
@ SCE_USBD_ERROR_FATAL
Definition usbd.h:27
@ SCE_USBD_ERROR_80240007
Definition usbd.h:24
@ SCE_USBD_ERROR_INVALID_PARAM
Definition usbd.h:20
Definition usbd.h:102
Definition usbd.h:162
Definition usbd.h:84
Definition usbd.h:127
Definition usbd.h:151
Definition usbd.h:144
Definition usbd.h:114
Definition usbd.h:137