aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2011-07-15 08:10:51 +0000
committerDean Camera <dean@fourwalledcubicle.com>2011-07-15 08:10:51 +0000
commitf07e766755b2489c76f0f353b7fe2d4a11300e61 (patch)
tree95f6050361cbfa3ecdca0d5926f7c8201b98ca64 /LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h
parentffa8b430c1886b696e1e94039e6a9343b5b81dbd (diff)
downloadlufa-f07e766755b2489c76f0f353b7fe2d4a11300e61.tar.gz
lufa-f07e766755b2489c76f0f353b7fe2d4a11300e61.tar.bz2
lufa-f07e766755b2489c76f0f353b7fe2d4a11300e61.zip
Complete USB XMEGA interrupt control subsystem code in the core USB driver.
Automatically load in the USB calibration bytes from the User Signature Row on start-up. Create internal SRAM variable for the endpoint control and status register table, used by the XMEGA USB controller hardware.
Diffstat (limited to 'LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h')
-rw-r--r--LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h b/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h
index f0a472ed6..4b438911e 100644
--- a/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h
+++ b/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h
@@ -50,6 +50,7 @@
/* Includes: */
#include "../../../../Common/Common.h"
+ #include "../USBController.h"
#include "../StdDescriptors.h"
#include "../USBInterrupt.h"
#include "../Endpoint.h"
@@ -103,12 +104,12 @@
/** Length of the device's unique internal serial number, in bits, if present on the selected microcontroller
* model.
*/
- #define INTERNAL_SERIAL_LENGTH_BITS 112
+ #define INTERNAL_SERIAL_LENGTH_BITS (8 * (1 + (offsetof(NVM_PROD_SIGNATURES_t, COORDY1) - offsetof(NVM_PROD_SIGNATURES_t, LOTNUM0))))
/** Start address of the internal serial number, in the appropriate address space, if present on the selected microcontroller
* model.
*/
- #define INTERNAL_SERIAL_START_ADDRESS 0x08
+ #define INTERNAL_SERIAL_START_ADDRESS offsetof(NVM_PROD_SIGNATURES_t, LOTNUM0)
/* Function Prototypes: */
/** Sends a Remote Wakeup request to the host. This signals to the host that the device should
@@ -139,7 +140,7 @@
static inline uint16_t USB_Device_GetFrameNumber(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
static inline uint16_t USB_Device_GetFrameNumber(void)
{
- return 0; // TODO
+ return (((uint16_t)USB_EndpointTable.FRAMENUMH << 8) | USB_EndpointTable.FRAMENUML);
}
#if !defined(NO_SOF_EVENTS)
@@ -152,7 +153,7 @@
static inline void USB_Device_EnableSOFEvents(void) ATTR_ALWAYS_INLINE;
static inline void USB_Device_EnableSOFEvents(void)
{
- // TODO
+ USB.INTCTRLA |= USB_SOFIE_bm;
}
/** Disables the device mode Start Of Frame events. When disabled, this stops the firing of the
@@ -163,7 +164,7 @@
static inline void USB_Device_DisableSOFEvents(void) ATTR_ALWAYS_INLINE;
static inline void USB_Device_DisableSOFEvents(void)
{
- // TODO
+ USB.INTCTRLA &= ~USB_SOFIE_bm;
}
#endif
@@ -222,8 +223,6 @@
}
SetGlobalInterruptMask(CurrentGlobalInt);
-
-
}
#endif