Corrected AudioInput and AudioOutput demos, to fix endpoint underflows due to roundin...
[pub/USBasp.git] / LUFA / Drivers / USB / Class / ConfigDescriptor.h
index d1f8927..bd92b51 100644 (file)
 \r
        /* Public Interface - May be used in end-application: */\r
                /* Macros: */\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
                        /** 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
                                #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
                         *  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
                         *  for certain descriptors matching unique criteria.\r
                         *\r
-                        *  Comparitor routines are passed in a single pointer named CurrentDescriptor, and should return a value\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
                         *  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
                         *  \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
                         *\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
                         *\r
                         *\r
                         *  \return Value of one of the members of the DSEARCH_Comp_Return_ErrorCodes_t enum\r
                         *\r
                        /** Enum for return values of USB_Host_GetNextDescriptorComp() */\r
                        enum DSEARCH_Comp_Return_ErrorCodes_t\r
                        {\r
                        /** Enum for return values of USB_Host_GetNextDescriptorComp() */\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
                                                                             *   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