Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
usb_dfu.h File Reference

USB Device Firmware Upgrade (DFU) public header. More...

#include <sys_clock.h>

Go to the source code of this file.

Data Structures

struct  dfu_runtime_descriptor
 

Macros

#define DFU_SUBCLASS   0x01
 
#define DFU_RT_PROTOCOL   0x01
 
#define DFU_MODE_PROTOCOL   0x02
 
#define DFU_DETACH   0x00
 DFU Class Specific Requests. More...
 
#define DFU_DNLOAD   0x01
 
#define DFU_UPLOAD   0x02
 
#define DFU_GETSTATUS   0x03
 
#define DFU_CLRSTATUS   0x04
 
#define DFU_GETSTATE   0x05
 
#define DFU_ABORT   0x06
 
#define DFU_FUNC_DESC   0x21
 
#define DFU_ATTR_WILL_DETACH   0x08
 
#define DFU_ATTR_MANIFESTATION_TOLERANT   0x04
 
#define DFU_ATTR_CAN_UPLOAD   0x02
 
#define DFU_ATTR_CAN_DNLOAD   0x01
 
#define DFU_VERSION   0x0110
 

Enumerations

enum  dfu_status {
  statusOK , errTARGET , errFILE , errWRITE ,
  errERASE , errCHECK_ERASED , errPROG , errVERIFY ,
  errADDRESS , errNOTDONE , errFIRMWARE , errVENDOR ,
  errUSB , errPOR , errUNKNOWN , errSTALLEDPKT
}
 
enum  dfu_state {
  appIDLE , appDETACH , dfuIDLE , dfuDNLOAD_SYNC ,
  dfuDNBUSY , dfuDNLOAD_IDLE , dfuMANIFEST_SYNC , dfuMANIFEST ,
  dfuMANIFEST_WAIT_RST , dfuUPLOAD_IDLE , dfuERROR
}
 

Functions

void wait_for_usb_dfu (k_timeout_t delay)
 

Detailed Description

USB Device Firmware Upgrade (DFU) public header.

Header follows the Device Class Specification for Device Firmware Upgrade Version 1.1

Macro Definition Documentation

◆ DFU_ABORT

#define DFU_ABORT   0x06

◆ DFU_ATTR_CAN_DNLOAD

#define DFU_ATTR_CAN_DNLOAD   0x01

◆ DFU_ATTR_CAN_UPLOAD

#define DFU_ATTR_CAN_UPLOAD   0x02

◆ DFU_ATTR_MANIFESTATION_TOLERANT

#define DFU_ATTR_MANIFESTATION_TOLERANT   0x04

◆ DFU_ATTR_WILL_DETACH

#define DFU_ATTR_WILL_DETACH   0x08

DFU attributes DFU Functional Descriptor

◆ DFU_CLRSTATUS

#define DFU_CLRSTATUS   0x04

◆ DFU_DETACH

#define DFU_DETACH   0x00

DFU Class Specific Requests.

◆ DFU_DNLOAD

#define DFU_DNLOAD   0x01

◆ DFU_FUNC_DESC

#define DFU_FUNC_DESC   0x21

DFU FUNCTIONAL descriptor type

◆ DFU_GETSTATE

#define DFU_GETSTATE   0x05

◆ DFU_GETSTATUS

#define DFU_GETSTATUS   0x03

◆ DFU_MODE_PROTOCOL

#define DFU_MODE_PROTOCOL   0x02

DFU Class DFU mode Protocol

◆ DFU_RT_PROTOCOL

#define DFU_RT_PROTOCOL   0x01

DFU Class runtime Protocol

◆ DFU_SUBCLASS

#define DFU_SUBCLASS   0x01

DFU Class Subclass

◆ DFU_UPLOAD

#define DFU_UPLOAD   0x02

◆ DFU_VERSION

#define DFU_VERSION   0x0110

DFU Specification release

Enumeration Type Documentation

◆ dfu_state

enum dfu_state

bState values for the DFU_GETSTATUS response

Enumerator
appIDLE 
appDETACH 
dfuIDLE 
dfuDNLOAD_SYNC 
dfuDNBUSY 
dfuDNLOAD_IDLE 
dfuMANIFEST_SYNC 
dfuMANIFEST 
dfuMANIFEST_WAIT_RST 
dfuUPLOAD_IDLE 
dfuERROR 

◆ dfu_status

enum dfu_status

bStatus values for the DFU_GETSTATUS response

Enumerator
statusOK 
errTARGET 
errFILE 
errWRITE 
errERASE 
errCHECK_ERASED 
errPROG 
errVERIFY 
errADDRESS 
errNOTDONE 
errFIRMWARE 
errVENDOR 
errUSB 
errPOR 
errUNKNOWN 
errSTALLEDPKT 

Function Documentation

◆ wait_for_usb_dfu()

void wait_for_usb_dfu ( k_timeout_t  delay)