Re: USB design
The descriptor is just an array of bytes. It can be a constant array if you do not have the ram to spare.
The Device Descriptor is simply a byte array of size 18. The Configuration Descriptor is 9 bytes, but enumeration requires that the Config/Interface/Endpoint Descriptors be sent at one shot. Hence your array should be of the appropriate length. Most enumeration sequences would not require the individual extraction of interface or endpoint descriptors, but you may keep a record of their offsets if need be. For String Descriptors, the first entry is 4 bytes long. The rest are variable. All these information is available under Chapter 9.5 of the USB 2.0 Specifications.