3      Copyright (C) Dean Camera, 2009. 
   5   dean [at] fourwalledcubicle [dot] com 
   6       www.fourwalledcubicle.com 
  10   Copyright 2009  Dean Camera (dean [at] fourwalledcubicle [dot] com) 
  12   Permission to use, copy, modify, and distribute this software 
  13   and its documentation for any purpose and without fee is hereby 
  14   granted, provided that the above copyright notice appear in all 
  15   copies and that both that the copyright notice and this 
  16   permission notice and warranty disclaimer appear in supporting 
  17   documentation, and that the name of the author not be used in 
  18   advertising or publicity pertaining to distribution of the 
  19   software without specific, written prior permission. 
  21   The author disclaim all warranties with regard to this 
  22   software, including all implied warranties of merchantability 
  23   and fitness.  In no event shall the author be liable for any 
  24   special, indirect or consequential damages or any damages 
  25   whatsoever resulting from loss of use, data or profits, whether 
  26   in an action of contract, negligence or other tortious action, 
  27   arising out of or in connection with the use or performance of 
  33  *  Master include file for the library USB functionality. This file should be included in all user projects making 
  34  *  use of the USB portions of the library, instead of including any headers in the USB/LowLevel or USB/HighLevel 
  38 /** @defgroup Group_USB USB - LUFA/Drivers/USB/USB.h 
  40  *  \section Sec_Dependencies Module Source Dependencies 
  41  *  The following files must be built with any user project that uses this module: 
  42  *    - LUFA/Drivers/USB/LowLevel/DevChapter9.c 
  43  *    - LUFA/Drivers/USB/LowLevel/Endpoint.c 
  44  *    - LUFA/Drivers/USB/LowLevel/Host.c 
  45  *    - LUFA/Drivers/USB/LowLevel/HostChapter9.c 
  46  *    - LUFA/Drivers/USB/LowLevel/LowLevel.c 
  47  *    - LUFA/Drivers/USB/LowLevel/Pipe.c 
  48  *    - LUFA/Drivers/USB/HighLevel/Events.c 
  49  *    - LUFA/Drivers/USB/HighLevel/USBInterrupt.c 
  50  *    - LUFA/Drivers/USB/HighLevel/USBTask.c 
  51  *    - LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c 
  53  *  \section Module Description 
  54  *  Driver and framework for the USB controller hardware on the USB series of AVR microcontrollers. This module 
  55  *  consists of many submodules, and is designed to provide an easy way to configure and control USB host, device 
  56  *  or OTG mode USB applications. 
  58  *  The USB stack requires the sole control over the USB controller in the microcontroller only; i.e. it does not 
  59  *  require any additional AVR timers, etc. to operate. This ensures that the USB stack requires as few resources 
  62  *  The USB stack can be used in Device Mode for connections to USB Hosts (see \ref Group_Device), in Host mode for 
  63  *  hosting of other USB devices (see \ref Group_Host), or as a dual role device which can either act as a USB host 
  64  *  or device depending on what peripheral is connected (see \ref Group_OTG). Both modes also require a common set 
  65  *  of USB management functions found \ref Group_USBManagement. 
  68 /** \ingroup Group_USB 
  69  *  @defgroup Group_USBClassDrivers USB Class Drivers 
  71  *  Drivers for both host and device mode of the standard USB classes, for rapid application development. 
  72  *  Class drivers give a framework which sits on top of the low level library API, allowing for standard 
  73  *  USB classes to be implemented in a project with minimal user code. These drivers can be used in 
  74  *  conjunction with the library low level APIs to implement interfaces both via the class drivers and via 
  75  *  the standard library APIs. 
  77  *  Multiple device mode class drivers can be used within a project, including multiple instances of the 
  78  *  same class driver. In this way, USB Hosts and Devices can be made quickly using the internal class drivers 
  79  *  so that more time and effort can be put into the end application instead of the USB protocol. 
  81  *  The available class drivers and their modes are listed below. 
  85  *   <th width="100px">USB Class</th>  
  86  *   <th width="80px">Device</th>  
  87  *   <th width="80px">Host</th>  
  91  *   <td bgcolor="#00EE00">Yes</td> 
  92  *   <td bgcolor="#EE0000">No</td> 
  96  *   <td bgcolor="#00EE00">Yes</td> 
  97  *   <td bgcolor="#00EE00">Yes</td> 
 101  *   <td bgcolor="#00EE00">Yes</td> 
 102  *   <td bgcolor="#00EE00">Yes</td> 
 106  *   <td bgcolor="#00EE00">Yes</td> 
 107  *   <td bgcolor="#00EE00">Yes</td> 
 110  *   <td>Mass Storage</td> 
 111  *   <td bgcolor="#00EE00">Yes</td> 
 112  *   <td bgcolor="#00EE00">Yes</td> 
 116  *   <td bgcolor="#00EE00">Yes</td> 
 117 *    <td bgcolor="#00EE00">Yes</td> 
 121  *   <td bgcolor="#00EE00">Yes</td> 
 122  *   <td bgcolor="#EE0000">No</td> 
 125  *   <td>Still Image</td> 
 126  *   <td bgcolor="#EE0000">No</td> 
 127  *   <td bgcolor="#00EE00">Yes</td> 
 135         /* Preprocessor Checks: */               
 136                 #if (!(defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB647__) ||  \ 
 137                        defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) ||  \ 
 138                            defined(__AVR_AT90USB162__)  || defined(__AVR_AT90USB82__)  ||  \ 
 139                            defined(__AVR_ATmega32U2__)  || defined(__AVR_ATmega16U2__) ||  \ 
 140                            defined(__AVR_ATmega8U2__)   ||                                 \ 
 141                            defined(__AVR_ATmega16U4__)  || defined(__AVR_ATmega32U4__) ||  \ 
 142                            defined(__AVR_ATmega32U6__))) 
 143                         #error The currently selected AVR model is not supported under the USB component of the LUFA library. 
 147                 #include "HighLevel/USBMode.h" 
 148                 #include "HighLevel/USBTask.h" 
 149                 #include "HighLevel/USBInterrupt.h" 
 150                 #include "HighLevel/Events.h" 
 151                 #include "HighLevel/StdDescriptors.h" 
 153                 #include "LowLevel/LowLevel.h" 
 155                 #if defined(USB_CAN_BE_HOST) || defined(__DOXYGEN__) 
 156                         #include "LowLevel/Host.h" 
 157                         #include "LowLevel/HostChapter9.h" 
 158                         #include "LowLevel/Pipe.h" 
 161                 #if defined(USB_CAN_BE_DEVICE) || defined(__DOXYGEN__) 
 162                         #include "LowLevel/Device.h" 
 163                         #include "LowLevel/DevChapter9.h" 
 164                         #include "LowLevel/Endpoint.h" 
 167                 #if defined(USB_CAN_BE_BOTH) || defined(__DOXYGEN__) 
 168                         #include "LowLevel/OTG.h" 
 171                 #include "HighLevel/ConfigDescriptor.h"