usbmsd_rom例程解析:
1、将指针映射到片上驱动程序表中:
ROM ** rom = (ROM **) 0x1fff1ff8;
2、设置设备类型和信息:
MscDevInfo.idVendor = USB_VENDOR_ID;
MscDevInfo.idProduct = USB_PROD_ID;
MscDevInfo.bcdDevice = USB_DEVICE;
MscDevInfo.StrDescPtr = (uint32_t)&USB_StringDescriptor[0];
MscDevInfo.MSCInquiryStr = (uint32_t)&InquiryStr[0];
MscDevInfo.BlockSize = MSC_BlockSize;
MscDevInfo.BlockCount = MSC_BlockCount;
MscDevInfo.MemorySize = MSC_MemorySize;
MscDevInfo.MSC_Read = MSC_MemoryRead;
MscDevInfo.MSC_Write = MSC_MemoryWrite;
|