Fixed incorrect HID interface class and subclass values in the Mouse and KeyboardMous...
authorDean Camera <dean@fourwalledcubicle.com>
Sun, 19 Apr 2009 11:43:21 +0000 (11:43 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Sun, 19 Apr 2009 11:43:21 +0000 (11:43 +0000)
Capitolised the "Descriptor_Search" and "Descriptor_Search_Comp" prefixes of the values in the DSearch_Return_ErrorCodes_t and DSearch_Comp_Return_ErrorCodes_t enums.

Minor documentation improvements.

33 files changed:
Demos/Device/KeyboardMouse/Descriptors.c
Demos/Device/Mouse/Descriptors.c
Demos/Host/CDCHost/ConfigDescriptor.c
Demos/Host/GenericHIDHost/ConfigDescriptor.c
Demos/Host/KeyboardHost/ConfigDescriptor.c
Demos/Host/KeyboardHostWithParser/ConfigDescriptor.c
Demos/Host/KeyboardHostWithParser/HIDReport.c
Demos/Host/KeyboardHostWithParser/KeyboardHostWithParser.c
Demos/Host/MassStorageHost/ConfigDescriptor.c
Demos/Host/MouseHost/ConfigDescriptor.c
Demos/Host/MouseHostWithParser/ConfigDescriptor.c
Demos/Host/MouseHostWithParser/HIDReport.c
Demos/Host/MouseHostWithParser/HIDReport.h
Demos/Host/MouseHostWithParser/MouseHostWithParser.c
Demos/Host/StillImageHost/ConfigDescriptor.c
LUFA/ChangeLog.txt
LUFA/DriverStubs/HWB.h
LUFA/Drivers/Board/Dataflash.h
LUFA/Drivers/Board/Temperature.h
LUFA/Drivers/Peripheral/AT90USBXXX67/ADC.h
LUFA/Drivers/Peripheral/Serial.h
LUFA/Drivers/USB/Class/ConfigDescriptor.c
LUFA/Drivers/USB/Class/ConfigDescriptor.h
LUFA/Drivers/USB/Class/HIDParser.c
LUFA/Drivers/USB/HighLevel/StreamCallbacks.h
LUFA/Drivers/USB/HighLevel/USBTask.h
LUFA/Drivers/USB/LowLevel/Device.h
LUFA/Drivers/USB/LowLevel/Endpoint.h
LUFA/Drivers/USB/LowLevel/Host.h
LUFA/Drivers/USB/LowLevel/OTG.h
LUFA/Drivers/USB/LowLevel/Pipe.h
LUFA/MigrationInformation.txt
LUFA/Scheduler/Scheduler.h

index 7f39c6b..39c1d4a 100644 (file)
@@ -173,7 +173,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                                \r
                        Class:                  0x03,\r
                        SubClass:               0x01,\r
-                       Protocol:               0x00,\r
+                       Protocol:               0x01,\r
                                \r
                        InterfaceStrIndex:      NO_DESCRIPTOR\r
                },\r
@@ -219,8 +219,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        TotalEndpoints:         1,\r
                                \r
                        Class:                  0x03,\r
-                       SubClass:               0x02,\r
-                       Protocol:               0x00,\r
+                       SubClass:               0x01,\r
+                       Protocol:               0x02,\r
                                \r
                        InterfaceStrIndex:      NO_DESCRIPTOR\r
                },\r
index 9ad39f4..a93d512 100644 (file)
@@ -132,8 +132,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        TotalEndpoints:         1,\r
                                \r
                        Class:                  0x03,\r
-                       SubClass:               0x02,\r
-                       Protocol:               0x01,\r
+                       SubClass:               0x01,\r
+                       Protocol:               0x02,\r
                                \r
                        InterfaceStrIndex:      NO_DESCRIPTOR\r
                },\r
index 972d3e6..9a23fc3 100644 (file)
@@ -181,11 +181,11 @@ DESCRIPTOR_COMPARATOR(NextCDCControlInterface)
                    (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).SubClass == CDC_CONTROL_SUBCLASS) &&\r
                    (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == CDC_CONTROL_PROTOCOL))\r
                {\r
-                       return Descriptor_Search_Found;\r
+                       return DESCRIPTOR_SEARCH_Found;\r
                }\r
        }\r
        \r
