#include <usb_host.h>
typedef struct sUSBHost tUSBHost;
+typedef struct sUSBDevice tUSBDevice;
+typedef struct sUSBEndpoint tUSBEndpoint;
// === STRUCTURES ===
/**
*/
struct sUSBHub
{
- tUSBDevice *Device;
-
- tUSB_HubPoll CheckPorts;
+ tUSBInterface *Interface;
int nPorts;
tUSBDevice *Devices[];
};
+struct sUSBEndpoint
+{
+ tUSBEndpoint *Next; // In the poll list
+ tUSBInterface *Interface;
+ int EndpointNum;
+
+ int PollingPeriod; // In 1ms intervals
+ int MaxPacketSize; // In bytes
+
+ Uint8 Type; // Same as sUSBDriver.Endpoints.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;
/**
*/
tUSBHost *Host;
int Address;
-
- tUSBDriver *Driver;
- void *Data;
+
+ int nInterfaces;
+ tUSBInterface *Interfaces[];
};
struct sUSBHost
Uint8 AddressBitmap[128/8];
tUSBDevice RootHubDev;
+ tUSBInterface RootHubIf;
tUSBHub RootHub;
};