USBInterrupt.h File Reference

#include <avr/io.h>
#include <stdbool.h>
#include "../../../Common/Common.h"
#include "../LowLevel/LowLevel.h"
#include "../LowLevel/USBMode.h"
#include "Events.h"
#include "../LowLevel/LowLevel.h"

Defines

#define ENDPOINT_PIPE_vect   USB_COM_vect
#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)

Functions

 RAISES_EVENT (USB_Connect)
 RAISES_EVENT (USB_Disconnect)
 RAISES_EVENT (USB_VBUSChange)
 RAISES_EVENT (USB_VBUSConnect)
 RAISES_EVENT (USB_VBUSDisconnect)
 RAISES_EVENT (USB_Suspend)
 RAISES_EVENT (USB_WakeUp)
 RAISES_EVENT (USB_Reset)
 RAISES_EVENT (USB_HostError)
 RAISES_EVENT (USB_DeviceUnattached)
 RAISES_EVENT (USB_UIDChange)

Detailed Description

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.

Define Documentation

#define ENDPOINT_PIPE_vect   USB_COM_vect

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 USB_INT_Clear ( int   )     MACROS{ USB_INT_GET_INT_REG(int) &= ~(USB_INT_GET_INT_MASK(int)); }MACROE

Resets the given USB interrupt flag, so that the interrupt is re-primed for the next firing.

#define USB_INT_Disable ( int   )     MACROS{ USB_INT_GET_EN_REG(int) &= ~(USB_INT_GET_EN_MASK(int)); }MACROE

Disables the given USB interrupt vector.

See also:
USB_INT_Enable()

#define USB_INT_Enable ( int   )     MACROS{ USB_INT_GET_EN_REG(int) |= USB_INT_GET_EN_MASK(int); }MACROE

Enables the given USB interrupt vector (such as the ENDPOINT_INT_* and PIPE_INT_* vectors in Endpoint.h and Pipe.h).

#define USB_INT_HasOccurred ( int   )     ((USB_INT_GET_INT_REG(int) & USB_INT_GET_INT_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 neccesarily enabled), otherwise returns false.

#define USB_INT_IsEnabled ( int   )     ((USB_INT_GET_EN_REG(int) & USB_INT_GET_EN_MASK(int)) ? true : false)

Returns boolean false if the given USB interrupt is disabled, or true if the interrupt is currently enabled.


Function Documentation

RAISES_EVENT ( USB_UIDChange   ) 

This module raises the UID Change event when the UID line changes in value on dual-role devices.

Note:
Not all USB AVR models support host mode and thus the UID pin; this event only exists on supported AVRs.
See also:
Events.h for more information on this event.

RAISES_EVENT ( USB_DeviceUnattached   ) 

This module raises the Device Unattached event when an attached device is removed from the AVR whilst running in host mode.

Note:
Not all USB AVR models support host mode; this event only exists on supported AVRs.
See also:
Events.h for more information on this event.

RAISES_EVENT ( USB_HostError   ) 

This module raises the Host Error event when the VBUS line voltage dips below the minimum threshold while running in host mode.

Note:
Not all USB AVR models support host mode; this event only exists on supported AVRs.
See also:
Events.h for more information on this event.

RAISES_EVENT ( USB_Reset   ) 

This module raises the USB Reset event when the host resets the USB interface of the AVR whilst running in device mode.

See also:
Events.h for more information on this event.

RAISES_EVENT ( USB_WakeUp   ) 

This module raises the Wake Up event when the host resumes the USB interface of the AVR whilst running in device mode.

See also:
Events.h for more information on this event.

RAISES_EVENT ( USB_Suspend   ) 

This module raises the Suspended event when the host suspends the USB interface of the AVR whilst running in device mode.

See also:
Events.h for more information on this event.

RAISES_EVENT ( USB_VBUSDisconnect   ) 

This module raises the VBUS Disconnect event when power is removed from the VBUS line.

Note:
Not all USB AVR models support VBUS interrupts; this event only exists on supported AVRs.
See also:
Events.h for more information on this event.

RAISES_EVENT ( USB_VBUSConnect   ) 

This module raises the VBUS Connect event when the VBUS line is powered.

Note:
Not all USB AVR models support VBUS interrupts; this event only exists on supported AVRs.
See also:
Events.h for more information on this event.

RAISES_EVENT ( USB_VBUSChange   ) 

This module raises the VBUS Change event when the current VBUS status (present or not present) has changed.

Note:
Not all USB AVR models support VBUS interrupts; this event only exists on supported AVRs.
See also:
Events.h for more information on this event.

RAISES_EVENT ( USB_Disconnect   ) 

This module raises the USB Disconnected interrupt when the AVR is removed from a host while in device USB mode.

Note:
For the smaller USB AVRs (AT90USBXX2) with limited USB controllers, VBUS is not available to the USB controller. this means that the current connection state is derived from the bus suspension and wake up events by default, 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.

RAISES_EVENT ( USB_Connect   ) 

This module raises the USB Connected interrupt when the AVR is attached to a host while in device USB mode.

Note:
For the smaller USB AVRs (AT90USBXX2) with limited USB controllers, VBUS is not available to the USB controller. this means that the current connection state is derived from the bus suspension and wake up events by default, 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.


Generated on Wed Dec 17 16:18:45 2008 for LUFA Library by  doxygen 1.5.7.1