X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/d6edfe35c8a9490407e4a5e34f8e5108c6a260a3..e322f14620a1064efc4b3a98cf701efc48da81cc:/LUFA/Drivers/USB/LowLevel/Pipe.h diff --git a/LUFA/Drivers/USB/LowLevel/Pipe.h b/LUFA/Drivers/USB/LowLevel/Pipe.h index c04849167..3e25d4976 100644 --- a/LUFA/Drivers/USB/LowLevel/Pipe.h +++ b/LUFA/Drivers/USB/LowLevel/Pipe.h @@ -1,21 +1,21 @@ /* LUFA Library - Copyright (C) Dean Camera, 2009. + Copyright (C) Dean Camera, 2010. dean [at] fourwalledcubicle [dot] com www.fourwalledcubicle.com */ /* - Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - Permission to use, copy, modify, and distribute this software - and its documentation for any purpose and without fee is hereby - granted, provided that the above copyright notice appear in all - copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the + Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the software without specific, written prior permission. The author disclaim all warranties with regard to this @@ -91,6 +91,11 @@ extern "C" { #endif + /* Preprocessor Checks: */ + #if !defined(__INCLUDE_FROM_USB_DRIVER) + #error Do not include this file directly. Include LUFA/Drivers/USB.h instead. + #endif + /* Public Interface - May be used in end-application: */ /* Macros: */ /** Mask for \ref Pipe_GetErrorFlags(), indicating that an overflow error occurred in the pipe on the received data. */ @@ -175,6 +180,11 @@ */ #define PIPE_EPNUM_MASK 0x0F + /** Endpoint direction mask, for masking against endpoint addresses to retrieve the endpoint's + * direction for comparing with the ENDPOINT_DESCRIPTOR_DIR_* masks. + */ + #define PIPE_EPDIR_MASK 0x80 + /* Pseudo-Function Macros: */ #if defined(__DOXYGEN__) /** Indicates the number of bytes currently stored in the current pipes's selected bank. @@ -432,7 +442,7 @@ #define Pipe_GetPipeToken() (UPCFG0X & PIPE_TOKEN_MASK) - #define Pipe_SetToken(token) MACROS{ UPCFG0X = ((UPCFG0X & ~PIPE_TOKEN_MASK) | (token)); }MACROE + #define Pipe_SetPipeToken(token) MACROS{ UPCFG0X = ((UPCFG0X & ~PIPE_TOKEN_MASK) | (token)); }MACROE #define Pipe_SetInfiniteINRequests() MACROS{ UPCONX |= (1 << INMODE); }MACROE @@ -805,9 +815,10 @@ /** Determines if a pipe has been bound to the given device endpoint address. If a pipe which is bound to the given * endpoint is found, it is automatically selected. * - * \param[in] EndpointAddress Address of the endpoint within the attached device to check + * \param[in] EndpointAddress Address and direction mask of the endpoint within the attached device to check * - * \return Boolean true if a pipe bound to the given endpoint address is found, false otherwise + * \return Boolean true if a pipe bound to the given endpoint address of the specified direction is found, false + * otherwise */ bool Pipe_IsEndpointBound(const uint8_t EndpointAddress); @@ -1032,7 +1043,7 @@ return (4 << EPSIZE0); else return (5 << EPSIZE0); - }; + } #endif