📄 mass_public.c
字号:
#include "mass_protocol.h"
#include "mass_usb.h"
#include "tcc730_usb.h"
code unsigned char g_NON_MASS_DeviceDescriptor[] = {
DEVICE_DESC_SIZE, //0 Device Descriptor Length : 18
0x01, //1 type = DEVICE
0x10, //2 USB Version LSB
0x01, //3 => 1.00 => 1.10 MSB
0x00, //4 class
0x00, //5 subclass
0x00, //6 protocol
0x10, //7 Max pack size for EP0 <= EP0_SIZE
(NON_MASS_VID >> 0) & 0xff, //8 vendor ID LSB
(NON_MASS_VID >> 8) & 0xff, //9 vendor ID MSB
(NON_MASS_PID >> 0) & 0xff, //10 product ID LSB
(NON_MASS_PID >> 8) & 0xff, //11 product ID MSB
0x00, //12 device release number. LSB
0x01, //13 device release number. MSB
0x00, //14 Index fo string descriptor describing manufacture.
0x00, //15 Index fo string descriptor describing this product.
0x00, //16 Index fo string descriptor describing the device's
// serial number. Keep the 0x00 data.
0x01 //17 num of possible configurations.
};
#pragma packed on
CONST_OR_CODE USB_DEVICE_DESCRIPTOR g_MASS_DeviceDescriptor =
{
sizeof(USB_DEVICE_DESCRIPTOR), // bLength
USB_DEVICE_DESCRIPTOR_TYPE, // bDescriptorType
SWAP16(0x0110), // bcdUSB, TCC730 was adopted USB version 1.1
0, // bDeviceClass
0, // bDeviceSubClass
0, // bDeviceProtocol
EP0_PACKET_SIZE, // bMaxPacketSize0
SWAP16(MASS_VID), // idVendor
SWAP16(MASS_PID), // idProduct
SWAP16(0x0100), // bcdDevice
1, //STR_INDEX_MANUFACTURER, // iManufacturer
2, //STR_INDEX_PRODUCT, // iProduct
3, //STR_INDEX_SERIALNUMBER, // iSerialNumber
1 // bNumConfigurations
};
#pragma packed off
#pragma packed on
CONST_OR_CODE USB_STRING_LANGUAGE_DESCRIPTOR g_strLanguage =
{
sizeof(USB_STRING_LANGUAGE_DESCRIPTOR),
USB_STRING_DESCRIPTOR_TYPE,
SWAP16(0x0412), // Korean
SWAP16(0x0409), // English
};
#pragma packed off
#pragma packed on
CONST_OR_CODE USB_STRING_MANUFACTURER_DESCRIPTOR g_strManufacturer =
{
sizeof(USB_STRING_MANUFACTURER_DESCRIPTOR),
USB_STRING_DESCRIPTOR_TYPE,
{
'T', 0,
'e', 0,
'l', 0,
'e', 0,
'c', 0,
'h', 0,
'i', 0,
'p', 0,
's', 0,
'A', 0,
'P', 0,
'I', 0,
'C', 0}
};
#pragma packed off
#pragma packed on
CONST_OR_CODE USB_STRING_PRODUCT_DESCRIPTOR g_strProduct =
{
sizeof(USB_STRING_PRODUCT_DESCRIPTOR),
USB_STRING_DESCRIPTOR_TYPE,
{
'T', 0,
'C', 0,
'C', 0,
'7', 0,
'3', 0,
'0', 0,
' ', 0,
'M', 0,
'M', 0,
'C', 0,
' ', 0,
'A', 0,
'd', 0,
'a', 0,
'p', 0,
't', 0,
'e', 0,
'r', 0}
};
#pragma packed off
#pragma packed on
CONST_OR_CODE USB_STRING_SERIALNUMBER_DESCRIPTOR g_strSerialNum =
{
sizeof(USB_STRING_SERIALNUMBER_DESCRIPTOR),
USB_STRING_DESCRIPTOR_TYPE,
{
'0',0,
'0',0,
'0',0,
'0',0,
'0',0,
'0',0,
'0',0,
'0',0,
'0',0,
'0',0,
'0',0,
'0',0}
};
#pragma packed off
/*************************************************************************************
* MASS_DRIVE_GetTotalPhyDrv
*
* Description :
* Argument :
* Return :
*
*
*************************************************************************************/
unsigned int MASS_DRIVE_GetTotalPhyDrv( void )
{
return 2; // NFL+MMC or NFL+SMC 2Drives
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -