X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Modules%2FUSB%2FCore%2Fusb_proto.h;h=b5399e8e3991c0cbdaf692fd2e0b42d1d83dda45;hb=9faf301f7a2b963fd58d289652cbf25b3c52bf9a;hp=3a98e47959922276b8b7ef3e92244d6fef4803af;hpb=dfe55553735a8cfa2b7207e5096caddded32c992;p=tpg%2Facess2.git diff --git a/Modules/USB/Core/usb_proto.h b/Modules/USB/Core/usb_proto.h index 3a98e479..b5399e8e 100644 --- a/Modules/USB/Core/usb_proto.h +++ b/Modules/USB/Core/usb_proto.h @@ -17,7 +17,7 @@ struct sDeviceRequest struct sDescriptor_Device { Uint8 Length; - Uint8 Type; // = + Uint8 Type; // = 1 Uint16 USBVersion; // BCD, 0x210 = 2.10 Uint8 DeviceClass; Uint8 DeviceSubClass; @@ -26,13 +26,81 @@ struct sDescriptor_Device Uint16 VendorID; Uint16 ProductID; + Uint16 DeviceID; // BCD Uint8 ManufacturerStr; Uint8 ProductStr; Uint8 SerialNumberStr; Uint8 NumConfigurations; -}; +} PACKED; + +struct sDescriptor_Configuration +{ + Uint8 Length; + Uint8 Type; // = 2 + + Uint16 TotalLength; + Uint8 NumInterfaces; + Uint8 ConfigurationValue; + Uint8 ConfigurationStr; + Uint8 AttributesBmp; + Uint8 MaxPower; // in units of 2 mA +} PACKED; + +struct sDescriptor_String +{ + Uint8 Length; + Uint8 Type; // = 3 + + Uint16 Data[62]; // 62 is arbitary +} PACKED; + +struct sDescriptor_Interface +{ + Uint8 Length; + Uint8 Type; // = 4 + + Uint8 InterfaceNum; + Uint8 AlternateSetting; + Uint8 NumEndpoints; // Excludes endpoint 0 + + Uint8 InterfaceClass; // + Uint8 InterfaceSubClass; + Uint8 InterfaceProtocol; + + Uint8 InterfaceStr; +} PACKED; + +struct sDescriptor_Endpoint +{ + Uint8 Length; + Uint8 Type; // = 5 + Uint8 Address; // 3:0 Endpoint Num, 7: Direction (IN/OUT) + /** + * 1:0 - Transfer Type + * - 00 = Control + * - 01 = Isochronous + * - 10 = Bulk + * - 11 = Interrupt + * 3:2 - Synchronisation type (Isonchronous only) + * - 00 = No Synchronisation + * - 01 = Asynchronous + * - 10 = Adaptive + * - 11 = Synchronous + * 5:4 - Usage type (Isonchronous only) + * - 00 = Data endpoint + * - 01 = Feedback endpoint + */ + Uint8 Attributes; + + Uint16 MaxPacketSize; + + /** + * + */ + Uint8 PollingInterval; +} PACKED; #endif