Descriptors.h File Reference

#include <LUFA/Drivers/USB/USB.h>

Data Structures

struct  USB_Descriptor_Configuration_t

Defines

#define CDC_FUNCTIONAL_DESCRIPTOR(DataSize)
#define CDC_NOTIFICATION_EPNUM   3
#define CDC_NOTIFICATION_EPSIZE   8
#define CDC_TX_EPNUM   1
#define CDC_RX_EPNUM   2
#define CDC_TXRX_EPSIZE   16

Functions

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

Detailed Description

Header file for Descriptors.c.


Define Documentation

#define CDC_FUNCTIONAL_DESCRIPTOR ( DataSize   ) 
Value:
struct                                        \
             {                                             \
                  USB_Descriptor_Header_t Header;          \
                  uint8_t                 SubType;         \
                  uint8_t                 Data[DataSize];  \
             }

Structure for a CDC class Functional descriptor, with a given data size. This is used instead of a type define so that the same macro can be used for functional descriptors of varying data lengths, while allowing the sizeof() operator to return correct results.

Parameters:
[in] DataSize Size of the functional descriptor's data payload, in bytes
#define CDC_NOTIFICATION_EPNUM   3

Endpoint number for the CDC control interface event notification endpoint.

#define CDC_NOTIFICATION_EPSIZE   8

Size of the CDC control interface notification endpoint bank, in bytes

#define CDC_RX_EPNUM   2

Endpoint number for the CDC data interface RX (data OUT) endpoint

#define CDC_TX_EPNUM   1

Endpoint number for the CDC data interface TX (data IN) endpoint

#define CDC_TXRX_EPSIZE   16

Size of the CDC data interface TX and RX data endpoint banks, in bytes


Function Documentation

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

This function is called by the library when in device mode, and must be overridden (see LUFA 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.

Generated by  doxygen 1.6.3