-       return Descriptor_Search_NotFound;\r
+       return DESCRIPTOR_SEARCH_NotFound;\r
 }\r
 \r
 /** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's\r
@@ -205,11 +205,11 @@ DESCRIPTOR_COMPARATOR(NextCDCDataInterface)
                    (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).SubClass == CDC_DATA_SUBCLASS) &&\r
                    (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == CDC_DATA_PROTOCOL))\r
                {\r
-                       return Descriptor_Search_Found;\r
+                       return DESCRIPTOR_SEARCH_Found;\r
                }\r
        }\r
        \r
-       return Descriptor_Search_NotFound;\r
+       return DESCRIPTOR_SEARCH_NotFound;\r
 }\r
 \r
 /** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's\r
@@ -230,12 +230,12 @@ DESCRIPTOR_COMPARATOR(NextInterfaceCDCDataEndpoint)
                                                        USB_Descriptor_Endpoint_t).Attributes & EP_TYPE_MASK);\r
        \r
                if ((EndpointType == EP_TYPE_BULK) || (EndpointType == EP_TYPE_INTERRUPT))\r
-                 return Descriptor_Search_Found;\r
+                 return DESCRIPTOR_SEARCH_Found;\r
        }\r
        else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)\r
        {\r
-               return Descriptor_Search_Fail;\r
+               return DESCRIPTOR_SEARCH_Fail;\r
        }\r
 \r
-       return Descriptor_Search_NotFound;\r
+       return DESCRIPTOR_SEARCH_NotFound;\r
 }\r
index caf88ef..7dc7d3e 100644 (file)
@@ -143,12 +143,12 @@ DESCRIPTOR_COMPARATOR(NextHIDInterface)
                if (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == HID_CLASS)\r
                {\r
                        /* Indicate that the descriptor being searched for has been found */\r
-                       return Descriptor_Search_Found;\r
+                       return DESCRIPTOR_SEARCH_Found;\r
                }\r
        }\r
        \r
        /* Current descriptor does not match what this comparator is looking for */\r
-       return Descriptor_Search_NotFound;\r
+       return DESCRIPTOR_SEARCH_NotFound;\r
 }\r
 \r
 /** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's\r
@@ -166,14 +166,14 @@ DESCRIPTOR_COMPARATOR(NextInterfaceHIDDataEndpoint)
        if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)\r
        {\r
                /* Indicate that the descriptor being searched for has been found */\r
-               return Descriptor_Search_Found;\r
+               return DESCRIPTOR_SEARCH_Found;\r
        }\r
        else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)\r
        {\r
                /* Indicate that the search has failed prematurely and should be aborted */\r
-               return Descriptor_Search_Fail;\r
+               return DESCRIPTOR_SEARCH_Fail;\r
        }\r
 \r
        /* Current descriptor does not match what this comparator is looking for */\r
-       return Descriptor_Search_NotFound;\r
+       return DESCRIPTOR_SEARCH_NotFound;\r
 }\r
index 1735401..7cbf948 100644 (file)
@@ -117,9 +117,9 @@ DESCRIPTOR_COMPARATOR(NextKeyboardInterface)
        {\r
                /* Check the HID descriptor class and protocol, break out if correct class/protocol interface found */\r
                if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class    == KEYBOARD_CLASS) &&\r
-                   (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == KEYBOARD_PROTOCOL))\r
+                   (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Subclass == KEYBOARD_SUBCLASS))\r
                {\r
-                       return Descriptor_Search_Found;\r
+                       return DESCRIPTOR_SEARCH_Found;\r
                }\r
        }\r
        \r
@@ -140,12 +140,12 @@ DESCRIPTOR_COMPARATOR(NextInterfaceKeyboardDataEndpoint)
        if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)\r
        {\r
                if (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Endpoint_t).EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)\r
-                 return Descriptor_Search_Found;\r
+                 return DESCRIPTOR_SEARCH_Found;\r
        }\r
        else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)\r
        {\r
-               return Descriptor_Search_Fail;\r
+               return DESCRIPTOR_SEARCH_Fail;\r
        }\r
 \r
-       return Descriptor_Search_NotFound;\r
+       return DESCRIPTOR_SEARCH_NotFound;\r
 }\r
index 73f0ce2..9b56823 100644 (file)
@@ -123,11 +123,11 @@ DESCRIPTOR_COMPARATOR(NextKeyboardInterface)
                if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class    == KEYBOARD_CLASS) &&\r
                    (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == KEYBOARD_PROTOCOL))\r
                {\r
-                       return Descriptor_Search_Found;\r
+                       return DESCRIPTOR_SEARCH_Found;\r
                }\r
        }\r
        \r
-       return Descriptor_Search_NotFound;\r
+       return DESCRIPTOR_SEARCH_NotFound;\r
 }\r
 \r
 /** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's\r
@@ -144,14 +144,14 @@ DESCRIPTOR_COMPARATOR(NextInterfaceKeyboardDataEndpoint)
        if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)\r
        {\r
                if (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Endpoint_t).EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)\r
-                 return Descriptor_Search_Found;\r
+                 return DESCRIPTOR_SEARCH_Found;\r
        }\r
        else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)\r
        {\r
-               return Descriptor_Search_Fail;\r
+               return DESCRIPTOR_SEARCH_Fail;\r
        }\r
 \r
-       return Descriptor_Search_NotFound;\r
+       return DESCRIPTOR_SEARCH_NotFound;\r
 }\r
 \r
 /** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's\r
@@ -165,7 +165,7 @@ DESCRIPTOR_COMPARATOR(NextInterfaceKeyboardDataEndpoint)
 DESCRIPTOR_COMPARATOR(NextHID)\r
 {\r
        if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_HID)\r
-         return Descriptor_Search_Found;\r
+         return DESCRIPTOR_SEARCH_Found;\r
        else\r
-         return Descriptor_Search_NotFound;      \r
+         return DESCRIPTOR_SEARCH_NotFound;      \r
 }\r
index d177a88..b985a45 100644 (file)
@@ -64,7 +64,7 @@ uint8_t GetHIDReportData(void)
          return ParseControlError;\r
 \r
        /* Send the HID report to the parser for processing */\r
