+ /** Clears the master pipe error flag. */\r
+ static inline void Pipe_ClearError(void);\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 true if an error has occurred on the selected pipe, false otherwise\r
+ */\r
+ static inline bool Pipe_IsError(void);\r
+ \r
+ /** Clears all the currently selected pipe's hardware error flags, but does not clear the master error\r
+ * flag for the pipe.\r
+ */\r
+ static inline void Pipe_ClearErrorFlags(void);\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 PIPE_ERRORFLAG_* masks to determine what error has occurred.\r
+ *\r
+ * \return Mask comprising of PIPE_ERRORFLAG_* bits indicating what error has occurred on the selected pipe\r
+ */\r
+ static inline uint8_t Pipe_GetErrorFlags(void);\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\r
+ * \r
+ * \return Boolean true if the currently selected pipe may be read from or written to, depending on its direction\r
+ */\r
+ static inline bool Pipe_IsReadWriteAllowed(void);\r
+ \r
+ /** Determines if an IN request has been received on the currently selected pipe.\r
+ *\r
+ * \ingroup Group_PipePacketManagement\r
+ *\r
+ * \return Boolean true if the current pipe has received an IN packet, false otherwise.\r
+ */\r
+ static inline bool Pipe_IsINReceived(void);\r
+ \r
+ /** Determines if the currently selected pipe is ready to send an OUT request.\r
+ *\r
+ * \ingroup Group_PipePacketManagement\r
+ *\r
+ * \return Boolean true if the current pipe is ready for an OUT packet, false otherwise.\r
+ */\r
+ static inline bool Pipe_IsOUTReady(void);\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\r
+ *\r
+ * \return Boolean true if the current pipe is ready for a SETUP packet, false otherwise.\r
+ */\r
+ static inline bool Pipe_IsSETUPSent(void);\r
+ \r
+ /** Sends the currently selected CONTROL type pipe's contents to the device as a SETUP packet.\r
+ *\r
+ * \ingroup Group_PipePacketManagement \r
+ */\r
+ static inline void Pipe_ClearSETUP(void);\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\r
+ */\r
+ static inline void Pipe_ClearIN(void);\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\r
+ */\r
+ static inline void Pipe_ClearOUT(void);\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\r
+ *\r
+ * \return Boolean true if an NAK has been received on the current pipe, false otherwise\r
+ */\r
+ static inline bool Pipe_IsNAKReceived(void);\r
+\r
+ /** Clears the NAK condition on the currently selected pipe.\r
+ *\r
+ * \ingroup Group_PipePacketManagement\r
+ *\r
+ * \see \ref Pipe_IsNAKReceived() for more details.\r
+ */\r
+ static inline void Pipe_ClearNAKReceived(void);\r
+ \r
+ /** Determines if the currently selected pipe has had the STALL condition set by the attached device.\r
+ *\r
+ * \ingroup Group_PipePacketManagement\r
+ *\r
+ * \return Boolean true if the current pipe has been stalled by the attached device, false otherwise\r
+ */\r
+ static inline bool Pipe_IsStalled(void);\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\r
+ */\r
+ static inline void Pipe_ClearStall(void);\r
+ #else\r
+ #define Pipe_BytesInPipe() UPBCX\r