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).
This commit is contained in:
@ -1,9 +1,9 @@
|
||||
//! USB types.
|
||||
|
||||
/// A handle for a USB interface that contains its number.
|
||||
#[derive(Copy, Clone, Eq, PartialEq)]
|
||||
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
|
||||
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
||||
pub struct InterfaceNumber(pub(crate) u8);
|
||||
pub struct InterfaceNumber(pub u8);
|
||||
|
||||
impl InterfaceNumber {
|
||||
pub(crate) fn new(index: u8) -> InterfaceNumber {
|
||||
@ -20,7 +20,7 @@ impl From<InterfaceNumber> for u8 {
|
||||
/// A handle for a USB string descriptor that contains its index.
|
||||
#[derive(Copy, Clone, Eq, PartialEq)]
|
||||
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
||||
pub struct StringIndex(u8);
|
||||
pub struct StringIndex(pub u8);
|
||||
|
||||
impl StringIndex {
|
||||
pub(crate) fn new(index: u8) -> StringIndex {
|
||||
|
Reference in New Issue
Block a user