📄 reqcode.c
字号:
//***********************************************************************
//* *
//* Routine : HS-Standard Endpoint Descriptor *
//* Input : None *
//* Output : None *
//* Function : None *
//* *
//***********************************************************************
ENDPOINT_DESCRIPTOR code Iso_In_Zero_Descriptor[] =
{
sizeof(ENDPOINT_DESCRIPTOR), //Length of Standard Endpoint Descriptor
0x05, //Standard Endpoint Type
0x81, //Enndpoint Address
0x01, //Endpoint Characteristic
SWAP(0x0000), //Endpoint Max Packet Size
0x01 //Interval for Polling Endpoint for data transfer
};
ENDPOINT_DESCRIPTOR code Iso_In_1024_Descriptor[] =
{
sizeof(ENDPOINT_DESCRIPTOR), //Length of Standard Endpoint Descriptor
0x05, //Standard Endpoint Type
0x81, //Enndpoint Address
0x01, //Endpoint Characteristic
SWAP(0x0400), //Endpoint Max Packet Size
0x01 //Interval for Polling Endpoint for data transfer
};
ENDPOINT_DESCRIPTOR code Iso_In_1020_Descriptor[] = //For Full speed only.
{
sizeof(ENDPOINT_DESCRIPTOR), //Length of Standard Endpoint Descriptor
0x05, //Standard Endpoint Type
0x81, //Enndpoint Address
0x01, //Endpoint Characteristic
SWAP(0x03FC), //Endpoint Max Packet Size
0x01 //Interval for Polling Endpoint for data transfer
};
ENDPOINT_DESCRIPTOR code Iso_In_512_Descriptor[] =
{
sizeof(ENDPOINT_DESCRIPTOR), //Length of Standard Endpoint Descriptor
0x05, //Standard Endpoint Type
0x81, //Enndpoint Address
0x01, //Endpoint Characteristic
SWAP(0x0200), //Endpoint Max Packet Size
0x01 //Interval for Polling Endpoint for data transfer
};
ENDPOINT_DESCRIPTOR code Iso_In_128_Descriptor[] =
{
sizeof(ENDPOINT_DESCRIPTOR), //Length of Standard Endpoint Descriptor
0x05, //Standard Endpoint Type
0x81, //Enndpoint Address
0x01, //Endpoint Characteristic
SWAP(0x0080), //Endpoint Max Packet Size
0x01 //Interval for Polling Endpoint for data transfer
};
ENDPOINT_DESCRIPTOR code Int_In_Descriptor[] =
{
sizeof(ENDPOINT_DESCRIPTOR), //Length of Standard Endpoint Descriptor
0x05, //Standard Endpoint Type
0x82, //Set Int endpoint to 2 for ATAPI mode
0x03, //Endpoint Characteristic
SWAP(0x0010), //SWAP(0x0008), //Endpoint Max Packet Size
0x0A //Interval for Polling Endpoint for data transfer
};
ENDPOINT_DESCRIPTOR code Bulk_In_512_Descriptor[] =
{
sizeof(ENDPOINT_DESCRIPTOR), //Length of Standard Endpoint Descriptor
0x05, //Standard Endpoint Type
0x81, //Set Int endpoint to 2 for ATAPI mode
0x02, //Endpoint Characteristic
SWAP(0x0200), //Endpoint Max Packet Size
0x10 //Interval for Polling Endpoint for data transfer
};
ENDPOINT_DESCRIPTOR code Bulk_In_256_Descriptor[] =
{
sizeof(ENDPOINT_DESCRIPTOR), //Length of Standard Endpoint Descriptor
0x05, //Standard Endpoint Type
0x81, //Set Int endpoint to 2 for ATAPI mode
0x02, //Endpoint Characteristic
SWAP(0x0100), //Endpoint Max Packet Size
0x10 //Interval for Polling Endpoint for data transfer
};
ENDPOINT_DESCRIPTOR code Bulk_In_64_Descriptor[] =
{
sizeof(ENDPOINT_DESCRIPTOR), //Length of Standard Endpoint Descriptor
0x05, //Standard Endpoint Type
0x81, //Set Int endpoint to 2 for ATAPI mode
0x02, //Endpoint Characteristic
SWAP(0x0040), //Endpoint Max Packet Size
0x10 //Interval for Polling Endpoint for data transfer
};
//TEST_BULK
//***********************************************************************
//* *
//* Routine : Standard String Descriptor *
//* Input : None *
//* Output : None *
//* Function : None *
//* *
//***********************************************************************
STRING_DESCRIPTOR code Standard_Product_String[] =
{ 0x30, // length
0x03, // descriptor type = string
'P' , 0x00,
'h' , 0x00,
'i' , 0x00,
'l' , 0x00,
'i' , 0x00,
'p' , 0x00,
's' , 0x00,
' ' , 0x00,
'I' , 0x00,
'S' , 0x00,
'P' , 0x00,
'1' , 0x00,
'5' , 0x00,
'8' , 0x00,
'1' , 0x00,
' ' , 0x00,
'V' , 0x00,
'e' , 0x00,
'r' , 0x00,
' ' , 0x00,
'1' , 0x00,
'.' , 0x00,
'0' , 0x00
};
//***********************************************************************
//* *
//* Routine : Standard String Descriptor *
//* Input : None *
//* Output : None *
//* Function : None *
//* *
//***********************************************************************
STRING_DESCRIPTOR code Standard_Manufacturer_String[] =
{ 0x1C, // length
0x03, // descriptor type = string
'P' , 0x00,
'h' , 0x00,
'i' , 0x00,
'l' , 0x00,
'i' , 0x00,
'p' , 0x00,
' ' , 0x00,
'-' , 0x00,
' ' , 0x00,
'A' , 0x00,
'P' , 0x00,
'I' , 0x00,
'C' , 0x00
};
//***********************************************************************
//* *
//* Routine : Standard String Identifications *
//* Input : None *
//* Output : None *
//* Function : None *
//* *
//***********************************************************************
STRING_ID code Standard_String_ID[] =
{
0x04,
0x03,
0x09,
0x04
};
//***********************************************************************
//* *
//* Routine : Test Packet *
//* Input : None *
//* Output : None *
//* Function : None *
//* *
//***********************************************************************
UC code Test_Packet[] =
{
// 0x00, 0x00,
// 0x00, 0x80, // syn pattern
0xc3,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
0x00, 0xaa,
0xaa, 0xaa,
0xaa, 0xaa,
0xaa, 0xaa,
0xaa, 0xee, //aa*4
0xee, 0xee,
0xee, 0xee,
0xee, 0xee,
0xee, 0xfe, //ee*4
0xff, 0xff,
0xff, 0xff,
0xff, 0xff,
0xff, 0xff,
0xff, 0xff, //FF*6
0xff, 0x7f,
0xbf, 0xdf,
0xef, 0xf7,
0xfb, 0xfd,
0xfc, 0x7e,
0xbf, 0xdf,
0xef, 0xf7,
0xfb, 0xfd,
0x7e,
0xb6, 0xce // crc --6D73
// 0xff, 0xf7
};
//***********************************************************************
//* *
//* Routine : HS Device Qualifier *
//* Input : None *
//* Output : None *
//* Function : None *
//* *
//***********************************************************************
DEVICE_QUALIFIER code Device_Qualifier_HS_Info[] =
{
sizeof(DEVICE_QUALIFIER), //length of HS Device Descriptor
0x06, //HS Device Qualifier Type
SWAP(0x0200), // USB 2.0 version
0x00, //Device class
0x00, //Device SubClass
0x00, //Device Protocol Code
0x40, //Maximum Packet SIze for other speed
0x01, //Number of Other speed configurations
0x00 //Reserved
};
DEVICE_QUALIFIER code Device_Qualifier_FS_Info[] =
{
sizeof(DEVICE_QUALIFIER), //length of HS Device Descriptor
0x06, //HS Device Qualifier Type
SWAP(0x0200), // USB 2.0 version
0x00, //Device class
0x00, //Device SubClass
0x00, //Device Protocol Code
0x40, //Maximum Packet SIze for other speed
0x01, //Number of Other speed configurations
0x00 //Reserved
};
//***********************************************************************
//* *
//* Routine : Other speed Configuration Descriptor *
//* Input : None *
//* Output : None *
//* Function : None *
//* *
//***********************************************************************
OTHER_SPEED_CONFIG_DESCRIPTOR code Config_Descriptor_FS_Info[] =
{
sizeof(OTHER_SPEED_CONFIG_DESCRIPTOR), //length of other speed configuration descriptor
0x07, //Other speed configuration Type
SWAP(FS_CONFIG_LENGTH), //Total length
0x01, //No of interface supported
0x01, //Configuration Value
0x00, //Index of string descriptor
0x80, //Configurations Characteristic
0x32 //Maximun Power
};
OTHER_SPEED_CONFIG_DESCRIPTOR code Config_Descriptor_HS_Info[] =
{
sizeof(OTHER_SPEED_CONFIG_DESCRIPTOR), //length of other speed configuration descriptor
0x07, //Other speed configuration Type
SWAP(HS_CONFIG_LENGTH), //Total length
0x01, //No of interface supported
0x01, //Configuration Value
0x00, //Index of string descriptor
0x80, //Configurations Characteristic
0x32 //Maximun Power
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -