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 // --- Driver Pointer ---
57 extern void *USB_GetDeviceDataPtr(tUSBInterface *Dev);
58 extern void USB_SetDeviceDataPtr(tUSBInterface *Dev, void *Ptr);
60 // --- Device/Interface information ---
61 extern Uint32 USB_GetInterfaceClass(tUSBInterface *Dev);
62 extern void USB_GetDeviceVendor(tUSBInterface *Dev, Uint16 *VendorID, Uint16 *DeviceID);
63 extern char *USB_GetSerialNumber(tUSBInterface *Dev);
66 extern void USB_StartPollingEndpoint(tUSBInterface *Dev, int Endpoint);
67 extern void USB_ReadDescriptor(tUSBInterface *Dev, int Type, int Index, int Length, void *Data);
68 extern void USB_Request(tUSBInterface *Dev, int Endpoint, int Type, int Req, int Value, int Index, int Len, void *Data);
70 extern void USB_SendData(tUSBInterface *Dev, int Endpoint, size_t Length, const void *Data);
71 extern void USB_RecvData(tUSBInterface *Dev, int Endpoint, size_t Length, void *Data);
72 extern void USB_RecvDataA(tUSBInterface *Dev, int Endpoint, size_t Length, void *DataBuf);