Struct usbd_dfu::DFUClass [−][src]
Expand description
DFU protocol USB class implementation for usb-device library.
Implementations
impl<B: UsbBus, M: DFUMemIO> DFUClass<B, M>
[src]
impl<B: UsbBus, M: DFUMemIO> DFUClass<B, M>
[src]pub fn new<'a>(alloc: &'a UsbBusAllocator<B>, mem: M) -> Self
[src]
pub fn new<'a>(alloc: &'a UsbBusAllocator<B>, mem: M) -> Self
[src]Creates a new DFUClass with the provided UsbBus and DFUMemIO
pub fn set_unexpected_reset_state(&mut self)
[src]
pub fn set_unexpected_reset_state(&mut self)
[src]This function may be called just after DFUClass::new()
to
set DFU error state to “Device detected unexpected power on reset”
instead of the usual dfuIdle
.
pub fn set_firmware_corrupted_state(&mut self)
[src]
pub fn set_firmware_corrupted_state(&mut self)
[src]This function may be called just after DFUClass::new()
to
set DFU error state to “Device’s firmware is corrupt. It cannot return to run-time (non-DFU) operations”
instead of the usual dfuIdle
.
pub fn get_address_pointer(&self) -> u32
[src]
pub fn get_address_pointer(&self) -> u32
[src]Return current Address Pointer value.
Trait Implementations
impl<B: UsbBus, M: DFUMemIO> UsbClass<B> for DFUClass<B, M>
[src]
impl<B: UsbBus, M: DFUMemIO> UsbClass<B> for DFUClass<B, M>
[src]fn get_configuration_descriptors(
&self,
writer: &mut DescriptorWriter<'_>
) -> Result<()>
[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 get_string(&self, index: StringIndex, lang_id: u16) -> Option<&str>
[src]
fn get_string(&self, index: StringIndex, lang_id: u16) -> Option<&str>
[src]Gets a class-specific string descriptor. Read more
fn control_in(&mut self, xfer: ControlIn<'_, '_, '_, B>)
[src]
fn control_in(&mut self, xfer: ControlIn<'_, '_, '_, B>)
[src]Called when a control request is received with direction DeviceToHost. Read more
fn control_out(&mut self, xfer: ControlOut<'_, '_, '_, B>)
[src]
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]
fn get_bos_descriptors(
&self,
writer: &mut BosWriter<'_, '_>
) -> Result<(), UsbError>
[src]fn endpoint_setup(&mut self, addr: EndpointAddress)
[src]
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]
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]
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<B, M> Send for DFUClass<B, M> where
B: Send,
M: Send,
B: Send,
M: Send,
impl<B, M> Sync for DFUClass<B, M> where
M: Sync,
M: Sync,
impl<B, M> Unpin for DFUClass<B, M> where
B: Unpin,
M: Unpin,
B: Unpin,
M: Unpin,