xref: /haiku/docs/user/drivers/USB_spec.dox (revision 56eb8e78cc702792e3b032e3f5f45da9e5dbea9e)
1/*
2 * Copyright 2007, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
4 *
5 * Documentation by:
6 *  Niels Sascha Reedijk <niels.reedijk@gmail.com>
7 * Corresponds to:
8 * /trunk/headers/os/drivers/USB_spec.h rev 19915
9 */
10
11/*!
12  \file USB_spec.h
13  \brief General definitions as defined by the USB standard.
14*/
15
16/*!
17  \name Request Types: targets and direction
18
19  These request types can be used in the usb_module_info::send_request()
20  and usb_module_info::queue_request() methods. They specifiy both the type
21  of interface and the direction of the transfer.
22
23  These are usually combined with a category (found on this page).
24*/
25
26//! @{
27
28/*!
29  \def USB_REQTYPE_DEVICE_IN
30  \brief Device. In.
31*/
32
33/*!
34  \def USB_REQTYPE_DEVICE_OUT
35  \brief Device. Out.
36*/
37
38/*!
39  \def USB_REQTYPE_INTERFACE_IN
40  \brief Interface. In.
41*/
42
43/*!
44  \def USB_REQTYPE_INTERFACE_OUT
45  \brief Interface. Out.
46*/
47
48/*!
49  \def USB_REQTYPE_ENDPOINT_IN
50  \brief Endpoint. In.
51*/
52
53/*!
54  \def USB_REQTYPE_ENDPOINT_OUT
55  \brief Endpoint. Out.
56*/
57
58/*!
59  \def USB_REQTYPE_OTHER_OUT
60  \brief Other. Out.
61*/
62
63/*!
64  \def USB_REQTYPE_OTHER_IN
65  \brief Other. In.
66*/
67
68//! @}
69
70/*!
71  \name Request Types: categories
72
73  These request types can be used in the usb_module_info::send_request()
74  and usb_module_info::queue_request() methods. They specifiy the category
75  of the transfer.
76
77  These are usually combined with a target and direction (found on this page).
78*/
79
80//! @{
81
82/*!
83  \def USB_REQTYPE_STANDARD
84  \brief Request that adheres to the USB specifications.
85*/
86
87/*!
88  \def USB_REQTYPE_CLASS
89  \brief Request that adheres to the specifications of the class.
90*/
91
92/*!
93  \def USB_REQTYPE_VENDOR
94  \brief Request that is defined by the specifications of the vendor.
95*/
96
97/*!
98  \def USB_REQTYPE_RESERVED
99  \brief Reserved for special implementations.
100*/
101
102/*!
103  \def USB_REQTYPE_MASK
104  \brief Constant that can be used as mask over the requesttype field.
105*/
106
107//! @}
108
109/*!
110  \name Standard Request Values
111
112  These request values are defined by the USB standard. You can use these
113  constants in both the usb_module_info::send_request() and
114  usb_module_info::queue_request() methods.
115
116  \warning The stack handles most of these standard requests for you. Use the
117  supplied convenience functions the the usb_module_info interface rather than
118  doing the requests yourself. Some of these request may actually interfere
119  with the inner workings of the USB stack!
120*/
121
122//! @{
123
124/*!
125  \def USB_REQUEST_GET_STATUS
126  \brief Get the status of a device.
127*/
128
129/*!
130  \def USB_REQUEST_CLEAR_FEATURE
131  \brief Clear a feature.
132*/
133
134/*!
135  \def USB_REQUEST_SET_FEATURE
136  \brief Set a feature.
137*/
138
139/*!
140  \def USB_REQUEST_SET_ADDRESS
141  \brief Set the device address.
142*/
143
144/*!
145  \def USB_REQUEST_GET_DESCRIPTOR
146  \brief Get a descriptor.
147*/
148
149/*!
150  \def USB_REQUEST_SET_DESCRIPTOR
151  \brief Update a descriptor to a supplied one.
152*/
153
154/*!
155  \def USB_REQUEST_GET_CONFIGURATION
156  \brief Get a configuration.
157*/
158
159/*!
160  \def USB_REQUEST_SET_CONFIGURATION
161  \brief Set the configuration.
162*/
163
164/*!
165  \def USB_REQUEST_GET_INTERFACE
166  \brief Request an interface descriptor.
167*/
168
169/*!
170  \def USB_REQUEST_SET_INTERFACE
171  \brief Set a specific interface.
172*/
173
174/*!
175  \def USB_REQUEST_SYNCH_FRAME
176  \brief Synchronize a frame.
177*/
178
179//! @}
180
181/*!
182  \name Descriptor Constants
183
184  These constants refer to a specific descriptor. They can be used when
185  building a standard USB request for a descriptor, or in the
186  usb_module_info::get_descriptor() method.
187*/
188
189//! @{
190
191/*!
192  \def USB_DESCRIPTOR_DEVICE
193  \brief Constant for the device descriptor.
194*/
195
196/*!
197  \def USB_DESCRIPTOR_CONFIGURATION
198  \brief Constant for a configuration descriptor.
199*/
200
201/*!
202  \def USB_DESCRIPTOR_STRING
203  \brief Constant for a string descriptor.
204*/
205
206/*!
207  \def USB_DESCRIPTOR_INTERFACE
208  \brief Constant for an interface descriptor.
209*/
210
211/*!
212  \def USB_DESCRIPTOR_ENDPOINT
213  \brief Constant for an endpoint descriptor.
214*/
215
216//! @}
217
218/*!
219  \name Feature Requests
220
221  These constants refer to standard feature requests. You can use these using
222  the convenient usb_module_info::set_feature() and
223  usb_module_info::clear_feature() methods.
224*/
225
226//! @{
227
228/*!
229  \def USB_FEATURE_DEVICE_REMOTE_WAKEUP
230  \brief Request a device to wakeup from remote calls.
231*/
232
233/*!
234  \def USB_FEATURE_ENDPOINT_HALT
235  \brief Request for a specific endpoint to halt.
236*/
237
238//! @}
239
240/*!
241  \name Endpoint Attributes
242
243  These constants refer to values in the usb_endpoint_descriptor::attributes
244  field.
245*/
246
247//! @{
248
249/*!
250  \def USB_ENDPOINT_ATTR_CONTROL
251  \brief Endpoint facilitates control transfers.
252*/
253
254/*!
255  \def USB_ENDPOINT_ATTR_ISOCHRONOUS
256  \brief Endpoint facilitates isochronous transfers.
257*/
258
259/*!
260  \def USB_ENDPOINT_ATTR_BULK
261  \brief Endpoint facilitates bulk transfers.
262*/
263
264/*!
265  \def USB_ENDPOINT_ATTR_INTERRUPT
266  \brief Endpoint facilitates interrupt transfers.
267*/
268
269/*!
270  \def USB_ENDPOINT_ATTR_MASK
271  \brief Constant to mask out transfer types.
272*/
273
274//! @}
275
276/*!
277  \name Endpoint Address
278
279  These constants refer to the direction that is embedded in the
280  usb_endpoint_descriptor::address field.
281*/
282
283//! @{
284
285/*!
286  \def USB_ENDPOINT_ADDR_DIR_IN
287  \brief The endpoint provides data for the driver.
288*/
289
290/*!
291  \def USB_ENDPOINT_ADDR_DIR_OUT
292  \brief The endpoint accepts data from the host.
293*/
294
295//! @}
296
297