-       if (ProcessHIDReport(HIDReportData, HIDReportSize, &HIDReportInfo) != HID_PARSE_Successful)\r
+       if (USB_ProcessHIDReport(HIDReportData, HIDReportSize, &HIDReportInfo) != HID_PARSE_Successful)\r
          return ParseError;\r
        \r
        return ParseSuccessful;\r
index d7d5f94..ff4ae75 100644 (file)
@@ -310,7 +310,7 @@ void ProcessKeyboardReport(uint8_t* KeyboardReport)
                        (ReportItem->ItemType                   == REPORT_ITEM_TYPE_In))\r
                {\r
                        /* Retrieve the keyboard scancode from the report data retrieved from the device */\r
-                       bool FoundData = GetReportItemInfo(KeyboardReport, ReportItem);\r
+                       bool FoundData = USB_GetHIDReportItemInfo(KeyboardReport, ReportItem);\r
                        \r
                        /* For multi-report devices - if the requested data was not in the issued report, continue */\r
                        if (!(FoundData))\r
index 1540590..6642e1c 100644 (file)
@@ -137,11 +137,11 @@ DESCRIPTOR_COMPARATOR(NextMassStorageInterface)
                    (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).SubClass == MASS_STORE_SUBCLASS) &&\r
                    (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == MASS_STORE_PROTOCOL))\r
                {\r
-                       return Descriptor_Search_Found;\r
+                       return DESCRIPTOR_SEARCH_Found;\r
                }\r
        }\r
        \r
-       return Descriptor_Search_NotFound;\r
+       return DESCRIPTOR_SEARCH_NotFound;\r
 }\r
 \r
 /** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's\r
@@ -162,12 +162,12 @@ DESCRIPTOR_COMPARATOR(NextInterfaceBulkDataEndpoint)
 \r
                /* Check the endpoint type, break out if correct BULK type endpoint found */\r
                if (EndpointType == EP_TYPE_BULK)\r
-                 return Descriptor_Search_Found;\r
+                 return DESCRIPTOR_SEARCH_Found;\r
        }\r
        else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)\r
        {\r
-               return Descriptor_Search_Fail;\r
+               return DESCRIPTOR_SEARCH_Fail;\r
        }\r
 \r
-       return Descriptor_Search_NotFound;\r
+       return DESCRIPTOR_SEARCH_NotFound;\r
 }\r
index 2c842ac..ef53e7c 100644 (file)
@@ -69,15 +69,15 @@ uint8_t ProcessConfigurationDescriptor(void)
          return InvalidConfigDataReturned;\r
        \r
        /* Get the mouse interface from the configuration descriptor */\r
-       if (USB_Host_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, NextMouseInterface))\r
+       if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, NextMouseInterface))\r
        {\r
                /* Descriptor not found, error out */\r
                return NoHIDInterfaceFound;\r
        }\r
 \r
        /* Get the mouse interface's data endpoint descriptor */\r
-       if (USB_Host_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,\r
-                                                       NextInterfaceMouseDataEndpoint))\r
+       if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,\r
+                                     NextInterfaceMouseDataEndpoint))\r
        {\r
                /* Descriptor not found, error out */\r
                return NoEndpointFound;\r
@@ -121,12 +121,12 @@ DESCRIPTOR_COMPARATOR(NextMouseInterface)
                    (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == MOUSE_PROTOCOL))\r
                {\r
                        /* Indicate that the descriptor being searched for has been found */\r
-                       return Descriptor_Search_Found;\r
+                       return DESCRIPTOR_SEARCH_Found;\r
                }\r
        }\r
        \r
        /* Current descriptor does not match what this comparator is looking for */\r
-       return Descriptor_Search_NotFound;\r
+       return DESCRIPTOR_SEARCH_NotFound;\r
 }\r
 \r
 /** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's\r
@@ -147,15 +147,15 @@ DESCRIPTOR_COMPARATOR(NextInterfaceMouseDataEndpoint)
                if (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Endpoint_t).EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)\r
                {\r
                        /* Indicate that the descriptor being searched for has been found */\r
-                       return Descriptor_Search_Found;\r
+                       return DESCRIPTOR_SEARCH_Found;\r
                }\r
        }\r
        else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)\r
        {\r
                /* Indicate that the search has failed prematurely and should be aborted */\r
-               return Descriptor_Search_Fail;\r
+               return DESCRIPTOR_SEARCH_Fail;\r
        }\r
 \r
        /* Current descriptor does not match what this comparator is looking for */\r
-       return Descriptor_Search_NotFound;\r
+       return DESCRIPTOR_SEARCH_NotFound;\r
 }\r
