Update UC3 platform driver support to use the bitmasks defined in the header files...
[pub/USBasp.git] / LUFA / Drivers / USB / Core / Host.h
index 7e83102..6bd7fab 100644 (file)
 \r
        /* Includes: */\r
                #include "../../../Common/Common.h"\r
+               #include "USBMode.h"            \r
 \r
-               #if (ARCH == ARCH_AVR8)\r
-                       #include "AVR8/Host.h"\r
+       /* Enable C linkage for C++ Compilers: */\r
+               #if defined(__cplusplus)\r
+                       extern "C" {\r
                #endif\r
 \r
        /* Preprocessor Checks: */\r
                        #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.\r
                #endif\r
 \r
+       /* Public Interface - May be used in end-application: */\r
+               /* Enums: */\r
+                       /** Enum for the various states of the USB Host state machine.\r
+                        *\r
+                        *  For information on each possible USB host state, refer to the USB 2.0 specification.\r
+                        *  Several of the USB host states are broken up further into multiple smaller sub-states,\r
+                        *  so that they can be internally implemented inside the library in an efficient manner.\r
+                        *\r
+                        *  \see \ref USB_HostState, which stores the current host state machine state.\r
+                        */\r
+                       enum USB_Host_States_t\r
+                       {\r
+                               HOST_STATE_WaitForDevice                = 0,  /**< This state indicates that the stack is waiting for an interval\r
+                                                                              *   to elapse before continuing with the next step of the device\r
+                                                                              *   enumeration process.\r
+                                                                              */\r
+                               HOST_STATE_Unattached                   = 1,  /**< This state indicates that the host state machine is waiting for\r
+                                                                              *   a device to be attached so that it can start the enumeration process.\r
+                                                                              */\r
+                               HOST_STATE_Powered                      = 2,  /**< This state indicates that a device has been attached, and the\r
+                                                                              *   library's internals are being configured to begin the enumeration\r
+                                                                              *   process.\r
+                                                                              */\r
+                               HOST_STATE_Powered_WaitForDeviceSettle  = 3,  /**< This state indicates that the stack is waiting for the initial\r
+                                                                              *   settling period to elapse before beginning the enumeration process.\r
+                                                                              */\r
+                               HOST_STATE_Powered_WaitForConnect       = 4,  /**< This state indicates that the stack is waiting for a connection event\r
+                                                                              *   from the USB controller to indicate a valid USB device has been attached\r
+                                                                              *   to the bus and is ready to be enumerated.\r
+                                                                              */\r
+                               HOST_STATE_Powered_DoReset              = 5,  /**< This state indicates that a valid USB device has been attached, and that\r
+                                                                              *   it will now be reset to ensure it is ready for enumeration.\r
+                                                                              */\r
+                               HOST_STATE_Powered_ConfigPipe           = 6,  /**< This state indicates that the attached device is currently powered and\r
+                                                                              *   reset, and that the control pipe is now being configured by the stack.\r
+                                                                              */\r
+                               HOST_STATE_Default                      = 7,  /**< This state indicates that the stack is currently retrieving the control\r
+                                                                              *   endpoint's size from the device, so that the control pipe can be altered\r
+                                                                              *   to match.\r
+                                                                              */\r
+                               HOST_STATE_Default_PostReset            = 8,  /**< This state indicates that the control pipe is being reconfigured to match\r
+                                                                              *   the retrieved control endpoint size from the device, and the device's USB\r
+                                                                              *   bus address is being set.\r
+                                                                              */\r
+                               HOST_STATE_Default_PostAddressSet       = 9,  /**< This state indicates that the device's address has now been set, and the\r
+                                                                              *   stack is has now completed the device enumeration process. This state causes \r
+                                                                              *   the stack to change the current USB device address to that set for the\r
+                                                                              *   connected device, before progressing to the \ref HOST_STATE_Addressed state\r
+                                                                              *   ready for use in the user application.\r
+                                                                              */\r
+                               HOST_STATE_Addressed                    = 10, /**< Indicates that the device has been enumerated and addressed, and is now waiting\r
+                                                                              *   for the user application to configure the device ready for use.                              \r
+                                                                              */\r
+                               HOST_STATE_Configured                   = 11, /**< Indicates that the device has been configured into a valid device configuration,\r
+                                                                              *   ready for general use by the user application.                               \r
+                                                                              */\r
+                       };\r
+\r
+       /* Architecture Includes: */\r
+               #if (ARCH == ARCH_AVR8)\r
+                       #include "AVR8/Host_AVR8.h"\r
+               #elif (ARCH == ARCH_UC3)\r
+                       #include "UC3/Host_UC3.h"\r
+               #endif\r
+\r
+       /* Disable C linkage for C++ Compilers: */\r
+               #if defined(__cplusplus)\r
+                       }\r
+               #endif\r
+\r
 #endif\r
 \r
 /** @} */\r