Skip to main content

Udc

Struct Udc 

Source
pub struct Udc { /* private fields */ }
Expand description

USB device controller (UDC).

Call udcs to obtain the controllers available on the system.

Implementations§

Source§

impl Udc

Source

pub fn name(&self) -> &OsStr

The name of the USB device controller.

Source

pub fn a_alt_hnp_support(&self) -> Result<bool>

Indicates if an OTG A-Host supports HNP at an alternate port.

Source

pub fn a_hnp_support(&self) -> Result<bool>

Indicates if an OTG A-Host supports HNP at this port.

Source

pub fn b_hnp_enable(&self) -> Result<bool>

Indicates if an OTG A-Host enabled HNP support.

Source

pub fn current_speed(&self) -> Result<Speed>

Indicates the current negotiated speed at this port.

None if unknown.

Source

pub fn max_speed(&self) -> Result<Speed>

Indicates the maximum USB speed supported by this port.

Source

pub fn is_a_peripheral(&self) -> Result<bool>

Indicates that this port is the default Host on an OTG session but HNP was used to switch roles.

Source

pub fn is_otg(&self) -> Result<bool>

Indicates that this port support OTG.

Source

pub fn state(&self) -> Result<UdcState>

Indicates current state of the USB Device Controller.

However not all USB Device Controllers support reporting all states.

Source

pub fn start_srp(&self) -> Result<()>

Manually start Session Request Protocol (SRP).

Source

pub fn set_soft_connect(&self, connect: bool) -> Result<()>

Connect or disconnect data pull-up resistors thus causing a logical connection to or disconnection from the USB host.

Source

pub fn driver(&self) -> Result<OsString>

The kernel driver managing this USB device controller, e.g. dwc2, dwc3, dummy_udc, musb-hdrc, cdns3.

Source

pub fn function(&self) -> Result<Option<OsString>>

Name of currently running USB Gadget Driver.

Trait Implementations§

Source§

impl Clone for Udc

Source§

fn clone(&self) -> Udc

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 Debug for Udc

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Udc

§

impl RefUnwindSafe for Udc

§

impl Send for Udc

§

impl Sync for Udc

§

impl Unpin for Udc

§

impl UnsafeUnpin for Udc

§

impl UnwindSafe for Udc

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

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.