index 9f0c444..486a0c7 100644 (file)
@@ -123,11 +123,11 @@ DESCRIPTOR_COMPARATOR(NextMouseInterface)
                if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class    == MOUSE_CLASS) &&\r
                    (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == MOUSE_PROTOCOL))\r
                {\r
-                       return Descriptor_Search_Found;\r
+                       return DESCRIPTOR_SEARCH_Found;\r
                }\r
        }\r
        \r
-       return Descriptor_Search_NotFound;\r
+       return DESCRIPTOR_SEARCH_NotFound;\r
 }\r
 \r
 /** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's\r
@@ -144,14 +144,14 @@ DESCRIPTOR_COMPARATOR(NextInterfaceMouseDataEndpoint)
        if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)\r
        {\r
                if (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Endpoint_t).EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)\r
-                 return Descriptor_Search_Found;\r
+                 return DESCRIPTOR_SEARCH_Found;\r
        }\r
        else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)\r
        {\r
-               return Descriptor_Search_Fail;\r
+               return DESCRIPTOR_SEARCH_Fail;\r
        }\r
 \r
-       return Descriptor_Search_NotFound;\r
+       return DESCRIPTOR_SEARCH_NotFound;\r
 }\r
 \r
 /** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's\r
@@ -165,7 +165,7 @@ DESCRIPTOR_COMPARATOR(NextInterfaceMouseDataEndpoint)
 DESCRIPTOR_COMPARATOR(NextHID)\r
 {\r
        if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_HID)\r
-         return Descriptor_Search_Found;\r
+         return DESCRIPTOR_SEARCH_Found;\r
        else\r
-         return Descriptor_Search_NotFound;      \r
+         return DESCRIPTOR_SEARCH_NotFound;      \r
 }\r
index 3d06bb1..176f18c 100644 (file)
@@ -64,7 +64,7 @@ uint8_t GetHIDReportData(void)
          return ParseControlError;\r
 \r
        /* Send the HID report to the parser for processing */\r
-       if (ProcessHIDReport(HIDReportData, HIDReportSize, &HIDReportInfo) != HID_PARSE_Successful)\r
+       if (USB_ProcessHIDReport(HIDReportData, HIDReportSize, &HIDReportInfo) != HID_PARSE_Successful)\r
          return ParseError;\r
        \r
        return ParseSuccessful;\r
index f5ad40b..a4fc76f 100644 (file)
@@ -37,7 +37,7 @@
 #define _HID_REPORT_H_\r
 \r
        /* Includes: */\r
-               #include <LUFA/Drivers/USB/USB.h>            // HID Class Report Parser\r
+               #include <LUFA/Drivers/USB/USB.h>            // USB Functionality\r
                \r
                #include "MouseHostWithParser.h"\r
 \r
index 259da2a..44c68ee 100644 (file)
@@ -312,7 +312,7 @@ void ProcessMouseReport(uint8_t* MouseReport)
                        (ReportItem->ItemType                    == REPORT_ITEM_TYPE_In))\r
                {\r
                        /* Get the mouse button value */\r
-                       FoundData = GetReportItemInfo(MouseReport, ReportItem);\r
+                       FoundData = USB_GetHIDReportItemInfo(MouseReport, ReportItem);\r
                        \r
                        /* For multi-report devices - if the requested data was not in the issued report, continue */\r
                        if (!(FoundData))\r
@@ -328,7 +328,7 @@ void ProcessMouseReport(uint8_t* MouseReport)
                                 (ReportItem->ItemType                == REPORT_ITEM_TYPE_In))\r
                {\r
                        /* Get the mouse relative position value */\r
-                       FoundData = GetReportItemInfo(MouseReport, ReportItem);\r
+                       FoundData = USB_GetHIDReportItemInfo(MouseReport, ReportItem);\r
                        \r
                        /* For multi-report devices - if the requested data was not in the issued report, continue */\r
                        if (!(FoundData))\r
index 2456e35..5e2916b 100644 (file)
@@ -156,11 +156,11 @@ DESCRIPTOR_COMPARATOR(NextStillImageInterface)
                    (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).SubClass == SIMAGE_SUBCLASS) &&\r
                    (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == SIMAGE_PROTOCOL))\r
                {\r
-                       return Descriptor_Search_Found;\r
+                       return DESCRIPTOR_SEARCH_Found;\r
                }\r
        }\r
        \r
