Line 1... |
Line 1... |
/*!
|
/*!
|
ZTEX Firmware Kit for EZ-USB Microcontrollers
|
ZTEX Firmware Kit for EZ-USB Microcontrollers
|
Copyright (C) 2008-2009 ZTEX e.K.
|
Copyright (C) 2009-2010 ZTEX e.K.
|
http://www.ztex.de
|
http://www.ztex.de
|
|
|
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
it under the terms of the GNU General Public License version 3 as
|
it under the terms of the GNU General Public License version 3 as
|
published by the Free Software Foundation.
|
published by the Free Software Foundation.
|
Line 47... |
Line 47... |
|
|
0.0.0.0 // default Product ID (no product specified)
|
0.0.0.0 // default Product ID (no product specified)
|
1.*.*.* // may be used for experimental purposes
|
1.*.*.* // may be used for experimental purposes
|
10.*.*.* // used for ZTEX products
|
10.*.*.* // used for ZTEX products
|
10.11.*.* // ZTEX USB-FPGA-Module 1.2
|
10.11.*.* // ZTEX USB-FPGA-Module 1.2
|
|
10.12.*.* // ZTEX USB-FPGA-Module 1.10
|
10.20.*.* // ZTEX USB-Module 1.0
|
10.20.*.* // ZTEX USB-Module 1.0
|
|
|
Please contact me (http://www.ztex.de --> Impressum/Kontakt) if you want to register/reserve a Product ID (range).
|
Please contact me (http://www.ztex.de --> Impressum/Kontakt) if you want to register/reserve a Product ID (range).
|
*/
|
*/
|
xdata at ZTEX_DESCRIPTOR_OFFS+6 BYTE PRODUCT_ID[4];
|
xdata at ZTEX_DESCRIPTOR_OFFS+6 BYTE PRODUCT_ID[4];
|
Line 79... |
Line 80... |
*/
|
*/
|
xdata at ZTEX_DESCRIPTOR_OFFS+30 BYTE SN_STRING[10];
|
xdata at ZTEX_DESCRIPTOR_OFFS+30 BYTE SN_STRING[10];
|
|
|
/* Are Vendor ID and Product ID defined? */
|
/* Are Vendor ID and Product ID defined? */
|
#ifndef[USB_VENDOR_ID]
|
#ifndef[USB_VENDOR_ID]
|
#error[No USB Vendor ID defined (you may use the Cypress Vendor ID 0x04b4 (only !) for development purposes)]
|
#error[No USB Vendor ID defined]
|
#endif
|
#endif
|
|
|
#ifndef[USB_PRODUCT_ID]
|
#ifndef[USB_PRODUCT_ID]
|
#error[No USB Product ID defined (you may use the FX2 Product ID 0x8613 from Cypress (only !) during the development process)]
|
#error[No USB Product ID defined]
|
#endif
|
#endif
|
|
|
/* Prepare the Interfaces, i.e. check which interfaces are defined */
|
/* Prepare the Interfaces, i.e. check which interfaces are defined */
|
#define[CONFIGURE_INTERFACE(][);][
|
#define[CONFIGURE_INTERFACE(][);][
|
#define[CONFIG_INTERFACE$0]
|
#define[CONFIG_INTERFACE$0]
|
Line 211... |
Line 212... |
#elifeq[EP$0_TYPE][INT]
|
#elifeq[EP$0_TYPE][INT]
|
,3 // 3, INT transferns
|
,3 // 3, INT transferns
|
#else
|
#else
|
#error[Invalid type for endpoint $0: `EP$0_TYPE' (`ISO', 'BULK' or `INT' expected)]
|
#error[Invalid type for endpoint $0: `EP$0_TYPE' (`ISO', 'BULK' or `INT' expected)]
|
#endif
|
#endif
|
#ifeq[EP$0_SIZE][64] // to avoid stupid warnings
|
|
,64 // 4, max. packet size (L)
|
|
,0 // 5, max. packet size (H)
|
|
#else
|
|
#ifdef[HIGH_SPEED]
|
#ifdef[HIGH_SPEED]
|
,EP$0_SIZE & 0xff // 4, max. packet size (L)
|
,EP$0_SIZE & 0xff // 4, max. packet size (L)
|
,EP$0_SIZE >> 8 // 5, max. packet size (H)
|
,EP$0_SIZE >> 8 // 5, max. packet size (H)
|
|
#ifneq[EP$0_TYPE][BULK]
|
|
| ( (EP$0_PPMF-1) << 3 )
|
|
#endif
|
#else
|
#else
|
,64 // 4, max. packet size (L)
|
,64 // 4, max. packet size (L)
|
,0 // 5, max. packet size (H)
|
,0 // 5, max. packet size (H)
|
#endif
|
#endif
|
#endif
|
#ifeq[EP$0_TYPE][BULK]
|
#ifeq[EP$0_TYPE][ISO]
|
|
,1 // 6, Polling interval
|
|
#else
|
|
,0 // 6, Polling interval
|
,0 // 6, Polling interval
|
|
#elifeq[EP$0_TYPE][ISO]
|
|
,1 // 6, Polling interval (1ms if Full Speed mode, 125µs in High Speed Mode)
|
|
#else
|
|
,EP$0_POLL // 6, Polling interval (1ms if Full Speed mode, 125µs in High Speed Mode)
|
#endif
|
#endif
|
]
|
]
|
|
|
#define[INTERFACE_DESCRIPTOR(][);][
|
#define[INTERFACE_DESCRIPTOR(][);][
|
// Interface $0 descriptor
|
// Interface $0 descriptor
|
Line 250... |
Line 251... |
+1
|
+1
|
#endif
|
#endif
|
#endif
|
#endif
|
#endif
|
#endif
|
#endif
|
#endif
|
,0 // 3, Alternate setting
|
,0 // 3, Alternate setting 0
|
,0 // 4, Number of end points
|
,0 // 4, Number of end points
|
#ifeq[EP1IN_INTERFACE][$0]
|
#ifeq[EP1IN_INTERFACE][$0]
|
+1
|
+1
|
#endif
|
#endif
|
#ifeq[EP1OUT_INTERFACE][$0]
|
#ifeq[EP1OUT_INTERFACE][$0]
|
Line 382... |
Line 383... |
|
|
code BYTE FullSpeedConfigDescriptor[] =
|
code BYTE FullSpeedConfigDescriptor[] =
|
{
|
{
|
9 // 0, Descriptor length
|
9 // 0, Descriptor length
|
,0x02 // 1, Decriptor type
|
,0x02 // 1, Decriptor type
|
,sizeof(HighSpeedConfigDescriptor) & 0xff // 2, Total length (LSB)
|
,sizeof(FullSpeedConfigDescriptor) & 0xff // 2, Total length (LSB)
|
// ,sizeof(HighSpeedConfigDescriptor) >> 8 // 3, Total length (MSB)
|
// ,sizeof(FullSpeedConfigDescriptor) >> 8 // 3, Total length (MSB)
|
,0 // 3, To avoid warnings, descriptor length will never exceed 255 bytes
|
,0 // 3, To avoid warnings, descriptor length will never exceed 255 bytes
|
,0 // 4, Number of Interfaces
|
,0 // 4, Number of Interfaces
|
#ifdef[CONFIG_INTERFACE0]
|
#ifdef[CONFIG_INTERFACE0]
|
+1
|
+1
|
#endif
|
#endif
|