]> sigrok.org Git - sigrok-firmware-fx2lafw.git/blame - include/dscr_hantek_6022be.inc
scopes: Unify code-base, remove duplicate code/files.
[sigrok-firmware-fx2lafw.git] / include / dscr_hantek_6022be.inc
CommitLineData
a77606e9
UH
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
040a6eae 17;; License along with this library; if not, see <http://www.gnu.org/licenses/>.
a77606e9 18;;
189db3d4 19
01c91958
UH
20.include "common.inc"
21
e0c25b8e
UH
22.module DEV_DSCR
23
24; Descriptor types
25DSCR_DEVICE_TYPE = 1
26DSCR_CONFIG_TYPE = 2
27DSCR_STRING_TYPE = 3
28DSCR_INTERFACE_TYPE = 4
29DSCR_ENDPOINT_TYPE = 5
30DSCR_DEVQUAL_TYPE = 6
31
32; Descriptor lengths
33DSCR_INTERFACE_LEN = 9
34DSCR_ENDPOINT_LEN = 7
35
36; Endpoint types
37ENDPOINT_TYPE_CONTROL = 0
38ENDPOINT_TYPE_ISO = 1
39ENDPOINT_TYPE_BULK = 2
40ENDPOINT_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; -----------------------------------------------------------------------------
189db3d4 48_dev_dscr:
e0c25b8e
UH
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
b2fc269a 58 .dw VER ; Product version/type
e0c25b8e
UH
59 .db 1 ; Manufacturer string index
60 .db 2 ; Product string index
e59a70a9 61 .db 3 ; Serial number string index
e0c25b8e 62 .db 1 ; Number of configurations
189db3d4
UH
63dev_dscr_end:
64
e0c25b8e
UH
65; -----------------------------------------------------------------------------
66; Device qualifier (for "other device speed")
67; -----------------------------------------------------------------------------
189db3d4 68_dev_qual_dscr:
e0c25b8e 69 .db dev_qualdscr_end - _dev_qual_dscr
189db3d4 70 .db DSCR_DEVQUAL_TYPE
e0c25b8e
UH
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
189db3d4
UH
78dev_qualdscr_end:
79
e0c25b8e
UH
80; -----------------------------------------------------------------------------
81; High-Speed configuration descriptor
82; -----------------------------------------------------------------------------
189db3d4 83_highspd_dscr:
e0c25b8e 84 .db highspd_dscr_end - _highspd_dscr
189db3d4 85 .db DSCR_CONFIG_TYPE
e0c25b8e
UH
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)
189db3d4
UH
94highspd_dscr_end:
95
e0c25b8e 96 ; Bulk interface 0, alt 0
189db3d4
UH
97 .db DSCR_INTERFACE_LEN
98 .db DSCR_INTERFACE_TYPE
e0c25b8e
UH
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)
189db3d4
UH
108 .db DSCR_ENDPOINT_LEN
109 .db DSCR_ENDPOINT_TYPE
e0c25b8e
UH
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)
b68bc8ea 114 .db 0x00 ; Polling interval (ignored for bulk)
189db3d4 115
e0c25b8e 116 ; Isochronous interface 0, alt 1
189db3d4
UH
117 .db DSCR_INTERFACE_LEN
118 .db DSCR_INTERFACE_TYPE
e0c25b8e
UH
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)
189db3d4
UH
128 .db DSCR_ENDPOINT_LEN
129 .db DSCR_ENDPOINT_TYPE
e0c25b8e
UH
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)
1cba5732
UH
134 ; 12:11 = 0b10 (3 tr. per microframe)
135 ; 10:00 = 1024
b68bc8ea 136 .db 0x01 ; Polling interval (1 microframe)
189db3d4 137
e0c25b8e 138 ; Isochronous interface 0, alt 2, 16MB/s
189db3d4
UH
139 .db DSCR_INTERFACE_LEN
140 .db DSCR_INTERFACE_TYPE
e0c25b8e
UH
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)
189db3d4
UH
150 .db DSCR_ENDPOINT_LEN
151 .db DSCR_ENDPOINT_TYPE
e0c25b8e
UH
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)
1cba5732
UH
156 ; 12:11 = 0b01 (2 tr. per microframe)
157 ; 10:00 = 1024
b68bc8ea 158 .db 0x01 ; Polling interval (1 microframe)
189db3d4 159
e0c25b8e 160 ; Isochronous interface 0, alt 3, 8MB/s
189db3d4
UH
161 .db DSCR_INTERFACE_LEN
162 .db DSCR_INTERFACE_TYPE
e0c25b8e
UH
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)
189db3d4
UH
172 .db DSCR_ENDPOINT_LEN
173 .db DSCR_ENDPOINT_TYPE
e0c25b8e
UH
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)
b68bc8ea 178 .db 0x01 ; Polling interval (1 microframe)
189db3d4 179
e0c25b8e 180 ; Isochronous interface 0, alt 4, 4MB/s
189db3d4
UH
181 .db DSCR_INTERFACE_LEN
182 .db DSCR_INTERFACE_TYPE
e0c25b8e
UH
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)
189db3d4
UH
192 .db DSCR_ENDPOINT_LEN
193 .db DSCR_ENDPOINT_TYPE
e0c25b8e
UH
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)
b68bc8ea 198 .db 0x02 ; Polling interval (2 microframes)
189db3d4 199
e0c25b8e 200 ; Isochronous interface 0, alt 5, 2MB/s
189db3d4
UH
201 .db DSCR_INTERFACE_LEN
202 .db DSCR_INTERFACE_TYPE
e0c25b8e
UH
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)
189db3d4
UH
212 .db DSCR_ENDPOINT_LEN
213 .db DSCR_ENDPOINT_TYPE
e0c25b8e
UH
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)
b68bc8ea 218 .db 0x03 ; Polling interval (4 microframes)
189db3d4 219
e0c25b8e 220 ; Isochronous interface 0, alt 6, 1MB/s
189db3d4
UH
221 .db DSCR_INTERFACE_LEN
222 .db DSCR_INTERFACE_TYPE
e0c25b8e
UH
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)
189db3d4
UH
232 .db DSCR_ENDPOINT_LEN
233 .db DSCR_ENDPOINT_TYPE
e0c25b8e
UH
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)
b68bc8ea 238 .db 0x04 ; Polling interval (8 microframes)
189db3d4 239
e0c25b8e 240 ; Isochronous interface 0, alt 7, 500kB/s
189db3d4
UH
241 .db DSCR_INTERFACE_LEN
242 .db DSCR_INTERFACE_TYPE
e0c25b8e
UH
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)
189db3d4
UH
252 .db DSCR_ENDPOINT_LEN
253 .db DSCR_ENDPOINT_TYPE
e0c25b8e
UH
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)
b68bc8ea 258 .db 0x04 ; Polling interval (8 microframes)
189db3d4
UH
259
260highspd_dscr_realend:
261
e0c25b8e
UH
262 .even
263
264; -----------------------------------------------------------------------------
265; Full-Speed configuration descriptor
266; -----------------------------------------------------------------------------
189db3d4 267_fullspd_dscr:
e0c25b8e 268 .db fullspd_dscr_end - _fullspd_dscr
189db3d4 269 .db DSCR_CONFIG_TYPE
e0c25b8e
UH
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)
189db3d4
UH
278fullspd_dscr_end:
279
e0c25b8e 280 ; Bulk interface 0, alt 0
189db3d4
UH
281 .db DSCR_INTERFACE_LEN
282 .db DSCR_INTERFACE_TYPE
e0c25b8e
UH
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)
189db3d4
UH
292 .db DSCR_ENDPOINT_LEN
293 .db DSCR_ENDPOINT_TYPE
e0c25b8e
UH
294 .db 0x86 ; EP number (6), direction (IN)
295 .db ENDPOINT_TYPE_BULK ; Endpoint type (bulk)
1cba5732
UH
296 .db 0x40 ; Max. packet size, LSB (64 bytes)
297 .db 0x00 ; Max. packet size, MSB (64 bytes)
b68bc8ea 298 .db 0x00 ; Polling interval (ignored for bulk)
189db3d4 299
e0c25b8e 300 ; Isochronous interface 0, alt 1, 1MB/s
189db3d4
UH
301 .db DSCR_INTERFACE_LEN
302 .db DSCR_INTERFACE_TYPE
e0c25b8e
UH
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)
189db3d4
UH
312 .db DSCR_ENDPOINT_LEN
313 .db DSCR_ENDPOINT_TYPE
e0c25b8e
UH
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)
b68bc8ea 318 .db 0x01 ; Polling interval (1 frame)
189db3d4 319
e0c25b8e 320 ; Isochronous interface 0, alt 2, 500kB/s
189db3d4
UH
321 .db DSCR_INTERFACE_LEN
322 .db DSCR_INTERFACE_TYPE
e0c25b8e
UH
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)
189db3d4
UH
332 .db DSCR_ENDPOINT_LEN
333 .db DSCR_ENDPOINT_TYPE
e0c25b8e
UH
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)
b68bc8ea 338 .db 0x01 ; Polling interval (1 frame)
189db3d4
UH
339
340fullspd_dscr_realend:
341
e0c25b8e
UH
342 .even
343
344; -----------------------------------------------------------------------------
345; Strings
346; -----------------------------------------------------------------------------
347
189db3d4 348_dev_strings:
e0c25b8e
UH
349
350; See http://www.usb.org/developers/docs/USB_LANGIDs.pdf for the full list.
01c91958
UH
351string_descriptor_lang 0 0x0409 ; Language code 0x0409 (English, US)
352
353string_descriptor_a 1,^"sigrok"
354string_descriptor_a 2,^"fx2lafw"