19 #if defined(__cplusplus) 32 #define USB_CLASS_DFU 0xFE 33 #define USB_DFU_SUBCLASS_DFU 0x01 34 #define USB_DFU_PROTO_RUNTIME 0x01 35 #define USB_DFU_PROTO_DFU 0x02 39 #define USB_DTYPE_DFU_FUNCTIONAL 0x21 43 #define USB_DFU_DETACH 0x00 45 #define USB_DFU_DNLOAD 0x01 46 #define USB_DFU_UPLOAD 0x02 48 #define USB_DFU_GETSTATUS 0x03 50 #define USB_DFU_CLRSTATUS 0x04 52 #define USB_DFU_GETSTATE 0x05 54 #define USB_DFU_ABORT 0x06 61 #define USB_DFU_ATTR_WILL_DETACH 0x08 63 #define USB_DFU_ATTR_MANIF_TOL 0x04 65 #define USB_DFU_ATTR_CAN_UPLOAD 0x02 66 #define USB_DFU_ATTR_CAN_DNLOAD 0x01 71 #define USB_DFU_STATUS_OK 0x00 72 #define USB_DFU_STATUS_ERR_TARGET 0x01 73 #define USB_DFU_STATUS_ERR_FILE 0x02 75 #define USB_DFU_STATUS_ERR_WRITE 0x03 76 #define USB_DFU_STATUS_ERR_ERASE 0x04 77 #define USB_DFU_STATUS_ERR_CHECK_ERASED 0x05 78 #define USB_DFU_STATUS_ERR_PROG 0x06 79 #define USB_DFU_STATUS_ERR_VERIFY 0x07 80 #define USB_DFU_STATUS_ERR_ADDRESS 0x08 82 #define USB_DFU_STATUS_ERR_NOTDONE 0x09 84 #define USB_DFU_STATUS_ERR_FIRMWARE 0x0A 86 #define USB_DFU_STATUS_ERR_VENDOR 0x0B 87 #define USB_DFU_STATUS_ERR_USBR 0x0C 88 #define USB_DFU_STATUS_ERR_POR 0x0D 89 #define USB_DFU_STATUS_ERR_UNKNOWN 0x0E 91 #define USB_DFU_STATUS_ERR_STALLEDPKT 0x0F 96 #define USB_DFU_STATE_APP_IDLE 0x00 97 #define USB_DFU_STATE_APP_DETACH 0x01 100 #define USB_DFU_STATE_DFU_IDLE 0x02 102 #define USB_DFU_STATE_DFU_DNLOADSYNC 0x03 104 #define USB_DFU_STATE_DFU_DNBUSY 0x04 106 #define USB_DFU_STATE_DFU_DNLOADIDLE 0x05 108 #define USB_DFU_STATE_DFU_MANIFESTSYNC 0x06 116 #define USB_DFU_STATE_DFU_MANIFEST 0x07 119 #define USB_DFU_STATE_DFU_MANIFESTWR 0x08 123 #define USB_DFU_STATE_DFU_UPLOADIDLE 0x09 124 #define USB_DFU_STATE_DFU_ERROR 0x0A 128 struct usb_dfu_func_desc { 130 uint8_t bDescriptorType;
131 uint8_t bmAttributes;
132 uint16_t wDetachTimeout;
133 uint16_t wTransferSize;
134 uint16_t bcdDFUVersion;
135 }__attribute__((packed));
152 #if defined(__cplusplus) uint8_t bStatus
An indication of the status resulting from the execution of the most recent request.
uint8_t iString
Index of the status string descriptor.
uint16_t wPollTimeout
Minimum time (MSB) in ms, that the host should wait before sending a subsequent DFU_GETSTATUS request...
uint8_t bState
An indication of the state that the device is going to enter immediately following transmission of th...
uint8_t bPollTimeout
Minimum time (LSB) in ms, that the host should wait before sending a subsequent DFU_GETSTATUS request...
Payload packet to response in DFU_GETSTATUS request.