-       return Descriptor_Search_NotFound;\r
+       return DESCRIPTOR_SEARCH_NotFound;\r
 }\r
 \r
 /** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's\r
@@ -180,12 +180,12 @@ DESCRIPTOR_COMPARATOR(NextSImageInterfaceDataEndpoint)
                                                        USB_Descriptor_Endpoint_t).Attributes & EP_TYPE_MASK);\r
        \r
                if ((EndpointType == EP_TYPE_BULK) || (EndpointType == EP_TYPE_INTERRUPT))\r
-                 return Descriptor_Search_Found;\r
+                 return DESCRIPTOR_SEARCH_Found;\r
        }\r
        else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)\r
        {\r
-               return Descriptor_Search_Fail;\r
+               return DESCRIPTOR_SEARCH_Fail;\r
        }\r
 \r
-       return Descriptor_Search_NotFound;\r
+       return DESCRIPTOR_SEARCH_NotFound;\r
 }\r
index 7e23243..16862ca 100644 (file)
@@ -52,6 +52,9 @@
   *  - Removed "Host_" section of the function names in ConfigDescriptor.h, as most of the routines can now be used in device mode on the\r
   *    device descriptor\r
   *  - Renamed functions in the HID parser to have a "USB_" prefix and the acronym "HID" in the name\r
+  *  - Fixed incorrect HID interface class and subclass values in the Mouse and KeyboardMouse demos (thanks to Brian Dickman)\r
+  *  - Capitolised the "Descriptor_Search" and "Descriptor_Search_Comp" prefixes of the values in the DSearch_Return_ErrorCodes_t and\r
+  *    DSearch_Comp_Return_ErrorCodes_t enums\r
   *    \r
   *\r
   *  \section Sec_ChangeLog090401 Version 090401\r
index 744828d..4b7f205 100644 (file)
@@ -66,7 +66,7 @@
                #if !defined(__DOXYGEN__)\r
                        static inline void HWB_Init(void)\r
                        {\r
-                               // TODO: Initialize the appropriate port pin as an input here, with pullup\r
+                               // TODO: Initialize the appropriate port pin as an input here, with pull-up\r
                        }\r
 \r
                        static inline bool HWB_GetStatus(void) ATTR_WARN_UNUSED_RESULT;\r
index 9f5d075..01ee889 100644 (file)
@@ -75,7 +75,7 @@
                #endif\r
 \r
        /* Public Interface - May be used in end-application: */\r
-               /* Psuedo-Function Macros: */\r
+               /* Pseudo-Function Macros: */\r
                        #if defined(__DOXYGEN__)\r
                                /** Determines the currently selected dataflash chip.\r
                                 *\r
index f21ed40..56e5790 100644 (file)
@@ -82,7 +82,7 @@
                        /** Maximum returnable temperature from the Temperature_GetTemperature() function. */\r
                        #define TEMP_MAX_TEMP      ((TEMP_TABLE_SIZE - 1) + TEMP_TABLE_OFFSET)\r
                \r
-               /* Psuedo-Functions: */\r
+               /* Pseudo-Function Macros: */\r
                        #if defined(__DOXYGEN__)\r
                                /** Initializes the temperature sensor driver, including setting up the appropriate ADC channel.\r
                                 *  This must be called before any other temperature sensor routines.\r
index a5bf037..494c1e4 100644 (file)
                #endif\r
 \r
        /* Public Interface - May be used in end-application: */\r
-               /* Macros: */\r
-                       /** Initializes the ADC, ready for conversions. This must be called before any other ADC operations.\r
-                        *  The "mode" parameter should be a mask comprised of a conversion mode (free running or single) and\r
-                        *  prescaler masks.\r
-                        */\r
-                       #define  ADC_Init(mode)          MACROS{ ADCSRA = ((1 << ADEN) | mode);         }MACROE\r
-\r
-                       /** Turns off the ADC. If this is called, any further ADC operations will require a call to the\r
-                        *  ADC_Init() macro before the ADC can be used again.\r
-                        */\r
-                       #define  ADC_Off()               MACROS{ ADCSRA = 0;                            }MACROE\r
-                       \r
-                       /** Indicates if the ADC is enabled. This macro will return boolean true if the ADC subsystem is\r
-                        *  currently enabled, or false otherwise.\r
-                        */\r
-                       #define  ADC_GetStatus()               ((ADCSRA & (1 << ADEN)) ? true : false)\r
-\r
-                       /** Indicates if the current ADC conversion is completed, or still in progress. This returns boolean\r
-                        *  false if the reading is still taking place, or true if the conversion is complete and ready to be\r
-                        *  read out with ADC_GetResult().\r
-                        */\r
-                       #define  ADC_IsReadingComplete()         (!(ADCSRA & (1 << ADSC)))\r
-                       \r
-                       /** Returns the result of the last conversion, as a 16-bit wide integer. */\r
-                       #define  ADC_GetResult()                 ADC\r
-                       \r
+               /* Macros: */                   \r
                        /** Reference mask, for using the voltage present at the AVR's AREF pin for the ADC reference. */\r
                        #define  ADC_REFERENCE_AREF              0\r
 \r
                        /** Sets the ADC input clock to prescale by a factor of 128 the AVR's system clock. */\r
                        #define  ADC_PRESCALE_128                ((1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0))\r
 \r
