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