* and other descriptor data can be extracted and used as needed.\r
*/\r
\r
+/** \ingroup Group_Descriptors\r
+ * @defgroup Group_ConfigDescriptorParser Configuration Descriptor Parser\r
+ *\r
+ * Functions, macros, variables, enums and types related to the parsing of Configuration Descriptors.\r
+ *\r
+ * @{\r
+ */\r
+\r
#ifndef __CONFIGDESCRIPTOR_H__\r
#define __CONFIGDESCRIPTOR_H__\r
\r
\r
/* Public Interface - May be used in end-application: */\r
/* Macros: */\r
+ /** Mask for determining the type of an endpoint from an endpoint descriptor. This should then be compared\r
+ * with the EP_TYPE_* masks to determine the exact type of the endpoint.\r
+ */\r
+ #define EP_TYPE_MASK 0x03\r
+\r
/** Casts a pointer to a descriptor inside the configuration descriptor into a pointer to the given\r
* descriptor type.\r
*\r
#define DESCRIPTOR_SIZE(DescriptorPtr) DESCRIPTOR_CAST(DescriptorPtr, USB_Descriptor_Header_t).bLength\r
#endif\r
\r
- /** Creates a prototype for or begins a descriptor comparitor routine. Descriptor comparitor routines are \r
+ /** Creates a prototype for or begins a descriptor comparator routine. Descriptor comparator routines are \r
* small search routines which are passed a pointer to the current sub descriptor in the configuration\r
* descriptor, and which analyse the sub descriptor to determine whether or not it matches the routine's\r
- * search parameters. Comparitor routines provide a powerful way to scan through the config descriptor\r
+ * search parameters. Comparator routines provide a powerful way to scan through the config descriptor\r
* for certain descriptors matching unique criteria.\r
*\r
- * Comparitor routines are passed in a single pointer named CurrentDescriptor, and should return a value\r
- * of a member of the DSEARCH_Return_ErrorCodes_t enum.\r
+ * Comparator routines are passed in a single pointer named CurrentDescriptor, and should return a value\r
+ * of a member of the DSearch_Return_ErrorCodes_t enum.\r
*/\r
#define DESCRIPTOR_COMPARATOR(name) uint8_t DCOMP_##name (void* const CurrentDescriptor)\r
\r
*\r
* \param DSize Pointer to an int storing the remaining bytes in the configuration descriptor\r
* \param DPos Pointer to the current position in the configuration descriptor\r
- * \param DSearch Name of the comparitor search function to use on the configuration descriptor\r
+ * \param DSearch Name of the comparator search function to use on the configuration descriptor\r
*\r
- * \return Value of one of the members of the DSEARCH_Comp_Return_ErrorCodes_t enum\r
+ * \return Value of one of the members of the DSearch_Comp_Return_ErrorCodes_t enum\r
*\r
* Usage Example:\r
* \code\r
USB_Host_GetNextDescriptorComp_P(DSize, DPos, DCOMP_##DSearch)\r
/* Enums: */\r
/** Enum for return values of a descriptor comparator made with DESCRIPTOR_COMPARATOR. */\r
- enum DSEARCH_Return_ErrorCodes_t\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
};\r
\r
/** Enum for return values of USB_Host_GetNextDescriptorComp() */\r
- enum DSEARCH_Comp_Return_ErrorCodes_t\r
+ enum DSearch_Comp_Return_ErrorCodes_t\r
{\r
- Descriptor_Search_Comp_Found = 0, /**< Configuration descriptor now points to decriptor 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
#if defined(__cplusplus)\r
}\r
#endif\r
- \r
+\r
#endif\r
+\r
+/** @} */\r