+ /** Disables the currently selected endpoint so that data cannot be sent and received through it\r
+ * to and from a host.\r
+ */\r
+ static inline void Endpoint_DisableEndpoint(void);\r
+ \r
+ /** Determines if the currently selected endpoint is enabled, but not necessarily configured.\r
+ *\r
+ * \return Boolean True if the currently selected endpoint is enabled, false otherwise\r
+ */\r
+ static inline bool Endpoint_IsEnabled(void);\r
+ \r
+ /** Determines if the currently selected endpoint may be read from (if data is waiting in the endpoint\r
+ * bank and the endpoint is an OUT direction, or if the bank is not yet full if the endpoint is an IN\r
+ * direction). This function will return false if an error has occurred in the endpoint, if the endpoint\r
+ * is an OUT direction and no packet (or an empty packet) has been received, or if the endpoint is an IN\r
+ * direction and the endpoint bank is full.\r
+ *\r
+ * \ingroup Group_EndpointPacketManagement\r
+ *\r
+ * \return Boolean true if the currently selected endpoint may be read from or written to, depending on its direction\r
+ */\r
+ static inline bool Endpoint_IsReadWriteAllowed(void);\r
+ \r
+ /** Determines if the currently selected endpoint is configured.\r
+ *\r
+ * \return Boolean true if the currently selected endpoint has been configured, false otherwise\r
+ */\r
+ static inline bool Endpoint_IsConfigured(void);\r
+ \r
+ /** Returns a mask indicating which INTERRUPT type endpoints have interrupted - i.e. their\r
+ * interrupt duration has elapsed. Which endpoints have interrupted can be determined by\r
+ * masking the return value against (1 << {Endpoint Number}).\r
+ *\r
+ * \return Mask whose bits indicate which endpoints have interrupted\r
+ */\r
+ static inline uint8_t Endpoint_GetEndpointInterrupts(void);\r
+ \r
+ /** Clears the endpoint interrupt flag. This clears the specified endpoint number's interrupt\r
+ * mask in the endpoint interrupt flag register.\r
+ *\r
+ * \param EndpointNumber Index of the endpoint whose interrupt flag should be cleared\r
+ */\r
+ static inline void Endpoint_ClearEndpointInterrupt(uint8_t EndpointNumber);\r
+ \r
+ /** Determines if the specified endpoint number has interrupted (valid only for INTERRUPT type\r
+ * endpoints).\r
+ *\r
+ * \param EndpointNumber Index of the endpoint whose interrupt flag should be tested\r
+ *\r
+ * \return Boolean true if the specified endpoint has interrupted, false otherwise\r
+ */\r
+ static inline bool Endpoint_HasEndpointInterrupted(uint8_t EndpointNumber);\r
+ \r
+ /** Determines if the selected IN endpoint is ready for a new packet.\r
+ *\r
+ * \ingroup Group_EndpointPacketManagement\r
+ *\r
+ * \return Boolean true if the current endpoint is ready for an IN packet, false otherwise.\r
+ */\r
+ static inline bool Endpoint_IsINReady(void);\r
+ \r
+ /** Determines if the selected OUT endpoint has received new packet.\r
+ *\r
+ * \ingroup Group_EndpointPacketManagement\r
+ *\r
+ * \return Boolean true if current endpoint is has received an OUT packet, false otherwise.\r
+ */\r
+ static inline bool Endpoint_IsOUTReceived(void);\r
+ \r
+ /** Determines if the current CONTROL type endpoint has received a SETUP packet.\r
+ *\r
+ * \ingroup Group_EndpointPacketManagement\r
+ *\r
+ * \return Boolean true if the selected endpoint has received a SETUP packet, false otherwise.\r
+ */\r
+ static inline bool Endpoint_IsSETUPReceived(void);\r
+ \r
+ /** Clears a received SETUP packet on the currently selected CONTROL type endpoint, freeing up the\r
+ * endpoint for the next packet.\r
+ *\r
+ * \ingroup Group_EndpointPacketManagement\r
+ *\r
+ * \note This is not applicable for non CONTROL type endpoints. \r
+ */\r
+ static inline void Endpoint_ClearControlSETUP(void);\r
+ \r
+ /** Sends an IN packet to the host on the currently selected CONTROL type endpoint, freeing up the\r
+ * endpoint for the next packet.\r
+ *\r
+ * \ingroup Group_EndpointPacketManagement\r
+ *\r
+ * \note For non CONTROL type endpoints, use Endpoint_ClearIN() instead. \r
+ */\r
+ static inline void Endpoint_ClearControlIN(void);\r
+ \r
+ /** Acknowledges an OUT packet to the host on the currently selected CONTROL type endpoint, freeing\r
+ * up the endpoint for the next packet.\r
+ *\r
+ * \ingroup Group_EndpointPacketManagement\r
+ *\r
+ * \note For non CONTROL type endpoints, use Endpoint_ClearOUT() instead.\r
+ */\r
+ static inline void Endpoint_ClearControlOUT(void);\r
+ \r
+ /** Sends an IN packet to the host on the currently selected non CONTROL type endpoint, freeing\r
+ * up the endpoint for the next packet and switching to the alternative endpoint bank if double banked.\r
+ *\r
+ * \ingroup Group_EndpointPacketManagement\r
+ *\r
+ * \note For CONTROL type endpoints, use Endpoint_ClearControlIN() instead.\r
+ */\r
+ static inline void Endpoint_ClearIN(void);\r
+ \r
+ /** Acknowledges an OUT packet to the host on the currently selected non CONTROL type endpoint, freeing\r
+ * up the endpoint for the next packet and switching to the alternative endpoint bank if double banked.\r
+ *\r
+ * \ingroup Group_EndpointPacketManagement\r
+ *\r
+ * \note For CONTROL type endpoints, use Endpoint_ClearControlOUT() instead.\r
+ */\r
+ static inline void Endpoint_ClearOUT(void);\r
+ \r
+ /** Stalls the current endpoint, indicating to the host that a logical problem occurred with the\r
+ * indicated endpoint and that the current transfer sequence should be aborted. This provides a\r
+ * way for devices to indicate invalid commands to the host so that the current transfer can be\r
+ * aborted and the host can begin its own recovery sequence.\r
+ *\r
+ * The currently selected endpoint remains stalled until either the Endpoint_ClearStall() macro\r
+ * is called, or the host issues a CLEAR FEATURE request to the device for the currently selected\r
+ * endpoint.\r
+ *\r
+ * \ingroup Group_EndpointPacketManagement\r
+ */\r
+ static inline void Endpoint_StallTransaction(void);\r
+ \r
+ /** Clears the STALL condition on the currently selected endpoint.\r
+ *\r
+ * \ingroup Group_EndpointPacketManagement\r
+ */\r
+ static inline void Endpoint_ClearStall(void);\r
+ \r
+ /** Determines if the currently selected endpoint is stalled, false otherwise.\r
+ *\r
+ * \ingroup Group_EndpointPacketManagement\r
+ *\r
+ * \return Boolean true if the currently selected endpoint is stalled, false otherwise\r
+ */\r
+ static inline bool Endpoint_IsStalled(void);\r
+ \r
+ /** Resets the data toggle of the currently selected endpoint. */\r
+ static inline void Endpoint_ResetDataToggle(void);\r
+ \r
+ /** Determines the currently selected endpoint's direction.\r
+ *\r
+ * \return The currently selected endpoint's direction, as a ENDPOINT_DIR_* mask.\r
+ */\r
+ static inline uint8_t Endpoint_GetEndpointDirection(void);\r
+ #else\r
+ #if defined(USB_FULL_CONTROLLER) || defined(USB_MODIFIED_FULL_CONTROLLER) || defined(__DOXYGEN__)\r
+ #define Endpoint_BytesInEndpoint() UEBCX\r
+ #else\r
+ #define Endpoint_BytesInEndpoint() UEBCLX\r
+ #endif\r
+ \r
+ #define Endpoint_GetCurrentEndpoint() (UENUM & ENDPOINT_EPNUM_MASK)\r
+ \r
+ #define Endpoint_SelectEndpoint(epnum) MACROS{ UENUM = epnum; }MACROE\r