diff options
| author | Dario Nieuwenhuis <[email protected]> | 2023-02-07 22:49:14 +0100 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2023-02-08 00:17:08 +0100 |
| commit | 3af991ab63d14cfad6f50d28bfb944d1895d1c70 (patch) | |
| tree | 575fecf6f47fbfd7116070aff2ffd5f4e84c7cf1 /embassy-usb/src/types.rs | |
| parent | 1d841cc8ac74feacc4d231958ce2c46419ae3bda (diff) | |
usb: unify ControlHandler+DeviceStateHandler, route all control requests to all handlers.
- Allows classes to handle vendor requests.
- Allows classes to use a single handler for multiple interfaces.
- Allows classes to access the other events (previously only `reset` was available).
Diffstat (limited to 'embassy-usb/src/types.rs')
| -rw-r--r-- | embassy-usb/src/types.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/embassy-usb/src/types.rs b/embassy-usb/src/types.rs index 1743e61ff..15d195002 100644 --- a/embassy-usb/src/types.rs +++ b/embassy-usb/src/types.rs | |||
| @@ -1,9 +1,9 @@ | |||
| 1 | //! USB types. | 1 | //! USB types. |
| 2 | 2 | ||
| 3 | /// A handle for a USB interface that contains its number. | 3 | /// A handle for a USB interface that contains its number. |
| 4 | #[derive(Copy, Clone, Eq, PartialEq)] | 4 | #[derive(Debug, Copy, Clone, Eq, PartialEq)] |
| 5 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 5 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 6 | pub struct InterfaceNumber(pub(crate) u8); | 6 | pub struct InterfaceNumber(pub u8); |
| 7 | 7 | ||
| 8 | impl InterfaceNumber { | 8 | impl InterfaceNumber { |
| 9 | pub(crate) fn new(index: u8) -> InterfaceNumber { | 9 | pub(crate) fn new(index: u8) -> InterfaceNumber { |
| @@ -20,7 +20,7 @@ impl From<InterfaceNumber> for u8 { | |||
| 20 | /// A handle for a USB string descriptor that contains its index. | 20 | /// A handle for a USB string descriptor that contains its index. |
| 21 | #[derive(Copy, Clone, Eq, PartialEq)] | 21 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 22 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 22 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 23 | pub struct StringIndex(u8); | 23 | pub struct StringIndex(pub u8); |
| 24 | 24 | ||
| 25 | impl StringIndex { | 25 | impl StringIndex { |
| 26 | pub(crate) fn new(index: u8) -> StringIndex { | 26 | pub(crate) fn new(index: u8) -> StringIndex { |
