Add const qualifiers to Host mode Class drivers.
[pub/USBasp.git] / LUFA / Drivers / USB / LowLevel / DevChapter9.h
index 68cb2c4..e6baca2 100644 (file)
@@ -35,6 +35,7 @@
                #include <avr/io.h>\r
                #include <avr/pgmspace.h>\r
                #include <avr/eeprom.h>\r
+               #include <avr/boot.h>\r
                \r
                #include "../HighLevel/StdDescriptors.h"\r
                #include "../HighLevel/Events.h"\r
                #endif\r
 \r
        /* Public Interface - May be used in end-application: */\r
+               /* Macros: */\r
+                       #if defined(USE_SINGLE_DEVICE_CONFIGURATION)\r
+                               #define FIXED_NUM_CONFIGURATIONS           1\r
+                       #endif\r
+       \r
+               /* Enums: */\r
+                       #if !defined(USE_FLASH_DESCRIPTORS) && !defined(USE_EEPROM_DESCRIPTORS) && !defined(USE_RAM_DESCRIPTORS)\r
+                               /** Enum for the possible descriptor memory spaces, for the MemoryAddressSpace of the\r
+                                *  \ref CALLBACK_USB_GetDescriptor() function. This can be used when none of the USE_*_DESCRIPTORS\r
+                                *  compile time options are used, to indicate in which memory space the descriptor is stored.\r
+                                *\r
+                                *  \ingroup Group_Device\r
+                                */\r
+                               enum USB_DescriptorMemorySpaces_t\r
+                               {\r
+                                       MEMSPACE_FLASH    = 0, /**< Indicates the requested descriptor is located in FLASH memory */\r
+                                       MEMSPACE_EEPROM   = 1, /**< Indicates the requested descriptor is located in EEPROM memory */\r
+                                       MEMSPACE_RAM      = 2, /**< Indicates the requested descriptor is located in RAM memory */\r
+                               };\r
+                       #endif\r
+       \r
                /* Global Variables: */\r
                        /** Indicates the currently set configuration number of the device. USB devices may have several\r
                         *  different configurations which the host can select between; this indicates the currently selected\r
                         *  value, or 0 if no configuration has been selected.\r
                         *\r
-                        *  If a device has only one single configuration, the token USE_SINGLE_DEVICE_CONFIGURATION may be\r
-                        *  defined in the project makefile and passed to the compiler using the -D switch. This optimize for\r
-                        *  a single configuration, saving a small amount of space in the resulting compiled binary.\r
-                        *\r
                         *  \note This variable should be treated as read-only in the user application, and never manually\r
                         *        changed in value.\r
                         *\r
        #if !defined(__DOXYGEN__)\r
                #if defined(USE_RAM_DESCRIPTORS) && defined(USE_EEPROM_DESCRIPTORS)\r
                        #error USE_RAM_DESCRIPTORS and USE_EEPROM_DESCRIPTORS are mutually exclusive.\r
+               #elif defined(USE_RAM_DESCRIPTORS) && defined(USE_FLASH_DESCRIPTORS)\r
+                       #error USE_RAM_DESCRIPTORS and USE_FLASH_DESCRIPTORS are mutually exclusive.\r
+               #elif defined(USE_FLASH_DESCRIPTORS) && defined(USE_EEPROM_DESCRIPTORS)\r
+                       #error USE_FLASH_DESCRIPTORS and USE_EEPROM_DESCRIPTORS are mutually exclusive.\r
+               #elif defined(USE_FLASH_DESCRIPTORS) && defined(USE_EEPROM_DESCRIPTORS) && defined(USE_RAM_DESCRIPTORS)\r
+                       #error Only one of the USE_*_DESCRIPTORS modes should be selected.\r
                #endif\r
        \r
                /* Function Prototypes: */\r
-                       void USB_Device_ProcessControlPacket(void);\r
+                       void USB_Device_ProcessControlRequest(void);\r
                        \r
                        #if defined(INCLUDE_FROM_DEVCHAPTER9_C)\r
                                static void USB_Device_SetAddress(void);\r
                                static void USB_Device_GetDescriptor(void);\r
                                static void USB_Device_GetStatus(void);\r
                                static void USB_Device_ClearSetFeature(void);\r
+                               \r
+                               #if !defined(NO_INTERNAL_SERIAL) && (defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR))\r
+                                       static char USB_Device_NibbleToASCII(uint8_t Nibble) ATTR_ALWAYS_INLINE;\r
+                                       static void USB_Device_GetInternalSerialDescriptor(void);\r
+                               #endif                          \r
                        #endif\r
        #endif\r
 \r