Embassy
embassy-usb-dfu

Crates

git

Versions

dfu

Flavors

Struct embassy_usb_dfu::Control

source ·
pub struct Control<'d, DFU: NorFlash, STATE: NorFlash, RST: Reset, const BLOCK_SIZE: usize> { /* private fields */ }
Expand description

Internal state for USB DFU

Implementations§

source§

impl<'d, DFU: NorFlash, STATE: NorFlash, RST: Reset, const BLOCK_SIZE: usize> Control<'d, DFU, STATE, RST, BLOCK_SIZE>

source

pub fn new( updater: BlockingFirmwareUpdater<'d, DFU, STATE>, attrs: DfuAttributes ) -> Self

Create a new DFU instance to handle DFU transfers.

Trait Implementations§

source§

impl<'d, DFU: NorFlash, STATE: NorFlash, RST: Reset, const BLOCK_SIZE: usize> Handler for Control<'d, DFU, STATE, RST, BLOCK_SIZE>

source§

fn control_out(&mut self, req: Request, data: &[u8]) -> Option<OutResponse>

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

fn control_in<'a>( &'a mut self, req: Request, buf: &'a mut [u8] ) -> Option<InResponse<'a>>

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

fn enabled(&mut self, _enabled: bool)

Called when the USB device has been enabled or disabled.
source§

fn reset(&mut self)

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

fn addressed(&mut self, _addr: u8)

Called when the host has set the address of the device to addr.
source§

fn configured(&mut self, _configured: bool)

Called when the host has enabled or disabled the configuration of the device.
source§

fn suspended(&mut self, _suspended: bool)

Called when the bus has entered or exited the suspend state.
source§

fn remote_wakeup_enabled(&mut self, _enabled: bool)

Called when remote wakeup feature is enabled or disabled.
source§

fn set_alternate_setting( &mut self, iface: InterfaceNumber, alternate_setting: u8 )

Called when a “set alternate setting” control request is done on the interface.
source§

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

Called when a GET_DESCRIPTOR STRING control request is received.

Auto Trait Implementations§

§

impl<'d, DFU, STATE, RST, const BLOCK_SIZE: usize> Freeze for Control<'d, DFU, STATE, RST, BLOCK_SIZE>
where DFU: Freeze, STATE: Freeze,

§

impl<'d, DFU, STATE, RST, const BLOCK_SIZE: usize> RefUnwindSafe for Control<'d, DFU, STATE, RST, BLOCK_SIZE>
where DFU: RefUnwindSafe, RST: RefUnwindSafe, STATE: RefUnwindSafe,

§

impl<'d, DFU, STATE, RST, const BLOCK_SIZE: usize> Send for Control<'d, DFU, STATE, RST, BLOCK_SIZE>
where DFU: Send, RST: Send, STATE: Send,

§

impl<'d, DFU, STATE, RST, const BLOCK_SIZE: usize> Sync for Control<'d, DFU, STATE, RST, BLOCK_SIZE>
where DFU: Sync, RST: Sync, STATE: Sync,

§

impl<'d, DFU, STATE, RST, const BLOCK_SIZE: usize> Unpin for Control<'d, DFU, STATE, RST, BLOCK_SIZE>
where DFU: Unpin, RST: Unpin, STATE: Unpin,

§

impl<'d, DFU, STATE, RST, const BLOCK_SIZE: usize> !UnwindSafe for Control<'d, DFU, STATE, RST, BLOCK_SIZE>

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> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.