Struct usbd_dfu_rt::DfuRuntimeClass[][src]

pub struct DfuRuntimeClass<T: DfuRuntimeOps> { /* fields omitted */ }
Expand description

Implementation of DFU runtime class.

Implements DFU_DETACH request and will call the DfuRuntimeOps::enter callback when the request is received.

Implementations

impl<T: DfuRuntimeOps> DfuRuntimeClass<T>[src]

pub fn new<B: UsbBus>(alloc: &UsbBusAllocator<B>, dfu_ops: T) -> Self[src]

Crate new DFU run-time class with the given device-specific implementations.

Trait Implementations

impl<T: DfuRuntimeOps, B: UsbBus> UsbClass<B> for DfuRuntimeClass<T>[src]

fn get_configuration_descriptors(
    &self,
    writer: &mut DescriptorWriter<'_>
) -> Result<()>
[src]

Called when a GET_DESCRIPTOR request is received for a configuration descriptor. When called, the implementation should write its interface, endpoint and any extra class descriptors into writer. The configuration descriptor itself will be written by UsbDevice and shouldn’t be written by classes. Read more

fn poll(&mut self)[src]

Called whenever the UsbDevice is polled.

fn control_out(&mut self, xfer: ControlOut<'_, '_, '_, B>)[src]

Called when a control request is received with direction HostToDevice. Read more

fn get_bos_descriptors(
    &self,
    writer: &mut BosWriter<'_, '_>
) -> Result<(), UsbError>
[src]

Called when a GET_DESCRIPTOR request is received for a BOS descriptor. When called, the implementation should write its blobs such as capability descriptors into writer. The BOS descriptor itself will be written by UsbDevice and shouldn’t be written by classes. Read more

fn get_string(&self, index: StringIndex, lang_id: u16) -> Option<&str>[src]

Gets a class-specific string descriptor. Read more

fn reset(&mut self)[src]

Called after a USB reset after the bus reset sequence is complete.

fn control_in(&mut self, xfer: ControlIn<'_, '_, '_, B>)[src]

Called when a control request is received with direction DeviceToHost. Read more

fn endpoint_setup(&mut self, addr: EndpointAddress)[src]

Called when endpoint with address addr has received a SETUP packet. Implementing this shouldn’t be necessary in most cases, but is provided for completeness’ sake. Read more

fn endpoint_out(&mut self, addr: EndpointAddress)[src]

Called when endpoint with address addr has received data (OUT packet). Read more

fn endpoint_in_complete(&mut self, addr: EndpointAddress)[src]

Called when endpoint with address addr has completed transmitting data (IN packet). Read more

Auto Trait Implementations

impl<T> Send for DfuRuntimeClass<T> where
    T: Send

impl<T> Sync for DfuRuntimeClass<T> where
    T: Sync

impl<T> Unpin for DfuRuntimeClass<T> where
    T: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.