X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Modules%2FUSB%2FCore%2Finclude%2Fusb_core.h;h=43af16f273a2c6bd341e975182bcc90fa07563ec;hb=1267ed57f39ebc3e6cdd9ec8835a881a2bcde32c;hp=2a8ce9d841acf15e7ab1e3cfbce7edaaee5ffac4;hpb=3ab2857efdcb81ce34dabf4d07b39ad6f5ab0b4a;p=tpg%2Facess2.git diff --git a/Modules/USB/Core/include/usb_core.h b/Modules/USB/Core/include/usb_core.h index 2a8ce9d8..43af16f2 100644 --- a/Modules/USB/Core/include/usb_core.h +++ b/Modules/USB/Core/include/usb_core.h @@ -8,9 +8,13 @@ #ifndef _USB_CORE_H_ #define _USB_CORE_H_ +#include + typedef struct sUSBInterface tUSBInterface; typedef struct sUSBDriver tUSBDriver; +typedef void (*tUSB_DataCallback)(tUSBInterface *Dev, int EndPt, int Length, void *Data); + /** */ struct sUSBDriver @@ -25,8 +29,8 @@ struct sUSBDriver // 23:16 - Interface Class // 15:8 - Interface Sub Class // 7:0 - Interface Protocol - Uint32 ClassMask; Uint32 ClassCode; + Uint32 ClassMask; } Class; struct { Uint16 VendorID; @@ -43,14 +47,20 @@ struct sUSBDriver // NOTE: Top bit indicates the direction (1=Input) Uint8 Attributes; // Data availiable Callback - void (*DataAvail)(tUSBInterface *Dev, int Length, void *Data); + tUSB_DataCallback DataAvail; } Endpoints[]; }; extern void *USB_GetDeviceDataPtr(tUSBInterface *Dev); extern void USB_SetDeviceDataPtr(tUSBInterface *Dev, void *Ptr); +extern void USB_StartPollingEndpoint(tUSBInterface *Dev, int Endpoint); +extern void USB_ReadDescriptor(tUSBInterface *Dev, int Type, int Index, int Length, void *Data); +extern void USB_Request(tUSBInterface *Dev, int Endpoint, int Type, int Req, int Value, int Index, int Len, void *Data); +// TODO: Async extern void USB_SendData(tUSBInterface *Dev, int Endpoint, int Length, void *Data); +extern void USB_RecvData(tUSBInterface *Dev, int Endpoint, int Length, void *Data); +extern void USB_RecvDataA(tUSBInterface *Dev, int Endpoint, int Length, void *DataBuf, tUSB_DataCallback Callback); #endif