embedded-trainings-2020/embedded-workshop-book/src/get-descriptor-config.md

18 lines
941 B
Markdown
Raw Permalink Normal View History

2020-07-13 11:48:24 +00:00
# Handling GET_DESCRIPTOR Configuration Requests
When the host issues a GET_DESCRIPTOR *Configuration* request the device needs to respond with the requested configuration descriptor *plus* all the interface and endpoint descriptors associated to that configuration descriptor during the DATA stage.
2021-01-29 14:04:51 +00:00
As a reminder, all GET_DESCRIPTOR request types are share the following properties:
2020-07-13 11:48:24 +00:00
2021-01-29 14:04:51 +00:00
- `bmRequestType` is **0b10000000**
- `bRequest` is **6** (i.e. the GET_DESCRIPTOR Request Code, defined in table 9-4 of the [USB specification][usb_spec])
2021-04-23 16:48:23 +00:00
A GET_DESCRIPTOR *Configuration* request is determined the high byte of its `wValue` field:
2021-01-29 14:04:51 +00:00
2021-04-23 16:48:23 +00:00
- The high byte of `wValue` is **2** (i.e. the `CONFIGURATION` descriptor type, defined in table 9-5 of the [USB specification][usb_spec])
2021-01-29 14:04:51 +00:00
[usb_spec]: https://www.usb.org/document-library/usb-20-specification
In the next sections, let's look into all the concepts required to respond to this request.