OpenCores
URL https://opencores.org/ocsvn/usb_fpga_1_2/usb_fpga_1_2/trunk

Subversion Repositories usb_fpga_1_2

[/] [usb_fpga_1_2/] [trunk/] [include/] [ztex-conf.h] - Blame information for rev 2

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 ZTEX
/*!
2
   ZTEX Firmware Kit for EZ-USB Microcontrollers
3
   Copyright (C) 2008-2009 ZTEX e.K.
4
   http://www.ztex.de
5
 
6
   This program is free software; you can redistribute it and/or modify
7
   it under the terms of the GNU General Public License version 3 as
8
   published by the Free Software Foundation.
9
 
10
   This program is distributed in the hope that it will be useful, but
11
   WITHOUT ANY WARRANTY; without even the implied warranty of
12
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
   General Public License for more details.
14
 
15
   You should have received a copy of the GNU General Public License
16
   along with this program; if not, see http://www.gnu.org/licenses/.
17
!*/
18
 
19
/*
20
   Configuration macros
21
*/
22
 
23
#ifndef[ZTEX_CONF_H]
24
#define[ZTEX_CONF_H]
25
 
26
/*
27
   Don't expant macros in comments
28
*/
29
#define[//][
30
][#noexpand[!dnapxeon!]//$0!dnapxeon!
31
]
32
#define[/*][*/][#noexpand[!dnapxeon!]/*$0*/!dnapxeon!]
33
 
34
/*
35
   This macro defines the USB Vendor ID and USB Product ID  (not the product ID
36
   from the ZTEX descriptor). The Vendor ID must be purchased from the USB-IF
37
   (http://www.usb.org). The Cypress Vendor ID may only be used during the
38
   develpoment process.
39
   Usage:
40
        SET_VPID(<Vendor ID>,<Pioduct ID>);
41
*/
42
#define[SET_VPID(][,$1);][#define[USB_VENDOR_ID][$0]
43
#define[USB_PRODUCT_ID][$1]]
44
 
45
 
46
/*
47
   This macro is called before FPGA Firmware is reset, e.g. to save some
48
   settings. After this macro is called the I/O ports are set to default
49
   states in order to avoid damage during / after the FPGA configuration.
50
   To append someting to this macro use the follwing definition:
51
#define[PRE_FPGA_RESET][PRE_FPGA_RESET
52
...]
53
*/
54
#define[PRE_FPGA_RESET][]
55
 
56
 
57
/*
58
   This macro is called after FPGA Firmware has been configured. This is
59
   usually used to configure the I/O ports.
60
   To append someting to this macro use the follwing definition:
61
#define[POST_FW_LOAD][POST_FW_LOAD
62
...]
63
*/
64
#define[POST_FPGA_CONFIG][]
65
 
66
 
67
/*
68
  Add a vedor request for endpoint 0,
69
 
70
   Usage:
71
     ADD_EP0_VENDOR_REQUEST((<request number>,,<code executed after setup package received>,,<code executed after data package received>''));
72
   Example:
73
     ADD_EP0_VENDOR_REQUEST((0x33,,initHSFPGAConfiguration();,,));;
74
...]
75
*/
76
#define[EP0_VENDOR_REQUESTS_SU;][]
77
#define[EP0_VENDOR_REQUESTS_DAT;][]
78
#define[ADD_EP0_VENDOR_REQUEST((][,,$1,,$2));;][#define[EP0_VENDOR_REQUESTS_SU;][EP0_VENDOR_REQUESTS_SU;
79
case $0:
80
    $1
81
    break;
82
]
83
#define[EP0_VENDOR_REQUESTS_DAT;][EP0_VENDOR_REQUESTS_DAT;
84
case $0:
85
    $2
86
    break;
87
]]
88
 
89
 
90
/*
91
   Add a vedor command for endpoint 0,
92
 
93
   Usage:
94
     ADD_EP0_VENDOR_COMMAND((<request number>,,<code executed after setup package received>,,<code executed after data package received>''));
95
   Example:
96
     ADD_EP0_VENDOR_COMMAND((0x33,,initHSFPGAConfiguration();,,));;
97
...]
98
*/
99
#define[EP0_VENDOR_COMMANDS_SU;][]
100
#define[EP0_VENDOR_COMMANDS_DAT;][]
101
#define[ADD_EP0_VENDOR_COMMAND((][,,$1,,$2));;][#define[EP0_VENDOR_COMMANDS_SU;][EP0_VENDOR_COMMANDS_SU;
102
case $0:
103
    $1
104
    break;
105
]
106
#define[EP0_VENDOR_COMMANDS_DAT;][EP0_VENDOR_COMMANDS_DAT;
107
case $0:
108
    $2
109
    break;
110
]]
111
 
112
 
