aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/LowLevel/Device.h
diff options
context:
space:
mode:
Diffstat (limited to 'LUFA/Drivers/USB/LowLevel/Device.h')
-rw-r--r--LUFA/Drivers/USB/LowLevel/Device.h53
1 files changed, 16 insertions, 37 deletions
diff --git a/LUFA/Drivers/USB/LowLevel/Device.h b/LUFA/Drivers/USB/LowLevel/Device.h
index c1a1d92a4..1f929bff0 100644
--- a/LUFA/Drivers/USB/LowLevel/Device.h
+++ b/LUFA/Drivers/USB/LowLevel/Device.h
@@ -41,11 +41,9 @@
#define __USBDEVICE_H__
/* Includes: */
- #if defined(__AVR__)
- #include <avr/pgmspace.h>
- #include <avr/eeprom.h>
- #endif
-
+ #include <avr/pgmspace.h>
+ #include <avr/eeprom.h>
+
#include "../../../Common/Common.h"
#include "../HighLevel/StdDescriptors.h"
#include "Endpoint.h"
@@ -56,13 +54,12 @@
#endif
#if !defined(__INCLUDE_FROM_USB_DRIVER)
- #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
+ #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
#endif
/* Public Interface - May be used in end-application: */
/* Macros: */
- #if (defined(USB_SERIES_4_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR) || \
- defined(USB_SERIES_UC3B_AVR) || defined(__DOXYGEN__))
+ #if defined(USB_SERIES_4_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR) || defined(__DOXYGEN__)
/** Mask for the Options parameter of the \ref USB_Init() function. This indicates that the
* USB interface should be initialized in low speed (1.5Mb/s) mode.
*
@@ -71,13 +68,13 @@
* \note Restrictions apply on the number, size and type of endpoints which can be used
* when running in low speed mode -- refer to the USB 2.0 standard.
*/
- #define USB_DEVICE_OPT_LOWSPEED (1 << 0)
+ #define USB_DEVICE_OPT_LOWSPEED (1 << 0)
#endif
/** Mask for the Options parameter of the USB_Init() function. This indicates that the
* USB interface should be initialized in full speed (12Mb/s) mode.
*/
- #define USB_DEVICE_OPT_FULLSPEED (0 << 0)
+ #define USB_DEVICE_OPT_FULLSPEED (0 << 0)
/* Pseudo-Function Macros: */
#if defined(__DOXYGEN__)
@@ -132,25 +129,16 @@
*/
static inline bool USB_Device_DisableSOFEvents(void);
#else
- #if defined(__AVR32__)
- #if !defined(NO_DEVICE_REMOTE_WAKEUP)
- #define USB_Device_SendRemoteWakeup() MACROS{ AVR32_USBB.UDCON.rmwkup = true; }MACROE
-
- #define USB_Device_IsRemoteWakeupSent() AVR32_USBB.UDCON.rmwkup
- #endif
-
- #define USB_Device_IsUSBSuspended() AVR32_USBB.UDINT.susp
- #elif defined(__AVR__)
- #if !defined(NO_DEVICE_REMOTE_WAKEUP)
- #define USB_Device_SendRemoteWakeup() MACROS{ UDCON |= (1 << RMWKUP); }MACROE
+ #if !defined(NO_DEVICE_REMOTE_WAKEUP)
+ #define USB_Device_SendRemoteWakeup() MACROS{ UDCON |= (1 << RMWKUP); }MACROE
- #define USB_Device_IsRemoteWakeupSent() ((UDCON & (1 << RMWKUP)) ? false : true)
- #endif
-
- #define USB_Device_IsUSBSuspended() ((UDINT & (1 << SUSPI)) ? true : false)
+ #define USB_Device_IsRemoteWakeupSent() ((UDCON & (1 << RMWKUP)) ? false : true)
#endif
-
+
+ #define USB_Device_IsUSBSuspended() ((UDINT & (1 << SUSPI)) ? true : false)
+
#define USB_Device_EnableSOFEvents() MACROS{ USB_INT_Enable(USB_INT_SOFI); }MACROE
+
#define USB_Device_DisableSOFEvents() MACROS{ USB_INT_Disable(USB_INT_SOFI); }MACROE
#endif
@@ -219,17 +207,8 @@
/* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
/* Macros: */
- #if defined(__AVR32__)
- #define USB_Device_SetLowSpeed() MACROS{ AVR32_USBB.UDCON.ls = true; }MACROE
- #define USB_Device_SetFullSpeed() MACROS{ AVR32_USBB.UDCON.ls = false; }MACROE
-
- #define USB_Device_SetDeviceAddress(addr) MACROS{ AVR32_USBB.UDCON.uadd = DeviceAddress; AVR32_USBB.UDCON.adden = true; }MACROE
- #elif defined(__AVR__)
- #define USB_Device_SetLowSpeed() MACROS{ UDCON |= (1 << LSM); }MACROE
- #define USB_Device_SetFullSpeed() MACROS{ UDCON &= ~(1 << LSM); }MACROE
-
- #define USB_Device_SetDeviceAddress(addr) MACROS{ UDADDR = ((1 << ADDEN) | DeviceAddress); }MACROE
- #endif
+ #define USB_Device_SetLowSpeed() MACROS{ UDCON |= (1 << LSM); }MACROE
+ #define USB_Device_SetFullSpeed() MACROS{ UDCON &= ~(1 << LSM); }MACROE
#endif
#endif