2 * Copyright 2007 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
6 * Niels Sascha Reedijk, niels.reedijk@gmail.com
9 * headers/os/drivers/USB_spec.h rev 19915
17 \brief General definitions as defined by the USB standard.
22 \name Request Types: targets and direction
24 These request types can be used in the usb_module_info::send_request()
25 and usb_module_info::queue_request() methods. They specifiy both the type
26 of interface and the direction of the transfer.
28 These are usually combined with a category (found on this page).
36 \def USB_REQTYPE_DEVICE_IN
42 \def USB_REQTYPE_DEVICE_OUT
48 \def USB_REQTYPE_INTERFACE_IN
54 \def USB_REQTYPE_INTERFACE_OUT
55 \brief Interface. Out.
60 \def USB_REQTYPE_ENDPOINT_IN
66 \def USB_REQTYPE_ENDPOINT_OUT
72 \def USB_REQTYPE_OTHER_OUT
78 \def USB_REQTYPE_OTHER_IN
87 \name Request Types: categories
89 These request types can be used in the usb_module_info::send_request()
90 and usb_module_info::queue_request() methods. They specifiy the category
93 These are usually combined with a target and direction (found on this page).
101 \def USB_REQTYPE_STANDARD
102 \brief Request that adheres to the USB specifications.
107 \def USB_REQTYPE_CLASS
108 \brief Request that adheres to the specifications of the class.
113 \def USB_REQTYPE_VENDOR
114 \brief Request that is defined by the specifications of the vendor.
119 \def USB_REQTYPE_RESERVED
120 \brief Reserved for special implementations.
125 \def USB_REQTYPE_MASK
126 \brief Constant that can be used as mask over the requesttype field.
134 \name Standard Request Values
136 These request values are defined by the USB standard. You can use these
137 constants in both the usb_module_info::send_request() and
138 usb_module_info::queue_request() methods.
140 \warning The stack handles most of these standard requests for you. Use the
141 supplied convenience functions the the usb_module_info interface rather than
142 doing the requests yourself. Some of these request may actually interfere
143 with the inner workings of the USB stack!
151 \def USB_REQUEST_GET_STATUS
152 \brief Get the status of a device.
157 \def USB_REQUEST_CLEAR_FEATURE
158 \brief Clear a feature.
163 \def USB_REQUEST_SET_FEATURE
164 \brief Set a feature.
169 \def USB_REQUEST_SET_ADDRESS
170 \brief Set the device address.
175 \def USB_REQUEST_GET_DESCRIPTOR
176 \brief Get a descriptor.
181 \def USB_REQUEST_SET_DESCRIPTOR
182 \brief Update a descriptor to a supplied one.
187 \def USB_REQUEST_GET_CONFIGURATION
188 \brief Get a configuration.
193 \def USB_REQUEST_SET_CONFIGURATION
194 \brief Set the configuration.
199 \def USB_REQUEST_GET_INTERFACE
200 \brief Request an interface descriptor.
205 \def USB_REQUEST_SET_INTERFACE
206 \brief Set a specific interface.
211 \def USB_REQUEST_SYNCH_FRAME
212 \brief Synchronize a frame.
220 \name Descriptor Constants
222 These constants refer to a specific descriptor. They can be used when
223 building a standard USB request for a descriptor, or in the
224 usb_module_info::get_descriptor() method.
232 \def USB_DESCRIPTOR_DEVICE
233 \brief Constant for the device descriptor.
238 \def USB_DESCRIPTOR_CONFIGURATION
239 \brief Constant for a configuration descriptor.
244 \def USB_DESCRIPTOR_STRING
245 \brief Constant for a string descriptor.
250 \def USB_DESCRIPTOR_INTERFACE
251 \brief Constant for an interface descriptor.
256 \def USB_DESCRIPTOR_ENDPOINT
257 \brief Constant for an endpoint descriptor.
265 \name Feature Requests
267 These constants refer to standard feature requests. You can use these
268 using the convenient usb_module_info::set_feature() and
269 usb_module_info::clear_feature() methods.
277 \def USB_FEATURE_DEVICE_REMOTE_WAKEUP
278 \brief Request a device to wakeup from remote calls.
283 \def USB_FEATURE_ENDPOINT_HALT
284 \brief Request for a specific endpoint to halt.
292 \name Endpoint Attributes
294 These constants refer to values in the usb_endpoint_descriptor::attributes
303 \def USB_ENDPOINT_ATTR_CONTROL
304 \brief Endpoint facilitates control transfers.
309 \def USB_ENDPOINT_ATTR_ISOCHRONOUS
310 \brief Endpoint facilitates isochronous transfers.
315 \def USB_ENDPOINT_ATTR_BULK
316 \brief Endpoint facilitates bulk transfers.
321 \def USB_ENDPOINT_ATTR_INTERRUPT
322 \brief Endpoint facilitates interrupt transfers.
327 \def USB_ENDPOINT_ATTR_MASK
328 \brief Constant to mask out transfer types.
336 \name Endpoint Address
338 These constants refer to the direction that is embedded in the
339 usb_endpoint_descriptor::address field.
347 \def USB_ENDPOINT_ADDR_DIR_IN
348 \brief The endpoint provides data for the driver.
353 \def USB_ENDPOINT_ADDR_DIR_OUT
354 \brief The endpoint accepts data from the host.