113
/*
114
   Endoint 2,4,5,8 configuration:
115
 
116
   EP_CONFIG(<EP number>,<interface>,<type>,<direction>,<size>,<buffers>)
117
        <EP number> = 2 | 4 | 6 | 8             Endpoint numer
118
        <INTERFACE> = 0 | 1 | 2 | 3             To which interface this endpoint belongs
119
        <type>      = BULK  | ISO | INT
120
        <dir>       = IN | OUT
121
        <size>      = 512 | 1024
122
        <buffers>   = 1 | 2 | 3 | 4
123
   Example: EP2_CONFIG(2,0,ISO,OUT,1024,4);
124
   Importand note: No spaces next to the commas
125
 
126
   Endoint 1 configuration. These Endpoints are defined by default and assigned to interface 0.
127
   EP1IN_CONFIG(<interface>);
128
           <INTERFACE> = 0 | 1 | 2 | 3          To which interface EP1IN belongs; default: 0
129
   EP1OUT_CONFIG(<interface>);
130
           <INTERFACE> = 0 | 1 | 2 | 3          To which interface EP1OUT belongs; default: 0
131
   EP1_CONFIG(<interface>);
132
           <INTERFACE> = 0 | 1 | 2 | 3          To which interface EP1IN and EP1OUT belongs; default: 0
133
 
134
   The following (maximum) configurations are possible:
135
   EP2          EP4     EP6     EP8
136
   2x512        2x512   2x512   2x512
137
   2x512        2x512   4x512
138
   2x512        2x512   2x1024
139
   4x512                2x512   2x512
140
   4x512                4x512
141
   4x512                2x1024
142
   2x1024               2x512   2x512
143
   2x1024               4x512
144
   2x1024               2x1024
145
   3x512                3x512   2x512
146
   3x1024                       2x512
147
   4x1024
148
*/
149
#define[EP_CONFIG(][,$1,$2,$3,$4,$5);][
150
#ifeq[$0][1IN]
151
#elifeq[$0][1OUT]
152
#elifeq[$0][2]
153
#elifeq[$0][4]
154
#elifeq[$0][6]
155
#elifneq[$0][8]
156
#error[EP_CONFIG: Invalid 1st parameter: `$0'. Expected `2', `4', `6' or '8']
157
#endif
158
#ifeq[$1][0]
159
#elifeq[$1][1]
160
#elifeq[$1][2]
161
#elifneq[$1][3]
162
#error[EP_CONFIG: Invalid 2nd parameter: `$1'. Expected `0', `1', `2' or '3']
163
#endif
164
#ifeq[$2][BULK]
165
#elifeq[$2][ISO]
166
#elifneq[$2][INT]
167
#error[EP_CONFIG: Invalid 3nd parameter: `$2'. Expected `BULK', `ISO' or 'INT']
168
#endif
169
#ifeq[$3][IN]
170
#elifneq[$3][OUT]
171
#error[EP_CONFIG: Invalid 4th parameter: `$3'. Expected `IN' or 'OUT']
172
#endif
173
#ifeq[$4][64]
174
#elifeq[$4][512]
175
#elifneq[$4][1024]
176
#error[EP_CONFIG: Invalid 5th parameter: `$4'. Expected `512' or '1024']
177
#endif
178
#ifeq[$5][1]
179
#elifeq[$5][2]
180
#elifeq[$5][3]
181
#elifneq[$5][4]
182
#error[EP_CONFIG: Invalid 6th parameter: `$5'. Expected `1', `2', `3' or `4']
183
#endif
184
#define[EP$0_INTERFACE][$1]
185
#define[EP$0_TYPE][$2]
186
#define[EP$0_DIR][$3]
187
#define[EP$0_SIZE][$4]
188
#define[EP$0_BUFFERS][$5]]
189
 
190
#define[EP1IN_CONFIG(][);][#define[EP1IN_INTERFACE][$0]]
191
#define[EP1OUT_CONFIG(][);][#define[EP1OUT_INTERFACE][$0]]
192
#define[EP1_CONFIG(][);][#define[EP1IN_INTERFACE][$0]
193
#define[EP1OUT_INTERFACE][$0]]
194
 
195
EP_CONFIG(1IN,0,BULK,IN,64,1);
196
EP_CONFIG(1OUT,0,BULK,OUT,64,1);
197
 
198
 
199
/*
200
   Settings which depends PRODUCT_ID, e.g extra capabilities.
201
   Overwrite this macros as desired.
202
*/
203
#define[MODULE_RESERVED_00][0]
204
#define[MODULE_RESERVED_01][0]
205
#define[MODULE_RESERVED_02][0]
206
#define[MODULE_RESERVED_03][0]
207
#define[MODULE_RESERVED_04][0]
208
#define[MODULE_RESERVED_05][0]
209
#define[MODULE_RESERVED_06][0]
210
#define[MODULE_RESERVED_07][0]
211
#define[MODULE_RESERVED_08][0]
212
#define[MODULE_RESERVED_09][0]
213
#define[MODULE_RESERVED_10][0]
214
#define[MODULE_RESERVED_11][0]
215
 
216
#define[FWVER][0]
217
 
218
#define[PRODUCT_ID_0][0]
219
#define[PRODUCT_ID_1][0]
220
#define[PRODUCT_ID_2][0]
221
#define[PRODUCT_ID_3][0]
222
 
223
 
224
/*
225
   Identify as ZTEX USB FPGA Module 1.0
226
   Usage: IDENTITY_UFM_1_0(<PRODUCT_ID_0>.<PRODUCT_ID_1><PRODUCT_ID_2>.<PRODUCT_ID_3>,<FW_VERSION>);
227
*/
228
#define[IDENTITY_UFM_1_0(][.$1.$2.$3,$4);][#define[PRODUCT_ID_0][$0]
229
#define[PRODUCT_ID_1][$1]
230
#define[PRODUCT_ID_2][$2]
231
#define[PRODUCT_ID_3][$3]
232
#define[FWVER][$4]
233
#define[PRODUCT_IS][UFM-1_0]
234
#define[PRODUCT_STRING]["USB-FPGA Module 1.0"]]
235
 
236
 
237
/*
238
   Identify as ZTEX USB FPGA Module 1.1
239
   Usage: IDENTITY_UFM_1_1(<PRODUCT_ID_0>.<PRODUCT_ID_1><PRODUCT_ID_2>.<PRODUCT_ID_3>,<FW_VERSION>);
240
*/
241
#define[IDENTITY_UFM_1_1(][.$1.$2.$3,$4);][#define[PRODUCT_ID_0][$0]
242
#define[PRODUCT_ID_1][$1]
243
#define[PRODUCT_ID_2][$2]
244
#define[PRODUCT_ID_3][$3]
245
#define[FWVER][$4]
246
#define[PRODUCT_IS][UFM-1_1]
247
#define[PRODUCT_STRING]["USB-FPGA Module 1.1"]]
248
 
249
 
250
/*
251
   Identify as ZTEX USB FPGA Module 1.2
252
   Usage: IDENTITY_UFM_1_2(<PRODUCT_ID_0>.<PRODUCT_ID_1><PRODUCT_ID_2>.<PRODUCT_ID_3>,<FW_VERSION>);
253
*/
254
#define[IDENTITY_UFM_1_2(][.$1.$2.$3,$4);][#define[PRODUCT_ID_0][$0]
255
#define[PRODUCT_ID_1][$1]
256
#define[PRODUCT_ID_2][$2]
257
#define[PRODUCT_ID_3][$3]
258
#define[FWVER][$4]
259
#define[PRODUCT_IS][UFM-1_2]
260
#define[PRODUCT_STRING]["USB-FPGA Module 1.2"]]
261
 
262
 
263
/*
264
   Identify as ZTEX USB Module 1.0
265
   Usage: IDENTITY_UM_1_0(<PRODUCT_ID_0>.<PRODUCT_ID_1><PRODUCT_ID_2>.<PRODUCT_ID_3>,<FW_VERSION>);
266
*/
267
#define[IDENTITY_UM_1_0(][.$1.$2.$3,$4);][#define[PRODUCT_ID_0][$0]
268
#define[PRODUCT_ID_1][$1]
269
#define[PRODUCT_ID_2][$2]
270
#define[PRODUCT_ID_3][$3]
271
#define[FWVER][$4]
272
#define[PRODUCT_IS][UM-1_0]
273
#define[PRODUCT_STRING]["USB Module 1.0"]]
274
 
275
 
276
/*
277
   This macro defines the Manufacturer string. Limited to 31 charcters.
278
*/
279
#define[MANUFACTURER_STRING]["ZTEX"]
280
 
281
 
282
/*
283
   This macro defines the Product string. Limited to 31 charcters.
284
*/
285
#define[PRODUCT_STRING]["USB-FPGA Module"]
286
 
287
 
288
/*
289
   This macro defines the Configuration string. Limited to 31 charcters.
290
*/
291
#define[CONFIGURATION_STRING]["(unknown)"]
292
 
293
 
294
/*
295
   This macro enables defines the Configuration string. Limited to 31 charcters.
296
*/
297
#define[CONFIGURATION_STRING]["(unknown)"]
298
 
299
 
300
/*
301
   This macro disables EEPROM interface and certain I2C functions (enabled by default)
302
   Usage: DISABLE_EEPROM;
303
*/
304
#define[DISBALE_EEPROM;][#define[EEPROM_DISBALED][1]]
305
 
306
 
307
/*
308
   This macro enables the Flash interface, if available
309
   Usage: ENABLE_FLASH;
310
*/
311
#define[ENABLE_FLASH;][#define[FLASH_ENABLED][1]]
312
 
313
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.