+               /* Pseudo-Function Macros: */\r
+                       #if defined(__DOXYGEN__)\r
+                               /** Initializes the ADC, ready for conversions. This must be called before any other ADC operations.\r
+                                *  The "mode" parameter should be a mask comprised of a conversion mode (free running or single) and\r
+                                *  prescaler masks.\r
+                                *\r
+                                *  \param Mode  Mask of ADC settings, including adjustment, prescale, mode and reference\r
+                                */\r
+                               static inline void ADC_Init(uint8_t Mode);\r
+                               \r
+                               /** Turns off the ADC. If this is called, any further ADC operations will require a call to\r
+                                *  ADC_Init() before the ADC can be used again.\r
+                                */\r
+                               static inline void ADC_Off(void);\r
+                               \r
+                               /** Indicates if the ADC is currently enabled.\r
+                                *\r
+                                *  \return Boolean true if the ADC subsystem is currently enabled, false otherwise.\r
+                                */\r
+                               static inline bool ADC_GetStatus(void);\r
+                               \r
+                               /** Indicates if the current ADC conversion is completed, or still in progress.\r
+                                *\r
+                                *  \return Boolean false if the reading is still taking place, or true if the conversion is\r
+                                *          complete and ready to be read out with ADC_GetResult()\r
+                                */\r
+                               static inline bool ADC_IsReadingComplete(void);\r
+                               \r
+                               /** Retrieves the conversion value of the last completed ADC conversion.\r
+                                *\r
+                                *  \return The result of the last ADC conversion\r
+                                */\r
+                               static inline uint16_t ADC_GetResult(void);\r
+                       #else\r
+                               #define  ADC_Init(mode)          MACROS{ ADCSRA = ((1 << ADEN) | mode);         }MACROE\r
+\r
+                               #define  ADC_Off()               MACROS{ ADCSRA = 0;                            }MACROE\r
+                               \r
+                               #define  ADC_GetStatus()               ((ADCSRA & (1 << ADEN)) ? true : false)\r
+\r
+                               #define  ADC_IsReadingComplete()         (!(ADCSRA & (1 << ADSC)))\r
+                               \r
+                               #define  ADC_GetResult()                 ADC                    \r
+                       #endif\r
+                       \r
                /* Inline Functions: */\r
                        /** Configures the given ADC channel, ready for ADC conversions. This function sets the\r
                         *  associated port pin as an input and disables the digital portion of the I/O to reduce\r
index 65b40a5..a50456b 100644 (file)
@@ -74,7 +74,7 @@
                         */\r
                        #define SERIAL_2X_UBBRVAL(baud) (((F_CPU / 8) / baud) - 1)\r
 \r
-               /* Psuedo-Functions: */\r
+               /* Pseudo-Function Macros: */\r
                        #if defined(__DOXYGEN__)\r
                                /** Indicates whether a character has been received through the USART.\r
                                 *\r
index 61a5c44..c9f8c3c 100644 (file)
@@ -125,9 +125,9 @@ uint8_t USB_GetNextDescriptorComp_P(uint16_t* BytesRem, uint8_t** CurrConfigLoc,
 \r
                USB_GetNextDescriptor(BytesRem, CurrConfigLoc);\r
 \r
-               if ((ErrorCode = ComparatorRoutine(*CurrConfigLoc)) != Descriptor_Search_NotFound)\r
+               if ((ErrorCode = ComparatorRoutine(*CurrConfigLoc)) != DESCRIPTOR_SEARCH_NotFound)\r
                {\r
-                       if (ErrorCode == Descriptor_Search_Fail)\r
+                       if (ErrorCode == DESCRIPTOR_SEARCH_Fail)\r
                        {\r
                                *CurrConfigLoc = PrevDescLoc;\r
                                *BytesRem      = PrevBytesRem;\r
@@ -137,5 +137,5 @@ uint8_t USB_GetNextDescriptorComp_P(uint16_t* BytesRem, uint8_t** CurrConfigLoc,
                }\r
        }\r
        \r
-       return Descriptor_Search_Comp_EndOfDescriptor;\r
+       return DESCRIPTOR_SEARCH_COMP_EndOfDescriptor;\r
 }\r
index 7a1d531..362a43e 100644 (file)
                         */\r
                        #define DESCRIPTOR_COMPARATOR(name)           uint8_t DCOMP_##name (void* const CurrentDescriptor)\r
 \r
-               /* Psuedo-Functions: */\r
+               /* Pseudo-Function Macros: */\r
                        #if defined(__DOXYGEN__)\r
                                /** Searches for the next descriptor in the given configuration descriptor using a premade comparator\r
                                 *  function. The routine updates the position and remaining configuration descriptor bytes values\r
                                 *  DESCRIPTOR_COMPARATOR(EndpointSearcher)\r
                                 *  {\r
                                 *     if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)\r
-                                *         return Descriptor_Search_Found;\r
+                                *         return DESCRIPTOR_SEARCH_Found;\r
                                 *     else\r
-                                *         return Descriptor_Search_NotFound;\r
+                                *         return DESCRIPTOR_SEARCH_NotFound;\r
                                 *  }\r
                                 *\r
                                 *  //...\r
                        /** Enum for return values of a descriptor comparator made with DESCRIPTOR_COMPARATOR. */\r
                        enum DSearch_Return_ErrorCodes_t\r
                        {\r
-                               Descriptor_Search_Found                = 0, /**< Current descriptor matches comparator criteria. */\r
-                               Descriptor_Search_Fail                 = 1, /**< No further descriptor could possibly match criteria, fail the search. */\r
-                               Descriptor_Search_NotFound             = 2, /**< Current descriptor does not match comparator criteria. */\r
+                               DESCRIPTOR_SEARCH_Found                = 0, /**< Current descriptor matches comparator criteria. */\r
+                               DESCRIPTOR_SEARCH_Fail                 = 1, /**< No further descriptor could possibly match criteria, fail the search. */\r
+                               DESCRIPTOR_SEARCH_NotFound             = 2, /**< Current descriptor does not match comparator criteria. */\r
                        };\r
 \r
                        /** Enum for return values of USB_GetNextDescriptorComp(). */\r
                        enum DSearch_Comp_Return_ErrorCodes_t\r
                        {\r
-                               Descriptor_Search_Comp_Found           = 0, /**< Configuration descriptor now points to descriptor which matches\r
+                               DESCRIPTOR_SEARCH_COMP_Found           = 0, /**< Configuration descriptor now points to descriptor which matches\r
                                                                             *   search criteria of the given comparator function. */\r
-                               Descriptor_Search_Comp_Fail            = 1, /**< Comparator function returned Descriptor_Search_Fail. */\r
-                               Descriptor_Search_Comp_EndOfDescriptor = 2, /**< End of configuration descriptor reached before match found. */\r
+                               DESCRIPTOR_SEARCH_COMP_Fail            = 1, /**< Comparator function returned Descriptor_Search_Fail. */\r
+                               DESCRIPTOR_SEARCH_COMP_EndOfDescriptor = 2, /**< End of configuration descriptor reached before match found. */\r
                        };\r
        \r
                /* Function Prototypes: */\r
