Add partial project documentation to the incomplete PrinterHost demo.
[pub/lufa.git] / Demos / Host / Incomplete / PrinterHost / ConfigDescriptor.h
index bbe2372..3e24adc 100644 (file)
                #include <LUFA/Drivers/USB/USB.h>\r
                \r
                #include "PrinterHost.h"\r
+               #include "Lib/PrinterCommands.h"\r
                \r
        /* Macros: */\r
+               /** Interface Class value for the Printer Device class */\r
                #define PRINTER_CLASS                    0x07\r
+\r
+               /** Interface Subclass value for the Printer Device class */\r
                #define PRINTER_SUBCLASS                 0x01\r
+\r
+               /** Interface Protocol value for a Bidirectional communication encapsulation */\r
+               #define PRINTER_PROTOCOL                 0x02\r
                \r
-               #define PRINTER_DATA_OUT_PIPE            1\r
-               #define PRINTER_DATA_IN_PIPE             2\r
-               \r
+               /** Maximum size of a device configuration descriptor which can be processed by the host, in bytes */\r
                #define MAX_CONFIG_DESCRIPTOR_SIZE       512\r
 \r
        /* Enums: */\r
+               /** Enum for the possible return codes of the ProcessConfigurationDescriptor() function. */\r
                enum PrinterHost_GetConfigDescriptorDataCodes_t\r
                {\r
-                       SuccessfulConfigRead                 = 0,\r
-                       ControlError                         = 1,\r
-                       DescriptorTooLarge                   = 2,\r
-                       InvalidConfigDataReturned            = 3,\r
-                       NoInterfaceFound                     = 4,\r
-                       NoEndpointFound                      = 5,\r
+                       SuccessfulConfigRead            = 0, /**< Configuration Descriptor was processed successfully */\r
+                       ControlError                    = 1, /**< A control request to the device failed to complete successfully */\r
+                       DescriptorTooLarge              = 2, /**< The device's Configuration Descriptor is too large to process */\r
+                       InvalidConfigDataReturned       = 3, /**< The device returned an invalid Configuration Descriptor */\r
+                       NoInterfaceFound                = 4, /**< A compatible printer interface was not found in the device's Configuration Descriptor */\r
+                       NoEndpointFound                 = 5, /**< The printer data endpoints were not found in the device's Configuration Descriptor */\r
                };\r
        \r
        /* External Variables: */\r
+               /** Interface index of the Bidirectional Printer interface within the device, once the Configuration\r
+                *  Descriptor has been processed.\r
+                */\r
                uint8_t PrinterInterfaceNumber;\r
+               \r
+               /** Interface Alternate Setting index of the Bidirectional Printer interface within the device, once\r
+                *  the Configuration Descriptor has been processed.\r
+                */\r
                uint8_t PrinterAltSetting;\r
 \r
        /* Function Prototypes: */\r
                uint8_t ProcessConfigurationDescriptor(void);   \r
 \r
-               uint8_t NextBidirectionalPrinterInterface(void* CurrentDescriptor);\r
-               uint8_t NextInterfaceBulkDataEndpoint(void* CurrentDescriptor);\r
+               uint8_t DComp_NextBidirectionalPrinterInterface(void* CurrentDescriptor);\r
+               uint8_t DComp_NextInterfaceBulkDataEndpoint(void* CurrentDescriptor);\r
 \r
 #endif\r