Skip to main content

ConfigurationDescriptor

Struct ConfigurationDescriptor 

Source
pub struct ConfigurationDescriptor {
    pub total_length: u16,
    pub num_interfaces: u8,
    pub value: u8,
    pub index: u8,
    pub attributes: ConfigurationAttributes,
    pub max_power: u8,
}
Expand description

The configuration descriptor describes information about a specific device configuration.

The descriptor contains a bConfigurationValue field with a value that, when used as a parameter to the SetConfiguration() request, causes the device to assume the described configuration.

Fields§

§total_length: u16

Total length of data returned for this configuration.

Includes the combined length of all descriptors (configuration, interface, endpoint, and class- or vendor-specific) returned for this configuration.

§num_interfaces: u8

Number of interfaces supported by this configuration

§value: u8

Value to use as an argument to the SetConfiguration() request to select this configuration

§index: u8

Index of string descriptor describing this configuration

§attributes: ConfigurationAttributes

Configuration characteristics

§max_power: u8

Maximum power consumption of the USB device from the bus in this specific configuration when the device is fully operational.

Expressed in 2 mA units (i.e., 50 = 100 mA).

Trait Implementations§

Source§

impl Format for ConfigurationDescriptor

Source§

fn format(&self, f: Formatter<'_>)

Writes the defmt representation of self to fmt.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.