]> sigrok.org Git - sigrok-firmware-fx2lafw.git/blob - include/dscr_hantek_6022be.inc
71cdc44d2b64e33241635f84c3a2a5ace263cf6d
[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 .include "common.inc"
22
23 .module DEV_DSCR
24
25 ; Descriptor types
26 DSCR_DEVICE_TYPE        = 1
27 DSCR_CONFIG_TYPE        = 2
28 DSCR_STRING_TYPE        = 3
29 DSCR_INTERFACE_TYPE     = 4
30 DSCR_ENDPOINT_TYPE      = 5
31 DSCR_DEVQUAL_TYPE       = 6
32
33 ; Descriptor lengths
34 DSCR_INTERFACE_LEN      = 9
35 DSCR_ENDPOINT_LEN       = 7
36
37 ; Endpoint types
38 ENDPOINT_TYPE_CONTROL   = 0
39 ENDPOINT_TYPE_ISO       = 1
40 ENDPOINT_TYPE_BULK      = 2
41 ENDPOINT_TYPE_INT       = 3
42
43 .globl _dev_dscr, _dev_qual_dscr, _highspd_dscr, _fullspd_dscr, _dev_strings, _dev_strings_end
44 .area DSCR_AREA (CODE)
45
46 ; -----------------------------------------------------------------------------
47 ; Device descriptor
48 ; -----------------------------------------------------------------------------
49 _dev_dscr:
50         .db     dev_dscr_end - _dev_dscr
51         .db     DSCR_DEVICE_TYPE
52         .dw     0x0002                  ; USB 2.0
53         .db     0xff                    ; Class (vendor specific)
54         .db     0xff                    ; Subclass (vendor specific)
55         .db     0xff                    ; Protocol (vendor specific)
56         .db     64                      ; Max. EP0 packet size
57         .dw     VID                     ; Manufacturer ID
58         .dw     PID                     ; Product ID
59         .dw     VER                     ; Product version/type
60         .db     1                       ; Manufacturer string index
61         .db     2                       ; Product string index
62         .db     0                       ; Serial number string index (none)
63         .db     1                       ; Number of configurations
64 dev_dscr_end:
65
66 ; -----------------------------------------------------------------------------
67 ; Device qualifier (for "other device speed")
68 ; -----------------------------------------------------------------------------
69 _dev_qual_dscr:
70         .db     dev_qualdscr_end - _dev_qual_dscr
71         .db     DSCR_DEVQUAL_TYPE
72         .dw     0x0002                  ; USB 2.0
73         .db     0                       ; Class (0)
74         .db     0                       ; Subclass (0)
75         .db     0                       ; Protocol (0)
76         .db     64                      ; Max. EP0 packet size
77         .db     1                       ; Number of configurations
78         .db     0                       ; Extra reserved byte
79 dev_qualdscr_end:
80
81 ; -----------------------------------------------------------------------------
82 ; High-Speed configuration descriptor
83 ; -----------------------------------------------------------------------------
84 _highspd_dscr:
85         .db     highspd_dscr_end - _highspd_dscr
86         .db     DSCR_CONFIG_TYPE
87         ; Total length of the configuration (1st line LSB, 2nd line MSB)
88         .db     (highspd_dscr_realend - _highspd_dscr) % 256
89         .db     (highspd_dscr_realend - _highspd_dscr) / 256
90         .db     1                       ; Number of interfaces
91         .db     1                       ; Configuration number
92         .db     0                       ; Configuration string (none)
93         .db     0x80                    ; Attributes (bus powered, no wakeup)
94         .db     0x37                    ; Max. power (110mA)
95 highspd_dscr_end:
96
97         ; Bulk interface 0, alt 0
98         .db     DSCR_INTERFACE_LEN
99         .db     DSCR_INTERFACE_TYPE
100         .db     0                       ; Interface index
101         .db     0                       ; Alternate setting index
102         .db     1                       ; Number of endpoints
103         .db     0xff                    ; Class (vendor specific)
104         .db     0                       ; Subclass (0)
105         .db     0                       ; Protocol (0)
106         .db     0                       ; String index (none)
107
108         ; Endpoint 6 (IN)
109         .db     DSCR_ENDPOINT_LEN
110         .db     DSCR_ENDPOINT_TYPE
111         .db     0x86                    ; EP number (6), direction (IN)
112         .db     ENDPOINT_TYPE_BULK      ; Endpoint type (bulk)
113         .db     0x00                    ; Max. packet size, LSB (512 bytes)
114         .db     0x02                    ; Max. packet size, MSB (512 bytes)
115         .db     0x00                    ; Polling interval (ignored for bulk)
116
117         ; Isochronous interface 0, alt 1
118         .db     DSCR_INTERFACE_LEN
119         .db     DSCR_INTERFACE_TYPE
120         .db     0                       ; Interface index
121         .db     1                       ; Alternate setting index
122         .db     1                       ; Number of endpoints
123         .db     0xff                    ; Class (vendor specific)
124         .db     0                       ; Subclass (0)
125         .db     1                       ; Protocol (1)
126         .db     0                       ; String index (none)
127
128         ; Endpoint 2 (IN)
129         .db     DSCR_ENDPOINT_LEN
130         .db     DSCR_ENDPOINT_TYPE
131         .db     0x82                    ; EP number (2), direction (IN)
132         .db     ENDPOINT_TYPE_ISO       ; Endpoint type (iso)
133         .db     0x00                    ; Max. packet size, LSB (3*1024 bytes)
134         .db     0x14                    ; Max. packet size, MSB (3*1024 bytes)
135                                         ; 12:11 = 0b10 (3 tr. per microframe)
136                                         ; 10:00 = 1024
137         .db     0x01                    ; Polling interval (1 microframe)
138
139         ; Isochronous interface 0, alt 2, 16MB/s
140         .db     DSCR_INTERFACE_LEN
141         .db     DSCR_INTERFACE_TYPE
142         .db     0                       ; Interface index
143         .db     2                       ; Alternate setting index
144         .db     1                       ; Number of endpoints
145         .db     0xff                    ; Class (vendor specific)
146         .db     0                       ; Subclass (0)
147         .db     1                       ; Protocol (1)
148         .db     0                       ; String index (none)
149
150         ; Endpoint 2 (IN)
151         .db     DSCR_ENDPOINT_LEN
152         .db     DSCR_ENDPOINT_TYPE
153         .db     0x82                    ; EP number (2), direction (IN)
154         .db     ENDPOINT_TYPE_ISO       ; Endpoint type (iso)
155         .db     0x00                    ; Max. packet size, LSB (2*1024 bytes)
156         .db     0x0c                    ; Max. packet size, MSB (2*1024 bytes)
157                                         ; 12:11 = 0b01 (2 tr. per microframe)
158                                         ; 10:00 = 1024
159         .db     0x01                    ; Polling interval (1 microframe)
160
161         ; Isochronous interface 0, alt 3, 8MB/s
162         .db     DSCR_INTERFACE_LEN
163         .db     DSCR_INTERFACE_TYPE
164         .db     0                       ; Interface index
165         .db     3                       ; Alternate setting index
166         .db     1                       ; Number of endpoints
167         .db     0xff                    ; Class (vendor specific)
168         .db     0                       ; Subclass (0)
169         .db     1                       ; Protocol (1)
170         .db     0                       ; String index (none)
171
172         ; Endpoint 2 (IN)
173         .db     DSCR_ENDPOINT_LEN
174         .db     DSCR_ENDPOINT_TYPE
175         .db     0x82                    ; EP number (2), direction (IN)
176         .db     ENDPOINT_TYPE_ISO       ; Endpoint type (iso)
177         .db     0x00                    ; Max. packet size, LSB (1024 bytes)
178         .db     0x04                    ; Max. packet size, MSB (1024 bytes)
179         .db     0x01                    ; Polling interval (1 microframe)
180
181         ; Isochronous interface 0, alt 4, 4MB/s
182         .db     DSCR_INTERFACE_LEN
183         .db     DSCR_INTERFACE_TYPE
184         .db     0                       ; Interface index
185         .db     4                       ; Alternate setting index
186         .db     1                       ; Number of endpoints
187         .db     0xff                    ; Class (vendor specific)
188         .db     0                       ; Subclass (0)
189         .db     1                       ; Protocol (1)
190         .db     0                       ; String index (none)
191
192         ; Endpoint 2 (IN)
193         .db     DSCR_ENDPOINT_LEN
194         .db     DSCR_ENDPOINT_TYPE
195         .db     0x82                    ; EP number (2), direction (IN)
196         .db     ENDPOINT_TYPE_ISO       ; Endpoint type (iso)
197         .db     0x00                    ; Max. packet size, LSB (1024 bytes)
198         .db     0x04                    ; Max. packet size, MSB (1024 bytes)
199         .db     0x02                    ; Polling interval (2 microframes)
200
201         ; Isochronous interface 0, alt 5, 2MB/s
202         .db     DSCR_INTERFACE_LEN
203         .db     DSCR_INTERFACE_TYPE
204         .db     0                       ; Interface index
205         .db     5                       ; Alternate setting index
206         .db     1                       ; Number of endpoints
207         .db     0xff                    ; Class (vendor specific)
208         .db     0                       ; Subclass (0)
209         .db     1                       ; Protocol (1)
210         .db     0                       ; String index (none)
211
212         ; Endpoint 2 (IN)
213         .db     DSCR_ENDPOINT_LEN
214         .db     DSCR_ENDPOINT_TYPE
215         .db     0x82                    ; EP number (2), direction (IN)
216         .db     ENDPOINT_TYPE_ISO       ; Endpoint type (iso)
217         .db     0x00                    ; Max. packet size, LSB (1024 bytes)
218         .db     0x04                    ; Max. packet size, MSB (1024 bytes)
219         .db     0x03                    ; Polling interval (4 microframes)
220
221         ; Isochronous interface 0, alt 6, 1MB/s
222         .db     DSCR_INTERFACE_LEN
223         .db     DSCR_INTERFACE_TYPE
224         .db     0                       ; Interface index
225         .db     6                       ; Alternate setting index
226         .db     1                       ; Number of endpoints
227         .db     0xff                    ; Class (vendor specific)
228         .db     0                       ; Subclass (0)
229         .db     1                       ; Protocol (1)
230         .db     0                       ; String index (none)
231
232         ; Endpoint 2 (IN)
233         .db     DSCR_ENDPOINT_LEN
234         .db     DSCR_ENDPOINT_TYPE
235         .db     0x82                    ; EP number (2), direction (IN)
236         .db     ENDPOINT_TYPE_ISO       ; Endpoint type (iso)
237         .db     0x00                    ; Max. packet size, LSB (1024 bytes)
238         .db     0x04                    ; Max. packet size, MSB (1024 bytes)
239         .db     0x04                    ; Polling interval (8 microframes)
240
241         ; Isochronous interface 0, alt 7, 500kB/s
242         .db     DSCR_INTERFACE_LEN
243         .db     DSCR_INTERFACE_TYPE
244         .db     0                       ; Interface index
245         .db     7                       ; Alternate setting index
246         .db     1                       ; Number of endpoints
247         .db     0xff                    ; Class (vendor specific)
248         .db     0                       ; Subclass (0)
249         .db     1                       ; Protocol (1)
250         .db     0                       ; String index (none)
251
252         ; Endpoint 2 (IN)
253         .db     DSCR_ENDPOINT_LEN
254         .db     DSCR_ENDPOINT_TYPE
255         .db     0x82                    ; EP number (2), direction (IN)
256         .db     ENDPOINT_TYPE_ISO       ; Endpoint type (iso)
257         .db     0x00                    ; Max. packet size, LSB (512 bytes)
258         .db     0x02                    ; Max. packet size, MSB (512 bytes)
259         .db     0x04                    ; Polling interval (8 microframes)
260
261 highspd_dscr_realend:
262
263         .even
264
265 ; -----------------------------------------------------------------------------
266 ; Full-Speed configuration descriptor
267 ; -----------------------------------------------------------------------------
268 _fullspd_dscr:
269         .db     fullspd_dscr_end - _fullspd_dscr
270         .db     DSCR_CONFIG_TYPE
271         ; Total length of the configuration (1st line LSB, 2nd line MSB)
272         .db     (fullspd_dscr_realend - _fullspd_dscr) % 256
273         .db     (fullspd_dscr_realend - _fullspd_dscr) / 256
274         .db     2                       ; Number of interfaces
275         .db     1                       ; Configuration number
276         .db     0                       ; Configuration string (none)
277         .db     0x80                    ; Attributes (bus powered, no wakeup)
278         .db     0x37                    ; Max. power (110mA)
279 fullspd_dscr_end:
280
281         ; Bulk interface 0, alt 0
282         .db     DSCR_INTERFACE_LEN
283         .db     DSCR_INTERFACE_TYPE
284         .db     0                       ; Interface index
285         .db     0                       ; Alternate setting index
286         .db     1                       ; Number of endpoints
287         .db     0xff                    ; Class (vendor specific)
288         .db     0                       ; Subclass (0)
289         .db     0                       ; Protocol (0)
290         .db     0                       ; String index (none)
291
292         ; Endpoint 6 (IN)
293         .db     DSCR_ENDPOINT_LEN
294         .db     DSCR_ENDPOINT_TYPE
295         .db     0x86                    ; EP number (6), direction (IN)
296         .db     ENDPOINT_TYPE_BULK      ; Endpoint type (bulk)
297         .db     0x40                    ; Max. packet size, LSB (64 bytes)
298         .db     0x00                    ; Max. packet size, MSB (64 bytes)
299         .db     0x00                    ; Polling interval (ignored for bulk)
300
301         ; Isochronous interface 0, alt 1, 1MB/s
302         .db     DSCR_INTERFACE_LEN
303         .db     DSCR_INTERFACE_TYPE
304         .db     0                       ; Interface index
305         .db     1                       ; Alternate setting index
306         .db     1                       ; Number of endpoints
307         .db     0xff                    ; Class (vendor specific)
308         .db     0                       ; Subclass (0)
309         .db     1                       ; Protocol (1)
310         .db     0                       ; String index (none)
311
312         ; Endpoint 2 (IN)
313         .db     DSCR_ENDPOINT_LEN
314         .db     DSCR_ENDPOINT_TYPE
315         .db     0x82                    ; EP number (2), direction (IN)
316         .db     ENDPOINT_TYPE_ISO       ; Endpoint type (iso)
317         .db     0xff                    ; Max. packet size, LSB (1023 bytes)
318         .db     0x03                    ; Max. packet size, MSB (1023 bytes)
319         .db     0x01                    ; Polling interval (1 frame)
320
321         ; Isochronous interface 0, alt 2, 500kB/s
322         .db     DSCR_INTERFACE_LEN
323         .db     DSCR_INTERFACE_TYPE
324         .db     0                       ; Interface index
325         .db     2                       ; Alternate setting index
326         .db     1                       ; Number of endpoints
327         .db     0xff                    ; Class (vendor specific)
328         .db     0                       ; Subclass (0)
329         .db     1                       ; Protocol (1)
330         .db     0                       ; String index (none)
331
332         ; Endpoint 2 (IN)
333         .db     DSCR_ENDPOINT_LEN
334         .db     DSCR_ENDPOINT_TYPE
335         .db     0x82                    ; EP number (2), direction (IN)
336         .db     ENDPOINT_TYPE_ISO       ; Endpoint type (iso)
337         .db     0x00                    ; Max. packet size, LSB (512 bytes)
338         .db     0x02                    ; Max. packet size, MSB (512 bytes)
339         .db     0x01                    ; Polling interval (1 frame)
340
341 fullspd_dscr_realend:
342
343         .even
344
345 ; -----------------------------------------------------------------------------
346 ; Strings
347 ; -----------------------------------------------------------------------------
348
349 _dev_strings:
350
351 ; See http://www.usb.org/developers/docs/USB_LANGIDs.pdf for the full list.
352 string_descriptor_lang 0 0x0409 ; Language code 0x0409 (English, US)
353
354 string_descriptor_a 1,^"sigrok"
355 string_descriptor_a 2,^"fx2lafw"
356
357 _dev_strings_end:
358         .dw     0x0000