3 * - By John Hodge (thePowersGang)
13 typedef struct sUSBInterface tUSBInterface;
14 typedef struct sUSBDriver tUSBDriver;
16 typedef void (*tUSB_DataCallback)(tUSBInterface *Dev, int EndPt, int Length, void *Data);
26 int MatchType; // 0: Interface, 1: Device, 2: Vendor
29 // 23:16 - Interface Class
30 // 15:8 - Interface Sub Class
31 // 7:0 - Interface Protocol
41 void (*Connected)(tUSBInterface *Dev, void *Descriptors, size_t Size);
42 void (*Disconnected)(tUSBInterface *Dev);
47 // NOTE: Top bit indicates the direction (1=Input)
49 // Data availiable Callback
50 tUSB_DataCallback DataAvail;
54 extern void USB_RegisterDriver(tUSBDriver *Driver);
56 extern void *USB_GetDeviceDataPtr(tUSBInterface *Dev);
57 extern void USB_SetDeviceDataPtr(tUSBInterface *Dev, void *Ptr);
59 extern void USB_StartPollingEndpoint(tUSBInterface *Dev, int Endpoint);
60 extern void USB_ReadDescriptor(tUSBInterface *Dev, int Type, int Index, int Length, void *Data);
61 extern void USB_Request(tUSBInterface *Dev, int Endpoint, int Type, int Req, int Value, int Index, int Len, void *Data);
63 extern void USB_SendData(tUSBInterface *Dev, int Endpoint, int Length, void *Data);
64 extern void USB_RecvData(tUSBInterface *Dev, int Endpoint, int Length, void *Data);
65 extern void USB_RecvDataA(tUSBInterface *Dev, int Endpoint, int Length, void *DataBuf, tUSB_DataCallback Callback);