X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Modules%2FUSB%2FCore%2Fusb.h;h=c293c7db49b95849ea49624ed4d3c5528c979912;hb=3ab2857efdcb81ce34dabf4d07b39ad6f5ab0b4a;hp=177d7c7fa8c2b980e679aeb4433ab042bb47f8bb;hpb=79089cf3bb4828329d224c1d1cac9250bc57f932;p=tpg%2Facess2.git diff --git a/Modules/USB/Core/usb.h b/Modules/USB/Core/usb.h index 177d7c7f..c293c7db 100644 --- a/Modules/USB/Core/usb.h +++ b/Modules/USB/Core/usb.h @@ -10,6 +10,8 @@ #include typedef struct sUSBHost tUSBHost; +typedef struct sUSBDevice tUSBDevice; +typedef struct sUSBEndpoint tUSBEndpoint; // === STRUCTURES === /** @@ -25,12 +27,38 @@ struct sUSBHub tUSBDevice *Devices[]; }; +struct sUSBEndpoint +{ + tUSBInterface *Interface; + tUSBEndpoint *Next; // In the poll list + int PollingPeriod; // In 1ms intervals + int MaxPacketSize; // In bytes + + char Direction; // 1 Polled Input, 0 Output + + Uint8 Type; // Same as sDescriptor_Endpoint.Type +}; + +/** + * \brief Structure for a device's interface + */ +struct sUSBInterface +{ + tUSBInterface *Next; + tUSBDevice *Dev; + + tUSBDriver *Driver; + void *Data; + + int nEndpoints; + tUSBEndpoint Endpoints[]; +}; + /** * \brief Defines a single device on the USB Bus */ struct sUSBDevice { - tUSBDevice *Next; tUSBHub *ParentHub; /** @@ -38,9 +66,9 @@ struct sUSBDevice */ tUSBHost *Host; int Address; - - tUSBDriver *Driver; - void *Data; + + int nInterfaces; + tUSBInterface *Interfaces[]; }; struct sUSBHost