aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/LowLevel/LowLevel.h
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-02-23 14:46:11 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-02-23 14:46:11 +0000
commit3702ba1fb31f265360a0e4cf1736465e44389103 (patch)
tree851b026782944e683eb480896a6512ea18ec56e2 /LUFA/Drivers/USB/LowLevel/LowLevel.h
parent0e6d5cf5b4fea133cbd3c16b958617deb42332cf (diff)
downloadlufa-3702ba1fb31f265360a0e4cf1736465e44389103.tar.gz
lufa-3702ba1fb31f265360a0e4cf1736465e44389103.tar.bz2
lufa-3702ba1fb31f265360a0e4cf1736465e44389103.zip
More porting of the USB core to the AVR32.
Diffstat (limited to 'LUFA/Drivers/USB/LowLevel/LowLevel.h')
-rw-r--r--LUFA/Drivers/USB/LowLevel/LowLevel.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/LUFA/Drivers/USB/LowLevel/LowLevel.h b/LUFA/Drivers/USB/LowLevel/LowLevel.h
index 581dfd113..2c8ade7b3 100644
--- a/LUFA/Drivers/USB/LowLevel/LowLevel.h
+++ b/LUFA/Drivers/USB/LowLevel/LowLevel.h
@@ -39,6 +39,15 @@
#ifndef __USBLOWLEVEL_H__
#define __USBLOWLEVEL_H__
+ /* External Variables: */
+ #if defined(__AVR32__)
+ #if !defined(CONTROL_ONLY_DEVICE)
+ extern uint8_t USB_SelectedEPNumber;
+ #else
+ #define USB_SelectedEPNumber 0
+ #endif
+ #endif
+
/* Includes: */
#if defined(__AVR32__)
#include <avr32/io.h>
@@ -77,7 +86,7 @@
/* Preprocessor Checks and Defines: */
#if !defined(__INCLUDE_FROM_USB_DRIVER)
- #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
+ #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
#endif
#if !defined(F_CLOCK)
@@ -354,16 +363,22 @@
#define USB_Controller_Disable() MACROS{ USBCON &= ~(1 << USBE); }MACROE
#define USB_Controller_Reset() MACROS{ const uint8_t Temp = USBCON; USBCON = (Temp & ~(1 << USBE)); \
USBCON = (Temp | (1 << USBE)); }MACROE
-
/* Inline Functions: */
#if defined(USB_CAN_BE_BOTH)
static inline uint8_t USB_GetUSBModeFromUID(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline uint8_t USB_GetUSBModeFromUID(void)
{
+ #if defined(__AVR32__)
+ if (AVR32_USBB.USBSTA.id)
+ return USB_MODE_DEVICE;
+ else
+ return USB_MODE_HOST;
+ #elif defined(__AVR__)
if (USBSTA & (1 << ID))
return USB_MODE_DEVICE;
else
return USB_MODE_HOST;
+ #endif
}
#endif