omap3530/beagle_drivers/wb/api/include/cyasusbdescs.h
changeset 27 117faf51deac
equal deleted inserted replaced
26:b7e488c49d0d 27:117faf51deac
       
     1 #ifndef USBDESCS_H
       
     2 #define USBDESCS_H
       
     3 
       
     4 #include <cyastoria.h>
       
     5 #include <cyasmtp.h>
       
     6 
       
     7 char* UsbStrings[] =
       
     8 {
       
     9     "Cypress Semiconductor",            /* Manufacturer (device) - index 1 */
       
    10 #ifdef DEBUG_ZERO
       
    11 	#ifdef DEBUG_MSC
       
    12 		"Astoria MSC Device Symbian",			/* 2 */
       
    13 	#else
       
    14 		"Astoria MTP Device Symbian",			/* 2 */
       
    15 	#endif
       
    16 #else
       
    17     "Astoria TMTP Device Symbian",		/* 2 */
       
    18 #endif
       
    19     "2222222222",				       	/* 3 */
       
    20     "Loopback Configuration",			/* 4 */
       
    21     "Loopback Interface"                /* 5 */
       
    22 } ;
       
    23 
       
    24 CyCh9DeviceQualifierDesc device_qualifier =
       
    25 {
       
    26     sizeof(CyCh9DeviceQualifierDesc),
       
    27     CY_CH9_GD_DEVICE_QUALIFIER,		/* DEVICE QUALIFIER TYPE */
       
    28     0x200,				/* USB VERSION */
       
    29     0x00,				/* DEVICE CLASS */
       
    30     0x00,				/* DEVICE SUBCLASS */
       
    31     0x00,				/* PROTOCOL */
       
    32     64,					/* EP0 PACKET SIZE */
       
    33     1,					/* NUMBER OF CONFIGURATIONS */
       
    34     0
       
    35 } ;
       
    36 
       
    37 /*
       
    38 * This is the basic device descriptor for this West Bridge test bench.  This descriptor is returned
       
    39 * by this software for P port based enumeration.
       
    40 */
       
    41 CyCh9DeviceDesc pport_device_desc =
       
    42 {
       
    43     sizeof(CyCh9DeviceDesc),
       
    44     CY_CH9_GD_DEVICE,		/* DESCRIPTOR TYPE */
       
    45     0x200,			/* USB VERSION */
       
    46     0x00,			/* DEVICE CLASS */
       
    47     0x00,			/* DEVICE SUBCLASS */
       
    48     0x00,			/* PROTOCOL */
       
    49     64,				/* EP0 packet size */
       
    50 #ifdef DEBUG_ZERO
       
    51     0x2,
       
    52     0x0,
       
    53 #else
       
    54     0x5,			/* CYPRESS VENDOR ID */
       
    55     0x5,			/* West Bridge (MADEUP) for composite device */
       
    56 #endif
       
    57     0x2,			/* DEVICE VERSION */
       
    58     0x01,			/* STRING ID FOR MANUF. */
       
    59     0x02,			/* STRING ID FOR PRODUCT */
       
    60     0x03,			/* STRING ID FOR SERIAL NUMBER */
       
    61     0x01			/* NUMBER OF CONFIGURATIONS */
       
    62 } ;
       
    63 
       
    64 CyCh9ConfigurationDesc ZeroDesc =
       
    65 {
       
    66     sizeof(CyCh9ConfigurationDesc),		/* Descriptor Length */
       
    67     CY_CH9_GD_CONFIGURATION,			/* Descriptor Type */
       
    68     sizeof(CyCh9ConfigurationDesc),
       
    69     0,						/* Number of Interfaces */
       
    70     1,						/* Configuration Number */
       
    71     0,						/* Configuration String */
       
    72     CY_CH9_CONFIG_ATTR_RESERVED_BIT7,		/* Configuration Attributes */
       
    73     50						/* Power Requirements */
       
    74 } ;
       
    75 
       
    76 #ifndef DEBUG_ZERO
       
    77 CyCh9ConfigurationDesc ConfigHSDesc =
       
    78 {
       
    79     sizeof(CyCh9ConfigurationDesc),		/* Descriptor Length */
       
    80     CY_CH9_GD_CONFIGURATION,			/* Descriptor Type */
       
    81     sizeof(CyCh9ConfigurationDesc),
       
    82     0,
       
    83     1,									/* Configuration Number */
       
    84     0,									/* Configuration String */
       
    85     CY_CH9_CONFIG_ATTR_RESERVED_BIT7,	/* Configuration attributes */
       
    86     50									/* Power requirements */
       
    87 } ;
       
    88 
       
    89 CyCh9ConfigurationDesc ConfigFSDesc =
       
    90 {
       
    91     sizeof(CyCh9ConfigurationDesc),		/* Descriptor Length */
       
    92     CY_CH9_GD_CONFIGURATION,			/* Descriptor Type */
       
    93     sizeof(CyCh9ConfigurationDesc),
       
    94     0,
       
    95     1,									/* Configuration Number */
       
    96     0,									/* Configuration String */
       
    97     CY_CH9_CONFIG_ATTR_RESERVED_BIT7,	/* Configuration attributes */
       
    98     50									/* Power requirements */
       
    99 } ;
       
   100 #else
       
   101 
       
   102 
       
   103 #ifdef DEBUG_MSC
       
   104 
       
   105 CyCh9ConfigurationDesc ConfigHSDesc =
       
   106 {
       
   107     sizeof(CyCh9ConfigurationDesc),		/* Descriptor Length */
       
   108     CY_CH9_GD_CONFIGURATION,			/* Descriptor Type */
       
   109     sizeof(CyCh9ConfigurationDesc),
       
   110     0,
       
   111     1,									/* Configuration Number */
       
   112     0,									/* Configuration String */
       
   113     CY_CH9_CONFIG_ATTR_RESERVED_BIT7,	/* Configuration attributes */
       
   114     50									/* Power requirements */
       
   115 } ;
       
   116 
       
   117 CyCh9ConfigurationDesc ConfigFSDesc =
       
   118 {
       
   119     sizeof(CyCh9ConfigurationDesc),		/* Descriptor Length */
       
   120     CY_CH9_GD_CONFIGURATION,			/* Descriptor Type */
       
   121     sizeof(CyCh9ConfigurationDesc),
       
   122     0,
       
   123     1,									/* Configuration Number */
       
   124     0,									/* Configuration String */
       
   125     CY_CH9_CONFIG_ATTR_RESERVED_BIT7,	/* Configuration attributes */
       
   126     50									/* Power requirements */
       
   127 } ;
       
   128 
       
   129 #else
       
   130 
       
   131 #pragma pack(push,1)
       
   132 typedef struct MyConfigDesc
       
   133 {
       
   134 	CyCh9ConfigurationDesc m_config ;
       
   135 	CyCh9InterfaceDesc     m_interface ;
       
   136 	/*nxz-debug-z CyCh9EndpointDesc      m_endpoints[2] ;*/
       
   137 	CyCh9EndpointDesc      m_endpoints[3] ;
       
   138 
       
   139 } MyConfigDesc ;
       
   140 #pragma pack(pop)
       
   141 
       
   142 static MyConfigDesc ConfigFSDesc =
       
   143 {
       
   144 	/*Configuration Descriptor*/
       
   145 	{
       
   146 		sizeof(CyCh9ConfigurationDesc),	/* Desc Length */
       
   147 		CY_CH9_GD_CONFIGURATION,	/* Desc Type */
       
   148 		/* nxz-debug-z sizeof(CyCh9ConfigurationDesc)+ sizeof(CyCh9InterfaceDesc) + 2 * sizeof(CyCh9EndpointDesc),*/
       
   149 		sizeof(CyCh9ConfigurationDesc)+ sizeof(CyCh9InterfaceDesc) + 3 * sizeof(CyCh9EndpointDesc),
       
   150 		1,				/* Num of Interface */
       
   151 		1,				/* Configuration Value */
       
   152 		251,				/* Configuration */
       
   153 		CY_CH9_CONFIG_ATTR_RESERVED_BIT7|CY_CH9_CONFIG_ATTR_SELF_POWERED, /* Configuration Attributes */
       
   154 		50
       
   155 	}
       
   156 	,
       
   157 	/* Interface Descriptor */
       
   158 	{
       
   159 		sizeof(CyCh9InterfaceDesc),	/* Desc Length */
       
   160 		CY_CH9_GD_INTERFACE,		/* Desc Type */
       
   161 		0,				/* Interface Num */
       
   162 		0, 				/* Alternate Interface */
       
   163 		/*nxz-debug-z 2,*/				/* Number of Endpoints */
       
   164 		3,				/* Number of Endpoints */
       
   165 		0xff,				/* IF class */
       
   166 		0x00,				/* IF sub-class */
       
   167 		0x00,				/* IF protocol */
       
   168 		251				/* IF string */
       
   169 	}
       
   170 	,
       
   171 	{
       
   172 		/* EP3_OUT */
       
   173 		{
       
   174 			sizeof(CyCh9EndpointDesc),	/* Desc Length */
       
   175 			CY_CH9_GD_ENDPOINT,		/* Desc Type */
       
   176 			CY_CH9_MK_EP_ADDR(CY_CH9_ENDPOINT_DIR_OUT, 3),
       
   177 			CY_CH9_ENDPOINT_ATTR_BULK,
       
   178 			64,
       
   179 			255
       
   180 		},
       
   181 		/* EP5_IN */
       
   182 		{
       
   183 			sizeof(CyCh9EndpointDesc),	/* Desc Length */
       
   184 			CY_CH9_GD_ENDPOINT,		/* Desc Type */
       
   185 			CY_CH9_MK_EP_ADDR(CY_CH9_ENDPOINT_DIR_IN, 5),
       
   186 			CY_CH9_ENDPOINT_ATTR_BULK,
       
   187 			64,
       
   188 			255
       
   189 		},
       
   190 		/* nxz-debug-z EP7_INT */
       
   191 		{
       
   192 			sizeof(CyCh9EndpointDesc),	/* Desc Length */
       
   193 			CY_CH9_GD_ENDPOINT,		/* Desc Type */
       
   194 			CY_CH9_MK_EP_ADDR(CY_CH9_ENDPOINT_DIR_IN, 7),
       
   195 			CY_CH9_ENDPOINT_ATTR_INTERRUPT,
       
   196 			64,
       
   197 			0
       
   198 		}
       
   199 
       
   200 	}
       
   201 };
       
   202 
       
   203 static MyConfigDesc ConfigHSDesc =
       
   204 {
       
   205 	/*Configuration Descriptor*/
       
   206 	{
       
   207 		sizeof(CyCh9ConfigurationDesc),	/* Desc Length */
       
   208 		CY_CH9_GD_CONFIGURATION,	/* Desc Type */
       
   209 		/*nxz-debug-z sizeof(CyCh9ConfigurationDesc)+ sizeof(CyCh9InterfaceDesc) + 2 * sizeof(CyCh9EndpointDesc),*/
       
   210 		sizeof(CyCh9ConfigurationDesc)+ sizeof(CyCh9InterfaceDesc) + 3 * sizeof(CyCh9EndpointDesc),
       
   211 		1,				/* Num of Interface */
       
   212 		1,				/* Configuration Value */
       
   213 		251,				/* Configuration */
       
   214 		CY_CH9_CONFIG_ATTR_RESERVED_BIT7, /* Configuration Attributes */
       
   215 		50
       
   216 	}
       
   217 	,
       
   218 	/* Interface Descriptor */
       
   219 	{
       
   220 		sizeof(CyCh9InterfaceDesc),	/* Desc Length */
       
   221 		CY_CH9_GD_INTERFACE,		/* Desc Type */
       
   222 		0,				/* Interface Num */
       
   223 		0, 				/* Alternate Interface */
       
   224 		/*nxz-debug-z2,	*/			/* Number of Endpoints */
       
   225 		3,				/* Number of Endpoints */
       
   226 		0xff,				/* IF class */
       
   227 		0x00,				/* IF sub-class */
       
   228 		0x00,				/* IF protocol */
       
   229 		251				/* IF string */
       
   230 	}
       
   231 	,
       
   232 	{
       
   233 		/* EP3_OUT */
       
   234 		{
       
   235 			sizeof(CyCh9EndpointDesc),	/* Desc Length */
       
   236 			CY_CH9_GD_ENDPOINT,		/* Desc Type */
       
   237 			CY_CH9_MK_EP_ADDR(CY_CH9_ENDPOINT_DIR_OUT, 3),
       
   238 			CY_CH9_ENDPOINT_ATTR_BULK,
       
   239 			512,
       
   240 			0
       
   241 		},
       
   242 		/* EP5_IN */
       
   243 		{
       
   244 			sizeof(CyCh9EndpointDesc),	/* Desc Length */
       
   245 			CY_CH9_GD_ENDPOINT,		/* Desc Type */
       
   246 			CY_CH9_MK_EP_ADDR(CY_CH9_ENDPOINT_DIR_IN, 5),
       
   247 			CY_CH9_ENDPOINT_ATTR_BULK,
       
   248 			512,
       
   249 			0
       
   250 		},
       
   251 		/* nxz-debug-z EP7_INT */
       
   252 		{
       
   253 			sizeof(CyCh9EndpointDesc),	/* Desc Length */
       
   254 			CY_CH9_GD_ENDPOINT,		/* Desc Type */
       
   255 			CY_CH9_MK_EP_ADDR(CY_CH9_ENDPOINT_DIR_IN, 7),
       
   256 			CY_CH9_ENDPOINT_ATTR_INTERRUPT,
       
   257 			64,
       
   258 			0
       
   259 		}
       
   260 	}
       
   261 };
       
   262 #endif
       
   263 #endif /*DEBUG_ZERO*/
       
   264 
       
   265 #endif
       
   266 
       
   267