pub struct Control<'d, STATE: NorFlash, RST: Reset> { /* private fields */ }
Expand description
Internal state for the DFU class
Implementations§
Source§impl<'d, STATE: NorFlash, RST: Reset> Control<'d, STATE, RST>
impl<'d, STATE: NorFlash, RST: Reset> Control<'d, STATE, RST>
Sourcepub fn new(
firmware_state: BlockingFirmwareState<'d, STATE>,
attrs: DfuAttributes,
) -> Self
pub fn new( firmware_state: BlockingFirmwareState<'d, STATE>, attrs: DfuAttributes, ) -> Self
Create a new DFU instance to expose a DFU interface.
Trait Implementations§
Source§impl<'d, STATE: NorFlash, RST: Reset> Handler for Control<'d, STATE, RST>
impl<'d, STATE: NorFlash, RST: Reset> Handler for Control<'d, STATE, RST>
Source§fn control_out(&mut self, req: Request, _: &[u8]) -> Option<OutResponse>
fn control_out(&mut self, req: Request, _: &[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>>
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)
fn enabled(&mut self, _enabled: bool)
Called when the USB device has been enabled or disabled.
Source§fn addressed(&mut self, _addr: u8)
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)
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)
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)
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,
)
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>
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, STATE, RST> Freeze for Control<'d, STATE, RST>where
STATE: Freeze,
impl<'d, STATE, RST> RefUnwindSafe for Control<'d, STATE, RST>where
STATE: RefUnwindSafe,
RST: RefUnwindSafe,
impl<'d, STATE, RST> Send for Control<'d, STATE, RST>
impl<'d, STATE, RST> Sync for Control<'d, STATE, RST>
impl<'d, STATE, RST> Unpin for Control<'d, STATE, RST>
impl<'d, STATE, RST> !UnwindSafe for Control<'d, STATE, RST>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more