embassy-usb-host

Crates

git

Versions

default

Flavors

Skip to main content

ControlPipeExt

Trait ControlPipeExt 

Source
pub trait ControlPipeExt<D: Direction>: UsbPipe<Control, D> {
    // Provided methods
    async fn request_descriptor<T: USBDescriptor, const SIZE: usize>(
        &mut self,
        index: u8,
        class: bool,
    ) -> Result<T, HostError>
       where D: IsIn { ... }
    async fn request_descriptor_bytes(
        &mut self,
        desc_type: u8,
        index: u8,
        buf: &mut [u8],
    ) -> Result<usize, HostError>
       where D: IsIn { ... }
    async fn interface_request_descriptor_bytes<T: USBDescriptor>(
        &mut self,
        interface_num: u8,
        buf: &mut [u8],
    ) -> Result<usize, HostError>
       where D: IsIn { ... }
    async fn active_configuration_value(
        &mut self,
    ) -> Result<Option<NonZeroU8>, HostError>
       where D: IsIn { ... }
    async fn set_configuration(
        &mut self,
        config_no: u8,
    ) -> Result<(), HostError>
       where D: IsOut { ... }
    async fn device_set_address(
        &mut self,
        new_addr: u8,
    ) -> Result<(), HostError>
       where D: IsOut { ... }
    async fn class_request_out(
        &mut self,
        request: u8,
        value: u16,
        index: u16,
        buf: &[u8],
    ) -> Result<(), HostError>
       where D: IsOut { ... }
}
Expand description

Extension trait providing higher-level control request methods on a USB control pipe.

Provided Methods§

Source

async fn request_descriptor<T: USBDescriptor, const SIZE: usize>( &mut self, index: u8, class: bool, ) -> Result<T, HostError>
where D: IsIn,

Request and parse a fixed-size descriptor.

Source

async fn request_descriptor_bytes( &mut self, desc_type: u8, index: u8, buf: &mut [u8], ) -> Result<usize, HostError>
where D: IsIn,

Request the raw bytes of a descriptor by type and index.

Source

async fn interface_request_descriptor_bytes<T: USBDescriptor>( &mut self, interface_num: u8, buf: &mut [u8], ) -> Result<usize, HostError>
where D: IsIn,

Request the raw bytes of a class-specific interface descriptor.

Source

async fn active_configuration_value( &mut self, ) -> Result<Option<NonZeroU8>, HostError>
where D: IsIn,

GET_CONFIGURATION — returns the active configuration value, or None if unconfigured.

Source

async fn set_configuration(&mut self, config_no: u8) -> Result<(), HostError>
where D: IsOut,

SET_CONFIGURATION.

Source

async fn device_set_address(&mut self, new_addr: u8) -> Result<(), HostError>
where D: IsOut,

SET_ADDRESS — assign the device a new address.

§Warning

Breaks host channel state; use only during enumeration.

Source

async fn class_request_out( &mut self, request: u8, value: u16, index: u16, buf: &[u8], ) -> Result<(), HostError>
where D: IsOut,

Class + Interface OUT request (no data stage).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<D: Direction, C> ControlPipeExt<D> for C
where C: UsbPipe<Control, D>,