9169b0fa5d34a5446a37a8b1fc1f14bae961aa84
[tpg/acess2.git] / Modules / USB / Core / include / usb_core.h
1 /*
2  * Acess2 USB Stack
3  * - By John Hodge (thePowersGang)
4  *
5  * usb_core.h
6  * - Core USB IO Header 
7  */
8 #ifndef _USB_CORE_H_
9 #define _USB_CORE_H_
10
11 typedef struct sUSBDevice       tUSBDevice;
12 typedef struct sUSBDriver       tUSBDriver;
13
14 /**
15  */
16 struct sUSBDriver
17 {
18         tUSBDriver      *Next;
19         
20         const char      *Name;
21         
22         // TODO: Check class codes and provide other identifcation options
23         Uint32  ClassCode;
24
25         void    (*Connected)(tUSBDevice *Dev);
26         void    (*Disconnected)(tUSBDevice *Dev);
27
28          int    MaxEndpoints;   
29         struct {
30                 // 0: Bulk, 1: Control, 2: Interrupt
31                  int    Type;
32                 // Data availiable Callback
33                 void    (*Interrupt)(tUSBDevice *Dev, int Length, void *Data);
34         } Endpoints[];
35 };
36
37 extern void     *USB_GetDeviceDataPtr(tUSBDevice *Dev);
38 extern void     USB_SetDeviceDataPtr(tUSBDevice *Dev, void *Ptr);
39
40 extern void     USB_SendData(tUSBDevice *Dev, int Endpoint, int Length, void *Data);
41
42 #endif
43

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