index 35b280b..5fb29aa 100644 (file)
@@ -30,7 +30,7 @@
 \r
 #include "HIDParser.h"\r
 \r
-uint8_t ProcessHIDReport(const uint8_t* ReportData, uint16_t ReportSize, HID_ReportInfo_t* const ParserData)\r
+uint8_t USB_ProcessHIDReport(const uint8_t* ReportData, uint16_t ReportSize, HID_ReportInfo_t* const ParserData)\r
 {\r
        HID_StateTable_t  StateTable[HID_STATETABLE_STACK_DEPTH];\r
        HID_StateTable_t* CurrStateTable               = &StateTable[0];\r
@@ -275,7 +275,7 @@ uint8_t ProcessHIDReport(const uint8_t* ReportData, uint16_t ReportSize, HID_Rep
        return HID_PARSE_Successful;\r
 }\r
 \r
-bool GetReportItemInfo(const uint8_t* ReportData, HID_ReportItem_t* const ReportItem)\r
+bool USB_GetHIDReportItemInfo(const uint8_t* ReportData, HID_ReportItem_t* const ReportItem)\r
 {\r
        uint16_t DataBitsRem  = ReportItem->Attributes.BitSize;\r
        uint16_t CurrentBit   = ReportItem->BitOffset;\r
@@ -303,7 +303,7 @@ bool GetReportItemInfo(const uint8_t* ReportData, HID_ReportItem_t* const Report
        return true;\r
 }\r
 \r
-void SetReportItemInfo(uint8_t* ReportData, const HID_ReportItem_t* ReportItem)\r
+void USB_SetHIDReportItemInfo(uint8_t* ReportData, const HID_ReportItem_t* ReportItem)\r
 {\r
        uint16_t DataBitsRem  = ReportItem->Attributes.BitSize;\r
        uint16_t CurrentBit   = ReportItem->BitOffset;\r
index 26f1503..5f0b737 100644 (file)
@@ -31,9 +31,8 @@
 /** \ingroup Group_USB\r
  *  @defgroup Group_StreamCallbacks Endpoint and Pipe Stream Callbacks\r
  *\r
- *  Macros and enums for the stream callback routines in Endpoint.h and Pipe.c. This module contains the\r
- *  code required to easily set up stream callback functions which can be used to force early abort of a\r
- *  stream read/write process.\r
+ *  Macros and enums for the stream callback routines. This module contains the code required to easily set up\r
+ *  stream callback functions which can be used to force early abort of a stream read/write process.\r
  *\r
  *  @{\r
  */\r
index 6378722..833fd9e 100644 (file)
@@ -86,7 +86,7 @@
                        /** Indicates if the USB interface is currently suspended by the host when in device mode. When suspended,\r
                         *  the device should consume minimal power, and cannot communicate to the host. If Remote Wakeup is\r
                         *  supported by the device and USB_RemoteWakeupEnabled is true, suspension can be terminated by the device\r
-                        *  by issuing a Remote Wakup request.\r
+                        *  by issuing a Remote Wakeup request.\r
                         *\r
                         *  \note This global is only present if the user application can be a USB device.\r
                         *\r
index 3c2bb36..206a993 100644 (file)
@@ -67,7 +67,7 @@
                         */\r
                        #define USB_DEVICE_OPT_FULLSPEED               (0 << 0)\r
                        \r
-               /* Psuedo-Function Macros: */\r
+               /* Pseudo-Function Macros: */\r
                        #if defined(__DOXYGEN__)\r
                                /** Sends a Remote Wakeup request to the host. This signals to the host that the device should\r
                                 *  be taken out of suspended mode, and communications should resume.\r
index 651c0e8..90375b0 100644 (file)
                         */\r
                        #define ENDPOINT_INT_OUT                      UEIENX, (1 << RXOUTE), UEINTX, (1 << RXOUTI)\r
                        \r
-               /* Psuedo-Function Macros: */\r
+               /* Pseudo-Function Macros: */\r
                        #if defined(__DOXYGEN__)\r
                                /** Indicates the number of bytes currently stored in the current endpoint's selected bank.\r
                                 *\r
index 82cceb2..62921e8 100644 (file)
@@ -85,7 +85,7 @@
                                #define HOST_DEVICE_SETTLE_DELAY_MS        1500\r
                        #endif\r
                \r
-               /* Psuedo-Function Macros: */\r
+               /* Pseudo-Function Macros: */\r
                        #if defined(__DOXYGEN__)\r
                                /** Resets the USB bus, including the endpoints in any attached device and pipes on the AVR host.\r
                                 *  USB bus resets leave the default control pipe configured (if already configured).\r
index da303c9..1f59e0c 100644 (file)
@@ -61,7 +61,7 @@
                         */                      \r
                        #define USB_OTG_STP_DATA                   0\r
 \r
-               /* Psuedo-Function Macros: */\r
+               /* Pseudo-Function Macros: */\r
                        #if defined(__DOXYGEN__)\r
                                /** Initiate a Host Negotiation Protocol request. This indicates to the other connected device\r
                                 *  that the device wishes to change device/host roles.\r
index 15be81e..4e2ffec 100644 (file)
                         */\r
                        #define PIPE_INT_STALL                 UPIENX, (1 << RXSTALLE), UPINTX, (1 << RXSTALLI)\r
 \r
-               /* Psuedo-Function Macros: */\r
+               /* Pseudo-Function Macros: */\r
                        #if defined(__DOXYGEN__)\r
                                /** Indicates the number of bytes currently stored in the current pipes's selected bank.\r
                                 *\r
                                 *\r
                                 *  \see Pipe_GetErrorFlags() macro for information on retrieving the exact error flag.\r
                                 *\r
-                                *  \return Boolean true if an error has ocurred on the selected pipe, false otherwise\r
+                                *  \return Boolean true if an error has occurred on the selected pipe, false otherwise\r
                                 */\r
                                static inline bool Pipe_IsError(void);\r
                                \r
                                /** Gets a mask of the hardware error flags which have occurred on the currently selected pipe. This\r
                                 *  value can then be masked against the PIPE_ERRORFLAG_* masks to determine what error has occurred.\r
                                 *\r
-                                *  \return  Mask comprising of PIPE_ERRORFLAG_* bits indicating what error has ocurred on the selected pipe\r
+                                *  \return  Mask comprising of PIPE_ERRORFLAG_* bits indicating what error has occurred on the selected pipe\r
                                 */\r
                                static inline uint8_t Pipe_GetErrorFlags(void);\r
                                \r
index f7e9860..dcdbdc2 100644 (file)
@@ -28,7 +28,7 @@
  *      on the new endpoint management macros.\r
  *    - The Endpoint_ReadWriteAllowed() macro has been renamed to Endpoint_IsReadWriteAllowed() to be more consistent with the rest of\r
  *      the API naming scheme.\r
- *    - The Endpoint_IsSetupINReady() and Endpoint_IsOutReceived() macros have been renamed to Endpoint_IsINReady() and\r
+ *    - The Endpoint_IsSetupINReady() and Endpoint_IsSetupOutReceived() macros have been renamed to Endpoint_IsINReady() and\r
  *      Endpoint_IsOUTReceived() respectively.\r
  *    - The Endpoint_IsSetupReceived() macro has been renamed to Endpoint_IsSETUPReceived().\r
  *    - The Endpoint_ClearSetupReceived() macro has been renamed to Endpoint_ClearControlSETUP().\r
@@ -60,7 +60,8 @@
  *    - Functions in the ConfigDescriptor.h header file no longer have "Host_" as part of their names.\r
  *    - The ProcessHIDReport() has been renamed to USB_ProcessHIDReport(), GetReportItemInfo() has been renamed to USB_GetHIDReportItemInfo()\r
  *      and SetReportItemInfo() has been renamed to USB_GetHIDReportItemInfo().\r
- *\r
+ *    - The values of the DSearch_Return_ErrorCodes_t and DSearch_Comp_Return_ErrorCodes_t enums have had their respective "Descriptor_Search"\r
+ *      and "Descriptor_Search_Comp" prefixes changed to all caps.\r
  *\r
  * \section Sec_Migration090401 Migrating from 090209 to 090401\r
  *\r
index 38e9736..1ef477c 100644 (file)
                        /** Task status mode constant, for passing to Scheduler_SetTaskMode() or Scheduler_SetGroupTaskMode(). */\r
                        #define TASK_STOP                         false\r
                        \r
-               /* Psuedo-Functions: */\r
+               /* Pseudo-Function Macros: */\r
                        #if defined(__DOXYGEN__)\r
                                /** Starts the scheduler in its infinite loop, executing running tasks. This should be placed at the end\r
                                 *  of the user application's main() function, as it can never return to the calling function.\r