diff options
| author | alexmoon <[email protected]> | 2022-04-06 22:10:18 -0400 |
|---|---|---|
| committer | alexmoon <[email protected]> | 2022-04-07 10:51:26 -0400 |
| commit | 6abbfa9a92ec9feb03e30846bccb66272020601d (patch) | |
| tree | 78ab2f5f6ccbb45e108520395252f0e6b45665a2 /embassy-usb/src/driver.rs | |
| parent | a1754ac8a820d9cae97cf214969faf3090b37c76 (diff) | |
Async-ify Driver::enable and UsbDeviceBuilder::build
Diffstat (limited to 'embassy-usb/src/driver.rs')
| -rw-r--r-- | embassy-usb/src/driver.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/embassy-usb/src/driver.rs b/embassy-usb/src/driver.rs index d3231cb45..01eb3d577 100644 --- a/embassy-usb/src/driver.rs +++ b/embassy-usb/src/driver.rs | |||
| @@ -11,6 +11,7 @@ pub trait Driver<'a> { | |||
| 11 | type EndpointIn: EndpointIn + 'a; | 11 | type EndpointIn: EndpointIn + 'a; |
| 12 | type ControlPipe: ControlPipe + 'a; | 12 | type ControlPipe: ControlPipe + 'a; |
| 13 | type Bus: Bus + 'a; | 13 | type Bus: Bus + 'a; |
| 14 | type EnableFuture: Future<Output = Self::Bus> + 'a; | ||
| 14 | 15 | ||
| 15 | /// Allocates an endpoint and specified endpoint parameters. This method is called by the device | 16 | /// Allocates an endpoint and specified endpoint parameters. This method is called by the device |
| 16 | /// and class implementations to allocate endpoints, and can only be called before | 17 | /// and class implementations to allocate endpoints, and can only be called before |
| @@ -46,7 +47,7 @@ pub trait Driver<'a> { | |||
| 46 | 47 | ||
| 47 | /// Enables and initializes the USB peripheral. Soon after enabling the device will be reset, so | 48 | /// Enables and initializes the USB peripheral. Soon after enabling the device will be reset, so |
| 48 | /// there is no need to perform a USB reset in this method. | 49 | /// there is no need to perform a USB reset in this method. |
| 49 | fn enable(self) -> Self::Bus; | 50 | fn enable(self) -> Self::EnableFuture; |
| 50 | 51 | ||
| 51 | /// Indicates that `set_device_address` must be called before accepting the corresponding | 52 | /// Indicates that `set_device_address` must be called before accepting the corresponding |
| 52 | /// control transfer, not after. | 53 | /// control transfer, not after. |
