Loading...
Searching...
No Matches
DFU - USB Device Firmware Upgrade

Generic USB DFU defines and helpers. More...

Detailed Description

Generic USB DFU defines and helpers.

Files

file  dfu.h
 Definition for USB DFU interfaces.
 

Data Structures

struct  usb_desc_if_dfu_t
 USB DFU interface descriptor. More...
 
struct  dfu_get_status_pkt_t
 USB DFU get_status control request packet. More...
 

Macros

#define USB_IF_DESCRIPTOR_DFU   0x21
 USB DFU type descriptor.
 
#define USB_DFU_VERSION_BCD   0x0110
 USB DFU version in BCD.
 

Enumerations

enum  usb_dfu_state_t {
  USB_DFU_STATE_APP_IDLE , USB_DFU_STATE_APP_DETACH , USB_DFU_STATE_DFU_IDLE , USB_DFU_STATE_DFU_DL_SYNC ,
  USB_DFU_STATE_DFU_DL_BUSY , USB_DFU_STATE_DFU_DL_IDLE , USB_DFU_STATE_DFU_MANIFEST_SYNC , USB_DFU_STATE_DFU_MANIFEST ,
  USB_DFU_STATE_DFU_MANIFEST_WAIT_RST , USB_DFU_STATE_DFU_UP_IDLE , USB_DFU_STATE_DFU_ERROR
}
 USBUS DFU internal state. More...
 

Default USB detach timeout for DFU descriptor

#define USB_DFU_DETACH_TIMEOUT_MS   255
 

USB DFU interface attributes

#define USB_DFU_CAN_DOWNLOAD   0x01
 DFU Download attribute.
 
#define USB_DFU_CAN_UPLOAD   0x02
 DFU Upload attribute.
 
#define USB_DFU_MANIFEST_TOLERANT   0x04
 DFU Manifest tolerant attribute.
 
#define USB_DFU_WILL_DETACH   0x08
 DFU Detach capability attribute.
 

USB DFU interface type

#define USB_DFU_INTERFACE   0xFE /** Application Specific Interface */
 

USB DFU subclass types

#define USB_DFU_SUBCLASS_DFU   0x01
 DFU subclass.
 

USB DFU protocol types

#define USB_DFU_PROTOCOL_RUNTIME_MODE   0x01
 Runtime mode.
 
#define USB_DFU_PROTOCOL_DFU_MODE   0x02
 DFU mode.
 

USB DFU setup request

#define DFU_DETACH   0x00
 DFU Detach request.
 
#define DFU_DOWNLOAD   0x01
 DFU Download request.
 
#define DFU_UPLOAD   0x02
 DFU Upload request.
 
#define DFU_GET_STATUS   0x03
 DFU Get Status request.
 
#define DFU_CLR_STATUS   0x04
 DFU Clear Status request.
 
#define DFU_GET_STATE   0x05
 DFU Get State request.
 
#define DFU_ABORT   0x06
 DFU Abort request.
 

Macro Definition Documentation

◆ DFU_ABORT

#define DFU_ABORT   0x06

DFU Abort request.

Definition at line 89 of file dfu.h.

◆ DFU_CLR_STATUS

#define DFU_CLR_STATUS   0x04

DFU Clear Status request.

Definition at line 87 of file dfu.h.

◆ DFU_DETACH

#define DFU_DETACH   0x00

DFU Detach request.

Definition at line 83 of file dfu.h.

◆ DFU_DOWNLOAD

#define DFU_DOWNLOAD   0x01

DFU Download request.

Definition at line 84 of file dfu.h.

◆ DFU_GET_STATE

#define DFU_GET_STATE   0x05

DFU Get State request.

Definition at line 88 of file dfu.h.

◆ DFU_GET_STATUS

#define DFU_GET_STATUS   0x03

DFU Get Status request.

Definition at line 86 of file dfu.h.

◆ DFU_UPLOAD

#define DFU_UPLOAD   0x02

DFU Upload request.

Definition at line 85 of file dfu.h.

◆ USB_DFU_CAN_DOWNLOAD

#define USB_DFU_CAN_DOWNLOAD   0x01

DFU Download attribute.

Definition at line 50 of file dfu.h.

◆ USB_DFU_CAN_UPLOAD

#define USB_DFU_CAN_UPLOAD   0x02

DFU Upload attribute.

Definition at line 51 of file dfu.h.

◆ USB_DFU_DETACH_TIMEOUT_MS

#define USB_DFU_DETACH_TIMEOUT_MS   255

Definition at line 42 of file dfu.h.

◆ USB_DFU_INTERFACE

#define USB_DFU_INTERFACE   0xFE /** Application Specific Interface */

Definition at line 60 of file dfu.h.

◆ USB_DFU_MANIFEST_TOLERANT

#define USB_DFU_MANIFEST_TOLERANT   0x04

DFU Manifest tolerant attribute.

Definition at line 52 of file dfu.h.

◆ USB_DFU_PROTOCOL_DFU_MODE

#define USB_DFU_PROTOCOL_DFU_MODE   0x02

DFU mode.

Definition at line 76 of file dfu.h.

◆ USB_DFU_PROTOCOL_RUNTIME_MODE

#define USB_DFU_PROTOCOL_RUNTIME_MODE   0x01

Runtime mode.

Definition at line 75 of file dfu.h.

◆ USB_DFU_SUBCLASS_DFU

#define USB_DFU_SUBCLASS_DFU   0x01

DFU subclass.

Definition at line 68 of file dfu.h.

◆ USB_DFU_VERSION_BCD

#define USB_DFU_VERSION_BCD   0x0110

USB DFU version in BCD.

Definition at line 35 of file dfu.h.

◆ USB_DFU_WILL_DETACH

#define USB_DFU_WILL_DETACH   0x08

DFU Detach capability attribute.

Definition at line 53 of file dfu.h.

◆ USB_IF_DESCRIPTOR_DFU

#define USB_IF_DESCRIPTOR_DFU   0x21

USB DFU type descriptor.

Definition at line 34 of file dfu.h.

Enumeration Type Documentation

◆ usb_dfu_state_t

USBUS DFU internal state.

Enumerator
USB_DFU_STATE_APP_IDLE 

DFU application idle.

USB_DFU_STATE_APP_DETACH 

DFU application detach (reboot to DFU mode)

USB_DFU_STATE_DFU_IDLE 

DFU runtime mode idle.

USB_DFU_STATE_DFU_DL_SYNC 

DFU download synchronization.

USB_DFU_STATE_DFU_DL_BUSY 

DFU download busy.

USB_DFU_STATE_DFU_DL_IDLE 

DFU download idle.

USB_DFU_STATE_DFU_MANIFEST_SYNC 

DFU manifest synchronization.

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_UP_IDLE 

DFU upload idle.

USB_DFU_STATE_DFU_ERROR 

DFU internal error.

Definition at line 95 of file dfu.h.