Struct DfuLibusb

Source
pub struct DfuLibusb<C: UsbContext> { /* private fields */ }

Implementations§

Source§

impl<C: UsbContext> DfuLibusb<C>

Source

pub fn open( context: &C, vid: u16, pid: u16, iface: u8, alt: u8, ) -> Result<Dfu<C>, Error>

Source

pub fn from_usb_device( device: Device<C>, handle: DeviceHandle<C>, iface: u8, alt: u8, ) -> Result<Dfu<C>, Error>

Trait Implementations§

Source§

impl<C: UsbContext> DfuIo for DfuLibusb<C>

Source§

type Read = usize

Return type after calling Self::read_control.
Source§

type Write = usize

Return type after calling Self::write_control.
Source§

type Reset = ()

Return type after calling Self::usb_reset.
Source§

type Error = Error

Error type.
Source§

type MemoryLayout = MemoryLayout

Dfuse Memory layout type
Source§

fn read_control( &self, request_type: u8, request: u8, value: u16, buffer: &mut [u8], ) -> Result<Self::Read, Self::Error>

Read data using control transfer.
Source§

fn write_control( &self, request_type: u8, request: u8, value: u16, buffer: &[u8], ) -> Result<Self::Write, Self::Error>

Write data using control transfer.
Source§

fn usb_reset(&self) -> Result<Self::Reset, Self::Error>

Triggers a USB reset.
Source§

fn protocol(&self) -> &DfuProtocol<Self::MemoryLayout>

Returns the protocol of the device
Source§

fn functional_descriptor(&self) -> &FunctionalDescriptor

Returns the functional descriptor of the device.

Auto Trait Implementations§

§

impl<C> !Freeze for DfuLibusb<C>

§

impl<C> !RefUnwindSafe for DfuLibusb<C>

§

impl<C> Send for DfuLibusb<C>

§

impl<C> !Sync for DfuLibusb<C>

§

impl<C> Unpin for DfuLibusb<C>
where C: Unpin,

§

impl<C> UnwindSafe for DfuLibusb<C>
where C: UnwindSafe,

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.