Skip to content
Snippets Groups Projects
Select Git revision
  • 5430e1973ce21f4bc558257855a06baf6a28217c
  • master default protected
  • LUFA-170418
  • LUFA-151115
  • LUFA-140928
  • LUFA-140302
  • LUFA-130901
  • LUFA-130901-BETA
  • LUFA-130303
  • LUFA-120730
  • LUFA-120730-BETA
  • LUFA-120219
  • LUFA-120219-BETA
  • LUFA-111009
  • LUFA-111009-BETA
  • LUFA-110528
  • LUFA-110528-BETA
17 results

Descriptors.h

Blame
  • Descriptors.c 10.04 KiB
    /*
                 LUFA Library
         Copyright (C) Dean Camera, 2010.
                  
      dean [at] fourwalledcubicle [dot] com
          www.fourwalledcubicle.com
    */
    
    /*
      Copyright 2010  Dean Camera (dean [at] fourwalledcubicle [dot] com)
    
      Permission to use, copy, modify, distribute, and sell this 
      software and its documentation for any purpose is hereby granted
      without fee, provided that the above copyright notice appear in 
      all copies and that both that the copyright notice and this
      permission notice and warranty disclaimer appear in supporting 
      documentation, and that the name of the author not be used in 
      advertising or publicity pertaining to distribution of the 
      software without specific, written prior permission.
    
      The author disclaim all warranties with regard to this
      software, including all implied warranties of merchantability
      and fitness.  In no event shall the author be liable for any
      special, indirect or consequential damages or any damages
      whatsoever resulting from loss of use, data or profits, whether
      in an action of contract, negligence or other tortious action,
      arising out of or in connection with the use or performance of
      this software.
    */
    
    /** \file
     *
     *  USB Device Descriptors, for library use when in USB device mode. Descriptors are special 
     *  computer-readable structures which the host requests upon device enumeration, to determine
     *  the device's capabilities and functions.  
     */
    
    #include "Descriptors.h"
    
    /* On some devices, there is a factory set internal serial number which can be automatically sent to the host as
     * the device's serial number when the Device Descriptor's .SerialNumStrIndex entry is set to USE_INTERNAL_SERIAL.
     * This allows the host to track a device across insertions on different ports, allowing them to retain allocated
     * resources like COM port numbers and drivers. On demos using this feature, give a warning on unsupported devices
     * so that the user can supply their own serial number descriptor instead or remove the USE_INTERNAL_SERIAL value
     * from the Device Descriptor (forcing the host to generate a serial number for each device from the VID, PID and
     * port location).
     */
    #if (USE_INTERNAL_SERIAL == NO_DESCRIPTOR)
    	#warning USE_INTERNAL_SERIAL is not available on this AVR - please manually construct a device serial descriptor.
    #endif
    
    /** Device descriptor structure. This descriptor, located in FLASH memory, describes the overall
     *  device characteristics, including the supported USB version, control endpoint size and the
     *  number of device configurations. The descriptor is read out by the USB host when the enumeration
     *  process begins.
     */
    USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
    {
    	.Header                 = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
    
    	.USBSpecification       = VERSION_BCD(01.10),
    	.Class                  = 0x02,
    	.SubClass               = 0x00,
    	.Protocol               = 0x00,
    
    	.Endpoint0Size          = FIXED_CONTROL_ENDPOINT_SIZE,
    
    	.VendorID               = 0x03EB,
    	.ProductID              = 0x2044,
    	.ReleaseNumber          = 0x0000,