#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
* \ingroup Group_Device\r
*/\r
extern bool USB_CurrentlySelfPowered;\r
-\r
- /* Throwable Events: */\r
- /** This module raises the \ref USB_UnhandledControlPacket event when a request to the default control\r
- * endpoint has been received, but the library does not implement an internal handler for it.\r
- *\r
- * \see \ref Group_Events for more information on this event.\r
- */\r
- RAISES_EVENT(USB_UnhandledControlPacket);\r
-\r
- /** This module raises the \ref USB_ConfigurationChanged event when the host issues a \ref REQ_SetConfiguration\r
- * device request, to change the currently selected configuration number.\r
- *\r
- * \see \ref Group_Events for more information on this event.\r
- */\r
- RAISES_EVENT(USB_ConfigurationChanged);\r
-\r
- /** This module raises the \ref USB_DeviceEnumerationComplete event when the host has completed its\r
- * enumeration of the device (i.e. when a \ref REQ_SetConfiguration request changes the current configuration\r
- * number from 0 to a non-zero value).\r
- *\r
- * \see \ref Group_Events for more information on this event.\r
- */\r
- RAISES_EVENT(USB_DeviceEnumerationComplete);\r
\r
/* Private Interface - For use in library only: */\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