Fixed incorrect comparison in the descriptor callback routine of the TeensyHID bootlo...
[pub/USBasp.git] / LUFA / Drivers / USB / LowLevel / Host.h
index 0a07002..97d908d 100644 (file)
@@ -1,21 +1,21 @@
 /*\r
              LUFA Library\r
 /*\r
              LUFA Library\r
-     Copyright (C) Dean Camera, 2009.\r
+     Copyright (C) Dean Camera, 2010.\r
               \r
   dean [at] fourwalledcubicle [dot] com\r
       www.fourwalledcubicle.com\r
 */\r
 \r
 /*\r
               \r
   dean [at] fourwalledcubicle [dot] com\r
       www.fourwalledcubicle.com\r
 */\r
 \r
 /*\r
-  Copyright 2009  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
-\r
-  Permission to use, copy, modify, and distribute this software\r
-  and its documentation for any purpose and without fee is hereby\r
-  granted, provided that the above copyright notice appear in all\r
-  copies and that both that the copyright notice and this\r
-  permission notice and warranty disclaimer appear in supporting\r
-  documentation, and that the name of the author not be used in\r
-  advertising or publicity pertaining to distribution of the\r
+  Copyright 2010  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
+\r
+  Permission to use, copy, modify, distribute, and sell this \r
+  software and its documentation for any purpose is hereby granted\r
+  without fee, provided that the above copyright notice appear in \r
+  all copies and that both that the copyright notice and this\r
+  permission notice and warranty disclaimer appear in supporting \r
+  documentation, and that the name of the author not be used in \r
+  advertising or publicity pertaining to distribution of the \r
   software without specific, written prior permission.\r
 \r
   The author disclaim all warranties with regard to this\r
   software without specific, written prior permission.\r
 \r
   The author disclaim all warranties with regard to this\r
   this software.\r
 */\r
 \r
   this software.\r
 */\r
 \r
+/** \file\r
+ *  \brief USB host mode definitions.\r
+ *\r
+ *  This file contains structures, function prototypes and macros related to USB host mode.\r
+ *\r
+ *  \note This file should not be included directly. It is automatically included as needed by the USB driver\r
+ *        dispatch header located in LUFA/Drivers/USB/USB.h.\r
+ */\r
+\r
 /** \ingroup Group_USB\r
  *  @defgroup Group_Host Host Management\r
  *\r
 /** \ingroup Group_USB\r
  *  @defgroup Group_Host Host Management\r
  *\r
                #include <util/delay.h>\r
 \r
                #include "../../../Common/Common.h"\r
                #include <util/delay.h>\r
 \r
                #include "../../../Common/Common.h"\r
-               #include "../HighLevel/USBInterrupt.h"\r
                #include "../HighLevel/StdDescriptors.h"\r
                #include "Pipe.h"\r
                #include "../HighLevel/StdDescriptors.h"\r
                #include "Pipe.h"\r
+               #include "USBInterrupt.h"\r
 \r
        /* Enable C linkage for C++ Compilers: */\r
                #if defined(__cplusplus)\r
                        extern "C" {\r
                #endif\r
 \r
 \r
        /* Enable C linkage for C++ Compilers: */\r
                #if defined(__cplusplus)\r
                        extern "C" {\r
                #endif\r
 \r
+       /* Preprocessor Checks: */\r
+               #if !defined(__INCLUDE_FROM_USB_DRIVER)\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
                /* Macros: */\r
                        /** Indicates the fixed USB device address which any attached device is enumerated to when in\r
        /* Public Interface - May be used in end-application: */\r
                /* Macros: */\r
                        /** Indicates the fixed USB device address which any attached device is enumerated to when in\r
                         *\r
                         *  \return A value from the \ref USB_Host_SendControlErrorCodes_t enum to indicate the result.\r
                         */\r
                         *\r
                         *  \return A value from the \ref USB_Host_SendControlErrorCodes_t enum to indicate the result.\r
                         */\r
-                       uint8_t USB_Host_GetDeviceStringDescriptor(uint8_t Index, void* const Buffer, uint8_t BufferLength);\r
+                       uint8_t USB_Host_GetDeviceStringDescriptor(const uint8_t Index, void* const Buffer, const uint8_t BufferLength);\r
                        \r
                        /** Clears a stall condition on the given pipe, via a ClearFeature request to the attached device.\r
                         *\r
                        \r
                        /** Clears a stall condition on the given pipe, via a ClearFeature request to the attached device.\r
                         *\r
                        /** Enum for the various states of the USB Host state machine. Only some states are\r
                         *  implemented in the LUFA library - other states are left to the user to implement.\r
                         *\r
                        /** Enum for the various states of the USB Host state machine. Only some states are\r
                         *  implemented in the LUFA library - other states are left to the user to implement.\r
                         *\r
-                        *  For information on each state, refer to the USB 2.0 specification. Some states have\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
                         *\r
                         *  \see \ref USB_HostState, which stores the current host state machine state.\r
                         */\r
                        void    USB_Host_ProcessNextHostState(void);\r
                        uint8_t USB_Host_WaitMS(uint8_t MS);\r
                        \r
                        void    USB_Host_ProcessNextHostState(void);\r
                        uint8_t USB_Host_WaitMS(uint8_t MS);\r
                        \r
-                       #if defined(INCLUDE_FROM_HOST_C)\r
+                       #if defined(__INCLUDE_FROM_HOST_C)\r
                                static void USB_Host_ResetDevice(void);\r
                        #endif\r
        #endif\r
                                static void USB_Host_ResetDevice(void);\r
                        #endif\r
        #endif\r