mirror of
https://github.com/ferrous-systems/embedded-trainings-2020.git
synced 2025-02-03 19:42:18 +00:00
Merge pull request #29 from ferrous-systems/skade-patch-4
usb-2: make clearer which file is to be edited
This commit is contained in:
commit
b7a922746b
1 changed files with 3 additions and 1 deletions
|
@ -270,11 +270,13 @@ The definition of `Descriptor::Configuration` as well as the associated test has
|
||||||
Now, proceed as follows:
|
Now, proceed as follows:
|
||||||
|
|
||||||
1. **Parse GET_DESCRIPTOR requests:**
|
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
|
- check table 9-4 in the USB specification for Request Codes
|
||||||
- remember that you can define binary literals by prefixing them with `0b`
|
- 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`
|
- 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:**
|
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.
|
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`
|
- 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`
|
||||||
|
|
Loading…
Reference in a new issue