diff --git a/advanced/README.md b/advanced/README.md index 1a8bdf2..31d0c28 100644 --- a/advanced/README.md +++ b/advanced/README.md @@ -270,11 +270,13 @@ The definition of `Descriptor::Configuration` as well as the associated test has Now, proceed as follows: 1. **Parse GET_DESCRIPTOR requests:** -Modify `Request::parse()` in `advanced/common/usb` to recognize a GET_DESCRIPTOR request so that the `get_descriptor_device` test passes. Note that the parser already handles SET_ADDRESS requests. +Modify `Request::parse()` in `advanced/common/usb/src/lib.rs` to recognize a GET_DESCRIPTOR request so that the `get_descriptor_device` test passes. Note that the parser already handles SET_ADDRESS requests. - check table 9-4 in the USB specification for Request Codes - remember that you can define binary literals by prefixing them with `0b` - you can use bit shifts (`>>`) and casts (`as u8`) to get the high/low bytes of a `u16` +See `advanced/common/usb/src/get-descriptor-device.rs` for a solution. + 2. **Read incoming request information and pass it to the parser:** modify `usb-2.rs` to read `USBD` registers and parse the SETUP data when an EPSETUP event is received. - for a mapping of register names to the `USBD` API, check the entry for `nrf52840_hal::target::usbd` in the documentation you've created using `cargo doc`