Add start of a SDP service table, which will be linked to the Bluetooth SDP code.
[pub/USBasp.git] / LUFA / Drivers / USB / LowLevel / Endpoint.h
index ff0b640..b18ff45 100644 (file)
   this software.\r
 */\r
 \r
+/** \file\r
+ *  \brief USB device endpoint management definitions.\r
+ *\r
+ *  This file contains structures, function prototypes and macros related to the management of the device's\r
+ *  data endpoints when the library is initialized in USB device 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_EndpointManagement Endpoint Management\r
  *\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
                        /** Endpoint data direction mask for \ref Endpoint_ConfigureEndpoint(). This indicates that the endpoint\r
                         */\r
                        #define ENDPOINT_EPNUM_MASK                   0x07\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 ENDPOINT_EPDIR_MASK                   0x80\r
+\r
                        /** Endpoint bank size mask, for masking against endpoint addresses to retrieve the endpoint's\r
                         *  bank size in the device.\r
                         */\r
                                #define Endpoint_ClearSETUP()                 MACROS{ UEINTX &= ~(1 << RXSTPI); }MACROE\r
 \r
                                #if !defined(CONTROL_ONLY_DEVICE)\r
-                                       #define Endpoint_ClearIN()                MACROS{ uint8_t Temp = UEINTX; UEINTX = (Temp & ~(1 << TXINI)); \\r
-                                                                                         UEINTX = (Temp & ~(1 << FIFOCON)); }MACROE\r
+                                       #define Endpoint_ClearIN()                MACROS{ UEINTX &= ~((1 << TXINI) | (1 << FIFOCON)); }MACROE\r
                                #else\r
                                        #define Endpoint_ClearIN()                MACROS{ UEINTX &= ~(1 << TXINI); }MACROE\r
                                #endif\r
 \r
                                #if !defined(CONTROL_ONLY_DEVICE)\r
-                                       #define Endpoint_ClearOUT()               MACROS{ uint8_t Temp = UEINTX; UEINTX = (Temp & ~(1 << RXOUTI)); \\r
-                                                                                         UEINTX = (Temp & ~(1 << FIFOCON)); }MACROE\r
+                                       #define Endpoint_ClearOUT()               MACROS{ UEINTX &= ~((1 << RXOUTI) | (1 << FIFOCON)); }MACROE\r
                                #else\r
                                        #define Endpoint_ClearOUT()               MACROS{ UEINTX &= ~(1 << RXOUTI); }MACROE                     \r
                                #endif\r
                         *  The banking mode may be either \ref ENDPOINT_BANK_SINGLE or \ref ENDPOINT_BANK_DOUBLE.\r
                         *\r
                         *  \note The default control endpoint does not have to be manually configured, as it is automatically\r
-                        *  configured by the library internally.\r
+                        *        configured by the library internally.\r
+                        *        \n\n\r
                         *\r
                         *  \note This routine will select the specified endpoint, and the endpoint will remain selected\r
                         *        once the routine completes regardless of if the endpoint configuration succeeds.\r
                         *\r
                         *  \note This function automatically clears the control transfer's status stage. Do not manually attempt\r
                         *        to clear the status stage when using this routine in a control transaction.\r
+                        *        \n\n\r
                         *\r
                         *  \note This routine should only be used on CONTROL type endpoints.\r
                         *\r
                         *\r
                         *  \note This function automatically clears the control transfer's status stage. Do not manually attempt\r
                         *        to clear the status stage when using this routine in a control transaction.\r
+                        *        \n\n\r
                         *\r
                         *  \note This routine should only be used on CONTROL type endpoints.\r
                         *\r
                         *\r
                         *  \note This function automatically clears the control transfer's status stage. Do not manually attempt\r
                         *        to clear the status stage when using this routine in a control transaction.\r
+                        *        \n\n\r
                         *\r
                         *  \note The FLASH data must be located in the first 64KB of FLASH for this function to work correctly.\r
+                        *        \n\n\r
                         *\r
                         *  \note This routine should only be used on CONTROL type endpoints.\r
                         *\r
                         *\r
                         *  \note This function automatically clears the control transfer's status stage. Do not manually attempt\r
                         *        to clear the status stage when using this routine in a control transaction.\r
+                        *        \n\n\r
                         *\r
                         *  \note This routine should only be used on CONTROL type endpoints.\r
                         *\r
                         *\r
                         *  \note This function automatically clears the control transfer's status stage. Do not manually attempt\r
                         *        to clear the status stage when using this routine in a control transaction.\r
+                        *        \n\n\r
                         *\r
                         *  \note This routine should only be used on CONTROL type endpoints.\r
                         *\r
                         *\r
                         *  \note This function automatically clears the control transfer's status stage. Do not manually attempt\r
                         *        to clear the status stage when using this routine in a control transaction.\r
+                        *        \n\n\r
                         *\r
                         *  \note The FLASH data must be located in the first 64KB of FLASH for this function to work correctly.\r
+                        *        \n\n\r
                         *\r
                         *  \note This routine should only be used on CONTROL type endpoints.\r
                         *\r
                         *\r
                         *  \note This function automatically clears the control transfer's status stage. Do not manually attempt\r
                         *        to clear the status stage when using this routine in a control transaction.\r
+                        *        \n\n\r
                         *\r
                         *  \note This routine should only be used on CONTROL type endpoints.\r
                         *\r
                         *\r
                         *  \note This function automatically clears the control transfer's status stage. Do not manually attempt\r
                         *        to clear the status stage when using this routine in a control transaction.\r
+                        *        \n\n\r
                         *\r
                         *  \note This routine should only be used on CONTROL type endpoints.\r
                         *\r
                         *\r
                         *  \note This function automatically clears the control transfer's status stage. Do not manually attempt\r
                         *        to clear the status stage when using this routine in a control transaction.\r
+                        *        \n\n\r
                         *\r
                         *  \note This routine should only be used on CONTROL type endpoints.\r
                         *\r
                         *\r
                         *  \note This function automatically clears the control transfer's status stage. Do not manually attempt\r
                         *        to clear the status stage when using this routine in a control transaction.\r
+                        *        \n\n\r
                         *\r
                         *  \note This routine should only be used on CONTROL type endpoints.\r
                         *\r