]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - protocol/lufa/LUFA-120730/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.h
Remove core library and build files
[qmk_firmware.git] / protocol / lufa / LUFA-120730 / LUFA / Drivers / USB / Core / AVR8 / Pipe_AVR8.h
diff --git a/protocol/lufa/LUFA-120730/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.h b/protocol/lufa/LUFA-120730/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.h
deleted file mode 100644 (file)
index 24c7b36..0000000
+++ /dev/null
@@ -1,921 +0,0 @@
-/*\r
-             LUFA Library\r
-     Copyright (C) Dean Camera, 2012.\r
-\r
-  dean [at] fourwalledcubicle [dot] com\r
-           www.lufa-lib.org\r
-*/\r
-\r
-/*\r
-  Copyright 2012  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, including all implied warranties of merchantability\r
-  and fitness.  In no event shall the author be liable for any\r
-  special, indirect or consequential damages or any damages\r
-  whatsoever resulting from loss of use, data or profits, whether\r
-  in an action of contract, negligence or other tortious action,\r
-  arising out of or in connection with the use or performance of\r
-  this software.\r
-*/\r
-\r
-/** \file\r
- *  \brief USB Pipe definitions for the AVR8 microcontrollers.\r
- *  \copydetails Group_PipeManagement_AVR8\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_PipeRW\r
- *  \defgroup Group_PipeRW_AVR8 Pipe Data Reading and Writing (AVR8)\r
- *  \brief Pipe data read/write definitions for the Atmel AVR8 architecture.\r
- *\r
- *  Functions, macros, variables, enums and types related to data reading and writing from and to pipes.\r
- */\r
-\r
-/** \ingroup Group_PipePrimitiveRW\r
- *  \defgroup Group_PipePrimitiveRW_AVR8 Read/Write of Primitive Data Types (AVR8)\r
- *  \brief Pipe primitive data read/write definitions for the Atmel AVR8 architecture.\r
- *\r
- *  Functions, macros, variables, enums and types related to data reading and writing of primitive data types\r
- *  from and to pipes.\r
- */\r
-\r
-/** \ingroup Group_PipePacketManagement\r
- *  \defgroup Group_PipePacketManagement_AVR8 Pipe Packet Management (AVR8)\r
- *  \brief Pipe packet management definitions for the Atmel AVR8 architecture.\r
- *\r
- *  Functions, macros, variables, enums and types related to packet management of pipes.\r
- */\r
-\r
-/** \ingroup Group_PipeControlReq\r
- *  \defgroup Group_PipeControlReq_AVR8 Pipe Control Request Management (AVR8)\r
- *  \brief Pipe control request management definitions for the Atmel AVR8 architecture.\r
- *\r
- *  Module for host mode request processing. This module allows for the transmission of standard, class and\r
- *  vendor control requests to the default control endpoint of an attached device while in host mode.\r
- *\r
- *  \see Chapter 9 of the USB 2.0 specification.\r
- */\r
-\r
-/** \ingroup Group_PipeManagement\r
- *  \defgroup Group_PipeManagement_AVR8 Pipe Management (AVR8)\r
- *  \brief Pipe management definitions for the Atmel AVR8 architecture.\r
- *\r
- *  This module contains functions, macros and enums related to pipe management when in USB Host mode. This\r
- *  module contains the pipe management macros, as well as pipe interrupt and data send/receive functions\r
- *  for various data types.\r
- *\r
- *  @{\r
- */\r
-\r
-#ifndef __PIPE_AVR8_H__\r
-#define __PIPE_AVR8_H__\r
-\r
-       /* Includes: */\r
-               #include "../../../../Common/Common.h"\r
-               #include "../USBTask.h"\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
-                       /** \name Pipe Error Flag Masks */\r
-                       //@{\r
-                       /** Mask for \ref Pipe_GetErrorFlags(), indicating that an overflow error occurred in the pipe on the received data. */\r
-                       #define PIPE_ERRORFLAG_OVERFLOW         (1 << 6)\r
-\r
-                       /** Mask for \ref Pipe_GetErrorFlags(), indicating that an underflow error occurred in the pipe on the received data. */\r
-                       #define PIPE_ERRORFLAG_UNDERFLOW        (1 << 5)\r
-\r
-                       /** Mask for \ref Pipe_GetErrorFlags(), indicating that a CRC error occurred in the pipe on the received data. */\r
-                       #define PIPE_ERRORFLAG_CRC16            (1 << 4)\r
-\r
-                       /** Mask for \ref Pipe_GetErrorFlags(), indicating that a hardware timeout error occurred in the pipe. */\r
-                       #define PIPE_ERRORFLAG_TIMEOUT          (1 << 3)\r
-\r
-                       /** Mask for \ref Pipe_GetErrorFlags(), indicating that a hardware PID error occurred in the pipe. */\r
-                       #define PIPE_ERRORFLAG_PID              (1 << 2)\r
-\r
-                       /** Mask for \ref Pipe_GetErrorFlags(), indicating that a hardware data PID error occurred in the pipe. */\r
-                       #define PIPE_ERRORFLAG_DATAPID          (1 << 1)\r
-\r
-                       /** Mask for \ref Pipe_GetErrorFlags(), indicating that a hardware data toggle error occurred in the pipe. */\r
-                       #define PIPE_ERRORFLAG_DATATGL          (1 << 0)\r
-                       //@}\r
-\r
-                       /** \name Pipe Token Masks */\r
-                       //@{\r
-                       /** Token mask for \ref Pipe_SetPipeToken() and \ref Pipe_GetPipeToken(). This sets the pipe as a SETUP token (for CONTROL type pipes),\r
-                        *  which will trigger a control request on the attached device when data is written to the pipe.\r
-                        */\r
-                       #define PIPE_TOKEN_SETUP                (0 << PTOKEN0)\r
-\r
-                       /** Token mask for \ref Pipe_SetPipeToken() and \ref Pipe_GetPipeToken(). This sets the pipe as a IN token (for non-CONTROL type pipes),\r
-                        *  indicating that the pipe data will flow from device to host.\r
-                        */\r
-                       #define PIPE_TOKEN_IN                   (1 << PTOKEN0)\r
-\r
-                       /** Token mask for \ref Pipe_SetPipeToken() and \ref Pipe_GetPipeToken(). This sets the pipe as a OUT token (for non-CONTROL type pipes),\r
-                        *  indicating that the pipe data will flow from host to device.\r
-                        */\r
-                       #define PIPE_TOKEN_OUT                  (2 << PTOKEN0)\r
-                       //@}\r
-\r
-                       /** Default size of the default control pipe's bank, until altered by the Endpoint0Size value\r
-                        *  in the device descriptor of the attached device.\r
-                        */\r
-                       #define PIPE_CONTROLPIPE_DEFAULT_SIZE   64\r
-\r
-                       /** Total number of pipes (including the default control pipe at address 0) which may be used in\r
-                        *  the device. Different USB AVR models support different amounts of pipes, this value reflects\r
-                        *  the maximum number of pipes for the currently selected AVR model.\r
-                        */\r
-                       #define PIPE_TOTAL_PIPES                7\r
-\r
-                       /** Size in bytes of the largest pipe bank size possible in the device. Not all banks on each AVR\r
-                        *  model supports the largest bank size possible on the device; different pipe numbers support\r
-                        *  different maximum bank sizes. This value reflects the largest possible bank of any pipe on the\r
-                        *  currently selected USB AVR model.\r
-                        */\r
-                       #define PIPE_MAX_SIZE                   256\r
-\r
-               /* Enums: */\r
-                       /** Enum for the possible error return codes of the \ref Pipe_WaitUntilReady() function.\r
-                        *\r
-                        *  \ingroup Group_PipeRW_AVR8\r
-                        */\r
-                       enum Pipe_WaitUntilReady_ErrorCodes_t\r
-                       {\r
-                               PIPE_READYWAIT_NoError                 = 0, /**< Pipe ready for next packet, no error. */\r
-                               PIPE_READYWAIT_PipeStalled             = 1,     /**< The device stalled the pipe while waiting. */\r
-                               PIPE_READYWAIT_DeviceDisconnected      = 2,     /**< Device was disconnected from the host while waiting. */\r
-                               PIPE_READYWAIT_Timeout                 = 3, /**< The device failed to accept or send the next packet\r
-                                                                            *   within the software timeout period set by the\r
-                                                                            *   \ref USB_STREAM_TIMEOUT_MS macro.\r
-                                                                            */\r
-                       };\r
-\r
-               /* Inline Functions: */\r
-                       /** Indicates the number of bytes currently stored in the current pipes's selected bank.\r
-                        *\r
-                        *  \ingroup Group_PipeRW_AVR8\r
-                        *\r
-                        *  \return Total number of bytes in the currently selected pipe's FIFO buffer.\r
-                        */\r
-                       static inline uint16_t Pipe_BytesInPipe(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;\r
-                       static inline uint16_t Pipe_BytesInPipe(void)\r
-                       {\r
-                               return UPBCX;\r
-                       }\r
-\r
-                       /** Determines the currently selected pipe's direction.\r
-                        *\r
-                        *  \return The currently selected pipe's direction, as a \c PIPE_DIR_* mask.\r
-                        */\r
-                       static inline uint8_t Pipe_GetPipeDirection(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;\r
-                       static inline uint8_t Pipe_GetPipeDirection(void)\r
-                       {\r
-                               return (UPCFG0X & (1 << EPDIR)) ? PIPE_DIR_IN : PIPE_DIR_OUT;\r
-                       }\r
-                       \r
-                       /** Returns the pipe address of the currently selected pipe. This is typically used to save the\r
-                        *  currently selected pipe address so that it can be restored after another pipe has been manipulated.\r
-                        *\r
-                        *  \return Index of the currently selected pipe.\r
-                        */\r
-                       static inline uint8_t Pipe_GetCurrentPipe(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;\r
-                       static inline uint8_t Pipe_GetCurrentPipe(void)\r
-                       {\r
-                               return ((UPNUM & PIPE_PIPENUM_MASK) | Pipe_GetPipeDirection());\r
-                       }\r
-\r
-                       /** Selects the given pipe address. Any pipe operations which do not require the pipe address to be\r
-                        *  indicated will operate on the currently selected pipe.\r
-                        *\r
-                        *  \param[in] Address  Address of the pipe to select.\r
-                        */\r
-                       static inline void Pipe_SelectPipe(const uint8_t Address) ATTR_ALWAYS_INLINE;\r
-                       static inline void Pipe_SelectPipe(const uint8_t Address)\r
-                       {\r
-                               UPNUM = (Address & PIPE_PIPENUM_MASK);\r
-                       }\r
-\r
-                       /** Resets the desired pipe, including the pipe banks and flags.\r
-                        *\r
-                        *  \param[in] Address  Address of the pipe to reset.\r
-                        */\r
-                       static inline void Pipe_ResetPipe(const uint8_t Address) ATTR_ALWAYS_INLINE;\r
-                       static inline void Pipe_ResetPipe(const uint8_t Address)\r
-                       {\r
-                               UPRST = (1 << (Address & PIPE_PIPENUM_MASK));\r
-                               UPRST = 0;\r
-                       }\r
-\r
-                       /** Enables the currently selected pipe so that data can be sent and received through it to and from\r
-                        *  an attached device.\r
-                        *\r
-                        *  \pre The currently selected pipe must first be configured properly via \ref Pipe_ConfigurePipe().\r
-                        */\r
-                       static inline void Pipe_EnablePipe(void) ATTR_ALWAYS_INLINE;\r
-                       static inline void Pipe_EnablePipe(void)\r
-                       {\r
-                               UPCONX |= (1 << PEN);\r
-                       }\r
-\r
-                       /** Disables the currently selected pipe so that data cannot be sent and received through it to and\r
-                        *  from an attached device.\r
-                        */\r
-                       static inline void Pipe_DisablePipe(void) ATTR_ALWAYS_INLINE;\r
-                       static inline void Pipe_DisablePipe(void)\r
-                       {\r
-                               UPCONX &= ~(1 << PEN);\r
-                       }\r
-\r
-                       /** Determines if the currently selected pipe is enabled, but not necessarily configured.\r
-                        *\r
-                        * \return Boolean \c true if the currently selected pipe is enabled, \c false otherwise.\r
-                        */\r
-                       static inline bool Pipe_IsEnabled(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;\r
-                       static inline bool Pipe_IsEnabled(void)\r
-                       {\r
-                               return ((UPCONX & (1 << PEN)) ? true : false);\r
-                       }\r
-\r
-                       /** Gets the current pipe token, indicating the pipe's data direction and type.\r
-                        *\r
-                        *  \return The current pipe token, as a \c PIPE_TOKEN_* mask.\r
-                        */\r
-                       static inline uint8_t Pipe_GetPipeToken(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;\r
-                       static inline uint8_t Pipe_GetPipeToken(void)\r
-                       {\r
-                               return (UPCFG0X & (0x03 << PTOKEN0));\r
-                       }\r
-\r
-                       /** Sets the token for the currently selected pipe to one of the tokens specified by the \c PIPE_TOKEN_*\r
-                        *  masks. This can be used on CONTROL type pipes, to allow for bidirectional transfer of data during\r
-                        *  control requests, or on regular pipes to allow for half-duplex bidirectional data transfer to devices\r
-                        *  which have two endpoints of opposite direction sharing the same endpoint address within the device.\r
-                        *\r
-                        *  \param[in] Token  New pipe token to set the selected pipe to, as a \c PIPE_TOKEN_* mask.\r
-                        */\r
-                       static inline void Pipe_SetPipeToken(const uint8_t Token) ATTR_ALWAYS_INLINE;\r
-                       static inline void Pipe_SetPipeToken(const uint8_t Token)\r
-                       {\r
-                               UPCFG0X = ((UPCFG0X & ~(0x03 << PTOKEN0)) | Token);\r
-                       }\r
-\r
-                       /** Configures the currently selected pipe to allow for an unlimited number of IN requests. */\r
-                       static inline void Pipe_SetInfiniteINRequests(void) ATTR_ALWAYS_INLINE;\r
-                       static inline void Pipe_SetInfiniteINRequests(void)\r
-                       {\r
-                               UPCONX |= (1 << INMODE);\r
-                       }\r
-\r
-                       /** Configures the currently selected pipe to only allow the specified number of IN requests to be\r
-                        *  accepted by the pipe before it is automatically frozen.\r
-                        *\r
-                        *  \param[in] TotalINRequests  Total number of IN requests that the pipe may receive before freezing.\r
-                        */\r
-                       static inline void Pipe_SetFiniteINRequests(const uint8_t TotalINRequests) ATTR_ALWAYS_INLINE;\r
-                       static inline void Pipe_SetFiniteINRequests(const uint8_t TotalINRequests)\r
-                       {\r
-                               UPCONX &= ~(1 << INMODE);\r
-                               UPINRQX = TotalINRequests;\r
-                       }\r
-\r
-                       /** Determines if the currently selected pipe is configured.\r
-                        *\r
-                        *  \return Boolean \c true if the selected pipe is configured, \c false otherwise.\r
-                        */\r
-                       static inline bool Pipe_IsConfigured(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;\r
-                       static inline bool Pipe_IsConfigured(void)\r
-                       {\r
-                               return ((UPSTAX & (1 << CFGOK)) ? true : false);\r
-                       }\r
-\r
-                       /** Retrieves the endpoint address of the endpoint within the attached device that the currently selected\r
-                        *  pipe is bound to.\r
-                        *\r
-                        *  \return Endpoint address the currently selected pipe is bound to.\r
-                        */\r
-                       static inline uint8_t Pipe_GetBoundEndpointAddress(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;\r
-                       static inline uint8_t Pipe_GetBoundEndpointAddress(void)\r
-                       {\r
-                               uint8_t UPCFG0X_Temp = UPCFG0X;\r
-                               \r
-                               return (((UPCFG0X_Temp >> PEPNUM0) & PIPE_EPNUM_MASK) | ((UPCFG0X_Temp & PEPNUM1) ? ENDPOINT_DIR_OUT : ENDPOINT_DIR_IN));\r
-                       }\r
-\r
-                       /** Sets the period between interrupts for an INTERRUPT type pipe to a specified number of milliseconds.\r
-                        *\r
-                        *  \param[in] Milliseconds  Number of milliseconds between each pipe poll.\r
-                        */\r
-                       static inline void Pipe_SetInterruptPeriod(const uint8_t Milliseconds) ATTR_ALWAYS_INLINE;\r
-                       static inline void Pipe_SetInterruptPeriod(const uint8_t Milliseconds)\r
-                       {\r
-                               UPCFG2X = Milliseconds;\r
-                       }\r
-\r
-                       /** Returns a mask indicating which pipe's interrupt periods have elapsed, indicating that the pipe should\r
-                        *  be serviced.\r
-                        *\r
-                        *  \return Mask whose bits indicate which pipes have interrupted.\r
-                        */\r
-                       static inline uint8_t Pipe_GetPipeInterrupts(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;\r
-                       static inline uint8_t Pipe_GetPipeInterrupts(void)\r
-                       {\r
-                               return UPINT;\r
-                       }\r
-\r
-                       /** Determines if the specified pipe address has interrupted (valid only for INTERRUPT type\r
-                        *  pipes).\r
-                        *\r
-                        *  \param[in] Address  Address of the pipe whose interrupt flag should be tested.\r
-                        *\r
-                        *  \return Boolean \c true if the specified pipe has interrupted, \c false otherwise.\r
-                        */\r
-                       static inline bool Pipe_HasPipeInterrupted(const uint8_t Address) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;\r
-                       static inline bool Pipe_HasPipeInterrupted(const uint8_t Address)\r
-                       {\r
-                               return ((UPINT & (1 << (Address & PIPE_PIPENUM_MASK))) ? true : false);\r
-                       }\r
-\r
-                       /** Unfreezes the selected pipe, allowing it to communicate with an attached device. */\r
-                       static inline void Pipe_Unfreeze(void) ATTR_ALWAYS_INLINE;\r
-                       static inline void Pipe_Unfreeze(void)\r
-                       {\r
-                               UPCONX &= ~(1 << PFREEZE);\r
-                       }\r
-\r
-                       /** Freezes the selected pipe, preventing it from communicating with an attached device. */\r
-                       static inline void Pipe_Freeze(void) ATTR_ALWAYS_INLINE;\r
-                       static inline void Pipe_Freeze(void)\r
-                       {\r
-                               UPCONX |= (1 << PFREEZE);\r
-                       }\r
-\r
-                       /** Determines if the currently selected pipe is frozen, and not able to accept data.\r
-                        *\r
-                        *  \return Boolean \c true if the currently selected pipe is frozen, \c false otherwise.\r
-                        */\r
-                       static inline bool Pipe_IsFrozen(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;\r
-                       static inline bool Pipe_IsFrozen(void)\r
-                       {\r
-                               return ((UPCONX & (1 << PFREEZE)) ? true : false);\r
-                       }\r
-\r
-                       /** Clears the error flags for the currently selected pipe. */\r
-                       static inline void Pipe_ClearError(void) ATTR_ALWAYS_INLINE;\r
-                       static inline void Pipe_ClearError(void)\r
-                       {\r
-                               UPERRX = 0;\r
-                               UPINTX &= ~(1 << PERRI);\r
-                       }\r
-\r
-                       /** Determines if the master pipe error flag is set for the currently selected pipe, indicating that\r
-                        *  some sort of hardware error has occurred on the pipe.\r
-                        *\r
-                        *  \see \ref Pipe_GetErrorFlags() macro for information on retrieving the exact error flag.\r
-                        *\r
-                        *  \return Boolean \c true if an error has occurred on the selected pipe, \c false otherwise.\r
-                        */\r
-                       static inline bool Pipe_IsError(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;\r
-                       static inline bool Pipe_IsError(void)\r
-                       {\r
-                               return ((UPINTX & (1 << PERRI)) ? true : false);\r
-                       }\r
-\r
-                       /** Gets a mask of the hardware error flags which have occurred on the currently selected pipe. This\r
-                        *  value can then be masked against the \c PIPE_ERRORFLAG_* masks to determine what error has occurred.\r
-                        *\r
-                        *  \return  Mask comprising of \c PIPE_ERRORFLAG_* bits indicating what error has occurred on the selected pipe.\r
-                        */\r
-                       static inline uint8_t Pipe_GetErrorFlags(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;\r
-                       static inline uint8_t Pipe_GetErrorFlags(void)\r
-                       {\r
-                               return ((UPERRX & (PIPE_ERRORFLAG_CRC16 | PIPE_ERRORFLAG_TIMEOUT |\r
-                                                  PIPE_ERRORFLAG_PID   | PIPE_ERRORFLAG_DATAPID |\r
-                                                  PIPE_ERRORFLAG_DATATGL)) |\r
-                                       (UPSTAX & (PIPE_ERRORFLAG_OVERFLOW | PIPE_ERRORFLAG_UNDERFLOW)));\r
-                       }\r
-\r
-                       /** Retrieves the number of busy banks in the currently selected pipe, which have been queued for\r
-                        *  transmission via the \ref Pipe_ClearOUT() command, or are awaiting acknowledgement via the\r
-                        *  \ref Pipe_ClearIN() command.\r
-                        *\r
-                        *  \ingroup Group_PipePacketManagement_AVR8\r
-                        *\r
-                        *  \return Total number of busy banks in the selected pipe.\r
-                        */\r
-                       static inline uint8_t Pipe_GetBusyBanks(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;\r
-                       static inline uint8_t Pipe_GetBusyBanks(void)\r
-                       {\r
-                               return (UPSTAX & (0x03 << NBUSYBK0));\r
-                       }\r
-\r
-                       /** Determines if the currently selected pipe may be read from (if data is waiting in the pipe\r
-                        *  bank and the pipe is an IN direction, or if the bank is not yet full if the pipe is an OUT\r
-                        *  direction). This function will return false if an error has occurred in the pipe, or if the pipe\r
-                        *  is an IN direction and no packet (or an empty packet) has been received, or if the pipe is an OUT\r
-                        *  direction and the pipe bank is full.\r
-                        *\r
-                        *  \note This function is not valid on CONTROL type pipes.\r
-                        *\r
-                        *  \ingroup Group_PipePacketManagement_AVR8\r
-                        *\r
-                        *  \return Boolean \c true if the currently selected pipe may be read from or written to, depending\r
-                        *          on its direction.\r
-                        */\r
-                       static inline bool Pipe_IsReadWriteAllowed(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;\r
-                       static inline bool Pipe_IsReadWriteAllowed(void)\r
-                       {\r
-                               return ((UPINTX & (1 << RWAL)) ? true : false);\r
-                       }\r
-\r
-                       /** Determines if a packet has been received on the currently selected IN pipe from the attached device.\r
-                        *\r
-                        *  \ingroup Group_PipePacketManagement_AVR8\r
-                        *\r
-                        *  \return Boolean \c true if the current pipe has received an IN packet, \c false otherwise.\r
-                        */\r
-                       static inline bool Pipe_IsINReceived(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;\r
-                       static inline bool Pipe_IsINReceived(void)\r
-                       {\r
-                               return ((UPINTX & (1 << RXINI)) ? true : false);\r
-                       }\r
-\r
-                       /** Determines if the currently selected OUT pipe is ready to send an OUT packet to the attached device.\r
-                        *\r
-                        *  \ingroup Group_PipePacketManagement_AVR8\r
-                        *\r
-                        *  \return Boolean \c true if the current pipe is ready for an OUT packet, \c false otherwise.\r
-                        */\r
-                       static inline bool Pipe_IsOUTReady(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;\r
-                       static inline bool Pipe_IsOUTReady(void)\r
-                       {\r
-                               return ((UPINTX & (1 << TXOUTI)) ? true : false);\r
-                       }\r
-\r
-                       /** Determines if no SETUP request is currently being sent to the attached device on the selected\r
-                        *  CONTROL type pipe.\r
-                        *\r
-                        *  \ingroup Group_PipePacketManagement_AVR8\r
-                        *\r
-                        *  \return Boolean \c true if the current pipe is ready for a SETUP packet, \c false otherwise.\r
-                        */\r
-                       static inline bool Pipe_IsSETUPSent(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;\r
-                       static inline bool Pipe_IsSETUPSent(void)\r
-                       {\r
-                               return ((UPINTX & (1 << TXSTPI)) ? true : false);\r
-                       }\r
-\r
-                       /** Sends the currently selected CONTROL type pipe's contents to the device as a SETUP packet.\r
-                        *\r
-                        *  \ingroup Group_PipePacketManagement_AVR8\r
-                        */\r
-                       static inline void Pipe_ClearSETUP(void) ATTR_ALWAYS_INLINE;\r
-                       static inline void Pipe_ClearSETUP(void)\r
-                       {\r
-                               UPINTX &= ~((1 << TXSTPI) | (1 << FIFOCON));\r
-                       }\r
-\r
-                       /** Acknowledges the reception of a setup IN request from the attached device on the currently selected\r
-                        *  pipe, freeing the bank ready for the next packet.\r
-                        *\r
-                        *  \ingroup Group_PipePacketManagement_AVR8\r
-                        */\r
-                       static inline void Pipe_ClearIN(void) ATTR_ALWAYS_INLINE;\r
-                       static inline void Pipe_ClearIN(void)\r
-                       {\r
-                               UPINTX &= ~((1 << RXINI) | (1 << FIFOCON));\r
-                       }\r
-\r
-                       /** Sends the currently selected pipe's contents to the device as an OUT packet on the selected pipe, freeing\r
-                        *  the bank ready for the next packet.\r
-                        *\r
-                        *  \ingroup Group_PipePacketManagement_AVR8\r
-                        */\r
-                       static inline void Pipe_ClearOUT(void) ATTR_ALWAYS_INLINE;\r
-                       static inline void Pipe_ClearOUT(void)\r
-                       {\r
-                               UPINTX &= ~((1 << TXOUTI) | (1 << FIFOCON));\r
-                       }\r
-\r
-                       /** Determines if the device sent a NAK (Negative Acknowledge) in response to the last sent packet on\r
-                        *  the currently selected pipe. This occurs when the host sends a packet to the device, but the device\r
-                        *  is not currently ready to handle the packet (i.e. its endpoint banks are full). Once a NAK has been\r
-                        *  received, it must be cleared using \ref Pipe_ClearNAKReceived() before the previous (or any other) packet\r
-                        *  can be re-sent.\r
-                        *\r
-                        *  \ingroup Group_PipePacketManagement_AVR8\r
-                        *\r
-                        *  \return Boolean \c true if an NAK has been received on the current pipe, \c false otherwise.\r
-                        */\r
-                       static inline bool Pipe_IsNAKReceived(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;\r
-                       static inline bool Pipe_IsNAKReceived(void)\r
-                       {\r
-                               return ((UPINTX & (1 << NAKEDI)) ? true : false);\r
-                       }\r
-\r
-                       /** Clears the NAK condition on the currently selected pipe.\r
-                        *\r
-                        *  \ingroup Group_PipePacketManagement_AVR8\r
-                        *\r
-                        *  \see \ref Pipe_IsNAKReceived() for more details.\r
-                        */\r
-                       static inline void Pipe_ClearNAKReceived(void) ATTR_ALWAYS_INLINE;\r
-                       static inline void Pipe_ClearNAKReceived(void)\r
-                       {\r
-                               UPINTX &= ~(1 << NAKEDI);\r
-                       }\r
-\r
-                       /** Determines if the currently selected pipe has had the STALL condition set by the attached device.\r
-                        *\r
-                        *  \ingroup Group_PipePacketManagement_AVR8\r
-                        *\r
-                        *  \return Boolean \c true if the current pipe has been stalled by the attached device, \c false otherwise.\r
-                        */\r
-                       static inline bool Pipe_IsStalled(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;\r
-                       static inline bool Pipe_IsStalled(void)\r
-                       {\r
-                               return ((UPINTX & (1 << RXSTALLI)) ? true : false);\r
-                       }\r
-\r
-                       /** Clears the STALL condition detection flag on the currently selected pipe, but does not clear the\r
-                        *  STALL condition itself (this must be done via a ClearFeature control request to the device).\r
-                        *\r
-                        *  \ingroup Group_PipePacketManagement_AVR8\r
-                        */\r
-                       static inline void Pipe_ClearStall(void) ATTR_ALWAYS_INLINE;\r
-                       static inline void Pipe_ClearStall(void)\r
-                       {\r
-                               UPINTX &= ~(1 << RXSTALLI);\r
-                       }\r
-\r
-                       /** Reads one byte from the currently selected pipe's bank, for OUT direction pipes.\r
-                        *\r
-                        *  \ingroup Group_PipePrimitiveRW_AVR8\r
-                        *\r
-                        *  \return Next byte in the currently selected pipe's FIFO buffer.\r
-                        */\r
-                       static inline uint8_t Pipe_Read_8(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;\r
-                       static inline uint8_t Pipe_Read_8(void)\r
-                       {\r
-                               return UPDATX;\r
-                       }\r
-\r
-                       /** Writes one byte to the currently selected pipe's bank, for IN direction pipes.\r
-                        *\r
-                        *  \ingroup Group_PipePrimitiveRW_AVR8\r
-                        *\r
-                        *  \param[in] Data  Data to write into the the currently selected pipe's FIFO buffer.\r
-                        */\r
-                       static inline void Pipe_Write_8(const uint8_t Data) ATTR_ALWAYS_INLINE;\r
-                       static inline void Pipe_Write_8(const uint8_t Data)\r
-                       {\r
-                               UPDATX = Data;\r
-                       }\r
-\r
-                       /** Discards one byte from the currently selected pipe's bank, for OUT direction pipes.\r
-                        *\r
-                        *  \ingroup Group_PipePrimitiveRW_AVR8\r
-                        */\r
-                       static inline void Pipe_Discard_8(void) ATTR_ALWAYS_INLINE;\r
-                       static inline void Pipe_Discard_8(void)\r
-                       {\r
-                               uint8_t Dummy;\r
-\r
-                               Dummy = UPDATX;\r
-\r
-                               (void)Dummy;\r
-                       }\r
-\r
-                       /** Reads two bytes from the currently selected pipe's bank in little endian format, for OUT\r
-                        *  direction pipes.\r
-                        *\r
-                        *  \ingroup Group_PipePrimitiveRW_AVR8\r
-                        *\r
-                        *  \return Next two bytes in the currently selected pipe's FIFO buffer.\r
-                        */\r
-                       static inline uint16_t Pipe_Read_16_LE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;\r
-                       static inline uint16_t Pipe_Read_16_LE(void)\r
-                       {\r
-                               union\r
-                               {\r
-                                       uint16_t Value;\r
-                                       uint8_t  Bytes[2];\r
-                               } Data;\r
-\r
-                               Data.Bytes[0] = UPDATX;\r
-                               Data.Bytes[1] = UPDATX;\r
-\r
-                               return Data.Value;\r
-                       }\r
-\r
-                       /** Reads two bytes from the currently selected pipe's bank in big endian format, for OUT\r
-                        *  direction pipes.\r
-                        *\r
-                        *  \ingroup Group_PipePrimitiveRW_AVR8\r
-                        *\r
-                        *  \return Next two bytes in the currently selected pipe's FIFO buffer.\r
-                        */\r
-                       static inline uint16_t Pipe_Read_16_BE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;\r
-                       static inline uint16_t Pipe_Read_16_BE(void)\r
-                       {\r
-                               union\r
-                               {\r
-                                       uint16_t Value;\r
-                                       uint8_t  Bytes[2];\r
-                               } Data;\r
-\r
-                               Data.Bytes[1] = UPDATX;\r
-                               Data.Bytes[0] = UPDATX;\r
-\r
-                               return Data.Value;\r
-                       }\r
-\r
-                       /** Writes two bytes to the currently selected pipe's bank in little endian format, for IN\r
-                        *  direction pipes.\r
-                        *\r
-                        *  \ingroup Group_PipePrimitiveRW_AVR8\r
-                        *\r
-                        *  \param[in] Data  Data to write to the currently selected pipe's FIFO buffer.\r
-                        */\r
-                       static inline void Pipe_Write_16_LE(const uint16_t Data) ATTR_ALWAYS_INLINE;\r
-                       static inline void Pipe_Write_16_LE(const uint16_t Data)\r
-                       {\r
-                               UPDATX = (Data & 0xFF);\r
-                               UPDATX = (Data >> 8);\r
-                       }\r
-\r
-                       /** Writes two bytes to the currently selected pipe's bank in big endian format, for IN\r
-                        *  direction pipes.\r
-                        *\r
-                        *  \ingroup Group_PipePrimitiveRW_AVR8\r
-                        *\r
-                        *  \param[in] Data  Data to write to the currently selected pipe's FIFO buffer.\r
-                        */\r
-                       static inline void Pipe_Write_16_BE(const uint16_t Data) ATTR_ALWAYS_INLINE;\r
-                       static inline void Pipe_Write_16_BE(const uint16_t Data)\r
-                       {\r
-                               UPDATX = (Data >> 8);\r
-                               UPDATX = (Data & 0xFF);\r
-                       }\r
-\r
-                       /** Discards two bytes from the currently selected pipe's bank, for OUT direction pipes.\r
-                        *\r
-                        *  \ingroup Group_PipePrimitiveRW_AVR8\r
-                        */\r
-                       static inline void Pipe_Discard_16(void) ATTR_ALWAYS_INLINE;\r
-                       static inline void Pipe_Discard_16(void)\r
-                       {\r
-                               uint8_t Dummy;\r
-\r
-                               Dummy = UPDATX;\r
-                               Dummy = UPDATX;\r
-\r
-                               (void)Dummy;\r
-                       }\r
-\r
-                       /** Reads four bytes from the currently selected pipe's bank in little endian format, for OUT\r
-                        *  direction pipes.\r
-                        *\r
-                        *  \ingroup Group_PipePrimitiveRW_AVR8\r
-                        *\r
-                        *  \return Next four bytes in the currently selected pipe's FIFO buffer.\r
-                        */\r
-                       static inline uint32_t Pipe_Read_32_LE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;\r
-                       static inline uint32_t Pipe_Read_32_LE(void)\r
-                       {\r
-                               union\r
-                               {\r
-                                       uint32_t Value;\r
-                                       uint8_t  Bytes[4];\r
-                               } Data;\r
-\r
-                               Data.Bytes[0] = UPDATX;\r
-                               Data.Bytes[1] = UPDATX;\r
-                               Data.Bytes[2] = UPDATX;\r
-                               Data.Bytes[3] = UPDATX;\r
-\r
-                               return Data.Value;\r
-                       }\r
-\r
-                       /** Reads four bytes from the currently selected pipe's bank in big endian format, for OUT\r
-                        *  direction pipes.\r
-                        *\r
-                        *  \ingroup Group_PipePrimitiveRW_AVR8\r
-                        *\r
-                        *  \return Next four bytes in the currently selected pipe's FIFO buffer.\r
-                        */\r
-                       static inline uint32_t Pipe_Read_32_BE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;\r
-                       static inline uint32_t Pipe_Read_32_BE(void)\r
-                       {\r
-                               union\r
-                               {\r
-                                       uint32_t DWord;\r
-                                       uint8_t  Bytes[4];\r
-                               } Data;\r
-\r
-                               Data.Bytes[3] = UPDATX;\r
-                               Data.Bytes[2] = UPDATX;\r
-                               Data.Bytes[1] = UPDATX;\r
-                               Data.Bytes[0] = UPDATX;\r
-\r
-                               return Data.DWord;\r
-                       }\r
-\r
-                       /** Writes four bytes to the currently selected pipe's bank in little endian format, for IN\r
-                        *  direction pipes.\r
-                        *\r
-                        *  \ingroup Group_PipePrimitiveRW_AVR8\r
-                        *\r
-                        *  \param[in] Data  Data to write to the currently selected pipe's FIFO buffer.\r
-                        */\r
-                       static inline void Pipe_Write_32_LE(const uint32_t Data) ATTR_ALWAYS_INLINE;\r
-                       static inline void Pipe_Write_32_LE(const uint32_t Data)\r
-                       {\r
-                               UPDATX = (Data &  0xFF);\r
-                               UPDATX = (Data >> 8);\r
-                               UPDATX = (Data >> 16);\r
-                               UPDATX = (Data >> 24);\r
-                       }\r
-\r
-                       /** Writes four bytes to the currently selected pipe's bank in big endian format, for IN\r
-                        *  direction pipes.\r
-                        *\r
-                        *  \ingroup Group_PipePrimitiveRW_AVR8\r
-                        *\r
-                        *  \param[in] Data  Data to write to the currently selected pipe's FIFO buffer.\r
-                        */\r
-                       static inline void Pipe_Write_32_BE(const uint32_t Data) ATTR_ALWAYS_INLINE;\r
-                       static inline void Pipe_Write_32_BE(const uint32_t Data)\r
-                       {\r
-                               UPDATX = (Data >> 24);\r
-                               UPDATX = (Data >> 16);\r
-                               UPDATX = (Data >> 8);\r
-                               UPDATX = (Data &  0xFF);\r
-                       }\r
-\r
-                       /** Discards four bytes from the currently selected pipe's bank, for OUT direction pipes.\r
-                        *\r
-                        *  \ingroup Group_PipePrimitiveRW_AVR8\r
-                        */\r
-                       static inline void Pipe_Discard_32(void) ATTR_ALWAYS_INLINE;\r
-                       static inline void Pipe_Discard_32(void)\r
-                       {\r
-                               uint8_t Dummy;\r
-\r
-                               Dummy = UPDATX;\r
-                               Dummy = UPDATX;\r
-                               Dummy = UPDATX;\r
-                               Dummy = UPDATX;\r
-\r
-                               (void)Dummy;\r
-                       }\r
-\r
-               /* External Variables: */\r
-                       /** Global indicating the maximum packet size of the default control pipe located at address\r
-                        *  0 in the device. This value is set to the value indicated in the attached device's device\r
-                    *  descriptor once the USB interface is initialized into host mode and a device is attached\r
-                        *  to the USB bus.\r
-                        *\r
-                        *  \attention This variable should be treated as read-only in the user application, and never manually\r
-                        *             changed in value.\r
-                        */\r
-                       extern uint8_t USB_Host_ControlPipeSize;\r
-\r
-               /* Function Prototypes: */\r
-                       /** Configures a table of pipe descriptions, in sequence. This function can be used to configure multiple\r
-                        *  pipes at the same time.\r
-                        *\r
-                        *  \note Pipe with a zero address will be ignored, thus this function cannot be used to configure the\r
-                        *        control pipe.\r
-                        *\r
-                        *  \param[in] Table    Pointer to a table of pipe descriptions.\r
-                        *  \param[in] Entries  Number of entries in the pipe table to configure.\r
-                        *\r
-                        *  \return Boolean \c true if all pipes configured successfully, \c false otherwise.\r
-                        */                     \r
-                       bool Pipe_ConfigurePipeTable(const USB_Pipe_Table_t* const Table,\r
-                                                    const uint8_t Entries);\r
-                                                                                \r
-                       /** Configures the specified pipe address with the given pipe type, endpoint address within the attached device, bank size\r
-                        *  and number of hardware banks.\r
-                        *\r
-                        *  A newly configured pipe is frozen by default, and must be unfrozen before use via the \ref Pipe_Unfreeze()\r
-                        *  before being used. Pipes should be kept frozen unless waiting for data from a device while in IN mode, or\r
-                        *  sending data to the device in OUT mode. IN type pipes are also automatically configured to accept infinite\r
-                        *  numbers of IN requests without automatic freezing - this can be overridden by a call to\r
-                        *  \ref Pipe_SetFiniteINRequests().\r
-                        *\r
-                        *  \param[in] Address          Pipe address to configure.\r
-                        *\r
-                        *  \param[in] Type             Type of pipe to configure, an \c EP_TYPE_* mask. Not all pipe types are available on Low\r
-                        *                              Speed USB devices - refer to the USB 2.0 specification.\r
-                        *\r
-                        *  \param[in] EndpointAddress  Endpoint address within the attached device that the pipe should interface to.\r
-                        *\r
-                        *  \param[in] Size             Size of the pipe's bank, where packets are stored before they are transmitted to\r
-                        *                              the USB device, or after they have been received from the USB device (depending on\r
-                        *                              the pipe's data direction). The bank size must indicate the maximum packet size that\r
-                        *                              the pipe can handle.\r
-                        *\r
-                        *  \param[in] Banks            Number of banks to use for the pipe being configured.\r
-                        *\r
-                        *  \attention When the \c ORDERED_EP_CONFIG compile time option is used, Pipes <b>must</b> be configured in ascending order,\r
-                        *             or bank corruption will occur.\r
-                        *\r
-                        *  \note Certain microcontroller model's pipes may have different maximum packet sizes based on the pipe's\r
-                        *        index - refer to the chosen microcontroller's datasheet to determine the maximum bank size for each pipe.\r
-                        *        \n\n\r
-                        *\r
-                        *  \note The default control pipe should not be manually configured by the user application, as it is\r
-                        *        automatically configured by the library internally.\r
-                        *        \n\n\r
-                        *\r
-                        *  \note This routine will automatically select the specified pipe upon success. Upon failure, the pipe which\r
-                        *        failed to reconfigure correctly will be selected.\r
-                        *\r
-                        *  \return Boolean \c true if the configuration succeeded, \c false otherwise.\r
-                        */\r
-                       bool Pipe_ConfigurePipe(const uint8_t Address,\r
-                                               const uint8_t Type,\r
-                                               const uint8_t EndpointAddress,\r
-                                               const uint16_t Size,\r
-                                               const uint8_t Banks);\r
-\r
-                       /** Spin-loops until the currently selected non-control pipe is ready for the next packet of data to be read\r
-                        *  or written to it, aborting in the case of an error condition (such as a timeout or device disconnect).\r
-                        *\r
-                        *  \ingroup Group_PipeRW_AVR8\r
-                        *\r
-                        *  \return A value from the \ref Pipe_WaitUntilReady_ErrorCodes_t enum.\r
-                        */\r
-                       uint8_t Pipe_WaitUntilReady(void);\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 and direction mask of the endpoint within the attached device to check.\r
-                        *\r
-                        *  \return Boolean \c true if a pipe bound to the given endpoint address of the specified direction is found,\r
-                        *          \c false otherwise.\r
-                        */\r
-                       bool Pipe_IsEndpointBound(const uint8_t EndpointAddress) ATTR_WARN_UNUSED_RESULT;\r
-\r
-       /* Private Interface - For use in library only: */\r
-       #if !defined(__DOXYGEN__)\r
-               /* Macros: */\r
-                       #if !defined(ENDPOINT_CONTROLEP)\r
-                               #define ENDPOINT_CONTROLEP          0\r
-                       #endif\r
-\r
-               /* Inline Functions: */\r
-                       static inline uint8_t Pipe_BytesToEPSizeMask(const uint16_t Bytes) ATTR_WARN_UNUSED_RESULT ATTR_CONST ATTR_ALWAYS_INLINE;\r
-                       static inline uint8_t Pipe_BytesToEPSizeMask(const uint16_t Bytes)\r
-                       {\r
-                               uint8_t  MaskVal    = 0;\r
-                               uint16_t CheckBytes = 8;\r
-\r
-                               while ((CheckBytes < Bytes) && (CheckBytes < PIPE_MAX_SIZE))\r
-                               {\r
-                                       MaskVal++;\r
-                                       CheckBytes <<= 1;\r
-                               }\r
-\r
-                               return (MaskVal << EPSIZE0);\r
-                       }\r
-\r
-               /* Function Prototypes: */\r
-                       void Pipe_ClearPipes(void);\r
-       #endif\r
-\r
-       /* Disable C linkage for C++ Compilers: */\r
-               #if defined(__cplusplus)\r
-                       }\r
-               #endif\r
-\r
-#endif\r
-\r
-/** @} */\r
-\r