LUFA Library - DFU Class Bootloader
Descriptors.h File Reference
#include <LUFA/Drivers/USB/USB.h>
#include "Config/AppConfig.h"

Data Structures

struct  USB_Descriptor_DFU_Functional_t
 
struct  USB_Descriptor_Configuration_t
 

Macros

#define DTYPE_DFUFunctional   0x21
 
#define ATTR_WILL_DETATCH   (1 << 3)
 
#define ATTR_MANEFESTATION_TOLLERANT   (1 << 2)
 
#define ATTR_CAN_UPLOAD   (1 << 1)
 
#define ATTR_CAN_DOWNLOAD   (1 << 0)
 

Enumerations

enum  StringDescriptors_t {
  STRING_ID_Language = 0,
  STRING_ID_Manufacturer = 1,
  STRING_ID_Product = 2
}
 

Functions

uint16_t CALLBACK_USB_GetDescriptor (const uint16_t wValue, const uint8_t wIndex, const void **const DescriptorAddress) ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3)
 

Detailed Description

Header file for Descriptors.c.

Macro Definition Documentation

#define ATTR_CAN_DOWNLOAD   (1 << 0)

DFU attribute mask, indicating that the DFU device can accept DFU_DNLOAD requests to send data from the host to the device.

#define ATTR_CAN_UPLOAD   (1 << 1)

DFU attribute mask, indicating that the DFU device can accept DFU_UPLOAD requests to send data from the device to the host.

#define ATTR_MANEFESTATION_TOLLERANT   (1 << 2)

DFU attribute mask, indicating that the DFU device can communicate during the manifestation phase (memory programming phase).

#define ATTR_WILL_DETATCH   (1 << 3)

DFU attribute mask, indicating that the DFU device will detach and re-attach when a DFU_DETACH command is issued, rather than the host issuing a USB Reset.

#define DTYPE_DFUFunctional   0x21

Descriptor type value for a DFU class functional descriptor.

Enumeration Type Documentation

Enum for the device string descriptor IDs within the device. Each string descriptor should have a unique ID index associated with it, which can be used to refer to the string from other descriptors.

Enumerator
STRING_ID_Language 

Supported Languages string descriptor ID (must be zero)

STRING_ID_Manufacturer 

Manufacturer string ID

STRING_ID_Product 

Product string ID

Function Documentation

uint16_t CALLBACK_USB_GetDescriptor ( const uint16_t  wValue,
const uint8_t  wIndex,
const void **const  DescriptorAddress 
)

This function is called by the library when in device mode, and must be overridden (see library "USB Descriptors" documentation) by the application code so that the address and size of a requested descriptor can be given to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the USB host.