Kernel - Slight reworks to timer code
[tpg/acess2.git] / Modules / USB / Core / usb_proto.h
1 /**
2  * Acess2 USB Stack
3  * - By John Hodge (thePowersGang)
4  * 
5  * usb_proto.h
6  * - USB Core Protocol Definitions
7  */
8 #ifndef _USB_PROTO_H_
9 #define _USB_PROTO_H_
10
11 struct sDeviceRequest
12 {
13         Uint8   ReqType;
14         Uint8   Request;
15         Uint16  Value;
16         Uint16  Index;
17         Uint16  Length;
18 };
19
20 /*
21  */
22 struct sDescriptor_Device
23 {
24         Uint8   Length;
25         Uint8   Type;   // = 1
26         Uint16  USBVersion;     // BCD, 0x210 = 2.10
27         Uint8   DeviceClass;
28         Uint8   DeviceSubClass;
29         Uint8   DeviceProtocol;
30         Uint8   MaxPacketSize;
31         
32         Uint16  VendorID;
33         Uint16  ProductID;
34         Uint16  DeviceID;       // BCD
35         
36         Uint8   ManufacturerStr;
37         Uint8   ProductStr;
38         Uint8   SerialNumberStr;
39         
40         Uint8   NumConfigurations;
41 } PACKED;
42
43 struct sDescriptor_Configuration
44 {
45         Uint8   Length;
46         Uint8   Type;   // = 2
47         
48         Uint16  TotalLength;
49         Uint8   NumInterfaces;
50         Uint8   ConfigurationValue;
51         Uint8   ConfigurationStr;
52         Uint8   AttributesBmp;
53         Uint8   MaxPower;       // in units of 2 mA
54 } PACKED;
55
56 struct sDescriptor_String
57 {
58         Uint8   Length;
59         Uint8   Type;   // = 3
60         
61         Uint16  Data[128-1];    // (256 bytes - 2 bytes) / Uint16
62 } PACKED;
63
64 struct sDescriptor_Interface
65 {
66         Uint8   Length;
67         Uint8   Type;   // = 4
68         
69         Uint8   InterfaceNum;
70         Uint8   AlternateSetting;
71         Uint8   NumEndpoints;   // Excludes endpoint 0
72         
73         Uint8   InterfaceClass; // 
74         Uint8   InterfaceSubClass;
75         Uint8   InterfaceProtocol;
76         
77         Uint8   InterfaceStr;
78 } PACKED;
79
80 struct sDescriptor_Endpoint
81 {
82         Uint8   Length;
83         Uint8   Type;   // = 5
84         Uint8   Address;        // 3:0 Endpoint Num, 7: Direction (1=IN)
85         /**
86          * 1:0 - Transfer Type
87          * - 00 = Control
88          * - 01 = Isochronous
89          * - 10 = Bulk
90          * - 11 = Interrupt
91          * 3:2 - Synchronisation type (Isonchronous only)
92          * - 00 = No Synchronisation
93          * - 01 = Asynchronous
94          * - 10 = Adaptive
95          * - 11 = Synchronous
96          * 5:4 - Usage type (Isonchronous only)
97          * - 00 = Data endpoint
98          * - 01 = Feedback endpoint
99          */
100         Uint8   Attributes;
101         
102         Uint16  MaxPacketSize;
103         
104         /**
105          * 
106          */
107         Uint8   PollingInterval;
108 } PACKED;
109
110 #endif
111

UCC git Repository :: git.ucc.asn.au