Hi anybody I declare the folowing stuctures:
typedef struct { ubyte bLength; ubyte bDescriptorType; ubyte bInterfaceNumber; ubyte bAlternateSetting; ubyte bNumEndpoints; ubyte bInterfaceClass; ubyte bInterfaceSubClass; ubyte bInterfaceProtocol; ubyte iInterface; } USB_interface_desc_t; typedef struct { ubyte bLength; ubyte bDescriptorType; uword wTotalLength; ubyte bNumInterfaces; ubyte bConfigurationValue; ubyte iConfiguration; ubyte bmAttributes; ubyte MaxPower; } USB_config_desc_t; typedef struct { ubyte bLength; ubyte bDescriptorType; struct { ubyte address:4; ubyte reserved:3; ubyte direction:1; } bEndpointAddress; ubyte bmAttributes; uword wMaxPacketSize; ubyte bInterval; } USB_endpoint_desc_t; typedef struct { USB_config_desc_t usb_dev_config_desc; USB_interface_desc_t usb_interface_0_alt_0_desc; USB_endpoint_desc_t usb_dev_endpoint_alt_0_desc[2]; } USB_long_config_desc_t;
While we're on the topic, I notice there are some bitfield declarations in the structure. Bitfield endianess (that is, whether they are allocated from the LSB first or MSB first) is implementation-specific, and is independent of multi-byte word endianness. Given the fragment
struct { ubyte myBits:4; ubyte myOtherBits:4; } nibble; nibble.myBits = 0xF; nibble.myOtherBits = 0;
2000