Merge branch 'master' of ssh.ucc.asn.au:tpg/acess2
[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         // 23:16 - Interface Class
23         // 15:8  - Interface Sub Class
24         // 7:0   - Interface Protocol
25         Uint32  ClassMask;
26         Uint32  ClassCode;
27
28         void    (*Connected)(tUSBDevice *Dev);
29         void    (*Disconnected)(tUSBDevice *Dev);
30
31          int    MaxEndpoints;   
32         struct {
33                 // 0: Bulk, 1: Control, 2: Interrupt
34                  int    Type;
35                 // Data availiable Callback
36                 void    (*Interrupt)(tUSBDevice *Dev, int Length, void *Data);
37         } Endpoints[];
38 };
39
40 extern void     *USB_GetDeviceDataPtr(tUSBDevice *Dev);
41 extern void     USB_SetDeviceDataPtr(tUSBDevice *Dev, void *Ptr);
42
43 extern void     USB_SendData(tUSBDevice *Dev, int Endpoint, int Length, void *Data);
44
45 #endif
46

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