Skip to main content

Device

Struct Device 

Source
pub struct Device {
    pub port: u8,
    pub hub_address: u8,
    pub depth: u8,
    pub endpoint: ControlEndpoint,
    pub descriptor: DeviceDescriptor,
}
Available on non-crate feature bcm2712 only.
Expand description

A downstream device found and addressed by enumerate, handed to its per-device callback. Everything needed to talk to the device further (read its configuration, configure it, poll its endpoints) is here, plus where on the bus it was found.

Fields§

§port: u8

The hub downstream port (1-based) the device is on.

§hub_address: u8

Address of the hub whose Self::port this is — the root hub for a device plugged straight into the board, or a downstream hub’s own address for one found behind it. With Self::port it names the device’s position on the bus, which survives a reboot in a way the assigned address doesn’t.

§depth: u8

How many hubs below the root hub the device sits: 0 on one of the root hub’s own ports, 1 behind a hub plugged into one of those, and so on — up to four, the deepest USB allows.

§endpoint: ControlEndpoint

The device’s addressed endpoint 0 — address, speed, endpoint-0 max packet size, and split target all filled in.

§descriptor: DeviceDescriptor

The device’s parsed device descriptor.

Trait Implementations§

Source§

impl Clone for Device

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Device

Source§

impl Debug for Device

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Device

Source§

impl PartialEq for Device

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Device

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.