18#ifndef __USB_COMMON_H__
19#define __USB_COMMON_H__
31#define DeviceRequest ((USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_DEVICE) << 8)
32#define DeviceOutRequest ((USB_DIR_OUT | USB_TYPE_STANDARD | USB_RECIP_DEVICE) << 8)
33#define InterfaceRequest ((USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_INTERFACE) << 8)
34#define EndpointRequest ((USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_INTERFACE) << 8)
35#define EndpointOutRequest ((USB_DIR_OUT | USB_TYPE_STANDARD | USB_RECIP_INTERFACE) << 8)
37#define ClearHubFeature (0x2000 | USB_REQ_CLEAR_FEATURE)
38#define ClearPortFeature (0x2300 | USB_REQ_CLEAR_FEATURE)
39#define GetHubDescriptor (0xa000 | USB_REQ_GET_DESCRIPTOR)
40#define GetHubStatus (0xa000 | USB_REQ_GET_STATUS)
41#define GetPortStatus (0xa300 | USB_REQ_GET_STATUS)
42#define SetHubFeature (0x2000 | USB_REQ_SET_FEATURE)
43#define SetPortFeature (0x2300 | USB_REQ_SET_FEATURE)
45#define USB_ENDPOINT_HALT 0
47#define USB_DT_DEVICE_SIZE 18
48#define USB_DT_CONFIG_SIZE 9
49#define USB_DT_INTERFACE_SIZE 9
50#define USB_DT_ENDPOINT_SIZE 7
51#define USB_DT_ENDPOINT_AUDIO_SIZE 9
52#define USB_DT_DEVICE_QUALIFIER_SIZE 10
53#define USB_DT_INTERFACE_ASSOCIATION_SIZE 8
54#define USB_DT_BOS_SIZE 5
297static inline int vsf_usb_hex_to_bin(
char ch)
299 if ((ch >=
'0') && (ch <=
'9')) {
303 if ((ch >=
'a') && (ch <=
'f')) {
304 return ch -
'a' + 10;
unsigned short uint16_t
Definition lvgl.h:41
unsigned char uint8_t
Definition lvgl.h:40
Definition usb_common.h:179
uint8_t bDescriptorType
Definition usb_common.h:181
uint8_t bLength
Definition usb_common.h:180
uint8_t bDescriptorSubType
Definition usb_common.h:182
Definition usb_common.h:203
uint8_t bConfigurationValue
Definition usb_common.h:209
uint8_t bDescriptorType
Definition usb_common.h:205
uint8_t bmAttributes
Definition usb_common.h:211
uint8_t bMaxPower
Definition usb_common.h:212
uint8_t bLength
Definition usb_common.h:204
uint8_t bNumInterfaces
Definition usb_common.h:208
uint8_t iConfiguration
Definition usb_common.h:210
uint16_t wTotalLength
Definition usb_common.h:207
Definition usb_common.h:85
uint16_t wIndex
Definition usb_common.h:89
uint8_t bRequestType
Definition usb_common.h:86
uint8_t bRequest
Definition usb_common.h:87
uint16_t wValue
Definition usb_common.h:88
uint16_t wLength
Definition usb_common.h:90
Definition usb_common.h:185
uint8_t bNumConfigurations
Definition usb_common.h:200
uint8_t bDescriptorType
Definition usb_common.h:187
uint8_t bMaxPacketSize0
Definition usb_common.h:193
uint8_t bDeviceClass
Definition usb_common.h:190
uint16_t idVendor
Definition usb_common.h:194
uint16_t bcdUSB
Definition usb_common.h:189
uint16_t bcdDevice
Definition usb_common.h:196
uint8_t iManufacturer
Definition usb_common.h:197
uint8_t iProduct
Definition usb_common.h:198
uint16_t idProduct
Definition usb_common.h:195
uint8_t bDeviceProtocol
Definition usb_common.h:192
uint8_t bLength
Definition usb_common.h:186
uint8_t iSerialNumber
Definition usb_common.h:199
uint8_t bDeviceSubClass
Definition usb_common.h:191
Definition usb_common.h:240
uint8_t bInterval
Definition usb_common.h:247
uint8_t bmAttributes
Definition usb_common.h:245
uint8_t bEndpointAddress
Definition usb_common.h:244
uint8_t bLength
Definition usb_common.h:241
uint8_t bDescriptorType
Definition usb_common.h:242
uint8_t bSynchAddress
Definition usb_common.h:252
uint8_t bRefresh
Definition usb_common.h:251
uint16_t wMaxPacketSize
Definition usb_common.h:246
Definition usb_common.h:255
uint8_t bLength
Definition usb_common.h:256
uint8_t bInterfaceCount
Definition usb_common.h:260
uint8_t bFunctionProtocol
Definition usb_common.h:263
uint8_t iFunction
Definition usb_common.h:264
uint8_t bFunctionClass
Definition usb_common.h:261
uint8_t bDescriptorType
Definition usb_common.h:257
uint8_t bFunctionSubClass
Definition usb_common.h:262
uint8_t bFirstInterface
Definition usb_common.h:259
Definition usb_common.h:227
uint8_t bAlternateSetting
Definition usb_common.h:232
uint8_t bInterfaceClass
Definition usb_common.h:234
uint8_t bInterfaceProtocol
Definition usb_common.h:236
uint8_t bDescriptorType
Definition usb_common.h:229
uint8_t iInterface
Definition usb_common.h:237
uint8_t bInterfaceNumber
Definition usb_common.h:231
uint8_t bNumEndpoints
Definition usb_common.h:233
uint8_t bInterfaceSubClass
Definition usb_common.h:235
uint8_t bLength
Definition usb_common.h:228
usb_desc_type_t
Definition usb_common.h:148
@ USB_DT_DEVICE_CAPABILITY
Definition usb_common.h:159
@ USB_DT_ENDPOINT
Definition usb_common.h:153
@ USB_DT_INTERFACE_ASSOCIATION
Definition usb_common.h:157
@ USB_DT_SS_ENDPOINT_COMP
Definition usb_common.h:160
@ USB_DT_CS_ENDPOINT
Definition usb_common.h:166
@ USB_DT_CONFIG
Definition usb_common.h:150
@ USB_DT_CS_DEVICE
Definition usb_common.h:162
@ USB_DT_INTERFACE
Definition usb_common.h:152
@ USB_DT_CS_INTERFACE
Definition usb_common.h:165
@ USB_DT_BOS
Definition usb_common.h:158
@ USB_DT_STRING
Definition usb_common.h:151
@ USB_DT_INTERFACE_POWER
Definition usb_common.h:156
@ USB_DT_REPORT
Definition usb_common.h:169
@ USB_DT_DEVICE_QUALIFIER
Definition usb_common.h:154
@ USB_DT_CS_STRING
Definition usb_common.h:164
@ USB_DT_HID
Definition usb_common.h:168
@ USB_DT_PHYSICAL
Definition usb_common.h:170
@ USB_DT_CS_CONFIG
Definition usb_common.h:163
@ USB_DT_HUB
Definition usb_common.h:171
@ USB_DT_OTHER_SPEED_CONFIG
Definition usb_common.h:155
@ USB_DT_DEVICE
Definition usb_common.h:149
usb_device_speed_t
Definition usb_common.h:267
@ USB_SPEED_LOW
Definition usb_common.h:269
@ USB_SPEED_FULL
Definition usb_common.h:269
@ USB_SPEED_HIGH
Definition usb_common.h:270
@ USB_SPEED_UNKNOWN
Definition usb_common.h:268
@ USB_SPEED_SUPER_PLUS
Definition usb_common.h:273
@ USB_SPEED_WIRELESS
Definition usb_common.h:271
@ USB_SPEED_SUPER
Definition usb_common.h:272
usb_feature_t
Definition usb_common.h:222
@ USB_DEVICE_REMOTE_WAKEUP
Definition usb_common.h:224
@ USB_DEVICE_SELF_POWERED
Definition usb_common.h:223
usb_endpoint_sync_t
Definition usb_common.h:276
@ USB_ENDPOINT_SYNC_SYNC
Definition usb_common.h:281
@ USB_ENDPOINT_SYNC_NONE
Definition usb_common.h:278
@ USB_ENDPOINT_SYNC_ADAPTIVE
Definition usb_common.h:280
@ USB_ENDPOINT_SYNCTYPE
Definition usb_common.h:277
@ USB_ENDPOINT_SYNC_ASYNC
Definition usb_common.h:279
usb_req_recip_t
Definition usb_common.h:115
@ USB_RECIP_ENDPOINT
Definition usb_common.h:119
@ USB_RECIP_DEVICE
Definition usb_common.h:117
@ USB_RECIP_RPIPE
Definition usb_common.h:123
@ USB_RECIP_OTHER
Definition usb_common.h:120
@ USB_RECIP_MASK
Definition usb_common.h:116
@ USB_RECIP_INTERFACE
Definition usb_common.h:118
@ USB_RECIP_PORT
Definition usb_common.h:122
usb_endpoint_xfer_t
Definition usb_common.h:284
@ USB_ENDPOINT_XFERTYPE_MASK
Definition usb_common.h:285
@ USB_ENDPOINT_XFER_BULK
Definition usb_common.h:288
@ USB_ENDPOINT_XFER_INT
Definition usb_common.h:289
@ USB_ENDPOINT_XFER_ISOC
Definition usb_common.h:287
@ USB_ENDPOINT_MAX_ADJUSTABLE
Definition usb_common.h:290
@ USB_ENDPOINT_XFER_CONTROL
Definition usb_common.h:286
usb_req_type_t
Definition usb_common.h:107
@ USB_TYPE_RESERVED
Definition usb_common.h:112
@ USB_TYPE_VENDOR
Definition usb_common.h:111
@ USB_TYPE_MASK
Definition usb_common.h:108
@ USB_TYPE_CLASS
Definition usb_common.h:110
@ USB_TYPE_STANDARD
Definition usb_common.h:109
usb_class_t
Definition usb_common.h:126
@ USB_CLASS_AUDIO
Definition usb_common.h:128
@ USB_CLASS_MISC
Definition usb_common.h:141
@ USB_CLASS_VIDEO
Definition usb_common.h:139
@ USB_CLASS_PHYSICAL
Definition usb_common.h:131
@ USB_CLASS_HID
Definition usb_common.h:130
@ USB_SUBCLASS_VENDOR_SPEC
Definition usb_common.h:145
@ USB_CLASS_PRINTER
Definition usb_common.h:133
@ USB_CLASS_COMM
Definition usb_common.h:129
@ USB_CLASS_APP_SPEC
Definition usb_common.h:142
@ USB_CLASS_PER_INTERFACE
Definition usb_common.h:127
@ USB_CLASS_CDC_DATA
Definition usb_common.h:136
@ USB_CLASS_HUB
Definition usb_common.h:135
@ USB_CLASS_STILL_IMAGE
Definition usb_common.h:132
@ USB_CLASS_CSCID
Definition usb_common.h:137
@ USB_CLASS_CONTENT_SEC
Definition usb_common.h:138
@ USB_CLASS_VENDOR_SPEC
Definition usb_common.h:143
@ USB_CLASS_MASS_STORAGE
Definition usb_common.h:134
@ USB_CLASS_WIRELESS_CONTROLLER
Definition usb_common.h:140
usb_dir_t
Definition usb_common.h:79
@ USB_DIR_OUT
Definition usb_common.h:81
@ USB_DIR_IN
Definition usb_common.h:82
@ USB_DIR_MASK
Definition usb_common.h:80
usb_req_t
Definition usb_common.h:93
@ USB_REQ_SYNCH_FRAME
Definition usb_common.h:104
@ USB_REQ_SET_INTERFACE
Definition usb_common.h:103
@ USB_REQ_GET_DESCRIPTOR
Definition usb_common.h:98
@ USB_REQ_SET_DESCRIPTOR
Definition usb_common.h:99
@ USB_REQ_CLEAR_FEATURE
Definition usb_common.h:95
@ USB_REQ_GET_INTERFACE
Definition usb_common.h:102
@ USB_REQ_GET_CONFIGURATION
Definition usb_common.h:100
@ USB_REQ_SET_ADDRESS
Definition usb_common.h:97
@ USB_REQ_SET_CONFIGURATION
Definition usb_common.h:101
@ USB_REQ_GET_STATUS
Definition usb_common.h:94
@ USB_REQ_SET_FEATURE
Definition usb_common.h:96
usb_config_desc_att_t
Definition usb_common.h:215
@ USB_CONFIG_ATT_BATTERY
Definition usb_common.h:219
@ USB_CONFIG_ATT_WAKEUP
Definition usb_common.h:218
@ USB_CONFIG_ATT_ONE
Definition usb_common.h:216
@ USB_CONFIG_ATT_SELFPOWER
Definition usb_common.h:217
usb_pid_t
Definition usb_common.h:59
@ USB_PID_MDATA
Definition usb_common.h:76
@ USB_PID_STALL
Definition usb_common.h:75
@ USB_PID_PREAMBLE
Definition usb_common.h:72
@ USB_PID_DATA1
Definition usb_common.h:71
@ USB_PID_NAK
Definition usb_common.h:70
@ USB_PID_PING
Definition usb_common.h:64
@ USB_PID_ACK
Definition usb_common.h:62
@ USB_PID_ERR
Definition usb_common.h:73
@ USB_PID_SOF
Definition usb_common.h:65
@ USB_PID_IN
Definition usb_common.h:69
@ USB_PID_DATA2
Definition usb_common.h:67
@ USB_PID_EXT
Definition usb_common.h:60
@ USB_PID_OUT
Definition usb_common.h:61
@ USB_PID_DATA0
Definition usb_common.h:63
@ USB_PID_NYET
Definition usb_common.h:66
@ USB_PID_SPLIT
Definition usb_common.h:68
@ USB_PID_SETUP
Definition usb_common.h:74
struct vk_romfs_header_t VSF_CAL_PACKED