30 #define USB_IF_DESCRIPTOR_DFU 0x21
31 #define USB_DFU_VERSION_BCD 0x0110
37 #ifndef USB_DFU_DETACH_TIMEOUT_MS
38 #define USB_DFU_DETACH_TIMEOUT_MS 255
46 #define USB_DFU_CAN_DOWNLOAD 0x01
47 #define USB_DFU_CAN_UPLOAD 0x02
48 #define USB_DFU_MANIFEST_TOLERANT 0x04
49 #define USB_DFU_WILL_DETACH 0x08
56 #define USB_DFU_INTERFACE 0xFE
64 #define USB_DFU_SUBCLASS_DFU 0x01
71 #define USB_DFU_PROTOCOL_RUNTIME_MODE 0x01
72 #define USB_DFU_PROTOCOL_DFU_MODE 0x02
79 #define DFU_DETACH 0x00
80 #define DFU_DOWNLOAD 0x01
81 #define DFU_UPLOAD 0x02
82 #define DFU_GET_STATUS 0x03
83 #define DFU_CLR_STATUS 0x04
84 #define DFU_GET_STATE 0x05
85 #define DFU_ABORT 0x06
108 typedef struct __attribute__((packed)) {
120 typedef struct __attribute__((packed)) {
Definitions for USB protocol messages.
usb_dfu_state_t
USBUS DFU internal state.
@ USB_DFU_STATE_DFU_UP_IDLE
DFU upload idle.
@ USB_DFU_STATE_DFU_MANIFEST
DFU manifest mode.
@ USB_DFU_STATE_DFU_MANIFEST_WAIT_RST
DFU manifest wait for CPU reset.
@ USB_DFU_STATE_DFU_ERROR
DFU internal error.
@ USB_DFU_STATE_DFU_DL_BUSY
DFU download busy.
@ USB_DFU_STATE_DFU_MANIFEST_SYNC
DFU manifest synchronization.
@ USB_DFU_STATE_DFU_IDLE
DFU runtime mode idle.
@ USB_DFU_STATE_DFU_DL_IDLE
DFU download idle.
@ USB_DFU_STATE_DFU_DL_SYNC
DFU download synchronization.
@ USB_DFU_STATE_APP_IDLE
DFU application idle.
@ USB_DFU_STATE_APP_DETACH
DFU application detach (reboot to DFU mode)
USB DFU get_status control request packet.
uint8_t state
DFU internal state machine.
uint32_t timeout
DFU timeout (ms) response.
uint8_t string
DFU string.
uint8_t status
DFU status response.
USB DFU interface descriptor.
uint8_t length
Descriptor length.
uint16_t bcd_dfu
Descriptor bcd version.
uint16_t xfer_size
Descriptor transaction size.
uint16_t detach_timeout
Descriptor detach timeout (ms)
uint8_t attribute
Descriptor attributes flags.
uint8_t type
Descriptor type.
Definition of global compile time configuration options.