|
@@ -14,15 +14,24 @@ const
|
|
USB_REPTYPE_INPUT = $01;
|
|
USB_REPTYPE_INPUT = $01;
|
|
USB_REPTYPE_OUTPUT = $02;
|
|
USB_REPTYPE_OUTPUT = $02;
|
|
USB_REPTYPE_FEATURE = $03;
|
|
USB_REPTYPE_FEATURE = $03;
|
|
- USB_REQTYPE_GET = $A1;
|
|
|
|
- USB_REQTYPE_SET = $21;
|
|
|
|
|
|
+
|
|
USB_DT_DEVICE = $01;
|
|
USB_DT_DEVICE = $01;
|
|
USB_DT_CONFIG = $02;
|
|
USB_DT_CONFIG = $02;
|
|
USB_DT_STRING = $03;
|
|
USB_DT_STRING = $03;
|
|
USB_DT_INTERFACE = $04;
|
|
USB_DT_INTERFACE = $04;
|
|
USB_DT_ENDPOINT = $05;
|
|
USB_DT_ENDPOINT = $05;
|
|
|
|
+ USB_DT_DEVICE_QUALIFIER = $06;
|
|
|
|
+ USB_DT_OTHER_SPEED_CONFIG = $07;
|
|
|
|
+ USB_DT_INTERFACE_POWER = $08;
|
|
|
|
+ USB_DT_OTG = $09;
|
|
|
|
+ USB_DT_DEBUG = $10;
|
|
|
|
+ USB_DT_INTERFACE_ASSOCIATION = $11;
|
|
USB_DT_HID = $21;
|
|
USB_DT_HID = $21;
|
|
USB_DT_REPORT = $22;
|
|
USB_DT_REPORT = $22;
|
|
|
|
+ USB_DT_PHYSICAL = $23;
|
|
|
|
+ USB_DT_CLASS_SPECIFIC_INTERFACE = $24;
|
|
|
|
+ USB_DT_CLASS_SPECIFIC_ENDPOINT = $25;
|
|
|
|
+ USB_DT_HUB = $29;
|
|
|
|
|
|
USB_REQ_GETSTATUS = $00;
|
|
USB_REQ_GETSTATUS = $00;
|
|
USB_REQ_CLEARFEATURE = $01;
|
|
USB_REQ_CLEARFEATURE = $01;
|
|
@@ -32,13 +41,16 @@ const
|
|
USB_REQ_SETDESCRIPTOR = $07;
|
|
USB_REQ_SETDESCRIPTOR = $07;
|
|
USB_REQ_GETCONFIG = $08;
|
|
USB_REQ_GETCONFIG = $08;
|
|
USB_REQ_SETCONFIG = $09;
|
|
USB_REQ_SETCONFIG = $09;
|
|
- USB_REQ_GETINTERFACE = $0a;
|
|
|
|
- USB_REQ_SETINTERFACE = $0b;
|
|
|
|
- USB_REQ_SYNCFRAME = $0c;
|
|
|
|
- USB_REQ_GETPROTOCOL = $03;
|
|
|
|
- USB_REQ_SETPROTOCOL = $0B;
|
|
|
|
|
|
+ USB_REQ_GETINTERFACE = $0A;
|
|
|
|
+ USB_REQ_SETINTERFACE = $0B;
|
|
|
|
+ USB_REQ_SYNCFRAME = $0C;
|
|
USB_REQ_GETREPORT = $01;
|
|
USB_REQ_GETREPORT = $01;
|
|
|
|
+ USB_REQ_GETIDLE = $02;
|
|
|
|
+ USB_REQ_GETPROTOCOL = $03;
|
|
USB_REQ_SETREPORT = $09;
|
|
USB_REQ_SETREPORT = $09;
|
|
|
|
+ USB_REQ_SETIDLE = $0A;
|
|
|
|
+ USB_REQ_SETPROTOCOL = $0B;
|
|
|
|
+
|
|
|
|
|
|
USB_DT_DEVICE_SIZE = 18;
|
|
USB_DT_DEVICE_SIZE = 18;
|
|
USB_DT_CONFIG_SIZE = 9;
|
|
USB_DT_CONFIG_SIZE = 9;
|
|
@@ -58,6 +70,14 @@ const
|
|
USB_CTRLTYPE_REC_INTERFACE = 1;
|
|
USB_CTRLTYPE_REC_INTERFACE = 1;
|
|
USB_CTRLTYPE_REC_ENDPOINT = 2;
|
|
USB_CTRLTYPE_REC_ENDPOINT = 2;
|
|
USB_CTRLTYPE_REC_OTHER = 3;
|
|
USB_CTRLTYPE_REC_OTHER = 3;
|
|
|
|
+
|
|
|
|
+ USB_REQTYPE_INTERFACE_GET = (USB_CTRLTYPE_DIR_DEVICE2HOST or USB_CTRLTYPE_TYPE_CLASS or USB_CTRLTYPE_REC_INTERFACE);
|
|
|
|
+ USB_REQTYPE_INTERFACE_SET = (USB_CTRLTYPE_DIR_HOST2DEVICE or USB_CTRLTYPE_TYPE_CLASS or USB_CTRLTYPE_REC_INTERFACE);
|
|
|
|
+ USB_REQTYPE_ENDPOINT_GET = (USB_CTRLTYPE_DIR_DEVICE2HOST or USB_CTRLTYPE_TYPE_CLASS or USB_CTRLTYPE_REC_ENDPOINT);
|
|
|
|
+ USB_REQTYPE_ENDPOINT_SET = (USB_CTRLTYPE_DIR_HOST2DEVICE or USB_CTRLTYPE_TYPE_CLASS or USB_CTRLTYPE_REC_ENDPOINT);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
USB_FEATURE_ENDPOINT_HALT = 0;
|
|
USB_FEATURE_ENDPOINT_HALT = 0;
|
|
USB_ENDPOINT_INTERRUPT = $03;
|
|
USB_ENDPOINT_INTERRUPT = $03;
|
|
USB_ENDPOINT_IN = $80;
|
|
USB_ENDPOINT_IN = $80;
|
|
@@ -88,7 +108,7 @@ type
|
|
bInterfaceProtocol : cuint8;
|
|
bInterfaceProtocol : cuint8;
|
|
iInterface : cuint8;
|
|
iInterface : cuint8;
|
|
extra : pcuint8;
|
|
extra : pcuint8;
|
|
- extra_size : cuint8;
|
|
|
|
|
|
+ extra_size : cuint16;
|
|
endpoints : P_usbendpointdesc;
|
|
endpoints : P_usbendpointdesc;
|
|
end;
|
|
end;
|
|
usb_interfacedesc = _usbinterfacedesc;
|
|
usb_interfacedesc = _usbinterfacedesc;
|
|
@@ -139,7 +159,7 @@ type
|
|
// u8 bDescriptorType;
|
|
// u8 bDescriptorType;
|
|
// u16 wDescriptorLength;
|
|
// u16 wDescriptorLength;
|
|
// } descr[1];
|
|
// } descr[1];
|
|
- descr: record
|
|
|
|
|
|
+ descr: packed record
|
|
bDescriptorType: cuint8;
|
|
bDescriptorType: cuint8;
|
|
wDescriptorLength: cuint16;
|
|
wDescriptorLength: cuint16;
|
|
end;
|
|
end;
|
|
@@ -179,8 +199,8 @@ function USB_GetDescriptors(fd: cint32; udd: Pusb_devdesc): cint32; cdecl; exter
|
|
|
|
|
|
procedure USB_FreeDescriptors(udd: Pusb_devdesc); cdecl; external;
|
|
procedure USB_FreeDescriptors(udd: Pusb_devdesc); cdecl; external;
|
|
|
|
|
|
-function USB_GetHIDDescriptor(fd: cint32; uhd: Pusb_hiddesc): cint32; cdecl; external;
|
|
|
|
-
|
|
|
|
|
|
+function USB_GetGenericDescriptor(fd: cint32; _type, _index, _interface: cuint8; data: pointer; size: cuint32): cint32; cdecl; external;
|
|
|
|
+function USB_GetHIDDescriptor(fd: cint32; _interface: cuint8; uhd: pusb_hiddesc; size: cuint32): cint32; cdecl; external;
|
|
|
|
|
|
function USB_GetDeviceDescription(fd: cint32; devdesc: Pusb_devdesc): cint32; cdecl; external;
|
|
function USB_GetDeviceDescription(fd: cint32; devdesc: Pusb_devdesc): cint32; cdecl; external;
|
|
|
|
|
|
@@ -193,6 +213,9 @@ function USB_SuspendDevice(fd: cint32): cint32; cdecl; external;
|
|
|
|
|
|
function USB_ResumeDevice(fd: cint32): cint32; cdecl; external;
|
|
function USB_ResumeDevice(fd: cint32): cint32; cdecl; external;
|
|
|
|
|
|
|
|
+function USB_ReadIsoMsg(fd: cint32; bEndpoint, bPackets: cuint8; rpPacketSizes: pcuint16; rpData: pointer): cint32; cdecl; external;
|
|
|
|
+function USB_ReadIsoMsgAsync(fd: cint32; bEndpoint, bPackets: cuint8; rpPacketSizes: pcuint16; rpData: pointer; cb: usbcallback; userdata: pointer): cint32; cdecl; external;
|
|
|
|
+
|
|
|
|
|
|
function USB_ReadIntrMsg(fd: cint32; bEndpoint: cuint8; wLength: cuint16;
|
|
function USB_ReadIntrMsg(fd: cint32; bEndpoint: cuint8; wLength: cuint16;
|
|
rpData: pointer): cint32; cdecl; external;
|
|
rpData: pointer): cint32; cdecl; external;
|
|
@@ -215,6 +238,10 @@ function USB_ReadCtrlMsgAsync(fd: cint32; bmRequestType, bmRequest: cuint8;
|
|
wValue, wIndex, wLength: cuint16; rpData: pointer; cb: usbcallback;
|
|
wValue, wIndex, wLength: cuint16; rpData: pointer; cb: usbcallback;
|
|
usrdata: pointer): cint32; cdecl; external;
|
|
usrdata: pointer): cint32; cdecl; external;
|
|
|
|
|
|
|
|
+function USB_WriteIsoMsg(fd: cint32; bEndpoint, bPackets: cuint8; rpPacketSizes: pcuint16; rpData: pointer): cint32; cdecl; external;
|
|
|
|
+function USB_WriteIsoMsgAsync(fd: cint32; bEndpoint, bPackets: cuint8; rpPacketSizes: pcuint16; rpData: pointer; cb: usbcallback; userdata: pointer): cint32; cdecl; external;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
function USB_WriteIntrMsg(fd: cint32; bEndpoint: cuint8; wLength: cuint16;
|
|
function USB_WriteIntrMsg(fd: cint32; bEndpoint: cuint8; wLength: cuint16;
|
|
rpData: pointer): cint32; cdecl; external;
|
|
rpData: pointer): cint32; cdecl; external;
|
|
@@ -250,7 +277,7 @@ function USB_ClearHalt(fd: cint32; endpointAddress: cuint8): cint32; cdecl; exte
|
|
function USB_GetDeviceList(descr_buffer: Pusb_device_entry;
|
|
function USB_GetDeviceList(descr_buffer: Pusb_device_entry;
|
|
num_descr, interface_class: cuint8; cnt_descr: pcuint8): cint32; cdecl; external;
|
|
num_descr, interface_class: cuint8; cnt_descr: pcuint8): cint32; cdecl; external;
|
|
|
|
|
|
-function USB_GetAsciiString(fd: cint32; wIndex, wLangID, wLength: cuint16; rpData: pointer): cint32; cdecl; external;
|
|
|
|
|
|
+function USB_GetAsciiString(fd: cint32; bIndex: cuint8; wLangID, wLength: cuint16; rpData: pointer): cint32; cdecl; external;
|
|
|
|
|
|
|
|
|
|
{$endif HW_RVL}
|
|
{$endif HW_RVL}
|