/* Scheduler Task List */\r
TASK_LIST\r
{\r
- #if !defined(INTERRUPT_CONTROL_ENDPOINT)\r
{ .Task = USB_USBTask , .TaskStatus = TASK_STOP },\r
- #endif\r
- \r
{ .Task = USB_HID_Report , .TaskStatus = TASK_STOP },\r
};\r
\r
Scheduler_Start();\r
}\r
\r
-/** Event handler for the USB_Reset event. This fires when the USB interface is reset by the USB host, before the\r
- * enumeration process begins, and enables the control endpoint interrupt so that control requests can be handled\r
- * asynchronously when they arrive rather than when the control endpoint is polled manually.\r
- */\r
-EVENT_HANDLER(USB_Reset)\r
-{\r
- #if defined(INTERRUPT_CONTROL_ENDPOINT)\r
- /* Select the control endpoint */\r
- Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);\r
-\r
- /* Enable the endpoint SETUP interrupt ISR for the control endpoint */\r
- USB_INT_Enable(ENDPOINT_INT_SETUP);\r
- #endif\r
-}\r
-\r
/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and\r
* starts the library USB task to begin the enumeration and USB management process.\r
*/\r
EVENT_HANDLER(USB_Connect)\r
{\r
- #if !defined(INTERRUPT_CONTROL_ENDPOINT)\r
/* Start USB management task */\r
Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);\r
- #endif\r
\r
/* Indicate USB enumerating */\r
UpdateStatus(Status_USBEnumerating);\r
{\r
/* Stop running HID reporting and USB management tasks */\r
Scheduler_SetTaskMode(USB_HID_Report, TASK_STOP);\r
-\r
- #if !defined(INTERRUPT_CONTROL_ENDPOINT)\r
Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);\r
- #endif\r
\r
/* Indicate USB not ready */\r
UpdateStatus(Status_USBNotReady);\r
}\r
}\r
}\r
-\r
-#if defined(INTERRUPT_CONTROL_ENDPOINT)\r
-/** ISR for the general Pipe/Endpoint interrupt vector. This ISR fires when an endpoint's status changes (such as\r
- * a packet has been received) on an endpoint with its corresponding ISR enabling bits set. This is used to send\r
- * HID packets to the host each time the HID interrupt endpoints polling period elapses, as managed by the USB\r
- * controller.\r
- */\r
-ISR(ENDPOINT_PIPE_vect, ISR_BLOCK)\r
-{\r
- /* Save previously selected endpoint before selecting a new endpoint */\r
- uint8_t PrevSelectedEndpoint = Endpoint_GetCurrentEndpoint();\r
-\r
- /* Check if the control endpoint has received a request */\r
- if (Endpoint_HasEndpointInterrupted(ENDPOINT_CONTROLEP))\r
- {\r
- /* Clear the endpoint interrupt */\r
- Endpoint_ClearEndpointInterrupt(ENDPOINT_CONTROLEP);\r
-\r
- /* Process the control request */\r
- USB_USBTask();\r
-\r
- /* Handshake the endpoint setup interrupt - must be after the call to USB_USBTask() */\r
- USB_INT_Clear(ENDPOINT_INT_SETUP);\r
- }\r
-\r
- /* Restore previously selected endpoint */\r
- Endpoint_SelectEndpoint(PrevSelectedEndpoint);\r
-}\r
-#endif\r
};\r
\r
/* Event Handlers: */\r
- /** Indicates that this module will catch the USB_Reset event when thrown by the library. */\r
- HANDLES_EVENT(USB_Reset);\r
-\r
/** Indicates that this module will catch the USB_Connect event when thrown by the library. */\r
HANDLES_EVENT(USB_Connect);\r
\r
* <td>This token defines the size of the device reports, both sent and received. The value must be an\r
* integer ranging from 1 to 255.</td>\r
* </tr>\r
- * <tr>\r
- * <td>INTERRUPT_CONTROL_ENDPOINT</td>\r
- * <td>Makefile CDEFS</td>\r
- * <td>When defined, this causes the demo to enable interrupts for the control endpoint,\r
- * which services control requests from the host. If not defined, the control endpoint\r
- * is serviced via polling using the task scheduler.</td>\r
- * </tr>\r
* </table>\r
*/\r
/* Scheduler Task List */\r
TASK_LIST\r
{\r
- #if !defined(INTERRUPT_CONTROL_ENDPOINT)\r
- { .Task = USB_USBTask , .TaskStatus = TASK_STOP },\r
- #endif\r
- \r
+ { .Task = USB_USBTask , .TaskStatus = TASK_STOP }, \r
{ .Task = USB_Keyboard_Report , .TaskStatus = TASK_STOP },\r
};\r
\r
*/\r
EVENT_HANDLER(USB_Connect)\r
{\r
- #if !defined(INTERRUPT_CONTROL_ENDPOINT)\r
/* Start USB management task */\r
Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);\r
- #endif\r
\r
/* Indicate USB enumerating */\r
UpdateStatus(Status_USBEnumerating);\r
UsingReportProtocol = true;\r
}\r
\r
-/** Event handler for the USB_Reset event. This fires when the USB interface is reset by the USB host, before the\r
- * enumeration process begins, and enables the control endpoint interrupt so that control requests can be handled\r
- * asynchronously when they arrive rather than when the control endpoint is polled manually.\r
- */\r
-EVENT_HANDLER(USB_Reset)\r
-{\r
- #if defined(INTERRUPT_CONTROL_ENDPOINT)\r
- /* Select the control endpoint */\r
- Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);\r
-\r
- /* Enable the endpoint SETUP interrupt ISR for the control endpoint */\r
- USB_INT_Enable(ENDPOINT_INT_SETUP);\r
- #endif\r
-}\r
-\r
/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via\r
* the status LEDs.\r
*/\r
{\r
/* Stop running keyboard reporting and USB management tasks */\r
Scheduler_SetTaskMode(USB_Keyboard_Report, TASK_STOP);\r
-\r
- #if !defined(INTERRUPT_CONTROL_ENDPOINT)\r
Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);\r
- #endif\r
\r
/* Indicate USB not ready */\r
UpdateStatus(Status_USBNotReady);\r
ReceiveNextReport();\r
}\r
}\r
-\r
-#if defined(INTERRUPT_CONTROL_ENDPOINT)\r
-/** ISR for the general Pipe/Endpoint interrupt vector. This ISR fires when an endpoint's status changes (such as\r
- * a packet has been received) on an endpoint with its corresponding ISR enabling bits set. This is used to send\r
- * HID packets to the host each time the HID interrupt endpoints polling period elapses, as managed by the USB\r
- * controller. It is also used to respond to standard and class specific requests send to the device on the control\r
- * endpoint, by handing them off to the LUFA library when they are received.\r
- */\r
-ISR(ENDPOINT_PIPE_vect, ISR_BLOCK)\r
-{\r
- /* Save previously selected endpoint before selecting a new endpoint */\r
- uint8_t PrevSelectedEndpoint = Endpoint_GetCurrentEndpoint();\r
-\r
- /* Check if the control endpoint has received a request */\r
- if (Endpoint_HasEndpointInterrupted(ENDPOINT_CONTROLEP))\r
- {\r
- /* Process the control request */\r
- USB_USBTask();\r
-\r
- /* Handshake the endpoint setup interrupt - must be after the call to USB_USBTask() */\r
- USB_INT_Clear(ENDPOINT_INT_SETUP);\r
- }\r
- \r
- /* Restore previously selected endpoint */\r
- Endpoint_SelectEndpoint(PrevSelectedEndpoint); \r
-}\r
-#endif\r
/** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */\r
HANDLES_EVENT(USB_Disconnect);\r
\r
- /** Indicates that this module will catch the USB_Reset event when thrown by the library. */\r
- HANDLES_EVENT(USB_Reset);\r
-\r
/** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */\r
HANDLES_EVENT(USB_ConfigurationChanged);\r
\r
*\r
* <table>\r
* <tr>\r
- * <td><b>Define Name:</b></td>\r
- * <td><b>Location:</b></td>\r
- * <td><b>Description:</b></td>\r
- * </tr>\r
- * <tr>\r
- * <td>INTERRUPT_CONTROL_ENDPOINT</td>\r
- * <td>Makefile CDEFS</td>\r
- * <td>When defined, this causes the demo to enable interrupts for the control endpoint,\r
- * which services control requests from the host. If not defined, the control endpoint\r
- * is serviced via polling using the task scheduler.</td>\r
+ * <td>\r
+ * None\r
+ * </td>\r
* </tr>\r
* </table>\r
*/\r
Scheduler_Start();\r
}\r
\r
-/** Event handler for the USB_Reset event. This fires when the USB interface is reset by the USB host, before the\r
- * enumeration process begins, and enables the control endpoint interrupt so that control requests can be handled\r
- * asynchronously when they arrive rather than when the control endpoint is polled manually.\r
- */\r
-EVENT_HANDLER(USB_Reset)\r
-{\r
- /* Select the control endpoint */\r
- Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);\r
-\r
- /* Enable the endpoint SETUP interrupt ISR for the control endpoint */\r
- USB_INT_Enable(ENDPOINT_INT_SETUP);\r
-}\r
-\r
/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs. */\r
EVENT_HANDLER(USB_Connect)\r
{\r
/* Continue with the current stream operation */\r
return STREAMCALLBACK_Continue;\r
}\r
-\r
-/** ISR for the general Pipe/Endpoint interrupt vector. This ISR fires when a control request has been issued to the control endpoint,\r
- * so that the request can be processed. As several elements of the Mass Storage implementation require asynchronous control requests\r
- * (such as endpoint stall clearing and Mass Storage Reset requests during data transfers) this is done via interrupts rather than\r
- * polling so that they can be processed regardless of the rest of the application's state.\r
- */\r
-ISR(ENDPOINT_PIPE_vect, ISR_BLOCK)\r
-{\r
- /* Check if the control endpoint has received a request */\r
- if (Endpoint_HasEndpointInterrupted(ENDPOINT_CONTROLEP))\r
- {\r
- /* Process the control request */\r
- USB_USBTask();\r
-\r
- /* Handshake the endpoint setup interrupt - must be after the call to USB_USBTask() */\r
- USB_INT_Clear(ENDPOINT_INT_SETUP);\r
- }\r
-}\r
STREAM_CALLBACK(AbortOnMassStoreReset);\r
\r
/* Event Handlers: */\r
- /** Indicates that this module will catch the USB_Reset event when thrown by the library. */\r
- HANDLES_EVENT(USB_Reset);\r
-\r
/** Indicates that this module will catch the USB_Connect event when thrown by the library. */\r
HANDLES_EVENT(USB_Connect);\r
\r
* 255), with each LUN being allocated an equal portion of the available\r
* Dataflash memory.\r
*\r
+ * The USB control endpoint is managed entirely by the library using endpoint\r
+ * interrupts, as the INTERRUPT_CONTROL_ENDPOINT option is enabled. This allows for\r
+ * the host to reset the Mass Storage device state during long transfers without\r
+ * the need for complicated polling logic.\r
+ *\r
* \section SSec_Options Project Options\r
*\r
* The following defines can be found in this demo, which can control the demo behaviour when defined, or changed in value.\r
CDEFS += -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DUSB_DEVICE_ONLY\r
CDEFS += -DFIXED_CONTROL_ENDPOINT_SIZE=8 -DUSE_SINGLE_DEVICE_CONFIGURATION\r
CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"\r
+CDEFS += -DINTERRUPT_CONTROL_ENDPOINT\r
\r
\r
# Place -D or -U options here for ASM sources\r
/* Scheduler Task List */\r
TASK_LIST\r
{\r
- #if !defined(INTERRUPT_CONTROL_ENDPOINT)\r
{ .Task = USB_USBTask , .TaskStatus = TASK_STOP },\r
- #endif\r
- \r
{ .Task = USB_Mouse_Report , .TaskStatus = TASK_STOP },\r
};\r
\r
*/\r
EVENT_HANDLER(USB_Connect)\r
{\r
- #if !defined(INTERRUPT_CONTROL_ENDPOINT)\r
/* Start USB management task */\r
Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);\r
- #endif\r
\r
/* Indicate USB enumerating */\r
UpdateStatus(Status_USBEnumerating);\r
UsingReportProtocol = true;\r
}\r
\r
-/** Event handler for the USB_Reset event. This fires when the USB interface is reset by the USB host, before the\r
- * enumeration process begins, and enables the control endpoint interrupt so that control requests can be handled\r
- * asynchronously when they arrive rather than when the control endpoint is polled manually.\r
- */\r
-EVENT_HANDLER(USB_Reset)\r
-{\r
- #if defined(INTERRUPT_CONTROL_ENDPOINT)\r
- /* Select the control endpoint */\r
- Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);\r
-\r
- /* Enable the endpoint SETUP interrupt ISR for the control endpoint */\r
- USB_INT_Enable(ENDPOINT_INT_SETUP);\r
- #endif\r
-}\r
-\r
/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via\r
* the status LEDs and stops the USB management and Mouse reporting tasks.\r
*/\r
{\r
/* Stop running mouse reporting and USB management tasks */\r
Scheduler_SetTaskMode(USB_Mouse_Report, TASK_STOP);\r
-\r
- #if !defined(INTERRUPT_CONTROL_ENDPOINT)\r
Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);\r
- #endif\r
\r
/* Indicate USB not ready */\r
UpdateStatus(Status_USBNotReady);\r
SendNextReport();\r
}\r
}\r
-\r
-#if defined(INTERRUPT_CONTROL_ENDPOINT)\r
-/** ISR for the general Pipe/Endpoint interrupt vector. This ISR fires when an endpoint's status changes (such as\r
- * a packet has been received) on an endpoint with its corresponding ISR enabling bits set. This is used to send\r
- * HID packets to the host each time the HID interrupt endpoints polling period elapses, as managed by the USB\r
- * controller. It is also used to respond to standard and class specific requests send to the device on the control\r
- * endpoint, by handing them off to the LUFA library when they are received.\r
- */\r
-ISR(ENDPOINT_PIPE_vect, ISR_BLOCK)\r
-{\r
- /* Save previously selected endpoint before selecting a new endpoint */\r
- uint8_t PrevSelectedEndpoint = Endpoint_GetCurrentEndpoint();\r
-\r
- /* Check if the control endpoint has received a request */\r
- if (Endpoint_HasEndpointInterrupted(ENDPOINT_CONTROLEP))\r
- {\r
- /* Process the control request */\r
- USB_USBTask();\r
-\r
- /* Handshake the endpoint setup interrupt - must be after the call to USB_USBTask() */\r
- USB_INT_Clear(ENDPOINT_INT_SETUP);\r
- }\r
-\r
- /* Restore previously selected endpoint */\r
- Endpoint_SelectEndpoint(PrevSelectedEndpoint);\r
-}\r
-#endif\r
/** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */\r
HANDLES_EVENT(USB_Disconnect);\r
\r
- /** Indicates that this module will catch the USB_Reset event when thrown by the library. */\r
- HANDLES_EVENT(USB_Reset);\r
-\r
/** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */\r
HANDLES_EVENT(USB_ConfigurationChanged);\r
\r
*\r
* <table>\r
* <tr>\r
- * <td><b>Define Name:</b></td>\r
- * <td><b>Location:</b></td>\r
- * <td><b>Description:</b></td>\r
- * </tr>\r
- * <tr>\r
- * <td>INTERRUPT_CONTROL_ENDPOINT</td>\r
- * <td>Makefile CDEFS</td>\r
- * <td>When defined, this causes the demo to enable interrupts for the control endpoint,\r
- * which services control requests from the host. If not defined, the control endpoint\r
- * is serviced via polling using the task scheduler.</td>\r
+ * <td>\r
+ * None\r
+ * </td>\r
* </tr>\r
* </table>\r
*/\r
break;\r
}\r
\r
- #if defined(INTERRUPT_DATA_PIPE) \r
- /* Select and unfreeze HID data IN pipe */\r
- Pipe_SelectPipe(HID_DATA_IN_PIPE);\r
- Pipe_Unfreeze();\r
- #endif\r
-\r
puts_P(PSTR("HID Device Enumerated.\r\n"));\r
\r
USB_HostState = HOST_STATE_Ready;\r
* - Fixed Mouse and Keyboard device demos not acting in accordance with the HID specification for idle periods (thanks to Brian Dickman)\r
* - Removed support for endpoint/pipe non-control interrupts; these did not act in the way users expected, and had many subtle issues\r
* - Fixed Device Mode not handling Set Feature and Clear Feature Chapter 9 requests that are addressed to the device (thanks to Brian Dickman)\r
+ * - Moved control endpoint interrupt handling into the library itself, enable via the new INTERRUPT_CONTROL_ENDPOINT token\r
*\r
*\r
* \section Sec_ChangeLog090510 Version 090510\r
* required, the VBUS line of the USB connector should be routed to an AVR pin to detect its level, so that the USB_IsConnected global\r
* can be accurately set and the USB_Connect and USB_Disconnect events manually raised by the RAISE_EVENT macro. When defined, this token disables\r
* the library's auto-detection of the connection state by the aforementioned suspension and wake up events.\r
+ *\r
+ * <b>INTERRUPT_CONTROL_ENDPOINT</b> - ( \ref Group_USBManagement ) \n\r
+ * Some applications prefer to not call the USB_USBTask() management task reguarly while in device mode, as it can complicate code significantly.\r
+ * Instead, when device mode is used this token can be passed to the library via the -D switch to allow the library to manage the USB control\r
+ * endpoint entirely via interrupts asynchronously to the user application.\r
*/\r
ENDPOINT_DIR_OUT, USB_ControlEndpointSize,\r
ENDPOINT_BANK_SINGLE);\r
\r
+ #if defined(INTERRUPT_CONTROL_ENDPOINT)\r
+ USB_INT_Enable(USB_INT_ENDPOINT_SETUP);\r
+ #endif\r
+\r
RAISE_EVENT(USB_Reset);\r
}\r
#endif\r
}\r
#endif\r
}\r
+\r
+#if defined(INTERRUPT_CONTROL_ENDPOINT)\r
+ISR(USB_COM_vect, ISR_BLOCK)\r
+{\r
+ uint8_t PrevSelectedEndpoint = Endpoint_GetCurrentEndpoint();\r
+\r
+ USB_USBTask();\r
+\r
+ USB_INT_Clear(USB_INT_ENDPOINT_SETUP);\r
+ \r
+ Endpoint_SelectEndpoint(PrevSelectedEndpoint); \r
+}\r
+#endif\r
this software.\r
*/\r
\r
-/** \ingroup Group_USB\r
- * @defgroup Group_USBInterrupt Endpoint and Pipe Interrupts\r
- *\r
- * This module manages the main USB interrupt vector, for handling such events as VBUS interrupts\r
- * (on supported USB AVR models), device connections and disconnections, etc. as well as providing\r
- * easy to use macros for the management of the unified Endpoint/Pipe interrupt vector.\r
- *\r
- * @{\r
- */\r
-\r
#ifndef __USBINTERRUPT_H__\r
#define __USBINTERRUPT_H__\r
\r
#endif\r
\r
/* Public Interface - May be used in end-application: */\r
- /* Macros: */\r
- /** Vector name for the common endpoint and pipe vector. This can be used to write an ISR handler\r
- * for the endpoint and pipe events, to make certain USB functions interrupt rather than poll\r
- * driven.\r
- */\r
- #define ENDPOINT_PIPE_vect USB_COM_vect\r
- \r
- /** Enables the given USB interrupt vector (such as the ENDPOINT_INT_* and PIPE_INT_* vectors in\r
- * Endpoint.h and Pipe.h).\r
- */\r
- #define USB_INT_Enable(int) MACROS{ USB_INT_GET_EN_REG(int) |= USB_INT_GET_EN_MASK(int); }MACROE\r
-\r
- /** Disables the given USB interrupt vector.\r
- *\r
- * \see \ref USB_INT_Enable()\r
- */\r
- #define USB_INT_Disable(int) MACROS{ USB_INT_GET_EN_REG(int) &= ~(USB_INT_GET_EN_MASK(int)); }MACROE\r
-\r
- /** Resets the given USB interrupt flag, so that the interrupt is re-primed for the next firing. */\r
- #define USB_INT_Clear(int) MACROS{ USB_INT_GET_INT_REG(int) &= ~(USB_INT_GET_INT_MASK(int)); }MACROE\r
- \r
- /** Returns boolean false if the given USB interrupt is disabled, or true if the interrupt is currently\r
- * enabled.\r
- */\r
- #define USB_INT_IsEnabled(int) ((USB_INT_GET_EN_REG(int) & USB_INT_GET_EN_MASK(int)) ? true : false)\r
-\r
- /** Returns boolean true if the given interrupt flag is set (i.e. the condition for the interrupt has occurred,\r
- * but the interrupt vector is not necessarily enabled), otherwise returns false.\r
- */\r
- #define USB_INT_HasOccurred(int) ((USB_INT_GET_INT_REG(int) & USB_INT_GET_INT_MASK(int)) ? true : false)\r
- \r
/* Throwable Events: */\r
/** This module raises the USB Connected interrupt when the AVR is attached to a host while in device\r
* USB mode.\r
/* Private Interface - For use in library only: */\r
#if !defined(__DOXYGEN__)\r
/* Macros: */\r
+ #define USB_INT_Enable(int) MACROS{ USB_INT_GET_EN_REG(int) |= USB_INT_GET_EN_MASK(int); }MACROE\r
+ #define USB_INT_Disable(int) MACROS{ USB_INT_GET_EN_REG(int) &= ~(USB_INT_GET_EN_MASK(int)); }MACROE\r
+ #define USB_INT_Clear(int) MACROS{ USB_INT_GET_INT_REG(int) &= ~(USB_INT_GET_INT_MASK(int)); }MACROE\r
+ #define USB_INT_IsEnabled(int) ((USB_INT_GET_EN_REG(int) & USB_INT_GET_EN_MASK(int)) ? true : false)\r
+ #define USB_INT_HasOccurred(int) ((USB_INT_GET_INT_REG(int) & USB_INT_GET_INT_MASK(int)) ? true : false)\r
+\r
#define USB_INT_GET_EN_REG(a, b, c, d) a\r
#define USB_INT_GET_EN_MASK(a, b, c, d) b\r
#define USB_INT_GET_INT_REG(a, b, c, d) c\r
#define USB_INT_HSOFI UHIEN, (1 << HSOFE) , UHINT , (1 << HSOFI)\r
#define USB_INT_RSTI UHIEN , (1 << RSTE) , UHINT , (1 << RSTI)\r
#define USB_INT_SRPI OTGIEN, (1 << SRPE) , OTGINT, (1 << SRPI)\r
+ #define USB_INT_ENDPOINT_SETUP UEIENX, (1 << RXSTPE) , UEINTX, (1 << RXSTPI)\r
\r
/* Function Prototypes: */\r
void USB_INT_ClearAllInterrupts(void);\r
#endif\r
\r
#endif\r
-\r
-/** @} */\r
* - In host mode, it may be disabled at start-up, enabled on the firing of the \ref USB_DeviceAttached\r
* event and disabled again on the firing of the \ref USB_DeviceUnattached event.\r
*\r
+ * If in device mode (only), the control endpoint can instead be managed via interrupts entirely by the library\r
+ * by defining the INTERRUPT_CONTROL_ENDPOINT token and passing it to the compiler via the -D switch.\r
+ *\r
* \see \ref Group_Events for more information on the USB events.\r
*\r
* \ingroup Group_USBManagement\r
#else\r
#define ENDPOINT_TOTAL_ENDPOINTS 1\r
#endif\r
-\r
- /** Interrupt definition for the endpoint SETUP interrupt (for CONTROL type endpoints). Should be\r
- * used with the USB_INT_* macros located in USBInterrupt.h.\r
- *\r
- * This interrupt will fire if enabled on a CONTROL type endpoint if a new control packet is\r
- * received from the host.\r
- *\r
- * \note This interrupt must be enabled and cleared on *each* endpoint which requires it (after the\r
- * endpoint is selected), and will fire the common endpoint interrupt vector.\r
- *\r
- * \see \ref ENDPOINT_PIPE_vect for more information on the common pipe and endpoint interrupt vector.\r
- */\r
- #define ENDPOINT_INT_SETUP UEIENX, (1 << RXSTPE), UEINTX, (1 << RXSTPI)\r
\r
/* Pseudo-Function Macros: */\r
#if defined(__DOXYGEN__)\r
*/\r
#define PIPE_EPSIZE_MASK 0x7FF\r
\r
- /** Interrupt definition for the pipe SETUP bank ready interrupt (for CONTROL type pipes). Should be\r
- * used with the USB_INT_* macros located in USBInterrupt.h.\r
- *\r
- * This interrupt will fire if enabled on an CONTROL type pipe when the pipe is ready for a new\r
- * control request.\r
- *\r
- * \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_SETUP UPIENX, (1 << TXSTPE) , UPINTX, (1 << TXSTPI)\r
-\r
- /** Interrupt definition for the pipe error interrupt. Should be used with the USB_INT_* macros\r
- * located in USBInterrupt.h.\r
- *\r
- * This interrupt will fire if enabled on a particular pipe if an error occurs on that pipe, such\r
- * as a CRC mismatch error.\r
- *\r
- * \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
- * \see \ref Pipe_GetErrorFlags() for more information on the pipe errors.\r
- */\r
- #define PIPE_INT_ERROR UPIENX, (1 << PERRE), UPINTX, (1 << PERRI)\r
-\r
- /** Interrupt definition for the pipe NAK received interrupt. Should be used with the USB_INT_* macros\r
- * located in USBInterrupt.h.\r
- *\r
- * This interrupt will fire if enabled on a particular pipe if an attached device returns a NAK in\r
- * response to a sent packet.\r
- *\r
- * \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
- * \see \ref Pipe_IsNAKReceived() for more information on pipe NAKs.\r
- */\r
- #define PIPE_INT_NAK UPIENX, (1 << NAKEDE), UPINTX, (1 << NAKEDI)\r
-\r
- /** Interrupt definition for the pipe STALL received interrupt. Should be used with the USB_INT_* macros\r
- * located in USBInterrupt.h.\r
- *\r
- * This interrupt will fire if enabled on a particular pipe if an attached device returns a STALL on the\r
- * currently selected pipe. This will also fire if the pipe is an isochronous pipe and a CRC error occurs.\r
- *\r
- * \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
* <b>Device Mode</b>\r
* - Support for non-control data endpoint interrupts has been dropped due to many issues in the implementation. All existing\r
- * projects using interrupts on non-control endpoints should switch to polling.\r
+ * projects using interrupts on non-control endpoints should switch to polling. For control interrupts, the library can\r
+ * manage the control endpoint via interrupts automatically by compiling with the INTERRUPT_CONTROL_ENDPOINT token defined.\r
* - The Endpoint_ClearEndpointInterrupt() macro has been deleted and references to it should be removed.\r
*\r
* <b>Device Mode</b>\r