+ * \note This interrupt must be enabled and cleared on *each* pipe which requires it (after the pipe\r
+ * is selected), and will fire the common pipe interrupt vector.\r
+ *\r
+ * \see \ref ENDPOINT_PIPE_vect for more information on the common pipe and endpoint interrupt vector.\r
+ */\r
+ #define PIPE_INT_STALL UPIENX, (1 << RXSTALLE), UPINTX, (1 << RXSTALLI)\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
+ * \note The return width of this function may differ, depending on the maximum pipe bank size\r
+ * of the selected AVR model.\r
+ *\r
+ * \ingroup Group_PipeRW\r
+ *\r
+ * \return Total number of bytes in the currently selected Pipe's FIFO buffer\r
+ */\r
+ static inline uint16_t Pipe_BytesInPipe(void);\r
+ \r
+ /** Returns the pipe address of the currently selected pipe. This is typically used to save the\r
+ * currently selected pipe number 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);\r
+\r
+ /** Selects the given pipe number. Any pipe operations which do not require the pipe number to be\r
+ * indicated will operate on the currently selected pipe.\r
+ *\r
+ * \param PipeNumber Index of the pipe to select\r
+ */\r
+ static inline void Pipe_SelectPipe(uint8_t PipeNumber);\r
+ \r
+ /** Resets the desired pipe, including the pipe banks and flags.\r
+ *\r
+ * \param PipeNumber Index of the pipe to reset\r
+ */\r
+ static inline void Pipe_ResetPipe(uint8_t PipeNumber);\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
+ * \note Pipes must first be configured properly via \ref Pipe_ConfigurePipe().\r
+ */\r
+ static inline void Pipe_EnablePipe(void);\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);\r
+\r
+ /** Determines if the currently selected pipe is enabled, but not necessarily configured.\r
+ *\r
+ * \return Boolean True if the currently selected pipe is enabled, false otherwise\r
+ */\r
+ static inline bool Pipe_IsEnabled(void);\r
+ \r
+ /** Gets the current pipe token, indicating the pipe's data direction and type.\r
+ *\r
+ * \return The current pipe token, as a PIPE_TOKEN_* mask\r
+ */\r
+ static inline uint8_t Pipe_GetCurrentToken(void);\r
+ \r
+ /** Sets the token for the currently selected pipe to one of the tokens specified by the 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 Token New pipe token to set the selected pipe to, as a PIPE_TOKEN_* mask\r
+ */\r
+ static inline void Pipe_SetPipeToken(uint8_t Token);\r
+ \r
+ /** Configures the currently selected pipe to allow for an unlimited number of IN requests. */\r
+ static inline void Pipe_SetInfiniteINRequests(void);\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 TotalINRequests Total number of IN requests that the pipe may receive before freezing\r
+ */\r
+ static inline void Pipe_SetFiniteINRequests(uint8_t TotalINRequests);\r
+\r
+ /** Determines if the currently selected pipe is configured.\r
+ *\r
+ * \return Boolean true if the selected pipe is configured, false otherwise\r
+ */\r
+ static inline bool Pipe_IsConfigured(void);\r
+ \r
+ /** Sets the period between interrupts for an INTERRUPT type pipe to a specified number of milliseconds.\r
+ *\r
+ * \param Milliseconds Number of milliseconds between each pipe poll\r
+ */\r
+ static inline void Pipe_SetInterruptPeriod(uint8_t Milliseconds);\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);\r
+ \r
+ /** Clears the interrupt flag for the specified pipe number.\r
+ *\r
+ * \param PipeNumber Index of the pipe whose interrupt flag is to be cleared\r
+ */\r
+ static inline void Pipe_ClearPipeInterrupt(uint8_t PipeNumber);\r
+ \r
+ /** Determines if the specified pipe number has interrupted (valid only for INTERRUPT type\r
+ * pipes).\r
+ *\r
+ * \param PipeNumber Index of the pipe whose interrupt flag should be tested\r
+ *\r
+ * \return Boolean true if the specified pipe has interrupted, false otherwise\r
+ */\r
+ static inline bool Pipe_HasPipeInterrupted(uint8_t PipeNumber);\r
+ \r
+ /** Unfreezes the selected pipe, allowing it to communicate with an attached device. */\r
+ static inline void Pipe_Unfreeze(void);\r
+ \r
+ /** Freezes the selected pipe, preventing it from communicating with an attached device. */\r
+ static inline void Pipe_Freeze(void);\r