More fixes to the AVRISP command timeout system so that it should no longer lock...
[pub/USBasp.git] / LUFA / Drivers / USB / LowLevel / Pipe.h
index c048491..3e25d49 100644 (file)
@@ -1,21 +1,21 @@
 /*\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
-  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
                        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.h instead.\r
+               #endif\r
+               \r
        /* Public Interface - May be used in end-application: */\r
                /* Macros: */\r
                        /** Mask for \ref Pipe_GetErrorFlags(), indicating that an overflow error occurred in the pipe on the received data. */\r
                         */\r
                        #define PIPE_EPNUM_MASK                 0x0F\r
 \r
+                       /** Endpoint direction mask, for masking against endpoint addresses to retrieve the endpoint's\r
+                        *  direction for comparing with the ENDPOINT_DESCRIPTOR_DIR_* masks.\r
+                        */\r
+                       #define PIPE_EPDIR_MASK                 0x80\r
+\r
                /* Pseudo-Function Macros: */\r
                        #if defined(__DOXYGEN__)\r
                                /** Indicates the number of bytes currently stored in the current pipes's selected bank.\r
 \r
                                #define Pipe_GetPipeToken()            (UPCFG0X & PIPE_TOKEN_MASK)\r
 \r
-                               #define Pipe_SetToken(token)           MACROS{ UPCFG0X = ((UPCFG0X & ~PIPE_TOKEN_MASK) | (token)); }MACROE\r
+                               #define Pipe_SetPipeToken(token)       MACROS{ UPCFG0X = ((UPCFG0X & ~PIPE_TOKEN_MASK) | (token)); }MACROE\r
                                \r
                                #define Pipe_SetInfiniteINRequests()   MACROS{ UPCONX |= (1 << INMODE); }MACROE\r
 \r
                        /** Determines if a pipe has been bound to the given device endpoint address. If a pipe which is bound to the given\r
                         *  endpoint is found, it is automatically selected.\r
                         *\r
-                        *  \param[in] EndpointAddress Address of the endpoint within the attached device to check\r
+                        *  \param[in] EndpointAddress Address and direction mask of the endpoint within the attached device to check\r
                         *\r
-                        *  \return Boolean true if a pipe bound to the given endpoint address is found, false otherwise\r
+                        *  \return Boolean true if a pipe bound to the given endpoint address of the specified direction is found, false\r
+                        *          otherwise\r
                         */\r
                        bool Pipe_IsEndpointBound(const uint8_t EndpointAddress);\r
                \r
                                  return (4 << EPSIZE0);\r
                                else\r
                                  return (5 << EPSIZE0);\r
-                       };\r
+                       }\r
 \r
        #endif\r
 \r