X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/b120c4e4cda5b5ed12a61697b5ab33d4dd0a70e8..64fe1cd0b2be01fd7b377736a85c1bd88a5fd429:/LUFA/Drivers/USB/LowLevel/Endpoint.h
diff --git a/LUFA/Drivers/USB/LowLevel/Endpoint.h b/LUFA/Drivers/USB/LowLevel/Endpoint.h
index e0a45f378..c8f9cbfd5 100644
--- a/LUFA/Drivers/USB/LowLevel/Endpoint.h
+++ b/LUFA/Drivers/USB/LowLevel/Endpoint.h
@@ -273,7 +273,8 @@
* More banks uses more USB DPRAM, but offers better performance. Isochronous type
* endpoints must have at least two banks.
*
- * \note Endpoints must be configured in ascending order, or bank corruption will occur.
+ * \note When the ORDERED_EP_CONFIG compile time option is used, Endpoints must be configured in ascending
+ * order, or bank corruption will occur.
* \n\n
*
* \note Certain models of USB AVR's endpoints may have different maximum packet sizes based on the endpoint's
@@ -400,6 +401,35 @@
return ((UECONX & (1 << EPEN)) ? true : false);
}
+ /** Aborts all pending IN transactions on the currently selected endpoint, once the bank
+ * has been queued for transmission to the host via \ref Endpoint_ClearIN(). This function
+ * will terminate all queued transactions, resetting the endpoint banks ready for a new
+ * packet.
+ *
+ * \ingroup Group_EndpointPacketManagement
+ */
+ static inline void Endpoint_AbortPendingIN(void)
+ {
+ while (UESTA0X & (0x03 << NBUSYBK0))
+ {
+ UEINTX |= (1 << RXOUTI);
+ while (UEINTX & (1 << RXOUTI));
+ }
+ }
+
+ /** Retrieves the number of busy banks in the currently selected endpoint, which have been queued for
+ * transmission via the \ref Endpoint_ClearIN() command, or are awaiting acknowledgement via the
+ * \ref Endpoint_ClearOUT() command.
+ *
+ * \ingroup Group_EndpointPacketManagement
+ *
+ * \return Total number of busy banks in the selected endpoint.
+ */
+ static inline uint8_t Endpoint_GetBusyBanks(void)
+ {
+ return (UESTA0X & (0x03 << NBUSYBK0));
+ }
+
/** Determines if the currently selected endpoint may be read from (if data is waiting in the endpoint
* bank and the endpoint is an OUT direction, or if the bank is not yet full if the endpoint is an IN
* direction). This function will return false if an error has occurred in the endpoint, if the endpoint