]> sigrok.org Git - sigrok-firmware-fx2lafw.git/blob - include/dscr_hantek_6022be.inc
dscr_hantek_6022be.inc: Fix incorrect comments, add additional ones.
[sigrok-firmware-fx2lafw.git] / include / dscr_hantek_6022be.inc
1 ;;
2 ;; This file is part of the sigrok-firmware-fx2lafw project.
3 ;;
4 ;; Copyright (C) 2009 Ubixum, Inc. 
5 ;;
6 ;; This library is free software; you can redistribute it and/or
7 ;; modify it under the terms of the GNU Lesser General Public
8 ;; License as published by the Free Software Foundation; either
9 ;; version 2.1 of the License, or (at your option) any later version.
10 ;;
11 ;; This library is distributed in the hope that it will be useful,
12 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 ;; Lesser General Public License for more details.
15 ;;
16 ;; You should have received a copy of the GNU Lesser General Public
17 ;; License along with this library; if not, write to the Free Software
18 ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
19 ;;
20
21 .module DEV_DSCR
22
23 ; Descriptor types
24 DSCR_DEVICE_TYPE        = 1
25 DSCR_CONFIG_TYPE        = 2
26 DSCR_STRING_TYPE        = 3
27 DSCR_INTERFACE_TYPE     = 4
28 DSCR_ENDPOINT_TYPE      = 5
29 DSCR_DEVQUAL_TYPE       = 6
30
31 ; Descriptor lengths
32 DSCR_INTERFACE_LEN      = 9
33 DSCR_ENDPOINT_LEN       = 7
34
35 ; Endpoint types
36 ENDPOINT_TYPE_CONTROL   = 0
37 ENDPOINT_TYPE_ISO       = 1
38 ENDPOINT_TYPE_BULK      = 2
39 ENDPOINT_TYPE_INT       = 3
40
41 .globl _dev_dscr, _dev_qual_dscr, _highspd_dscr, _fullspd_dscr, _dev_strings, _dev_strings_end
42 .area DSCR_AREA (CODE)
43
44 ; -----------------------------------------------------------------------------
45 ; Device descriptor
46 ; -----------------------------------------------------------------------------
47 _dev_dscr:
48         .db     dev_dscr_end - _dev_dscr
49         .db     DSCR_DEVICE_TYPE
50         .dw     0x0002                  ; USB 2.0
51         .db     0xff                    ; Class (vendor specific)
52         .db     0xff                    ; Subclass (vendor specific)
53         .db     0xff                    ; Protocol (vendor specific)
54         .db     64                      ; Max. EP0 packet size
55         .dw     VID                     ; Manufacturer ID
56         .dw     PID                     ; Product ID
57         .dw     0x0000                  ; Product version (0.00)
58         .db     1                       ; Manufacturer string index
59         .db     2                       ; Product string index
60         .db     0                       ; Serial number string index (none)
61         .db     1                       ; Number of configurations
62 dev_dscr_end:
63
64 ; -----------------------------------------------------------------------------
65 ; Device qualifier (for "other device speed")
66 ; -----------------------------------------------------------------------------
67 _dev_qual_dscr:
68         .db     dev_qualdscr_end - _dev_qual_dscr
69         .db     DSCR_DEVQUAL_TYPE
70         .dw     0x0002                  ; USB 2.0
71         .db     0                       ; Class (0)
72         .db     0                       ; Subclass (0)
73         .db     0                       ; Protocol (0)
74         .db     64                      ; Max. EP0 packet size
75         .db     1                       ; Number of configurations
76         .db     0                       ; Extra reserved byte
77 dev_qualdscr_end:
78
79 ; -----------------------------------------------------------------------------
80 ; High-Speed configuration descriptor
81 ; -----------------------------------------------------------------------------
82 _highspd_dscr:
83         .db     highspd_dscr_end - _highspd_dscr
84         .db     DSCR_CONFIG_TYPE
85         ; Total length of the configuration (1st line LSB, 2nd line MSB)
86         .db     (highspd_dscr_realend - _highspd_dscr) % 256
87         .db     (highspd_dscr_realend - _highspd_dscr) / 256
88         .db     1                       ; Number of interfaces
89         .db     1                       ; Configuration number
90         .db     0                       ; Configuration string (none)
91         .db     0x80                    ; Attributes (bus powered, no wakeup)
92         .db     0x37                    ; Max. power (110mA)
93 highspd_dscr_end:
94
95         ; Bulk interface 0, alt 0
96         .db     DSCR_INTERFACE_LEN
97         .db     DSCR_INTERFACE_TYPE
98         .db     0                       ; Interface index
99         .db     0                       ; Alternate setting index
100         .db     1                       ; Number of endpoints
101         .db     0xff                    ; Class (vendor specific)
102         .db     0                       ; Subclass (0)
103         .db     0                       ; Protocol (0)
104         .db     0                       ; String index (none)
105
106         ; Endpoint 6 (IN)
107         .db     DSCR_ENDPOINT_LEN
108         .db     DSCR_ENDPOINT_TYPE
109         .db     0x86                    ; EP number (6), direction (IN)
110         .db     ENDPOINT_TYPE_BULK      ; Endpoint type (bulk)
111         .db     0x00                    ; Max. packet size, LSB (512 bytes)
112         .db     0x02                    ; Max. packet size, MSB (512 bytes)
113         .db     0x00                    ; Polling interval
114
115         ; Isochronous interface 0, alt 1
116         .db     DSCR_INTERFACE_LEN
117         .db     DSCR_INTERFACE_TYPE
118         .db     0                       ; Interface index
119         .db     1                       ; Alternate setting index
120         .db     1                       ; Number of endpoints
121         .db     0xff                    ; Class (vendor specific)
122         .db     0                       ; Subclass (0)
123         .db     1                       ; Protocol (1)
124         .db     0                       ; String index (none)
125
126         ; Endpoint 2 (IN)
127         .db     DSCR_ENDPOINT_LEN
128         .db     DSCR_ENDPOINT_TYPE
129         .db     0x82                    ; EP number (2), direction (IN)
130         .db     ENDPOINT_TYPE_ISO       ; Endpoint type (iso)
131         .db     0x00                    ; Max. packet size, LSB (3*1024 bytes)
132         .db     0x14                    ; Max. packet size, MSB (3*1024 bytes)
133                                         ; 12:11 = 0b10 (3 tr. per microframe)
134                                         ; 10:00 = 1024
135         .db     0x01                    ; Polling interval
136
137         ; Isochronous interface 0, alt 2, 16MB/s
138         .db     DSCR_INTERFACE_LEN
139         .db     DSCR_INTERFACE_TYPE
140         .db     0                       ; Interface index
141         .db     2                       ; Alternate setting index
142         .db     1                       ; Number of endpoints
143         .db     0xff                    ; Class (vendor specific)
144         .db     0                       ; Subclass (0)
145         .db     1                       ; Protocol (1)
146         .db     0                       ; String index (none)
147
148         ; Endpoint 2 (IN)
149         .db     DSCR_ENDPOINT_LEN
150         .db     DSCR_ENDPOINT_TYPE
151         .db     0x82                    ; EP number (2), direction (IN)
152         .db     ENDPOINT_TYPE_ISO       ; Endpoint type (iso)
153         .db     0x00                    ; Max. packet size, LSB (2*1024 bytes)
154         .db     0x0c                    ; Max. packet size, MSB (2*1024 bytes)
155                                         ; 12:11 = 0b01 (2 tr. per microframe)
156                                         ; 10:00 = 1024
157         .db     0x01                    ; Polling interval
158
159         ; Isochronous interface 0, alt 3, 8MB/s
160         .db     DSCR_INTERFACE_LEN
161         .db     DSCR_INTERFACE_TYPE
162         .db     0                       ; Interface index
163         .db     3                       ; Alternate setting index
164         .db     1                       ; Number of endpoints
165         .db     0xff                    ; Class (vendor specific)
166         .db     0                       ; Subclass (0)
167         .db     1                       ; Protocol (1)
168         .db     0                       ; String index (none)
169
170         ; Endpoint 2 (IN)
171         .db     DSCR_ENDPOINT_LEN
172         .db     DSCR_ENDPOINT_TYPE
173         .db     0x82                    ; EP number (2), direction (IN)
174         .db     ENDPOINT_TYPE_ISO       ; Endpoint type (iso)
175         .db     0x00                    ; Max. packet size, LSB (1024 bytes)
176         .db     0x04                    ; Max. packet size, MSB (1024 bytes)
177         .db     0x01                    ; Polling interval
178
179         ; Isochronous interface 0, alt 4, 4MB/s
180         .db     DSCR_INTERFACE_LEN
181         .db     DSCR_INTERFACE_TYPE
182         .db     0                       ; Interface index
183         .db     4                       ; Alternate setting index
184         .db     1                       ; Number of endpoints
185         .db     0xff                    ; Class (vendor specific)
186         .db     0                       ; Subclass (0)
187         .db     1                       ; Protocol (1)
188         .db     0                       ; String index (none)
189
190         ; Endpoint 2 (IN)
191         .db     DSCR_ENDPOINT_LEN
192         .db     DSCR_ENDPOINT_TYPE
193         .db     0x82                    ; EP number (2), direction (IN)
194         .db     ENDPOINT_TYPE_ISO       ; Endpoint type (iso)
195         .db     0x00                    ; Max. packet size, LSB (1024 bytes)
196         .db     0x04                    ; Max. packet size, MSB (1024 bytes)
197         .db     0x02                    ; Polling interval
198
199         ; Isochronous interface 0, alt 5, 2MB/s
200         .db     DSCR_INTERFACE_LEN
201         .db     DSCR_INTERFACE_TYPE
202         .db     0                       ; Interface index
203         .db     5                       ; Alternate setting index
204         .db     1                       ; Number of endpoints
205         .db     0xff                    ; Class (vendor specific)
206         .db     0                       ; Subclass (0)
207         .db     1                       ; Protocol (1)
208         .db     0                       ; String index (none)
209
210         ; Endpoint 2 (IN)
211         .db     DSCR_ENDPOINT_LEN
212         .db     DSCR_ENDPOINT_TYPE
213         .db     0x82                    ; EP number (2), direction (IN)
214         .db     ENDPOINT_TYPE_ISO       ; Endpoint type (iso)
215         .db     0x00                    ; Max. packet size, LSB (1024 bytes)
216         .db     0x04                    ; Max. packet size, MSB (1024 bytes)
217         .db     0x03                    ; Polling interval
218
219         ; Isochronous interface 0, alt 6, 1MB/s
220         .db     DSCR_INTERFACE_LEN
221         .db     DSCR_INTERFACE_TYPE
222         .db     0                       ; Interface index
223         .db     6                       ; Alternate setting index
224         .db     1                       ; Number of endpoints
225         .db     0xff                    ; Class (vendor specific)
226         .db     0                       ; Subclass (0)
227         .db     1                       ; Protocol (1)
228         .db     0                       ; String index (none)
229
230         ; Endpoint 2 (IN)
231         .db     DSCR_ENDPOINT_LEN
232         .db     DSCR_ENDPOINT_TYPE
233         .db     0x82                    ; EP number (2), direction (IN)
234         .db     ENDPOINT_TYPE_ISO       ; Endpoint type (iso)
235         .db     0x00                    ; Max. packet size, LSB (1024 bytes)
236         .db     0x04                    ; Max. packet size, MSB (1024 bytes)
237         .db     0x04                    ; Polling interval
238
239         ; Isochronous interface 0, alt 7, 500kB/s
240         .db     DSCR_INTERFACE_LEN
241         .db     DSCR_INTERFACE_TYPE
242         .db     0                       ; Interface index
243         .db     7                       ; Alternate setting index
244         .db     1                       ; Number of endpoints
245         .db     0xff                    ; Class (vendor specific)
246         .db     0                       ; Subclass (0)
247         .db     1                       ; Protocol (1)
248         .db     0                       ; String index (none)
249
250         ; Endpoint 2 (IN)
251         .db     DSCR_ENDPOINT_LEN
252         .db     DSCR_ENDPOINT_TYPE
253         .db     0x82                    ; EP number (2), direction (IN)
254         .db     ENDPOINT_TYPE_ISO       ; Endpoint type (iso)
255         .db     0x00                    ; Max. packet size, LSB (512 bytes)
256         .db     0x02                    ; Max. packet size, MSB (512 bytes)
257         .db     0x04                    ; Polling interval
258
259 highspd_dscr_realend:
260
261         .even
262
263 ; -----------------------------------------------------------------------------
264 ; Full-Speed configuration descriptor
265 ; -----------------------------------------------------------------------------
266 _fullspd_dscr:
267         .db     fullspd_dscr_end - _fullspd_dscr
268         .db     DSCR_CONFIG_TYPE
269         ; Total length of the configuration (1st line LSB, 2nd line MSB)
270         .db     (fullspd_dscr_realend - _fullspd_dscr) % 256
271         .db     (fullspd_dscr_realend - _fullspd_dscr) / 256
272         .db     2                       ; Number of interfaces
273         .db     1                       ; Configuration number
274         .db     0                       ; Configuration string (none)
275         .db     0x80                    ; Attributes (bus powered, no wakeup)
276         .db     0x37                    ; Max. power (110mA)
277 fullspd_dscr_end:
278
279         ; Bulk interface 0, alt 0
280         .db     DSCR_INTERFACE_LEN
281         .db     DSCR_INTERFACE_TYPE
282         .db     0                       ; Interface index
283         .db     0                       ; Alternate setting index
284         .db     1                       ; Number of endpoints
285         .db     0xff                    ; Class (vendor specific)
286         .db     0                       ; Subclass (0)
287         .db     0                       ; Protocol (0)
288         .db     0                       ; String index (none)
289
290         ; Endpoint 6 (IN)
291         .db     DSCR_ENDPOINT_LEN
292         .db     DSCR_ENDPOINT_TYPE
293         .db     0x86                    ; EP number (6), direction (IN)
294         .db     ENDPOINT_TYPE_BULK      ; Endpoint type (bulk)
295         .db     0x40                    ; Max. packet size, LSB (64 bytes)
296         .db     0x00                    ; Max. packet size, MSB (64 bytes)
297         .db     0x00                    ; Polling interval
298
299         ; Isochronous interface 0, alt 1, 1MB/s
300         .db     DSCR_INTERFACE_LEN
301         .db     DSCR_INTERFACE_TYPE
302         .db     0                       ; Interface index
303         .db     1                       ; Alternate setting index
304         .db     1                       ; Number of endpoints
305         .db     0xff                    ; Class (vendor specific)
306         .db     0                       ; Subclass (0)
307         .db     1                       ; Protocol (1)
308         .db     0                       ; String index (none)
309
310         ; Endpoint 2 (IN)
311         .db     DSCR_ENDPOINT_LEN
312         .db     DSCR_ENDPOINT_TYPE
313         .db     0x82                    ; EP number (2), direction (IN)
314         .db     ENDPOINT_TYPE_ISO       ; Endpoint type (iso)
315         .db     0xff                    ; Max. packet size, LSB (1023 bytes)
316         .db     0x03                    ; Max. packet size, MSB (1023 bytes)
317         .db     0x01                    ; Polling interval
318
319         ; Isochronous interface 0, alt 2, 500kB/s
320         .db     DSCR_INTERFACE_LEN
321         .db     DSCR_INTERFACE_TYPE
322         .db     0                       ; Interface index
323         .db     2                       ; Alternate setting index
324         .db     1                       ; Number of endpoints
325         .db     0xff                    ; Class (vendor specific)
326         .db     0                       ; Subclass (0)
327         .db     1                       ; Protocol (1)
328         .db     0                       ; String index (none)
329
330         ; Endpoint 2 (IN)
331         .db     DSCR_ENDPOINT_LEN
332         .db     DSCR_ENDPOINT_TYPE
333         .db     0x82                    ; EP number (2), direction (IN)
334         .db     ENDPOINT_TYPE_ISO       ; Endpoint type (iso)
335         .db     0x00                    ; Max. packet size, LSB (512 bytes)
336         .db     0x02                    ; Max. packet size, MSB (512 bytes)
337         .db     0x01                    ; Polling interval
338
339 fullspd_dscr_realend:
340
341         .even
342
343 ; -----------------------------------------------------------------------------
344 ; Strings
345 ; -----------------------------------------------------------------------------
346
347 _dev_strings:
348
349 ; See http://www.usb.org/developers/docs/USB_LANGIDs.pdf for the full list.
350 _string0:
351         .db     string0end - _string0
352         .db     DSCR_STRING_TYPE
353         .db     0x09, 0x04              ; Language code 0x0409 (English, US)
354 string0end:
355
356 _string1:
357         .db     string1end - _string1
358         .db     DSCR_STRING_TYPE
359         .ascii  's\0i\0g\0r\0o\0k\0'
360 string1end:
361
362 _string2:
363         .db     string2end - _string2
364         .db     DSCR_STRING_TYPE
365         .ascii  'f\0x\0002\0l\0a\0f\0w\0'
366 string2end:
367
368 _dev_strings_end:
369         .dw     0x0000
370