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.
\r
Class: 0x03,\r
SubClass: 0x01,\r
- Protocol: 0x00,\r
+ Protocol: 0x01,\r
\r
InterfaceStrIndex: NO_DESCRIPTOR\r
},\r
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
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
(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
(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
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
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
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
{\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
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
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
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
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
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
(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
(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
\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
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
(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
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
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
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
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
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
#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
(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
(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
(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
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
* - 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
#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
#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
/** 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
#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
*/\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
\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
}\r
}\r
\r
- return Descriptor_Search_Comp_EndOfDescriptor;\r
+ return DESCRIPTOR_SEARCH_COMP_EndOfDescriptor;\r
}\r
*/\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
\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
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
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
/** \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
/** 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
*/\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
*/\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
#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
*/ \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
*/\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
* 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
* - 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
/** 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