Added new USB_DeviceState variable to keep track of the current Device mode USB state.
[pub/USBasp.git] / LUFA / Drivers / USB / LowLevel / Device.h
index 975d09a..e162a59 100644 (file)
 \r
                                #define USB_Device_IsUSBSuspended()           ((UDINT &  (1 << SUSPI)) ? true : false)\r
                        #endif\r
-\r
+                       \r
+               /* Type Defines: */\r
+                       enum USB_Device_States_t\r
+                       {\r
+                               DEVICE_STATE_Unattached                   = 0, /**< Internally implemented by the library. This state indicates\r
+                                                                               *   that the device is not currently connected to a host.\r
+                                                                               */\r
+                               DEVICE_STATE_Powered                      = 1, /**< Internally implemented by the library. This state indicates\r
+                                                                               *   that the device is connected to a host, but enumeration has not\r
+                                                                               *   yet begun.\r
+                                                                               */\r
+                               DEVICE_STATE_Default                      = 2, /**< Internally implemented by the library. This state indicates\r
+                                                                               *   that the device's USB bus has been reset by the host and it is\r
+                                                                               *   now waiting for the host to begin the enumeration process.\r
+                                                                               */\r
+                               DEVICE_STATE_Addressed                    = 3, /**< Internally implemented by the library. This state indicates\r
+                                                                               *   that the device has been addressed by the USB Host, but is not\r
+                                                                               *   yet configured.\r
+                                                                               */\r
+                               DEVICE_STATE_Configured                   = 4, /**< May be implemented by the user project. This state indicates\r
+                                                                               *   that the device has been enumerated by the host and is ready\r
+                                                                               *   for USB communications to begin.\r
+                                                                               */\r
+                               DEVICE_STATE_Suspended                    = 5, /**< May be implemented by the user project. This state indicates\r
+                                                                               *   that the USB bus has been suspended by the host, and the device\r
+                                                                               *   should power down to a minimal power level until the bus is\r
+                                                                               *   resumed.\r
+                                                                               */\r
+                       };\r
+                       \r
                /* Function Prototypes: */\r
                        /** Function to retrieve a given descriptor's size and memory location from the given descriptor type value,\r
                         *  index and language ID. This function MUST be overridden in the user application (added with full, identical  \r