aboutsummaryrefslogtreecommitdiff
path: root/embassy-usb/src/types.rs
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2023-02-07 22:49:14 +0100
committerDario Nieuwenhuis <[email protected]>2023-02-08 00:17:08 +0100
commit3af991ab63d14cfad6f50d28bfb944d1895d1c70 (patch)
tree575fecf6f47fbfd7116070aff2ffd5f4e84c7cf1 /embassy-usb/src/types.rs
parent1d841cc8ac74feacc4d231958ce2c46419ae3bda (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.rs6
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))]
6pub struct InterfaceNumber(pub(crate) u8); 6pub struct InterfaceNumber(pub u8);
7 7
8impl InterfaceNumber { 8impl 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))]
23pub struct StringIndex(u8); 23pub struct StringIndex(pub u8);
24 24
25impl StringIndex { 25impl StringIndex {
26 pub(crate) fn new(index: u8) -> StringIndex { 26 pub(crate) fn new(index: u8) -> StringIndex {