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