Function embassy_usb_dfu::usb_dfu
source · pub fn usb_dfu<'d, D: Driver<'d>, DFU: NorFlash, STATE: NorFlash, RST: Reset, const BLOCK_SIZE: usize>(
builder: &mut Builder<'d, D>,
handler: &'d mut Control<'d, DFU, STATE, RST, BLOCK_SIZE>
)
Expand description
An implementation of the USB DFU 1.1 protocol
This function will add a DFU interface descriptor to the provided Builder, and register the provided Control as a handler for the USB device The handler is responsive to DFU GetState, GetStatus, Abort, and ClrStatus commands, as well as Download if configured by the user.
Once the host has initiated a DFU download operation, the chunks sent by the host will be written to the DFU partition. Once the final sync in the manifestation phase has been received, the handler will trigger a system reset to swap the new firmware.