📄 u_rom_data.h
字号:
/******************************************************************************
* File name : rom_data.h
* Module name : A definition of a ROM variable
* Author : Hiromichi Kondo
*-----------------------------------------------------------------------------
* $Id: rom_data.h,v 1.2 2003/05/16 06:53:00 9551619 Exp $
*****************************************************************************/
#ifndef _ROM_DATA_H_
#define _ROM_DATA_H_
#include "u_macro.h"
#include "u_usb.h"
/*--- TestMode -----------------------------*/
GLOBALC BYTE const test_packet[]
#ifdef GLBREAL
= {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,
0xAA,0xEE,0xEE,0xEE,0xEE,0xEE,0xEE,0xEE,
0xEE,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0xBF,0xDF,
0xEF,0xF7,0xFB,0xFD,0xFC,0x7E,0xBF,0xDF,
0xEF,0xF7,0xFB,0xFD,0x7E
}
#endif
;
/* Inquiry */
GLOBALC BYTE const inquiry_data[]
#ifdef GLBREAL
={
0x00, /* =0 */
0x80, /* RMB=1, =0 */
0x00, /* ISO=0, ECMA=0, ANSI=0 */
0x01, /* AENC=0, TrmIOP=0, =1 */
0x1f, /* */
0x00, /* */
0x00, /* */
0x10, /* RelAdr=0, Wbus32=0, Wbus16=0, Sync=1, Linked=0 */
/* CmdQue=0, SftRe=0 */
'E','P','S','O','N',' ',' ',' ',
/* ID*/
'N','I','K','K','A',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',
/* ID */
'V','0','.','1' /* */
}
#endif
;
/* ATAPI ModeSenseModeSelect */
GLOBALC BYTE const mode_data[]
#ifdef GLBREAL
={
/*--- Page 01h Default or Current Value --- */
0x01, /* Page Code */
0x0A, /* Page Length */
0x00, /* Error Recovery Parameters */
0x01, /* Read Retry Count */
0x00, /* Reserved */
0x00, /* Reserved */
0x00, /* Reserved */
0x00, /* Reserved */
0x01, /* Write Retry Count */
0x00, /* Reserved */
0x00, /* Reserved */
0x00, /* Reserved */
/*--- Page 08h Default or Current Value --- */
0x08, /* Page Code */
0x0A, /* Page Length */
0x00, /* Read or Write Cache Control */
0x00, /* Reserved */
0x00, /* Reserved */
0x00, /* Reserved */
0x00, /* Reserved */
0x00, /* Reserved */
0x00, /* Reserved */
0x00, /* Reserved */
0x00, /* Reserved */
0x00, /* Reserved */
/*--- Page 1Bh Default or Current Value --- */
0x1B, /* Page Code */
0x0A, /* Page Length */
0x00, /* SRFP = 0 */
0x00, /* NCD = 0MSL = 0TLUN = 0 */
0x00, /* Reserved */
0x00, /* Reserved */
0x00, /* Reserved */
0x00, /* Reserved */
0x00, /* Reserved */
0x00, /* Reserved */
0x00, /* Reserved */
0x00, /* Reserved */
/*--- Page 01h Changeable Value --- */
0x01, /* Page Code */
0x0A, /* Page Length */
0x00, /* Error Recovery Parameters */
0x00, /* Read Retry Count */
0x00, /* Reserved */
0x00, /* Reserved */
0x00, /* Reserved */
0x00, /* Reserved */
0x00, /* Write Retry Count */
0x00, /* Reserved */
0x00, /* Reserved */
0x00, /* Reserved */
/*--- Page 08h Changeable Value --- */
0x08, /* Page Code */
0x0A, /* Page Length */
0x00, /* Read or Write Cache Control */
0x00, /* Reserved */
0x00, /* Reserved */
0x00, /* Reserved */
0x00, /* Reserved */
0x00, /* Reserved */
0x00, /* Reserved */
0x00, /* Reserved */
0x00, /* Reserved */
0x00, /* Reserved */
/*--- Page 1Bh Changeable Value --- */
0x1B, /* Page Code */
0x0A, /* Page Length */
0x00, /* SRFP = 0 */
0x00, /* NCD = 0MSL = 0TLUN = 0 */
0x00, /* Reserved */
0x00, /* Reserved */
0x00, /* Reserved */
0x00, /* Reserved */
0x00, /* Reserved */
0x00, /* Reserved */
0x00, /* Reserved */
0x00} /* Reserved */
#endif
;
#ifdef DEBUG_PRINT
GLOBALC BYTE hexstr[]
#ifdef GLBREAL
= "0123456789ABCDEF"
#endif
;
typedef struct {
char *name; /* Variable name */
int len; /* length */
unsigned long *dwcount; /* count */
} DEBUGCOUNT;
GLOBALC DEBUGCOUNT debugcounts[]
#ifdef GLBREAL
={
{"BulkInError",12,&INErrorCount},
{"BulkOutError",13,&OUTErrorCount},
{"USBResetCount",14,&USBResetCount},
{"EP0INErrorCount",16,&EP0INErrorCount},
{"EP0OUTErrorCount",17,&EP0OUTErrorCount},
{"",0,NULL}
}
#endif
;
#endif
#ifdef BULK_ONLY
/*** BulkOnlyDescriptor ***************************************************/
/*--- Device Descriptor ----------------------------------------------------*/
GLOBALC DeviceDesc const fs_device_desc
#ifdef GLBREAL
= {
0x12, /* bLength */
0x01, /* bDescriptorType */
W(02,00), /* bcdUSB */
0x00, /* bDeviceClass */
0x00, /* bDeviceSubClass */
0x00, /* bDeviceProtocol */
0x40, /* bMaxPacketSize0 */
W(04,B8), /* idVendor */
#ifndef USBTOOL
W(05,07), /* idProduct (Nikka BulkOnly) */
#else
W(05,18), /* idProduct (S1R72013 ) */
#endif
W(01,00), /* bcdDevice */
0x01, /* iManufacturer */
0x02, /* iProduct */
0x03, /* iSerialNumber */
0x01} /* bNumConfigurations */
#endif
;
/*--- String Descriptor ----------------------------------------------------*/
GLOBALC BYTE const string0_desc[] /* String0 */
#ifdef GLBREAL
= {
0x04, /* bLength */
0x03, /* bDescriptorType */
0x09,0x04} /* LANGID */
#endif
;
GLOBALC BYTE const string1_desc[] /* String1 */
#ifdef GLBREAL
= {
0x12, /* bLength */
0x03, /* bDescriptorType */
'E',0x00, /* bString */
'P',0x00,
'S',0x00,
'O',0x00,
'N',0x00,
' ',0x00,
' ',0x00,
' ',0x00}
#endif
;
GLOBALC BYTE const string2_desc[] /* String2 */
#ifdef GLBREAL
= {
0x52, /* bLength */
0x03, /* bDescriptorType */
'E',0x00, /* bString */
'P',0x00,
'S',0x00,
'O',0x00,
'N',0x00,
' ',0x00,
'N',0x00,
'I',0x00,
'K',0x00,
'K',0x00,
'A',0x00,
' ',0x00,
'A',0x00,
'T',0x00,
'A',0x00,
'/',0x00,
'A',0x00,
'T',0x00,
'A',0x00,
'P',0x00,
'I',0x00,
' ',0x00,
'B',0x00,
'r',0x00,
'i',0x00,
'd',0x00,
'g',0x00,
'e',0x00,
' ',0x00,
'(',0x00,
'B',0x00,
'u',0x00,
'l',0x00,
'k',0x00,
'-',0x00,
'O',0x00,
'n',0x00,
'l',0x00,
'y',0x00,
')',0x00}
#endif
;
GLOBALC BYTE const string3_desc[] /* String3 */
#ifdef GLBREAL
= {
0x12, /* bLength */
0x03, /* bDescriptorType */
'R',0x00, /* bString */
'e',0x00,
'v',0x00,
'.',0x00,
'0',0x00,
'.',0x00,
'2',0x00,
'0',0x00}
#endif
;
GLOBALC BYTE const *string_table[] /* String */
#ifdef GLBREAL
= {
string0_desc,
string1_desc,
string2_desc,
string3_desc
}
#endif
;
/*--- Config Descriptor ----------------------------------------------------*/
GLOBALC ConfigDesc fs_config_desc
#ifdef GLBREAL
= {
0x09, /* bLength */
0x02, /* bDescriptorType */
W(00,20), /* wTotalLength */
0x01, /* bNumInterfaces */
0x01, /* bConfigurationValue */
0x00, /* iConfiguration */
#ifdef DISABLE_REMOTE_WAKEUP
0xC0, /* bmAttributes */
#else
0xE0, /* bmAttributes(Remote Wakeup Support) */
#endif
0x31} /* bMaxPower */
#endif
;
/*--- FS Endpoint Descriptor -----------------------------------------------*/
GLOBALC EndpointDesc fs_endpoint_desc[2] /* FSEndpoint0 */
#ifdef GLBREAL
= {{
0x07, /* bLength */
0x05, /* bDescriptorType */
#ifdef IODATA_HOST
0x82, /* bEndpointAddress */
#else
0x81, /* bEndpointAddress */
#endif
0x02, /* bmAttributes */
W(00,40), /* wMaxPacketSize */
0xFF}, /* bInterval */
/*-----------------------------------------------------------------------*/
{ /* FSEndpoint1 */
0x07, /* bLength */
0x05, /* bDescriptorType */
#ifdef IODATA_HOST
0x01, /* bEndpointAddress */
#else
0x02, /* bEndpointAddress */
#endif
0x02, /* bmAttributes */
W(00,40), /* wMaxPacketSize */
0xFF}} /* bInterval */
#endif
;
/*--- FS Interface Descriptor -----------------------------------------------*/
GLOBALC InterfaceDesc fs_interface_desc[1] /* FSInterface0 */
#ifdef GLBREAL
= {
0x09, /* bLength */
0x04, /* bDescriptorType */
0x00, /* bInterfaceNumber */
0x00, /* bAlternateSetting */
0x02, /* bNumEndpoints */
#ifndef USBTOOL
0x08, /* bInterfaceClass(BulkOnly) */
#else
0xFF, /* bInterfaceClass(S1R72013 ) */
#endif
0x05, /* bInterfaceSubClass */
0x50, /* bInterfaceProtocol */
0x00, /* iInterface */
fs_endpoint_desc} /* Endpoint Descriptor */
#endif
;
#else
/*** CBIDescriptor ********************************************************/
/*--- Device Descriptor ----------------------------------------------------*/
GLOBALC DeviceDesc const fs_device_desc
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -