]> sigrok.org Git - sigrok-firmware-fx2lafw.git/blame - hw/hantek-6022be/dscr.a51
hantek_6022be.c: Simplify handle_vendorcommand().
[sigrok-firmware-fx2lafw.git] / hw / hantek-6022be / dscr.a51
CommitLineData
189db3d4
UH
1; Copyright (C) 2009 Ubixum, Inc.
2;
3; This library is free software; you can redistribute it and/or
4; modify it under the terms of the GNU Lesser General Public
5; License as published by the Free Software Foundation; either
6; version 2.1 of the License, or (at your option) any later version.
7;
8; This library is distributed in the hope that it will be useful,
9; but WITHOUT ANY WARRANTY; without even the implied warranty of
10; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11; Lesser General Public License for more details.
12;
13; You should have received a copy of the GNU Lesser General Public
14; License along with this library; if not, write to the Free Software
15; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
17; this is a the default
18; full speed and high speed
19; descriptors found in the TRM
20; change however you want but leave
21; the descriptor pointers so the setupdat.c file works right
22
23
24.module DEV_DSCR
25
26; descriptor types
27; same as setupdat.h
28DSCR_DEVICE_TYPE=1
29DSCR_CONFIG_TYPE=2
30DSCR_STRING_TYPE=3
31DSCR_INTERFACE_TYPE=4
32DSCR_ENDPOINT_TYPE=5
33DSCR_DEVQUAL_TYPE=6
34
35; for the repeating interfaces
36DSCR_INTERFACE_LEN=9
37DSCR_ENDPOINT_LEN=7
38
39; endpoint types
40ENDPOINT_TYPE_CONTROL=0
41ENDPOINT_TYPE_ISO=1
42ENDPOINT_TYPE_BULK=2
43ENDPOINT_TYPE_INT=3
44
45 .globl _dev_dscr, _dev_qual_dscr, _highspd_dscr, _fullspd_dscr, _dev_strings, _dev_strings_end
46; These need to be in code memory. If
47; they aren't you'll have to manully copy them somewhere
48; in code memory otherwise SUDPTRH:L don't work right
49 .area DSCR_AREA (CODE)
50
51_dev_dscr:
52 .db dev_dscr_end-_dev_dscr ; len
53 .db DSCR_DEVICE_TYPE ; type
54 .dw 0x0002 ; usb 2.0
55 .db 0xff ; class (vendor specific)
56 .db 0xff ; subclass (vendor specific)
57 .db 0xff ; protocol (vendor specific)
58 .db 64 ; packet size (ep0)
59 .dw 0xB504 ; vendor id
60 .dw 0x2260 ; product id
61 .dw 0x0000 ; version id
62 .db 1 ; manufacturure str idx
63 .db 2 ; product str idx
64 .db 0 ; serial str idx
65 .db 1 ; n configurations
66dev_dscr_end:
67
68_dev_qual_dscr:
69 .db dev_qualdscr_end-_dev_qual_dscr
70 .db DSCR_DEVQUAL_TYPE
71 .dw 0x0002 ; usb 2.0
72 .db 0
73 .db 0
74 .db 0
75 .db 64 ; max packet
76 .db 1 ; n configs
77 .db 0 ; extra reserved byte
78dev_qualdscr_end:
79
80_highspd_dscr:
81 .db highspd_dscr_end-_highspd_dscr ; dscr len ;; Descriptor length
82 .db DSCR_CONFIG_TYPE
83 ; can't use .dw because byte order is different
84 .db (highspd_dscr_realend-_highspd_dscr) % 256 ; total length of config lsb
85 .db (highspd_dscr_realend-_highspd_dscr) / 256 ; total length of config msb
86 .db 1 ; n interfaces
87 .db 1 ; config number
88 .db 0 ; config string
89 .db 0x80 ; attrs = bus powered, no wakeup
90 .db 55 ; max power = 110mA
91highspd_dscr_end:
92
93; all the interfaces next
94; BULK interface
95 .db DSCR_INTERFACE_LEN
96 .db DSCR_INTERFACE_TYPE
97 .db 0 ; index
98 .db 0 ; alt setting idx
99 .db 1 ; n endpoints
100 .db 0xff ; class
101 .db 0
102 .db 0
103 .db 0 ; string index
104
105; endpoint 6 in
106 .db DSCR_ENDPOINT_LEN
107 .db DSCR_ENDPOINT_TYPE
108 .db 0x86 ; ep1 dir=in and address
109 .db ENDPOINT_TYPE_BULK ; type
110 .db 0x00 ; max packet LSB
111 .db 0x02 ; max packet size=512 bytes
112 .db 0x00 ; polling interval
113
114; ISOCHRONOUS interface
115 .db DSCR_INTERFACE_LEN
116 .db DSCR_INTERFACE_TYPE
117 .db 0 ; index
118 .db 1 ; alt setting idx
119 .db 1 ; n endpoints
120 .db 0xff ; class
121 .db 0
122 .db 1
123 .db 0 ; string index
124
125; endpoint 2 in
126 .db DSCR_ENDPOINT_LEN
127 .db DSCR_ENDPOINT_TYPE
128 .db 0x82 ; ep1 dir=in and address
129 .db ENDPOINT_TYPE_ISO ; type
130 .db 0x00 ; max packet LSB
131 .db 0x14 ; max packet size=3*1024 bytes
132 .db 0x01 ; polling interval
133
134; ISOCHRONOUS interface 16MB/s
135 .db DSCR_INTERFACE_LEN
136 .db DSCR_INTERFACE_TYPE
137 .db 0 ; index
138 .db 2 ; alt setting idx
139 .db 1 ; n endpoints
140 .db 0xff ; class
141 .db 0
142 .db 1
143 .db 0 ; string index
144
145; endpoint 2 in
146 .db DSCR_ENDPOINT_LEN
147 .db DSCR_ENDPOINT_TYPE
148 .db 0x82 ; ep1 dir=in and address
149 .db ENDPOINT_TYPE_ISO ; type
150 .db 0x00 ; max packet LSB
151 .db 0x0c ; max packet size=2*1024 bytes
152 .db 0x01 ; polling interval
153
154; ISOCHRONOUS interface 8MB/s
155 .db DSCR_INTERFACE_LEN
156 .db DSCR_INTERFACE_TYPE
157 .db 0 ; index
158 .db 3 ; alt setting idx
159 .db 1 ; n endpoints
160 .db 0xff ; class
161 .db 0
162 .db 1
163 .db 0 ; string index
164
165; endpoint 2 in
166 .db DSCR_ENDPOINT_LEN
167 .db DSCR_ENDPOINT_TYPE
168 .db 0x82 ; ep1 dir=in and address
169 .db ENDPOINT_TYPE_ISO ; type
170 .db 0x00 ; max packet LSB
171 .db 0x04 ; max packet size=1024 bytes
172 .db 0x01 ; polling interval
173
174; ISOCHRONOUS interface 4MB/s
175 .db DSCR_INTERFACE_LEN
176 .db DSCR_INTERFACE_TYPE
177 .db 0 ; index
178 .db 4 ; alt setting idx
179 .db 1 ; n endpoints
180 .db 0xff ; class
181 .db 0
182 .db 1
183 .db 0 ; string index
184
185; endpoint 2 in
186 .db DSCR_ENDPOINT_LEN
187 .db DSCR_ENDPOINT_TYPE
188 .db 0x82 ; ep1 dir=in and address
189 .db ENDPOINT_TYPE_ISO ; type
190 .db 0x00 ; max packet LSB
191 .db 0x04 ; max packet size=1024 bytes
192 .db 0x02 ; polling interval
193
194
195; ISOCHRONOUS interface 2MB/s
196 .db DSCR_INTERFACE_LEN
197 .db DSCR_INTERFACE_TYPE
198 .db 0 ; index
199 .db 5 ; alt setting idx
200 .db 1 ; n endpoints
201 .db 0xff ; class
202 .db 0
203 .db 1
204 .db 0 ; string index
205
206; endpoint 2 in
207 .db DSCR_ENDPOINT_LEN
208 .db DSCR_ENDPOINT_TYPE
209 .db 0x82 ; ep1 dir=in and address
210 .db ENDPOINT_TYPE_ISO ; type
211 .db 0x00 ; max packet LSB
212 .db 0x04 ; max packet size=1024 bytes
213 .db 0x03 ; polling interval
214
215; ISOCHRONOUS interface 1MB/s
216 .db DSCR_INTERFACE_LEN
217 .db DSCR_INTERFACE_TYPE
218 .db 0 ; index
219 .db 6 ; alt setting idx
220 .db 1 ; n endpoints
221 .db 0xff ; class
222 .db 0
223 .db 1
224 .db 0 ; string index
225
226; endpoint 2 in
227 .db DSCR_ENDPOINT_LEN
228 .db DSCR_ENDPOINT_TYPE
229 .db 0x82 ; ep1 dir=in and address
230 .db ENDPOINT_TYPE_ISO ; type
231 .db 0x00 ; max packet LSB
232 .db 0x04 ; max packet size=1024 bytes
233 .db 0x04 ; polling interval
234
235; ISOCHRONOUS interface 500 kB/s
236 .db DSCR_INTERFACE_LEN
237 .db DSCR_INTERFACE_TYPE
238 .db 0 ; index
239 .db 7 ; alt setting idx
240 .db 1 ; n endpoints
241 .db 0xff ; class
242 .db 0
243 .db 1
244 .db 0 ; string index
245
246; endpoint 2 in
247 .db DSCR_ENDPOINT_LEN
248 .db DSCR_ENDPOINT_TYPE
249 .db 0x82 ; ep1 dir=in and address
250 .db ENDPOINT_TYPE_ISO ; type
251 .db 0x00 ; max packet LSB
252 .db 0x02 ; max packet size=512 bytes
253 .db 0x04 ; polling interval
254
255
256highspd_dscr_realend:
257
258.even
259_fullspd_dscr:
260 .db fullspd_dscr_end-_fullspd_dscr ; dscr len
261 .db DSCR_CONFIG_TYPE
262 ; can't use .dw because byte order is different
263 .db (fullspd_dscr_realend-_fullspd_dscr) % 256 ; total length of config lsb
264 .db (fullspd_dscr_realend-_fullspd_dscr) / 256 ; total length of config msb
265 .db 2 ; n interfaces
266 .db 1 ; config number
267 .db 0 ; config string
268 .db 0x80 ; attrs = bus powered, no wakeup
269 .db 55 ; max power = 110mA
270fullspd_dscr_end:
271
272
273; all the interfaces next
274; BULK interface
275 .db DSCR_INTERFACE_LEN
276 .db DSCR_INTERFACE_TYPE
277 .db 0 ; index
278 .db 0 ; alt setting idx
279 .db 1 ; n endpoints
280 .db 0xff ; class
281 .db 0
282 .db 0
283 .db 0 ; string index
284
285; endpoint 6 in
286 .db DSCR_ENDPOINT_LEN
287 .db DSCR_ENDPOINT_TYPE
288 .db 0x86 ; ep1 dir=in and address
289 .db ENDPOINT_TYPE_BULK ; type
290 .db 0x40 ; max packet LSB
291 .db 0x00 ; max packet size=512 bytes
292 .db 0x00 ; polling interval
293
294; ISOCHRONOUS interface 1 MB/s
295 .db DSCR_INTERFACE_LEN
296 .db DSCR_INTERFACE_TYPE
297 .db 0 ; index
298 .db 1 ; alt setting idx
299 .db 1 ; n endpoints
300 .db 0xff ; class
301 .db 0
302 .db 1
303 .db 0 ; string index
304
305; endpoint 2 in
306 .db DSCR_ENDPOINT_LEN
307 .db DSCR_ENDPOINT_TYPE
308 .db 0x82 ; ep1 dir=in and address
309 .db ENDPOINT_TYPE_ISO ; type
310 .db 0xff ; max packet LSB
311 .db 0x03 ; max packet size=1023 bytes
312 .db 0x01 ; polling interval
313
314; ISOCHRONOUS interface 500 kB/s
315 .db DSCR_INTERFACE_LEN
316 .db DSCR_INTERFACE_TYPE
317 .db 0 ; index
318 .db 2 ; alt setting idx
319 .db 1 ; n endpoints
320 .db 0xff ; class
321 .db 0
322 .db 1
323 .db 0 ; string index
324
325; endpoint 2 in
326 .db DSCR_ENDPOINT_LEN
327 .db DSCR_ENDPOINT_TYPE
328 .db 0x82 ; ep1 dir=in and address
329 .db ENDPOINT_TYPE_ISO ; type
330 .db 0x00 ; max packet LSB
331 .db 0x02 ; max packet size=512 bytes
332 .db 0x01 ; polling interval
333
334fullspd_dscr_realend:
335
336.even
337_dev_strings:
338; sample string
339_string0:
340 .db string0end-_string0 ; len
341 .db DSCR_STRING_TYPE
342 .db 0x09, 0x04 ; 0x0409 is the language code for English. Possible to add more codes after this.
343string0end:
344; add more strings here
345_string1:
346 .db string1end-_string1 ; len
347 .db DSCR_STRING_TYPE
348 .ascii 'O\0D\0M\0'
349string1end:
350_string2:
351 .db string2end-_string2 ; len
352 .db DSCR_STRING_TYPE
353 .ascii 'H\0a\0n\0t\0e\0k\0D\0S\0O\0006\0000\0002\0002\0B\0E\0'
354string2end:
355
356
357_dev_strings_end:
358 .dw 0x0000 ; in case you wanted to look at memory between _dev_strings and _dev_strings_end