X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/3702ba1fb31f265360a0e4cf1736465e44389103..a2e6d54336144f7fa3cc1d77f887cc9e20631771:/LUFA/Drivers/USB/LowLevel/LowLevel.h diff --git a/LUFA/Drivers/USB/LowLevel/LowLevel.h b/LUFA/Drivers/USB/LowLevel/LowLevel.h index 2c8ade7b3..04b2c460c 100644 --- a/LUFA/Drivers/USB/LowLevel/LowLevel.h +++ b/LUFA/Drivers/USB/LowLevel/LowLevel.h @@ -28,6 +28,16 @@ this software. */ +/** \file + * \brief USB low level USB controller definitions. + * + * This file contains structures, function prototypes and macros related to the low level configutation of the + * USB controller, to start, stop and reset the USB library core. + * + * \note This file should not be included directly. It is automatically included as needed by the USB driver + * dispatch header located in LUFA/Drivers/USB/USB.h. + */ + /** \ingroup Group_USB * @defgroup Group_USBManagement USB Interface Management * @@ -39,26 +49,11 @@ #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 - #include - #include - #elif defined(__AVR__) - #include - #include - #include - #endif - + #include + #include + #include + #include "../HighLevel/USBMode.h" #include "../../../Common/Common.h" @@ -363,22 +358,16 @@ #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