diff options
| author | chemicstry <[email protected]> | 2023-01-11 17:47:12 +0100 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2023-01-11 17:47:12 +0100 |
| commit | ce842fe28c27e6f57a05efc92bc417f6f7d7af64 (patch) | |
| tree | b825147f49704853d07cb0dd16b1da09980c1a2e /embassy-usb-driver/src/lib.rs | |
| parent | 96b97c4711af0851f7d3a6785be13b0202b6e902 (diff) | |
Refactor embassy-usb address handling to allow reordering of status resoponse
Diffstat (limited to 'embassy-usb-driver/src/lib.rs')
| -rw-r--r-- | embassy-usb-driver/src/lib.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/embassy-usb-driver/src/lib.rs b/embassy-usb-driver/src/lib.rs index d7238dc7d..64d647351 100644 --- a/embassy-usb-driver/src/lib.rs +++ b/embassy-usb-driver/src/lib.rs | |||
| @@ -164,9 +164,6 @@ pub trait Bus { | |||
| 164 | 164 | ||
| 165 | async fn poll(&mut self) -> Event; | 165 | async fn poll(&mut self) -> Event; |
| 166 | 166 | ||
| 167 | /// Sets the device USB address to `addr`. | ||
| 168 | fn set_address(&mut self, addr: u8); | ||
| 169 | |||
| 170 | /// Enables or disables an endpoint. | 167 | /// Enables or disables an endpoint. |
| 171 | fn endpoint_set_enabled(&mut self, ep_addr: EndpointAddress, enabled: bool); | 168 | fn endpoint_set_enabled(&mut self, ep_addr: EndpointAddress, enabled: bool); |
| 172 | 169 | ||
| @@ -306,6 +303,12 @@ pub trait ControlPipe { | |||
| 306 | /// | 303 | /// |
| 307 | /// Sets a STALL condition on the pipe to indicate an error. | 304 | /// Sets a STALL condition on the pipe to indicate an error. |
| 308 | async fn reject(&mut self); | 305 | async fn reject(&mut self); |
| 306 | |||
| 307 | /// Accept SET_ADDRESS control and change bus address. | ||
| 308 | /// | ||
| 309 | /// For most drivers this function should firstly call `accept()` and then change the bus address. | ||
| 310 | /// However, there are peripherals (Synopsys USB OTG) that have reverse order. | ||
| 311 | async fn accept_set_address(&mut self, addr: u8); | ||
| 309 | } | 312 | } |
| 310 | 313 | ||
| 311 | pub trait EndpointIn: Endpoint { | 314 | pub trait EndpointIn: Endpoint { |
