我试图设置USB设备,以便在连接到Windows 8机器时自动使用WinUSB作为驱动程序,如概述here。在设备固件中支持WinUSB
它说:
为了使USB驱动程序堆栈,以了解该设备支持扩展的特征描述,该设备必须定义存储在字符串索引0xEE的OS字符串描述符。
我认为我需要在内存位置0xEE创建一个包含描述符的结构体。我会怎么去解决C?
这里是我的尝试:
// 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
};
但是编译器不喜欢这个,抱怨那个数据定义没有类型。 有没有办法在C中做到这一点?我是否正确理解文章?
任何帮助将被apprciated。
这github链接看起来像我之后。谢谢! –