Designer Reference Manual USB08 Evaluation Board
94 Source Code Files MOTOROLA
Source Code Files
//--------------------- ------------------------ ----------------------- --------
// Standard Interface Descriptor
// according to USB1.1 spec page 202
//
typedef struct {
uchar bLength; // Size of this Descriptor in Bytes
uchar bDescriptorType; // Descriptor Type (=4)
uchar bInterfaceNumber; // Number of *this* Int erface (0..)
uchar bAlternateSetting ; // Alternative for this Interface (if any)
uchar bNumEndpoints; // No of EPs used by th is IF (excl. EP0)
uchar bInterfaceClass; // Interface Class Co de
uchar bInterfaceSubClas s; // Interface Subclass C ode
uchar bInterfaceProtoco l; // Interface Protocol C ode
uchar iInterface; // Index of String Desc for this Interface
} interface_descriptor;
//--------------------- ------------------------ ----------------------- --------
// Standard Endpoint De scriptor
// according to USB1.1 spec page 203
//
typedef struct {
uchar bLength; // Size of this Descriptor in Bytes
uchar bDescriptorType; // Descriptor Type (=5)
uchar bEndpointAddress; // Endpoint Address (Nu mber + Direction)
uchar bmAttributes; // Endpoint Attributes (Trans fe r Typ e)
iword wMaxPacketSize; // Max. Endpoint Packet Size
uchar bInterval; // Polling Interval (Interrupt) in ms
} endpoint_descriptor;
//--------------------- ------------------------ ----------------------- --------
// Structure of Setup P acket sent during
// SETUP Stage of Stand ard Device Requests
// according to USB1.1 spec page 183
//
typedef struct {
uchar bmRequestType; // Characteristics (Direction ,T yp e,Recipient)
uchar bRequest; // Standard Request Code
iword wValue; // Value Field
iword wIndex; // Index or Offset Field
iword wLength; // Number of Bytes to transfer (Data Sta ge )
} setup_buffer;
//--------------------- ------------------------ ----------------------- --------
// USB Status Codes
//
#define US_ATTACHED 0x00 // (not used here)
#define US_POWERED 0x01
#define US_DEFAULT 0x02
#define US_ADDRESSED 0x03
#define US_CONFIGURED 0x04
#define US_SUSPENDED 0x80