diff options
Diffstat (limited to 'embassy-usb/src/driver.rs')
| -rw-r--r-- | embassy-usb/src/driver.rs | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/embassy-usb/src/driver.rs b/embassy-usb/src/driver.rs index e552dc7b6..57f2b0656 100644 --- a/embassy-usb/src/driver.rs +++ b/embassy-usb/src/driver.rs | |||
| @@ -14,7 +14,7 @@ pub trait Driver<'a> { | |||
| 14 | 14 | ||
| 15 | /// Allocates an endpoint and specified endpoint parameters. This method is called by the device | 15 | /// 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 | 16 | /// and class implementations to allocate endpoints, and can only be called before |
| 17 | /// [`enable`](UsbBus::enable) is called. | 17 | /// [`start`](UsbBus::start) is called. |
| 18 | /// | 18 | /// |
| 19 | /// # Arguments | 19 | /// # Arguments |
| 20 | /// | 20 | /// |
| @@ -25,7 +25,6 @@ pub trait Driver<'a> { | |||
| 25 | /// * `interval` - Polling interval parameter for interrupt endpoints. | 25 | /// * `interval` - Polling interval parameter for interrupt endpoints. |
| 26 | fn alloc_endpoint_out( | 26 | fn alloc_endpoint_out( |
| 27 | &mut self, | 27 | &mut self, |
| 28 | ep_addr: Option<EndpointAddress>, | ||
| 29 | ep_type: EndpointType, | 28 | ep_type: EndpointType, |
| 30 | max_packet_size: u16, | 29 | max_packet_size: u16, |
| 31 | interval: u8, | 30 | interval: u8, |
| @@ -33,20 +32,20 @@ pub trait Driver<'a> { | |||
| 33 | 32 | ||
| 34 | fn alloc_endpoint_in( | 33 | fn alloc_endpoint_in( |
| 35 | &mut self, | 34 | &mut self, |
| 36 | ep_addr: Option<EndpointAddress>, | ||
| 37 | ep_type: EndpointType, | 35 | ep_type: EndpointType, |
| 38 | max_packet_size: u16, | 36 | max_packet_size: u16, |
| 39 | interval: u8, | 37 | interval: u8, |
| 40 | ) -> Result<Self::EndpointIn, EndpointAllocError>; | 38 | ) -> Result<Self::EndpointIn, EndpointAllocError>; |
| 41 | 39 | ||
| 42 | fn alloc_control_pipe( | 40 | /// Start operation of the USB device. |
| 43 | &mut self, | 41 | /// |
| 44 | max_packet_size: u16, | 42 | /// This returns the `Bus` and `ControlPipe` instances that are used to operate |
| 45 | ) -> Result<Self::ControlPipe, EndpointAllocError>; | 43 | /// the USB device. Additionally, this makes all the previously allocated endpoints |
| 46 | 44 | /// start operating. | |
| 47 | /// Enables and initializes the USB peripheral. Soon after enabling the device will be reset, so | 45 | /// |
| 48 | /// there is no need to perform a USB reset in this method. | 46 | /// This consumes the `Driver` instance, so it's no longer possible to allocate more |
| 49 | fn into_bus(self) -> Self::Bus; | 47 | /// endpoints. |
| 48 | fn start(self, control_max_packet_size: u16) -> (Self::Bus, Self::ControlPipe); | ||
| 50 | 49 | ||
| 51 | /// Indicates that `set_device_address` must be called before accepting the corresponding | 50 | /// Indicates that `set_device_address` must be called before accepting the corresponding |
| 52 | /// control transfer, not after. | 51 | /// control transfer, not after. |
