diff --git a/Demos/Device/KeyboardMouse/Descriptors.c b/Demos/Device/KeyboardMouse/Descriptors.c index 7f39c6b59c71cab245aa2ef1791289db9a8bb918..39c1d4a2eab6147db21681f4e8452633550c57d9 100644 --- a/Demos/Device/KeyboardMouse/Descriptors.c +++ b/Demos/Device/KeyboardMouse/Descriptors.c @@ -173,7 +173,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = Class: 0x03, SubClass: 0x01, - Protocol: 0x00, + Protocol: 0x01, InterfaceStrIndex: NO_DESCRIPTOR }, @@ -219,8 +219,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = TotalEndpoints: 1, Class: 0x03, - SubClass: 0x02, - Protocol: 0x00, + SubClass: 0x01, + Protocol: 0x02, InterfaceStrIndex: NO_DESCRIPTOR }, diff --git a/Demos/Device/Mouse/Descriptors.c b/Demos/Device/Mouse/Descriptors.c index 9ad39f4d47b60e365293ea2d9b0f64f213146727..a93d512416f9c69abbbd66cb7399483e956a35a7 100644 --- a/Demos/Device/Mouse/Descriptors.c +++ b/Demos/Device/Mouse/Descriptors.c @@ -132,8 +132,8 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = TotalEndpoints: 1, Class: 0x03, - SubClass: 0x02, - Protocol: 0x01, + SubClass: 0x01, + Protocol: 0x02, InterfaceStrIndex: NO_DESCRIPTOR }, diff --git a/Demos/Host/CDCHost/ConfigDescriptor.c b/Demos/Host/CDCHost/ConfigDescriptor.c index 972d3e68cc2e895053a362dec9146b5ac9d125c1..9a23fc3fa1d0fbf7b0d01f6189abb1a06563c1f1 100644 --- a/Demos/Host/CDCHost/ConfigDescriptor.c +++ b/Demos/Host/CDCHost/ConfigDescriptor.c @@ -181,11 +181,11 @@ DESCRIPTOR_COMPARATOR(NextCDCControlInterface) (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).SubClass == CDC_CONTROL_SUBCLASS) && (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == CDC_CONTROL_PROTOCOL)) { - return Descriptor_Search_Found; + return DESCRIPTOR_SEARCH_Found; } } - return Descriptor_Search_NotFound; + return DESCRIPTOR_SEARCH_NotFound; } /** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's @@ -205,11 +205,11 @@ DESCRIPTOR_COMPARATOR(NextCDCDataInterface) (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).SubClass == CDC_DATA_SUBCLASS) && (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == CDC_DATA_PROTOCOL)) { - return Descriptor_Search_Found; + return DESCRIPTOR_SEARCH_Found; } } - return Descriptor_Search_NotFound; + return DESCRIPTOR_SEARCH_NotFound; } /** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's @@ -230,12 +230,12 @@ DESCRIPTOR_COMPARATOR(NextInterfaceCDCDataEndpoint) USB_Descriptor_Endpoint_t).Attributes & EP_TYPE_MASK); if ((EndpointType == EP_TYPE_BULK) || (EndpointType == EP_TYPE_INTERRUPT)) - return Descriptor_Search_Found; + return DESCRIPTOR_SEARCH_Found; } else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface) { - return Descriptor_Search_Fail; + return DESCRIPTOR_SEARCH_Fail; } - return Descriptor_Search_NotFound; + return DESCRIPTOR_SEARCH_NotFound; } diff --git a/Demos/Host/GenericHIDHost/ConfigDescriptor.c b/Demos/Host/GenericHIDHost/ConfigDescriptor.c index caf88ef0517ba18dce588c8992b6036ba0b5d102..7dc7d3e8773e1fbaf0ffe8fd415d1827e9bf36e5 100644 --- a/Demos/Host/GenericHIDHost/ConfigDescriptor.c +++ b/Demos/Host/GenericHIDHost/ConfigDescriptor.c @@ -143,12 +143,12 @@ DESCRIPTOR_COMPARATOR(NextHIDInterface) if (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == HID_CLASS) { /* Indicate that the descriptor being searched for has been found */ - return Descriptor_Search_Found; + return DESCRIPTOR_SEARCH_Found; } } /* Current descriptor does not match what this comparator is looking for */ - return Descriptor_Search_NotFound; + return DESCRIPTOR_SEARCH_NotFound; } /** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's @@ -166,14 +166,14 @@ DESCRIPTOR_COMPARATOR(NextInterfaceHIDDataEndpoint) if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint) { /* Indicate that the descriptor being searched for has been found */ - return Descriptor_Search_Found; + return DESCRIPTOR_SEARCH_Found; } else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface) { /* Indicate that the search has failed prematurely and should be aborted */ - return Descriptor_Search_Fail; + return DESCRIPTOR_SEARCH_Fail; } /* Current descriptor does not match what this comparator is looking for */ - return Descriptor_Search_NotFound; + return DESCRIPTOR_SEARCH_NotFound; } diff --git a/Demos/Host/KeyboardHost/ConfigDescriptor.c b/Demos/Host/KeyboardHost/ConfigDescriptor.c index 1735401cf19f2a10b7f403b2f4076eb57dd7f53c..7cbf9484babb7f9d1f2f15816bffbdd33cfc650e 100644 --- a/Demos/Host/KeyboardHost/ConfigDescriptor.c +++ b/Demos/Host/KeyboardHost/ConfigDescriptor.c @@ -117,9 +117,9 @@ DESCRIPTOR_COMPARATOR(NextKeyboardInterface) { /* Check the HID descriptor class and protocol, break out if correct class/protocol interface found */ if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == KEYBOARD_CLASS) && - (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == KEYBOARD_PROTOCOL)) + (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Subclass == KEYBOARD_SUBCLASS)) { - return Descriptor_Search_Found; + return DESCRIPTOR_SEARCH_Found; } } @@ -140,12 +140,12 @@ DESCRIPTOR_COMPARATOR(NextInterfaceKeyboardDataEndpoint) if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint) { if (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Endpoint_t).EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN) - return Descriptor_Search_Found; + return DESCRIPTOR_SEARCH_Found; } else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface) { - return Descriptor_Search_Fail; + return DESCRIPTOR_SEARCH_Fail; } - return Descriptor_Search_NotFound; + return DESCRIPTOR_SEARCH_NotFound; } diff --git a/Demos/Host/KeyboardHostWithParser/ConfigDescriptor.c b/Demos/Host/KeyboardHostWithParser/ConfigDescriptor.c index 73f0ce216550fedfa1e930e5f02c9b3dd1876f33..9b56823eff0d84d3285c445c19471ebd1f1023c6 100644 --- a/Demos/Host/KeyboardHostWithParser/ConfigDescriptor.c +++ b/Demos/Host/KeyboardHostWithParser/ConfigDescriptor.c @@ -123,11 +123,11 @@ DESCRIPTOR_COMPARATOR(NextKeyboardInterface) if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == KEYBOARD_CLASS) && (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == KEYBOARD_PROTOCOL)) { - return Descriptor_Search_Found; + return DESCRIPTOR_SEARCH_Found; } } - return Descriptor_Search_NotFound; + return DESCRIPTOR_SEARCH_NotFound; } /** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's @@ -144,14 +144,14 @@ DESCRIPTOR_COMPARATOR(NextInterfaceKeyboardDataEndpoint) if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint) { if (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Endpoint_t).EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN) - return Descriptor_Search_Found; + return DESCRIPTOR_SEARCH_Found; } else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface) { - return Descriptor_Search_Fail; + return DESCRIPTOR_SEARCH_Fail; } - return Descriptor_Search_NotFound; + return DESCRIPTOR_SEARCH_NotFound; } /** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's @@ -165,7 +165,7 @@ DESCRIPTOR_COMPARATOR(NextInterfaceKeyboardDataEndpoint) DESCRIPTOR_COMPARATOR(NextHID) { if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_HID) - return Descriptor_Search_Found; + return DESCRIPTOR_SEARCH_Found; else - return Descriptor_Search_NotFound; + return DESCRIPTOR_SEARCH_NotFound; } diff --git a/Demos/Host/KeyboardHostWithParser/HIDReport.c b/Demos/Host/KeyboardHostWithParser/HIDReport.c index d177a8877d0f97bba688de0b8c891a3ca86923b9..b985a45fefe4b0d6b2c51e172ed40b4b8fee2604 100644 --- a/Demos/Host/KeyboardHostWithParser/HIDReport.c +++ b/Demos/Host/KeyboardHostWithParser/HIDReport.c @@ -64,7 +64,7 @@ uint8_t GetHIDReportData(void) return ParseControlError; /* Send the HID report to the parser for processing */ - if (ProcessHIDReport(HIDReportData, HIDReportSize, &HIDReportInfo) != HID_PARSE_Successful) + if (USB_ProcessHIDReport(HIDReportData, HIDReportSize, &HIDReportInfo) != HID_PARSE_Successful) return ParseError; return ParseSuccessful; diff --git a/Demos/Host/KeyboardHostWithParser/KeyboardHostWithParser.c b/Demos/Host/KeyboardHostWithParser/KeyboardHostWithParser.c index d7d5f941437a027f3d2e670ff86bea2da1e9f01b..ff4ae75c89cf53e26133321e295239dbbecb3871 100644 --- a/Demos/Host/KeyboardHostWithParser/KeyboardHostWithParser.c +++ b/Demos/Host/KeyboardHostWithParser/KeyboardHostWithParser.c @@ -310,7 +310,7 @@ void ProcessKeyboardReport(uint8_t* KeyboardReport) (ReportItem->ItemType == REPORT_ITEM_TYPE_In)) { /* Retrieve the keyboard scancode from the report data retrieved from the device */ - bool FoundData = GetReportItemInfo(KeyboardReport, ReportItem); + bool FoundData = USB_GetHIDReportItemInfo(KeyboardReport, ReportItem); /* For multi-report devices - if the requested data was not in the issued report, continue */ if (!(FoundData)) diff --git a/Demos/Host/MassStorageHost/ConfigDescriptor.c b/Demos/Host/MassStorageHost/ConfigDescriptor.c index 1540590ff5767ff509417911ba0fea82041c21a2..6642e1c5c58450abc1e3b721393dfa6166575cf9 100644 --- a/Demos/Host/MassStorageHost/ConfigDescriptor.c +++ b/Demos/Host/MassStorageHost/ConfigDescriptor.c @@ -137,11 +137,11 @@ DESCRIPTOR_COMPARATOR(NextMassStorageInterface) (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).SubClass == MASS_STORE_SUBCLASS) && (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == MASS_STORE_PROTOCOL)) { - return Descriptor_Search_Found; + return DESCRIPTOR_SEARCH_Found; } } - return Descriptor_Search_NotFound; + return DESCRIPTOR_SEARCH_NotFound; } /** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's @@ -162,12 +162,12 @@ DESCRIPTOR_COMPARATOR(NextInterfaceBulkDataEndpoint) /* Check the endpoint type, break out if correct BULK type endpoint found */ if (EndpointType == EP_TYPE_BULK) - return Descriptor_Search_Found; + return DESCRIPTOR_SEARCH_Found; } else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface) { - return Descriptor_Search_Fail; + return DESCRIPTOR_SEARCH_Fail; } - return Descriptor_Search_NotFound; + return DESCRIPTOR_SEARCH_NotFound; } diff --git a/Demos/Host/MouseHost/ConfigDescriptor.c b/Demos/Host/MouseHost/ConfigDescriptor.c index 2c842ac992a031d5d852281806e54efeed5ab7b9..ef53e7c42d0879a26484a94321ed9e6882219f92 100644 --- a/Demos/Host/MouseHost/ConfigDescriptor.c +++ b/Demos/Host/MouseHost/ConfigDescriptor.c @@ -69,15 +69,15 @@ uint8_t ProcessConfigurationDescriptor(void) return InvalidConfigDataReturned; /* Get the mouse interface from the configuration descriptor */ - if (USB_Host_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, NextMouseInterface)) + if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, NextMouseInterface)) { /* Descriptor not found, error out */ return NoHIDInterfaceFound; } /* Get the mouse interface's data endpoint descriptor */ - if (USB_Host_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, - NextInterfaceMouseDataEndpoint)) + if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, + NextInterfaceMouseDataEndpoint)) { /* Descriptor not found, error out */ return NoEndpointFound; @@ -121,12 +121,12 @@ DESCRIPTOR_COMPARATOR(NextMouseInterface) (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == MOUSE_PROTOCOL)) { /* Indicate that the descriptor being searched for has been found */ - return Descriptor_Search_Found; + return DESCRIPTOR_SEARCH_Found; } } /* Current descriptor does not match what this comparator is looking for */ - return Descriptor_Search_NotFound; + return DESCRIPTOR_SEARCH_NotFound; } /** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's @@ -147,15 +147,15 @@ DESCRIPTOR_COMPARATOR(NextInterfaceMouseDataEndpoint) if (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Endpoint_t).EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN) { /* Indicate that the descriptor being searched for has been found */ - return Descriptor_Search_Found; + return DESCRIPTOR_SEARCH_Found; } } else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface) { /* Indicate that the search has failed prematurely and should be aborted */ - return Descriptor_Search_Fail; + return DESCRIPTOR_SEARCH_Fail; } /* Current descriptor does not match what this comparator is looking for */ - return Descriptor_Search_NotFound; + return DESCRIPTOR_SEARCH_NotFound; } diff --git a/Demos/Host/MouseHostWithParser/ConfigDescriptor.c b/Demos/Host/MouseHostWithParser/ConfigDescriptor.c index 9f0c444e28e3c17ff268ad37356f5fec79b77655..486a0c7fba74336fb4fc68eb8b04668a20599e1e 100644 --- a/Demos/Host/MouseHostWithParser/ConfigDescriptor.c +++ b/Demos/Host/MouseHostWithParser/ConfigDescriptor.c @@ -123,11 +123,11 @@ DESCRIPTOR_COMPARATOR(NextMouseInterface) if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == MOUSE_CLASS) && (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == MOUSE_PROTOCOL)) { - return Descriptor_Search_Found; + return DESCRIPTOR_SEARCH_Found; } } - return Descriptor_Search_NotFound; + return DESCRIPTOR_SEARCH_NotFound; } /** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's @@ -144,14 +144,14 @@ DESCRIPTOR_COMPARATOR(NextInterfaceMouseDataEndpoint) if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint) { if (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Endpoint_t).EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN) - return Descriptor_Search_Found; + return DESCRIPTOR_SEARCH_Found; } else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface) { - return Descriptor_Search_Fail; + return DESCRIPTOR_SEARCH_Fail; } - return Descriptor_Search_NotFound; + return DESCRIPTOR_SEARCH_NotFound; } /** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's @@ -165,7 +165,7 @@ DESCRIPTOR_COMPARATOR(NextInterfaceMouseDataEndpoint) DESCRIPTOR_COMPARATOR(NextHID) { if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_HID) - return Descriptor_Search_Found; + return DESCRIPTOR_SEARCH_Found; else - return Descriptor_Search_NotFound; + return DESCRIPTOR_SEARCH_NotFound; } diff --git a/Demos/Host/MouseHostWithParser/HIDReport.c b/Demos/Host/MouseHostWithParser/HIDReport.c index 3d06bb1409d4f8a87367d60df197e9df16f3c7fc..176f18cf6a79d39fde55e3b90e71c9e38c8363b2 100644 --- a/Demos/Host/MouseHostWithParser/HIDReport.c +++ b/Demos/Host/MouseHostWithParser/HIDReport.c @@ -64,7 +64,7 @@ uint8_t GetHIDReportData(void) return ParseControlError; /* Send the HID report to the parser for processing */ - if (ProcessHIDReport(HIDReportData, HIDReportSize, &HIDReportInfo) != HID_PARSE_Successful) + if (USB_ProcessHIDReport(HIDReportData, HIDReportSize, &HIDReportInfo) != HID_PARSE_Successful) return ParseError; return ParseSuccessful; diff --git a/Demos/Host/MouseHostWithParser/HIDReport.h b/Demos/Host/MouseHostWithParser/HIDReport.h index f5ad40be310ce7db07e6b035bd563a02921f3fee..a4fc76fa7ba155e5749cfff250e7cf95405e3e4e 100644 --- a/Demos/Host/MouseHostWithParser/HIDReport.h +++ b/Demos/Host/MouseHostWithParser/HIDReport.h @@ -37,7 +37,7 @@ #define _HID_REPORT_H_ /* Includes: */ - #include <LUFA/Drivers/USB/USB.h> // HID Class Report Parser + #include <LUFA/Drivers/USB/USB.h> // USB Functionality #include "MouseHostWithParser.h" diff --git a/Demos/Host/MouseHostWithParser/MouseHostWithParser.c b/Demos/Host/MouseHostWithParser/MouseHostWithParser.c index 259da2a60e8aa45b636b9683eda3541fd465e5cf..44c68eea7280c6713ea1c3ba1dc0f90f918b89fe 100644 --- a/Demos/Host/MouseHostWithParser/MouseHostWithParser.c +++ b/Demos/Host/MouseHostWithParser/MouseHostWithParser.c @@ -312,7 +312,7 @@ void ProcessMouseReport(uint8_t* MouseReport) (ReportItem->ItemType == REPORT_ITEM_TYPE_In)) { /* Get the mouse button value */ - FoundData = GetReportItemInfo(MouseReport, ReportItem); + FoundData = USB_GetHIDReportItemInfo(MouseReport, ReportItem); /* For multi-report devices - if the requested data was not in the issued report, continue */ if (!(FoundData)) @@ -328,7 +328,7 @@ void ProcessMouseReport(uint8_t* MouseReport) (ReportItem->ItemType == REPORT_ITEM_TYPE_In)) { /* Get the mouse relative position value */ - FoundData = GetReportItemInfo(MouseReport, ReportItem); + FoundData = USB_GetHIDReportItemInfo(MouseReport, ReportItem); /* For multi-report devices - if the requested data was not in the issued report, continue */ if (!(FoundData)) diff --git a/Demos/Host/StillImageHost/ConfigDescriptor.c b/Demos/Host/StillImageHost/ConfigDescriptor.c index 2456e35afcd7f3d8dfd62ec7e3ce37f11596b36d..5e2916ba2a0b9a10b3bce2da66341dabf6bc2cd9 100644 --- a/Demos/Host/StillImageHost/ConfigDescriptor.c +++ b/Demos/Host/StillImageHost/ConfigDescriptor.c @@ -156,11 +156,11 @@ DESCRIPTOR_COMPARATOR(NextStillImageInterface) (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).SubClass == SIMAGE_SUBCLASS) && (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == SIMAGE_PROTOCOL)) { - return Descriptor_Search_Found; + return DESCRIPTOR_SEARCH_Found; } } - return Descriptor_Search_NotFound; + return DESCRIPTOR_SEARCH_NotFound; } /** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's @@ -180,12 +180,12 @@ DESCRIPTOR_COMPARATOR(NextSImageInterfaceDataEndpoint) USB_Descriptor_Endpoint_t).Attributes & EP_TYPE_MASK); if ((EndpointType == EP_TYPE_BULK) || (EndpointType == EP_TYPE_INTERRUPT)) - return Descriptor_Search_Found; + return DESCRIPTOR_SEARCH_Found; } else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface) { - return Descriptor_Search_Fail; + return DESCRIPTOR_SEARCH_Fail; } - return Descriptor_Search_NotFound; + return DESCRIPTOR_SEARCH_NotFound; } diff --git a/LUFA/ChangeLog.txt b/LUFA/ChangeLog.txt index 7e23243a4a0433cae65a111c0967059c8981f3d2..16862caeada83f50d50f8bd552ac3cf01e377fed 100644 --- a/LUFA/ChangeLog.txt +++ b/LUFA/ChangeLog.txt @@ -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 * device descriptor * - Renamed functions in the HID parser to have a "USB_" prefix and the acronym "HID" in the name + * - Fixed incorrect HID interface class and subclass values in the Mouse and KeyboardMouse demos (thanks to Brian Dickman) + * - 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 * * * \section Sec_ChangeLog090401 Version 090401 diff --git a/LUFA/DriverStubs/HWB.h b/LUFA/DriverStubs/HWB.h index 744828d8c3f796001ba0b2ce1e5a41a271f8f0eb..4b7f205424a896937afed56b575fbbf01f9c5559 100644 --- a/LUFA/DriverStubs/HWB.h +++ b/LUFA/DriverStubs/HWB.h @@ -66,7 +66,7 @@ #if !defined(__DOXYGEN__) static inline void HWB_Init(void) { - // TODO: Initialize the appropriate port pin as an input here, with pullup + // TODO: Initialize the appropriate port pin as an input here, with pull-up } static inline bool HWB_GetStatus(void) ATTR_WARN_UNUSED_RESULT; diff --git a/LUFA/Drivers/Board/Dataflash.h b/LUFA/Drivers/Board/Dataflash.h index 9f5d0756d58ebd499924b78e9df9f6ac9edf5e86..01ee88930d425bd8e0963d9ba4cbf16f54560339 100644 --- a/LUFA/Drivers/Board/Dataflash.h +++ b/LUFA/Drivers/Board/Dataflash.h @@ -75,7 +75,7 @@ #endif /* Public Interface - May be used in end-application: */ - /* Psuedo-Function Macros: */ + /* Pseudo-Function Macros: */ #if defined(__DOXYGEN__) /** Determines the currently selected dataflash chip. * diff --git a/LUFA/Drivers/Board/Temperature.h b/LUFA/Drivers/Board/Temperature.h index f21ed400d20c6b0eccda064d7cfc6eb0f31a1331..56e5790760ae94f61465da5a664f6c955bf2a5d3 100644 --- a/LUFA/Drivers/Board/Temperature.h +++ b/LUFA/Drivers/Board/Temperature.h @@ -82,7 +82,7 @@ /** Maximum returnable temperature from the Temperature_GetTemperature() function. */ #define TEMP_MAX_TEMP ((TEMP_TABLE_SIZE - 1) + TEMP_TABLE_OFFSET) - /* Psuedo-Functions: */ + /* Pseudo-Function Macros: */ #if defined(__DOXYGEN__) /** Initializes the temperature sensor driver, including setting up the appropriate ADC channel. * This must be called before any other temperature sensor routines. diff --git a/LUFA/Drivers/Peripheral/AT90USBXXX67/ADC.h b/LUFA/Drivers/Peripheral/AT90USBXXX67/ADC.h index a5bf03734c01dbfec1081bd2257f17475cb858f8..494c1e478501805159cd63bf4df86fa0e271f261 100644 --- a/LUFA/Drivers/Peripheral/AT90USBXXX67/ADC.h +++ b/LUFA/Drivers/Peripheral/AT90USBXXX67/ADC.h @@ -62,32 +62,7 @@ #endif /* Public Interface - May be used in end-application: */ - /* Macros: */ - /** Initializes the ADC, ready for conversions. This must be called before any other ADC operations. - * The "mode" parameter should be a mask comprised of a conversion mode (free running or single) and - * prescaler masks. - */ - #define ADC_Init(mode) MACROS{ ADCSRA = ((1 << ADEN) | mode); }MACROE - - /** Turns off the ADC. If this is called, any further ADC operations will require a call to the - * ADC_Init() macro before the ADC can be used again. - */ - #define ADC_Off() MACROS{ ADCSRA = 0; }MACROE - - /** Indicates if the ADC is enabled. This macro will return boolean true if the ADC subsystem is - * currently enabled, or false otherwise. - */ - #define ADC_GetStatus() ((ADCSRA & (1 << ADEN)) ? true : false) - - /** Indicates if the current ADC conversion is completed, or still in progress. This returns boolean - * false if the reading is still taking place, or true if the conversion is complete and ready to be - * read out with ADC_GetResult(). - */ - #define ADC_IsReadingComplete() (!(ADCSRA & (1 << ADSC))) - - /** Returns the result of the last conversion, as a 16-bit wide integer. */ - #define ADC_GetResult() ADC - + /* Macros: */ /** Reference mask, for using the voltage present at the AVR's AREF pin for the ADC reference. */ #define ADC_REFERENCE_AREF 0 @@ -134,6 +109,51 @@ /** Sets the ADC input clock to prescale by a factor of 128 the AVR's system clock. */ #define ADC_PRESCALE_128 ((1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0)) + /* Pseudo-Function Macros: */ + #if defined(__DOXYGEN__) + /** Initializes the ADC, ready for conversions. This must be called before any other ADC operations. + * The "mode" parameter should be a mask comprised of a conversion mode (free running or single) and + * prescaler masks. + * + * \param Mode Mask of ADC settings, including adjustment, prescale, mode and reference + */ + static inline void ADC_Init(uint8_t Mode); + + /** Turns off the ADC. If this is called, any further ADC operations will require a call to + * ADC_Init() before the ADC can be used again. + */ + static inline void ADC_Off(void); + + /** Indicates if the ADC is currently enabled. + * + * \return Boolean true if the ADC subsystem is currently enabled, false otherwise. + */ + static inline bool ADC_GetStatus(void); + + /** Indicates if the current ADC conversion is completed, or still in progress. + * + * \return Boolean false if the reading is still taking place, or true if the conversion is + * complete and ready to be read out with ADC_GetResult() + */ + static inline bool ADC_IsReadingComplete(void); + + /** Retrieves the conversion value of the last completed ADC conversion. + * + * \return The result of the last ADC conversion + */ + static inline uint16_t ADC_GetResult(void); + #else + #define ADC_Init(mode) MACROS{ ADCSRA = ((1 << ADEN) | mode); }MACROE + + #define ADC_Off() MACROS{ ADCSRA = 0; }MACROE + + #define ADC_GetStatus() ((ADCSRA & (1 << ADEN)) ? true : false) + + #define ADC_IsReadingComplete() (!(ADCSRA & (1 << ADSC))) + + #define ADC_GetResult() ADC + #endif + /* Inline Functions: */ /** Configures the given ADC channel, ready for ADC conversions. This function sets the * associated port pin as an input and disables the digital portion of the I/O to reduce diff --git a/LUFA/Drivers/Peripheral/Serial.h b/LUFA/Drivers/Peripheral/Serial.h index 65b40a53f6010daebfc95fb3d664666a27dd4127..a50456b37e42588d0284aaaf2f634a458875aed1 100644 --- a/LUFA/Drivers/Peripheral/Serial.h +++ b/LUFA/Drivers/Peripheral/Serial.h @@ -74,7 +74,7 @@ */ #define SERIAL_2X_UBBRVAL(baud) (((F_CPU / 8) / baud) - 1) - /* Psuedo-Functions: */ + /* Pseudo-Function Macros: */ #if defined(__DOXYGEN__) /** Indicates whether a character has been received through the USART. * diff --git a/LUFA/Drivers/USB/Class/ConfigDescriptor.c b/LUFA/Drivers/USB/Class/ConfigDescriptor.c index 61a5c445c216d29ed8ffc09e9948e0c63977af6f..c9f8c3cbb217388ff3549acc260ff0efaa432771 100644 --- a/LUFA/Drivers/USB/Class/ConfigDescriptor.c +++ b/LUFA/Drivers/USB/Class/ConfigDescriptor.c @@ -125,9 +125,9 @@ uint8_t USB_GetNextDescriptorComp_P(uint16_t* BytesRem, uint8_t** CurrConfigLoc, USB_GetNextDescriptor(BytesRem, CurrConfigLoc); - if ((ErrorCode = ComparatorRoutine(*CurrConfigLoc)) != Descriptor_Search_NotFound) + if ((ErrorCode = ComparatorRoutine(*CurrConfigLoc)) != DESCRIPTOR_SEARCH_NotFound) { - if (ErrorCode == Descriptor_Search_Fail) + if (ErrorCode == DESCRIPTOR_SEARCH_Fail) { *CurrConfigLoc = PrevDescLoc; *BytesRem = PrevBytesRem; @@ -137,5 +137,5 @@ uint8_t USB_GetNextDescriptorComp_P(uint16_t* BytesRem, uint8_t** CurrConfigLoc, } } - return Descriptor_Search_Comp_EndOfDescriptor; + return DESCRIPTOR_SEARCH_COMP_EndOfDescriptor; } diff --git a/LUFA/Drivers/USB/Class/ConfigDescriptor.h b/LUFA/Drivers/USB/Class/ConfigDescriptor.h index 7a1d53118924250bebe04edc9683b914fca84c98..362a43e755611eedfa4650c3b8eea3f38f12d2e4 100644 --- a/LUFA/Drivers/USB/Class/ConfigDescriptor.h +++ b/LUFA/Drivers/USB/Class/ConfigDescriptor.h @@ -122,7 +122,7 @@ */ #define DESCRIPTOR_COMPARATOR(name) uint8_t DCOMP_##name (void* const CurrentDescriptor) - /* Psuedo-Functions: */ + /* Pseudo-Function Macros: */ #if defined(__DOXYGEN__) /** Searches for the next descriptor in the given configuration descriptor using a premade comparator * function. The routine updates the position and remaining configuration descriptor bytes values @@ -146,9 +146,9 @@ * DESCRIPTOR_COMPARATOR(EndpointSearcher) * { * if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint) - * return Descriptor_Search_Found; + * return DESCRIPTOR_SEARCH_Found; * else - * return Descriptor_Search_NotFound; + * return DESCRIPTOR_SEARCH_NotFound; * } * * //... @@ -169,18 +169,18 @@ /** Enum for return values of a descriptor comparator made with DESCRIPTOR_COMPARATOR. */ enum DSearch_Return_ErrorCodes_t { - Descriptor_Search_Found = 0, /**< Current descriptor matches comparator criteria. */ - Descriptor_Search_Fail = 1, /**< No further descriptor could possibly match criteria, fail the search. */ - Descriptor_Search_NotFound = 2, /**< Current descriptor does not match comparator criteria. */ + DESCRIPTOR_SEARCH_Found = 0, /**< Current descriptor matches comparator criteria. */ + DESCRIPTOR_SEARCH_Fail = 1, /**< No further descriptor could possibly match criteria, fail the search. */ + DESCRIPTOR_SEARCH_NotFound = 2, /**< Current descriptor does not match comparator criteria. */ }; /** Enum for return values of USB_GetNextDescriptorComp(). */ enum DSearch_Comp_Return_ErrorCodes_t { - Descriptor_Search_Comp_Found = 0, /**< Configuration descriptor now points to descriptor which matches + DESCRIPTOR_SEARCH_COMP_Found = 0, /**< Configuration descriptor now points to descriptor which matches * search criteria of the given comparator function. */ - Descriptor_Search_Comp_Fail = 1, /**< Comparator function returned Descriptor_Search_Fail. */ - Descriptor_Search_Comp_EndOfDescriptor = 2, /**< End of configuration descriptor reached before match found. */ + DESCRIPTOR_SEARCH_COMP_Fail = 1, /**< Comparator function returned Descriptor_Search_Fail. */ + DESCRIPTOR_SEARCH_COMP_EndOfDescriptor = 2, /**< End of configuration descriptor reached before match found. */ }; /* Function Prototypes: */ diff --git a/LUFA/Drivers/USB/Class/HIDParser.c b/LUFA/Drivers/USB/Class/HIDParser.c index 35b280b5c4b8d1755f25023919d634f371aa1194..5fb29aa0a694b0419aaca764461b102722c17ff5 100644 --- a/LUFA/Drivers/USB/Class/HIDParser.c +++ b/LUFA/Drivers/USB/Class/HIDParser.c @@ -30,7 +30,7 @@ #include "HIDParser.h" -uint8_t ProcessHIDReport(const uint8_t* ReportData, uint16_t ReportSize, HID_ReportInfo_t* const ParserData) +uint8_t USB_ProcessHIDReport(const uint8_t* ReportData, uint16_t ReportSize, HID_ReportInfo_t* const ParserData) { HID_StateTable_t StateTable[HID_STATETABLE_STACK_DEPTH]; HID_StateTable_t* CurrStateTable = &StateTable[0]; @@ -275,7 +275,7 @@ uint8_t ProcessHIDReport(const uint8_t* ReportData, uint16_t ReportSize, HID_Rep return HID_PARSE_Successful; } -bool GetReportItemInfo(const uint8_t* ReportData, HID_ReportItem_t* const ReportItem) +bool USB_GetHIDReportItemInfo(const uint8_t* ReportData, HID_ReportItem_t* const ReportItem) { uint16_t DataBitsRem = ReportItem->Attributes.BitSize; uint16_t CurrentBit = ReportItem->BitOffset; @@ -303,7 +303,7 @@ bool GetReportItemInfo(const uint8_t* ReportData, HID_ReportItem_t* const Report return true; } -void SetReportItemInfo(uint8_t* ReportData, const HID_ReportItem_t* ReportItem) +void USB_SetHIDReportItemInfo(uint8_t* ReportData, const HID_ReportItem_t* ReportItem) { uint16_t DataBitsRem = ReportItem->Attributes.BitSize; uint16_t CurrentBit = ReportItem->BitOffset; diff --git a/LUFA/Drivers/USB/HighLevel/StreamCallbacks.h b/LUFA/Drivers/USB/HighLevel/StreamCallbacks.h index 26f15035007e34e909f2bbbbc1806b735f30eb3f..5f0b73742634fc599fd34c4b43de7ed98cadd5ce 100644 --- a/LUFA/Drivers/USB/HighLevel/StreamCallbacks.h +++ b/LUFA/Drivers/USB/HighLevel/StreamCallbacks.h @@ -31,9 +31,8 @@ /** \ingroup Group_USB * @defgroup Group_StreamCallbacks Endpoint and Pipe Stream Callbacks * - * Macros and enums for the stream callback routines in Endpoint.h and Pipe.c. This module contains the - * code required to easily set up stream callback functions which can be used to force early abort of a - * stream read/write process. + * Macros and enums for the stream callback routines. This module contains the code required to easily set up + * stream callback functions which can be used to force early abort of a stream read/write process. * * @{ */ diff --git a/LUFA/Drivers/USB/HighLevel/USBTask.h b/LUFA/Drivers/USB/HighLevel/USBTask.h index 63787229116ee3e504ac2370e701eb8d8a532926..833fd9ec78b7f5394163d0860b7542db28952dd1 100644 --- a/LUFA/Drivers/USB/HighLevel/USBTask.h +++ b/LUFA/Drivers/USB/HighLevel/USBTask.h @@ -86,7 +86,7 @@ /** Indicates if the USB interface is currently suspended by the host when in device mode. When suspended, * the device should consume minimal power, and cannot communicate to the host. If Remote Wakeup is * supported by the device and USB_RemoteWakeupEnabled is true, suspension can be terminated by the device - * by issuing a Remote Wakup request. + * by issuing a Remote Wakeup request. * * \note This global is only present if the user application can be a USB device. * diff --git a/LUFA/Drivers/USB/LowLevel/Device.h b/LUFA/Drivers/USB/LowLevel/Device.h index 3c2bb36970161c9988a864d049e803c5c6a6af3f..206a99361aad395eb6f66c7d984f40712a41677c 100644 --- a/LUFA/Drivers/USB/LowLevel/Device.h +++ b/LUFA/Drivers/USB/LowLevel/Device.h @@ -67,7 +67,7 @@ */ #define USB_DEVICE_OPT_FULLSPEED (0 << 0) - /* Psuedo-Function Macros: */ + /* Pseudo-Function Macros: */ #if defined(__DOXYGEN__) /** Sends a Remote Wakeup request to the host. This signals to the host that the device should * be taken out of suspended mode, and communications should resume. diff --git a/LUFA/Drivers/USB/LowLevel/Endpoint.h b/LUFA/Drivers/USB/LowLevel/Endpoint.h index 651c0e8e6972e081df5c40ee535a4e5705e838b2..90375b0ef673c5e57580051a0f3f2a45318d4540 100644 --- a/LUFA/Drivers/USB/LowLevel/Endpoint.h +++ b/LUFA/Drivers/USB/LowLevel/Endpoint.h @@ -178,7 +178,7 @@ */ #define ENDPOINT_INT_OUT UEIENX, (1 << RXOUTE), UEINTX, (1 << RXOUTI) - /* Psuedo-Function Macros: */ + /* Pseudo-Function Macros: */ #if defined(__DOXYGEN__) /** Indicates the number of bytes currently stored in the current endpoint's selected bank. * diff --git a/LUFA/Drivers/USB/LowLevel/Host.h b/LUFA/Drivers/USB/LowLevel/Host.h index 82cceb2c011ff72c91b120cc5fa7b6d78719d87f..62921e8663ef2b5b842c3aafa1683e3ef264b062 100644 --- a/LUFA/Drivers/USB/LowLevel/Host.h +++ b/LUFA/Drivers/USB/LowLevel/Host.h @@ -85,7 +85,7 @@ #define HOST_DEVICE_SETTLE_DELAY_MS 1500 #endif - /* Psuedo-Function Macros: */ + /* Pseudo-Function Macros: */ #if defined(__DOXYGEN__) /** Resets the USB bus, including the endpoints in any attached device and pipes on the AVR host. * USB bus resets leave the default control pipe configured (if already configured). diff --git a/LUFA/Drivers/USB/LowLevel/OTG.h b/LUFA/Drivers/USB/LowLevel/OTG.h index da303c9093acf902265c4c4c27ad3f70e091c32e..1f59e0cfa1a80dcbc9e1aba68a1737afc96901cd 100644 --- a/LUFA/Drivers/USB/LowLevel/OTG.h +++ b/LUFA/Drivers/USB/LowLevel/OTG.h @@ -61,7 +61,7 @@ */ #define USB_OTG_STP_DATA 0 - /* Psuedo-Function Macros: */ + /* Pseudo-Function Macros: */ #if defined(__DOXYGEN__) /** Initiate a Host Negotiation Protocol request. This indicates to the other connected device * that the device wishes to change device/host roles. diff --git a/LUFA/Drivers/USB/LowLevel/Pipe.h b/LUFA/Drivers/USB/LowLevel/Pipe.h index 15be81e13549f7a0f3af8dff822660957404c8c7..4e2ffec5a4a50793c9e620515ac0bb7dd20c7abe 100644 --- a/LUFA/Drivers/USB/LowLevel/Pipe.h +++ b/LUFA/Drivers/USB/LowLevel/Pipe.h @@ -242,7 +242,7 @@ */ #define PIPE_INT_STALL UPIENX, (1 << RXSTALLE), UPINTX, (1 << RXSTALLI) - /* Psuedo-Function Macros: */ + /* Pseudo-Function Macros: */ #if defined(__DOXYGEN__) /** Indicates the number of bytes currently stored in the current pipes's selected bank. * @@ -367,7 +367,7 @@ * * \see Pipe_GetErrorFlags() macro for information on retrieving the exact error flag. * - * \return Boolean true if an error has ocurred on the selected pipe, false otherwise + * \return Boolean true if an error has occurred on the selected pipe, false otherwise */ static inline bool Pipe_IsError(void); @@ -379,7 +379,7 @@ /** Gets a mask of the hardware error flags which have occurred on the currently selected pipe. This * value can then be masked against the PIPE_ERRORFLAG_* masks to determine what error has occurred. * - * \return Mask comprising of PIPE_ERRORFLAG_* bits indicating what error has ocurred on the selected pipe + * \return Mask comprising of PIPE_ERRORFLAG_* bits indicating what error has occurred on the selected pipe */ static inline uint8_t Pipe_GetErrorFlags(void); diff --git a/LUFA/MigrationInformation.txt b/LUFA/MigrationInformation.txt index f7e98604650bd5dbee88c10ed8596eae1daec007..dcdbdc272c3a5cf89aeb93d2921de351ed39fe74 100644 --- a/LUFA/MigrationInformation.txt +++ b/LUFA/MigrationInformation.txt @@ -28,7 +28,7 @@ * on the new endpoint management macros. * - The Endpoint_ReadWriteAllowed() macro has been renamed to Endpoint_IsReadWriteAllowed() to be more consistent with the rest of * the API naming scheme. - * - The Endpoint_IsSetupINReady() and Endpoint_IsOutReceived() macros have been renamed to Endpoint_IsINReady() and + * - The Endpoint_IsSetupINReady() and Endpoint_IsSetupOutReceived() macros have been renamed to Endpoint_IsINReady() and * Endpoint_IsOUTReceived() respectively. * - The Endpoint_IsSetupReceived() macro has been renamed to Endpoint_IsSETUPReceived(). * - The Endpoint_ClearSetupReceived() macro has been renamed to Endpoint_ClearControlSETUP(). @@ -60,7 +60,8 @@ * - Functions in the ConfigDescriptor.h header file no longer have "Host_" as part of their names. * - The ProcessHIDReport() has been renamed to USB_ProcessHIDReport(), GetReportItemInfo() has been renamed to USB_GetHIDReportItemInfo() * and SetReportItemInfo() has been renamed to USB_GetHIDReportItemInfo(). - * + * - The values of the DSearch_Return_ErrorCodes_t and DSearch_Comp_Return_ErrorCodes_t enums have had their respective "Descriptor_Search" + * and "Descriptor_Search_Comp" prefixes changed to all caps. * * \section Sec_Migration090401 Migrating from 090209 to 090401 * diff --git a/LUFA/Scheduler/Scheduler.h b/LUFA/Scheduler/Scheduler.h index 38e97367202f63dbd716dcf48b5a7388e4cc5101..1ef477cad3825a6dff3942d98b1b372805627da4 100644 --- a/LUFA/Scheduler/Scheduler.h +++ b/LUFA/Scheduler/Scheduler.h @@ -133,7 +133,7 @@ /** Task status mode constant, for passing to Scheduler_SetTaskMode() or Scheduler_SetGroupTaskMode(). */ #define TASK_STOP false - /* Psuedo-Functions: */ + /* Pseudo-Function Macros: */ #if defined(__DOXYGEN__) /** Starts the scheduler in its infinite loop, executing running tasks. This should be placed at the end * of the user application's main() function, as it can never return to the calling function.