mirror of
https://github.com/ferrous-systems/embedded-trainings-2020.git
synced 2025-01-09 15:55:37 +00:00
tell folks to keep the USB cable connected
This commit is contained in:
parent
5fe1cd7a0e
commit
1310e1aa6d
4 changed files with 12 additions and 5 deletions
|
@ -4,6 +4,8 @@ The next step is to respond to the GET_DESCRIPTOR request with a device descript
|
|||
|
||||
✅ Open the file `src/bin/usb-3.rs`. Implement the response to the GET_DESCRIPTOR request. Use the following guide for assistance.
|
||||
|
||||
❗️ Keep the cable connected to the J3 port for the rest of the workshop
|
||||
|
||||
To do this we'll use the `dk::usb::Ep0In` abstraction -- we'll look into what the abstraction does in a future section; for now we'll just use it.
|
||||
|
||||
An instance of this abstraction is available in the `board` value (`#[init]` function). The first step is to make this `Ep0In` instance available to the `on_event` function.
|
||||
|
|
|
@ -14,6 +14,8 @@ The definition of `Descriptor::Configuration` as well as the associated test has
|
|||
|
||||
✅ Parse the data of this SETUP stage.
|
||||
|
||||
❗️ Keep the cable connected to the J3 port for the rest of the workshop
|
||||
|
||||
Start with the GET_DESCRIPTOR request, which is described in detail in section 9.4.3 of the USB specification. All the constants you will need are described in Tables 9-3, 9-4 and 9-5.
|
||||
|
||||
The fields of a GET_DESCRIPTOR request are as follows:
|
||||
|
|
|
@ -11,6 +11,8 @@ The starter `common/usb` code contains unit tests for these other requests as we
|
|||
|
||||
✅ For each green test, extend `usb-4.rs` to handle the new requests your parser is now able to recognize. **Make sure to read the next sections as you're working**, since they contain explanations about the concepts used and needed to complete this task.
|
||||
|
||||
❗️ Keep the cable connected to the J3 port for the rest of the workshop
|
||||
|
||||
If you need a reference, you can find solutions to parsing `GET_DESCRIPTOR Configuration` and `SET_CONFIGURATION` requests in the following files:
|
||||
|
||||
- `advanced/common/usb/solution-get-descriptor-configuration.rs`
|
||||
|
|
|
@ -8,6 +8,8 @@ In this starter code the USBD peripheral is initialized in `init` and a task, na
|
|||
|
||||
✅ Connect the USB cable to the port J3 then run the starter code.
|
||||
|
||||
❗️ Keep the cable connected to the J3 port for the rest of the workshop
|
||||
|
||||
Go to `fn on_event`, line 39. In this section you'll need to implement the following USB events until you reach the EP0SETUP event:
|
||||
|
||||
- `USBRESET`. This event indicates that the host issued a USB reset signal. According to the USB specification this will move the device from any state to the `Default` state. Since we are currently not dealing with any other state, you can handle this state by doing nothing.
|
||||
|
@ -27,4 +29,3 @@ INFO:usb_1 -- goal reached; move to the next section
|
|||
Do not overthink this exercise; it is not a trick question. There is very little to do and no new functionality to add.
|
||||
|
||||
You can find the solution in the `usb-1-solution.rs` file.
|
||||
|
||||
|
|
Loading…
Reference in a new issue