diff options
| author | Ulf Lilleengen <[email protected]> | 2022-08-22 10:36:33 +0200 |
|---|---|---|
| committer | Ulf Lilleengen <[email protected]> | 2022-08-22 16:37:35 +0200 |
| commit | 3e155d2ec366379584bf7ba4a447109555aa0d77 (patch) | |
| tree | e1a6a8340354ea67316697bf737bd08ec0ab7d00 /embassy-usb/src | |
| parent | 5fddff849eea74fb240147432a1739ae1759cb6c (diff) | |
nRF documentation warning fixes
Diffstat (limited to 'embassy-usb/src')
| -rw-r--r-- | embassy-usb/src/builder.rs | 2 | ||||
| -rw-r--r-- | embassy-usb/src/control.rs | 3 | ||||
| -rw-r--r-- | embassy-usb/src/driver.rs | 6 |
3 files changed, 7 insertions, 4 deletions
diff --git a/embassy-usb/src/builder.rs b/embassy-usb/src/builder.rs index 1ca24cc08..6be88bc76 100644 --- a/embassy-usb/src/builder.rs +++ b/embassy-usb/src/builder.rs | |||
| @@ -10,6 +10,7 @@ use crate::{Interface, STRING_INDEX_CUSTOM_START}; | |||
| 10 | #[derive(Debug, Copy, Clone)] | 10 | #[derive(Debug, Copy, Clone)] |
| 11 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 11 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 12 | #[non_exhaustive] | 12 | #[non_exhaustive] |
| 13 | /// Configuration used when creating [UsbDevice]. | ||
| 13 | pub struct Config<'a> { | 14 | pub struct Config<'a> { |
| 14 | pub(crate) vendor_id: u16, | 15 | pub(crate) vendor_id: u16, |
| 15 | pub(crate) product_id: u16, | 16 | pub(crate) product_id: u16, |
| @@ -96,6 +97,7 @@ pub struct Config<'a> { | |||
| 96 | } | 97 | } |
| 97 | 98 | ||
| 98 | impl<'a> Config<'a> { | 99 | impl<'a> Config<'a> { |
| 100 | /// Create default configuration with the provided vid and pid values. | ||
| 99 | pub fn new(vid: u16, pid: u16) -> Self { | 101 | pub fn new(vid: u16, pid: u16) -> Self { |
| 100 | Self { | 102 | Self { |
| 101 | device_class: 0x00, | 103 | device_class: 0x00, |
diff --git a/embassy-usb/src/control.rs b/embassy-usb/src/control.rs index 12e5303c3..3e5749a01 100644 --- a/embassy-usb/src/control.rs +++ b/embassy-usb/src/control.rs | |||
| @@ -1,3 +1,4 @@ | |||
| 1 | //! USB control data types. | ||
| 1 | use core::mem; | 2 | use core::mem; |
| 2 | 3 | ||
| 3 | use super::types::*; | 4 | use super::types::*; |
| @@ -8,7 +9,7 @@ use super::types::*; | |||
| 8 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 9 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 9 | pub enum RequestType { | 10 | pub enum RequestType { |
| 10 | /// Request is a USB standard request. Usually handled by | 11 | /// Request is a USB standard request. Usually handled by |
| 11 | /// [`UsbDevice`](crate::device::UsbDevice). | 12 | /// [`UsbDevice`](crate::UsbDevice). |
| 12 | Standard = 0, | 13 | Standard = 0, |
| 13 | /// Request is intended for a USB class. | 14 | /// Request is intended for a USB class. |
| 14 | Class = 1, | 15 | Class = 1, |
diff --git a/embassy-usb/src/driver.rs b/embassy-usb/src/driver.rs index 2a84ff9e7..7888f1639 100644 --- a/embassy-usb/src/driver.rs +++ b/embassy-usb/src/driver.rs | |||
| @@ -12,7 +12,7 @@ pub trait Driver<'a> { | |||
| 12 | 12 | ||
| 13 | /// Allocates an endpoint and specified endpoint parameters. This method is called by the device | 13 | /// Allocates an endpoint and specified endpoint parameters. This method is called by the device |
| 14 | /// and class implementations to allocate endpoints, and can only be called before | 14 | /// and class implementations to allocate endpoints, and can only be called before |
| 15 | /// [`start`](UsbBus::start) is called. | 15 | /// [`start`](Self::start) is called. |
| 16 | /// | 16 | /// |
| 17 | /// # Arguments | 17 | /// # Arguments |
| 18 | /// | 18 | /// |
| @@ -95,7 +95,7 @@ pub trait Bus { | |||
| 95 | /// | 95 | /// |
| 96 | /// # Errors | 96 | /// # Errors |
| 97 | /// | 97 | /// |
| 98 | /// * [`Unsupported`](crate::UsbError::Unsupported) - This UsbBus implementation doesn't support | 98 | /// * [`Unsupported`](crate::driver::Unsupported) - This UsbBus implementation doesn't support |
| 99 | /// simulating a disconnect or it has not been enabled at creation time. | 99 | /// simulating a disconnect or it has not been enabled at creation time. |
| 100 | fn force_reset(&mut self) -> Result<(), Unsupported> { | 100 | fn force_reset(&mut self) -> Result<(), Unsupported> { |
| 101 | Err(Unsupported) | 101 | Err(Unsupported) |
| @@ -105,7 +105,7 @@ pub trait Bus { | |||
| 105 | /// | 105 | /// |
| 106 | /// # Errors | 106 | /// # Errors |
| 107 | /// | 107 | /// |
| 108 | /// * [`Unsupported`](crate::UsbError::Unsupported) - This UsbBus implementation doesn't support | 108 | /// * [`Unsupported`](crate::driver::Unsupported) - This UsbBus implementation doesn't support |
| 109 | /// remote wakeup or it has not been enabled at creation time. | 109 | /// remote wakeup or it has not been enabled at creation time. |
| 110 | fn remote_wakeup(&mut self) -> Self::RemoteWakeupFuture<'_>; | 110 | fn remote_wakeup(&mut self) -> Self::RemoteWakeupFuture<'_>; |
| 111 | } | 111 | } |
