X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/8f6b4ddf764c3a54e42d00a7502c82c5c3e71b1c..76d5e99bb8765030a7f99e7b5adf9bae7f92e0ba:/LUFA/Drivers/USB/HighLevel/USBInterrupt.h diff --git a/LUFA/Drivers/USB/HighLevel/USBInterrupt.h b/LUFA/Drivers/USB/HighLevel/USBInterrupt.h index 65e0b5fb1..7fbb33efc 100644 --- a/LUFA/Drivers/USB/HighLevel/USBInterrupt.h +++ b/LUFA/Drivers/USB/HighLevel/USBInterrupt.h @@ -28,20 +28,6 @@ this software. */ -/** \file - * - * Main USB interrupt vector handler. This file manages the main USB interrupt vector, for handling such - * events as VBUS interrupts (on supported USB AVR models), device connections and disconnections, etc. - */ - -/** \ingroup Group_USB - * @defgroup Group_USBInterrupt Endpoint and Pipe Interrupts - * - * Functions, macros, variables, enums and types related to endpoint and pipe interrupts. - * - * @{ - */ - #ifndef __USBINTERRUPT_H__ #define __USBINTERRUPT_H__ @@ -60,37 +46,6 @@ #endif /* Public Interface - May be used in end-application: */ - /* Macros: */ - /** Vector name for the common endpoint and pipe vector. This can be used to write an ISR handler - * for the endpoint and pipe events, to make certain USB functions interrupt rather than poll - * driven. - */ - #define ENDPOINT_PIPE_vect USB_COM_vect - - /** Enables the given USB interrupt vector (such as the ENDPOINT_INT_* and PIPE_INT_* vectors in - * Endpoint.h and Pipe.h). - */ - #define USB_INT_Enable(int) MACROS{ USB_INT_GET_EN_REG(int) |= USB_INT_GET_EN_MASK(int); }MACROE - - /** Disables the given USB interrupt vector. - * - * \see USB_INT_Enable() - */ - #define USB_INT_Disable(int) MACROS{ USB_INT_GET_EN_REG(int) &= ~(USB_INT_GET_EN_MASK(int)); }MACROE - - /** Resets the given USB interrupt flag, so that the interrupt is re-primed for the next firing. */ - #define USB_INT_Clear(int) MACROS{ USB_INT_GET_INT_REG(int) &= ~(USB_INT_GET_INT_MASK(int)); }MACROE - - /** Returns boolean false if the given USB interrupt is disabled, or true if the interrupt is currently - * enabled. - */ - #define USB_INT_IsEnabled(int) ((USB_INT_GET_EN_REG(int) & USB_INT_GET_EN_MASK(int)) ? true : false) - - /** Returns boolean true if the given interrupt flag is set (i.e. the condition for the interrupt has occurred, - * but the interrupt vector is not necessarily enabled), otherwise returns false. - */ - #define USB_INT_HasOccurred(int) ((USB_INT_GET_INT_REG(int) & USB_INT_GET_INT_MASK(int)) ? true : false) - /* Throwable Events: */ /** This module raises the USB Connected interrupt when the AVR is attached to a host while in device * USB mode. @@ -100,7 +55,7 @@ * which is not always accurate (host may suspend the bus while still connected). If the actual connection state * needs to be determined, VBUS should be routed to an external pin, and the auto-detect behaviour turned off by * passing the NO_LIMITED_CONTROLLER_CONNECT token to the compiler via the -D switch at compile time. The connection - * and disconnection events may be manually fired by RAISE_EVENT(), and the USB_IsConnected global changed manually. + * and disconnection events may be manually fired by \ref RAISE_EVENT(), and the USB_IsConnected global changed manually. */ RAISES_EVENT(USB_Connect); @@ -112,7 +67,7 @@ * which is not always accurate (host may suspend the bus while still connected). If the actual connection state * needs to be determined, VBUS should be routed to an external pin, and the auto-detect behaviour turned off by * passing the NO_LIMITED_CONTROLLER_CONNECT token to the compiler via the -D switch at compile time. The connection - * and disconnection events may be manually fired by RAISE_EVENT(), and the USB_IsConnected global changed manually. + * and disconnection events may be manually fired by \ref RAISE_EVENT(), and the USB_IsConnected global changed manually. */ RAISES_EVENT(USB_Disconnect); @@ -122,7 +77,7 @@ * * \note Not all USB AVR models support VBUS interrupts; this event only exists on supported AVRs. * - * \see Events.h for more information on this event. + * \see \ref Group_Events for more information on this event. */ RAISES_EVENT(USB_VBUSChange); @@ -130,7 +85,7 @@ * * \note Not all USB AVR models support VBUS interrupts; this event only exists on supported AVRs. * - * \see Events.h for more information on this event. + * \see \ref Group_Events for more information on this event. */ RAISES_EVENT(USB_VBUSConnect); @@ -138,7 +93,7 @@ * * \note Not all USB AVR models support VBUS interrupts; this event only exists on supported AVRs. * - * \see Events.h for more information on this event. + * \see \ref Group_Events for more information on this event. */ RAISES_EVENT(USB_VBUSDisconnect); #endif @@ -147,21 +102,21 @@ /** This module raises the Suspended event when the host suspends the USB interface of the AVR * whilst running in device mode. * - * \see Events.h for more information on this event. + * \see \ref Group_Events for more information on this event. */ RAISES_EVENT(USB_Suspend); /** This module raises the Wake Up event when the host resumes the USB interface of the AVR * whilst running in device mode. * - * \see Events.h for more information on this event. + * \see \ref Group_Events for more information on this event. */ RAISES_EVENT(USB_WakeUp); /** This module raises the USB Reset event when the host resets the USB interface of the AVR * whilst running in device mode. * - * \see Events.h for more information on this event. + * \see \ref Group_Events for more information on this event. */ RAISES_EVENT(USB_Reset); #endif @@ -172,7 +127,7 @@ * * \note Not all USB AVR models support host mode; this event only exists on supported AVRs. * - * \see Events.h for more information on this event. + * \see \ref Group_Events for more information on this event. */ RAISES_EVENT(USB_HostError); @@ -181,7 +136,7 @@ * * \note Not all USB AVR models support host mode; this event only exists on supported AVRs. * - * \see Events.h for more information on this event. + * \see \ref Group_Events for more information on this event. */ RAISES_EVENT(USB_DeviceUnattached); #endif @@ -192,7 +147,7 @@ * \note Not all USB AVR models support host mode and thus the UID pin; this event only exists on * supported AVRs. * - * \see Events.h for more information on this event. + * \see \ref Group_Events for more information on this event. */ RAISES_EVENT(USB_UIDChange); #endif @@ -200,6 +155,12 @@ /* Private Interface - For use in library only: */ #if !defined(__DOXYGEN__) /* Macros: */ + #define USB_INT_Enable(int) MACROS{ USB_INT_GET_EN_REG(int) |= USB_INT_GET_EN_MASK(int); }MACROE + #define USB_INT_Disable(int) MACROS{ USB_INT_GET_EN_REG(int) &= ~(USB_INT_GET_EN_MASK(int)); }MACROE + #define USB_INT_Clear(int) MACROS{ USB_INT_GET_INT_REG(int) &= ~(USB_INT_GET_INT_MASK(int)); }MACROE + #define USB_INT_IsEnabled(int) ((USB_INT_GET_EN_REG(int) & USB_INT_GET_EN_MASK(int)) ? true : false) + #define USB_INT_HasOccurred(int) ((USB_INT_GET_INT_REG(int) & USB_INT_GET_INT_MASK(int)) ? true : false) + #define USB_INT_GET_EN_REG(a, b, c, d) a #define USB_INT_GET_EN_MASK(a, b, c, d) b #define USB_INT_GET_INT_REG(a, b, c, d) c @@ -218,6 +179,7 @@ #define USB_INT_HSOFI UHIEN, (1 << HSOFE) , UHINT , (1 << HSOFI) #define USB_INT_RSTI UHIEN , (1 << RSTE) , UHINT , (1 << RSTI) #define USB_INT_SRPI OTGIEN, (1 << SRPE) , OTGINT, (1 << SRPI) + #define USB_INT_ENDPOINT_SETUP UEIENX, (1 << RXSTPE) , UEINTX, (1 << RXSTPI) /* Function Prototypes: */ void USB_INT_ClearAllInterrupts(void); @@ -230,5 +192,3 @@ #endif #endif - -/** @} */