I'm trying to set up a USB device to automatically use WinUSB as the driver when it is connected to a Windows 8 machine, as outlined here.
It says:
In order for the USB driver stack to know that the device supports extended feature descriptors, the device must define an OS string descriptor that is stored at string index 0xEE.
Which I take to mean that I need to create a struct containing the descriptor at memory location 0xEE. How would I go about that in C?
Here's what I tried:
// The struct definition
typedef struct {
uint8_t bLength;
uint8_t bDescriptorType;
uint8_t qwSignature[14];
uint8_t bMS_VendorCode;
uint8_t bPad;
} usb_os_str_desc_t;
// Create a pointer to a struct located at 0xEE
volatile usb_os_str_desc_t* const extended_feature_support = (usb_os_str_desc_t*) 0xEE;
// Create a new struct at the location specified in "extended_feature_support"
(*extended_feature_support) = {
.bLength = 0x12,
.bDescriptorType = 0x03,
.qwSignature = "MSFT100",
.bMS_VendorCode = 0x04,
.bPad = 0x00
};
But the compiler doesn't like this, complaining that the data definition has no type. Is there a way to do this in C? Am I understanding the article correctly?
Any help would be apprciated.