aboutsummaryrefslogtreecommitdiffstats
path: root/Demos
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2013-05-19 21:49:13 +0200
committerDean Camera <dean@fourwalledcubicle.com>2013-05-19 21:49:13 +0200
commit654baf7d609963cf25da328f2b3fc8ced0eaf68a (patch)
tree38dad4b3d6e7054a6538a3447a1db945417e914f /Demos
parent847426272826c19eb7ab226465a7687ab47266ce (diff)
downloadlufa-654baf7d609963cf25da328f2b3fc8ced0eaf68a.tar.gz
lufa-654baf7d609963cf25da328f2b3fc8ced0eaf68a.tar.bz2
lufa-654baf7d609963cf25da328f2b3fc8ced0eaf68a.zip
Add XMEGA support to the class driver demos where possible.
Diffstat (limited to 'Demos')
-rw-r--r--Demos/Device/ClassDriver/AudioInput/AudioInput.c4
-rw-r--r--Demos/Device/ClassDriver/AudioInput/AudioInput.h3
-rw-r--r--Demos/Device/ClassDriver/AudioInput/asf.xml8
-rw-r--r--Demos/Device/ClassDriver/AudioOutput/AudioOutput.c4
-rw-r--r--Demos/Device/ClassDriver/AudioOutput/AudioOutput.h3
-rw-r--r--Demos/Device/ClassDriver/AudioOutput/asf.xml8
-rw-r--r--Demos/Device/ClassDriver/DualVirtualSerial/Config/LUFAConfig.h33
-rw-r--r--Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.c12
-rw-r--r--Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.h1
-rw-r--r--Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.txt3
-rw-r--r--Demos/Device/ClassDriver/DualVirtualSerial/asf.xml20
-rw-r--r--Demos/Device/ClassDriver/GenericHID/Config/LUFAConfig.h33
-rw-r--r--Demos/Device/ClassDriver/GenericHID/GenericHID.c12
-rw-r--r--Demos/Device/ClassDriver/GenericHID/GenericHID.h3
-rw-r--r--Demos/Device/ClassDriver/GenericHID/GenericHID.txt5
-rw-r--r--Demos/Device/ClassDriver/GenericHID/asf.xml20
-rw-r--r--Demos/Device/ClassDriver/Joystick/Config/LUFAConfig.h33
-rw-r--r--Demos/Device/ClassDriver/Joystick/Joystick.c12
-rw-r--r--Demos/Device/ClassDriver/Joystick/Joystick.h1
-rw-r--r--Demos/Device/ClassDriver/Joystick/Joystick.txt3
-rw-r--r--Demos/Device/ClassDriver/Joystick/asf.xml20
-rw-r--r--Demos/Device/ClassDriver/Keyboard/Config/LUFAConfig.h33
-rw-r--r--Demos/Device/ClassDriver/Keyboard/Keyboard.c12
-rw-r--r--Demos/Device/ClassDriver/Keyboard/Keyboard.h1
-rw-r--r--Demos/Device/ClassDriver/Keyboard/Keyboard.txt3
-rw-r--r--Demos/Device/ClassDriver/Keyboard/asf.xml20
-rw-r--r--Demos/Device/ClassDriver/KeyboardMouse/Config/LUFAConfig.h33
-rw-r--r--Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c12
-rw-r--r--Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.h1
-rw-r--r--Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.txt3
-rw-r--r--Demos/Device/ClassDriver/KeyboardMouse/asf.xml20
-rw-r--r--Demos/Device/ClassDriver/KeyboardMouseMultiReport/Config/LUFAConfig.h33
-rw-r--r--Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.c12
-rw-r--r--Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.h1
-rw-r--r--Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.txt3
-rw-r--r--Demos/Device/ClassDriver/KeyboardMouseMultiReport/asf.xml20
-rw-r--r--Demos/Device/ClassDriver/MIDI/Config/LUFAConfig.h33
-rw-r--r--Demos/Device/ClassDriver/MIDI/MIDI.c12
-rw-r--r--Demos/Device/ClassDriver/MIDI/MIDI.h1
-rw-r--r--Demos/Device/ClassDriver/MIDI/MIDI.txt3
-rw-r--r--Demos/Device/ClassDriver/MIDI/asf.xml20
-rw-r--r--Demos/Device/ClassDriver/MassStorage/Config/LUFAConfig.h33
-rw-r--r--Demos/Device/ClassDriver/MassStorage/MassStorage.c12
-rw-r--r--Demos/Device/ClassDriver/MassStorage/MassStorage.h1
-rw-r--r--Demos/Device/ClassDriver/MassStorage/MassStorage.txt3
-rw-r--r--Demos/Device/ClassDriver/MassStorage/asf.xml20
-rw-r--r--Demos/Device/ClassDriver/MassStorageKeyboard/Config/LUFAConfig.h33
-rw-r--r--Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c12
-rw-r--r--Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.h1
-rw-r--r--Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.txt3
-rw-r--r--Demos/Device/ClassDriver/MassStorageKeyboard/asf.xml20
-rw-r--r--Demos/Device/ClassDriver/Mouse/Config/LUFAConfig.h33
-rw-r--r--Demos/Device/ClassDriver/Mouse/Mouse.c12
-rw-r--r--Demos/Device/ClassDriver/Mouse/Mouse.h1
-rw-r--r--Demos/Device/ClassDriver/Mouse/Mouse.txt3
-rw-r--r--Demos/Device/ClassDriver/Mouse/asf.xml20
-rw-r--r--Demos/Device/ClassDriver/RNDISEthernet/Config/LUFAConfig.h33
-rw-r--r--Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c12
-rw-r--r--Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.h3
-rw-r--r--Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.txt3
-rw-r--r--Demos/Device/ClassDriver/RNDISEthernet/asf.xml20
-rw-r--r--Demos/Device/ClassDriver/VirtualSerial/Config/LUFAConfig.h33
-rw-r--r--Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.c12
-rw-r--r--Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.h1
-rw-r--r--Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.txt3
-rw-r--r--Demos/Device/ClassDriver/VirtualSerial/asf.xml20
-rw-r--r--Demos/Device/ClassDriver/VirtualSerialMassStorage/Config/LUFAConfig.h33
-rw-r--r--Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.c12
-rw-r--r--Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.h1
-rw-r--r--Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.txt3
-rw-r--r--Demos/Device/ClassDriver/VirtualSerialMassStorage/asf.xml20
-rw-r--r--Demos/Device/ClassDriver/VirtualSerialMouse/Config/LUFAConfig.h33
-rw-r--r--Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c12
-rw-r--r--Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.h1
-rw-r--r--Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.txt3
-rw-r--r--Demos/Device/ClassDriver/VirtualSerialMouse/asf.xml20
76 files changed, 931 insertions, 71 deletions
diff --git a/Demos/Device/ClassDriver/AudioInput/AudioInput.c b/Demos/Device/ClassDriver/AudioInput/AudioInput.c
index c5ba9bca1..9eec39ca2 100644
--- a/Demos/Device/ClassDriver/AudioInput/AudioInput.c
+++ b/Demos/Device/ClassDriver/AudioInput/AudioInput.c
@@ -79,12 +79,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
LEDs_Init();
@@ -265,7 +267,7 @@ bool CALLBACK_Audio_Device_GetSetInterfaceProperty(USB_ClassInfo_Audio_Device_t*
const uint8_t EntityAddress,
const uint16_t Parameter,
uint16_t* const DataLength,
- uint8_t* Data)
+ uint8_t* Data)
{
/* No audio interface entities in the device descriptor, thus no properties to get or set. */
return false;
diff --git a/Demos/Device/ClassDriver/AudioInput/AudioInput.h b/Demos/Device/ClassDriver/AudioInput/AudioInput.h
index 093f3eefa..14bbd2ea0 100644
--- a/Demos/Device/ClassDriver/AudioInput/AudioInput.h
+++ b/Demos/Device/ClassDriver/AudioInput/AudioInput.h
@@ -46,6 +46,7 @@
#include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/Peripheral/ADC.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
#include "Descriptors.h"
#include "Config/AppConfig.h"
@@ -76,7 +77,7 @@
void EVENT_USB_Device_Disconnect(void);
void EVENT_USB_Device_ConfigurationChanged(void);
void EVENT_USB_Device_ControlRequest(void);
-
+
bool CALLBACK_Audio_Device_GetSetEndpointProperty(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo,
const uint8_t EndpointProperty,
const uint8_t EndpointAddress,
diff --git a/Demos/Device/ClassDriver/AudioInput/asf.xml b/Demos/Device/ClassDriver/AudioInput/asf.xml
index b61714e9f..2a60a1eb1 100644
--- a/Demos/Device/ClassDriver/AudioInput/asf.xml
+++ b/Demos/Device/ClassDriver/AudioInput/asf.xml
@@ -1,14 +1,14 @@
<asf xmlversion="1.0">
- <project caption="Audio Input Device Demo (Class Driver APIs)" id="lufa.demos.device.class.audio_input.example">
+ <project caption="Audio Input Device Demo (Class Driver APIs)" id="lufa.demos.device.class.audio_input.example.avr8">
<require idref="lufa.demos.device.class.audio_input"/>
<require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/>
<device-support value="at90usb1287"/>
- <config name="lufa.drivers.board.name" value="usbkey"/>
+ <config name="lufa.drivers.board.name" value="none"/>
- <build type="define" name="F_CPU" value="8000000UL"/>
- <build type="define" name="F_USB" value="8000000UL"/>
+ <build type="define" name="F_CPU" value="16000000UL"/>
+ <build type="define" name="F_USB" value="16000000UL"/>
</project>
<module type="application" id="lufa.demos.device.class.audio_input" caption="Audio Input Device Demo (Class Driver APIs)">
diff --git a/Demos/Device/ClassDriver/AudioOutput/AudioOutput.c b/Demos/Device/ClassDriver/AudioOutput/AudioOutput.c
index 22d19a4d5..81fd95b16 100644
--- a/Demos/Device/ClassDriver/AudioOutput/AudioOutput.c
+++ b/Demos/Device/ClassDriver/AudioOutput/AudioOutput.c
@@ -79,12 +79,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
LEDs_Init();
@@ -302,7 +304,7 @@ bool CALLBACK_Audio_Device_GetSetInterfaceProperty(USB_ClassInfo_Audio_Device_t*
const uint8_t EntityAddress,
const uint16_t Parameter,
uint16_t* const DataLength,
- uint8_t* Data)
+ uint8_t* Data)
{
/* No audio interface entities in the device descriptor, thus no properties to get or set. */
return false;
diff --git a/Demos/Device/ClassDriver/AudioOutput/AudioOutput.h b/Demos/Device/ClassDriver/AudioOutput/AudioOutput.h
index 802bec924..bf2d3c8a7 100644
--- a/Demos/Device/ClassDriver/AudioOutput/AudioOutput.h
+++ b/Demos/Device/ClassDriver/AudioOutput/AudioOutput.h
@@ -48,6 +48,7 @@
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
@@ -81,6 +82,6 @@
const uint8_t EntityAddress,
const uint16_t Parameter,
uint16_t* const DataLength,
- uint8_t* Data);
+ uint8_t* Data);
#endif
diff --git a/Demos/Device/ClassDriver/AudioOutput/asf.xml b/Demos/Device/ClassDriver/AudioOutput/asf.xml
index dacdbd5c6..5d0081b83 100644
--- a/Demos/Device/ClassDriver/AudioOutput/asf.xml
+++ b/Demos/Device/ClassDriver/AudioOutput/asf.xml
@@ -1,14 +1,14 @@
<asf xmlversion="1.0">
- <project caption="Audio Output Device Demo (Class Driver APIs)" id="lufa.demos.device.class.audio_output.example">
+ <project caption="Audio Output Device Demo (Class Driver APIs)" id="lufa.demos.device.class.audio_output.example.avr8">
<require idref="lufa.demos.device.class.audio_output"/>
<require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/>
<device-support value="at90usb1287"/>
- <config name="lufa.drivers.board.name" value="usbkey"/>
+ <config name="lufa.drivers.board.name" value="none"/>
- <build type="define" name="F_CPU" value="8000000UL"/>
- <build type="define" name="F_USB" value="8000000UL"/>
+ <build type="define" name="F_CPU" value="16000000UL"/>
+ <build type="define" name="F_USB" value="16000000UL"/>
</project>
<module type="application" id="lufa.demos.device.class.audio_output" caption="Audio Output Device Demo (Class Driver APIs)">
diff --git a/Demos/Device/ClassDriver/DualVirtualSerial/Config/LUFAConfig.h b/Demos/Device/ClassDriver/DualVirtualSerial/Config/LUFAConfig.h
index 3b33e2d04..d2f780a0b 100644
--- a/Demos/Device/ClassDriver/DualVirtualSerial/Config/LUFAConfig.h
+++ b/Demos/Device/ClassDriver/DualVirtualSerial/Config/LUFAConfig.h
@@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 6
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
diff --git a/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.c b/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.c
index b7d045505..eaba6185a 100644
--- a/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.c
+++ b/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.c
@@ -131,12 +131,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
Joystick_Init();
diff --git a/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.h b/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.h
index 0f4ae5892..c0447af8e 100644
--- a/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.h
+++ b/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.h
@@ -48,6 +48,7 @@
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
diff --git a/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.txt b/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.txt
index 70e95ad51..1e8d3c531 100644
--- a/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.txt
+++ b/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.txt
@@ -13,6 +13,9 @@
* \li Series 7 USB AVRs (AT90USBxxx7)
* \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
diff --git a/Demos/Device/ClassDriver/DualVirtualSerial/asf.xml b/Demos/Device/ClassDriver/DualVirtualSerial/asf.xml
index 11a23eb21..78ca488ca 100644
--- a/Demos/Device/ClassDriver/DualVirtualSerial/asf.xml
+++ b/Demos/Device/ClassDriver/DualVirtualSerial/asf.xml
@@ -1,14 +1,26 @@
<asf xmlversion="1.0">
- <project caption="Dual Virtual Serial Device Demo (Class Driver APIs)" id="lufa.demos.device.class.dual_cdc.example">
+ <project caption="Dual Virtual Serial Device Demo (Class Driver APIs)" id="lufa.demos.device.class.dual_cdc.example.avr8">
<require idref="lufa.demos.device.class.dual_cdc"/>
<require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/>
<device-support value="at90usb1287"/>
- <config name="lufa.drivers.board.name" value="usbkey"/>
+ <config name="lufa.drivers.board.name" value="none"/>
- <build type="define" name="F_CPU" value="8000000UL"/>
- <build type="define" name="F_USB" value="8000000UL"/>
+ <build type="define" name="F_CPU" value="16000000UL"/>
+ <build type="define" name="F_USB" value="16000000UL"/>
+ </project>
+
+ <project caption="Dual Virtual Serial Device Demo (Class Driver APIs)" id="lufa.demos.device.class.dual_cdc.example.xmega">
+ <require idref="lufa.demos.device.class.dual_cdc"/>
+ <require idref="lufa.boards.dummy.xmega"/>
+ <generator value="as5_8"/>
+
+ <device-support value="atxmega128a1u"/>
+ <config name="lufa.drivers.board.name" value="none"/>
+
+ <build type="define" name="F_CPU" value="32000000UL"/>
+ <build type="define" name="F_USB" value="48000000UL"/>
</project>
<module type="application" id="lufa.demos.device.class.dual_cdc" caption="Dual Virtual Serial Device Demo (Class Driver APIs)">
diff --git a/Demos/Device/ClassDriver/GenericHID/Config/LUFAConfig.h b/Demos/Device/ClassDriver/GenericHID/Config/LUFAConfig.h
index 3244d3bb7..3871759b6 100644
--- a/Demos/Device/ClassDriver/GenericHID/Config/LUFAConfig.h
+++ b/Demos/Device/ClassDriver/GenericHID/Config/LUFAConfig.h
@@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 1
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
diff --git a/Demos/Device/ClassDriver/GenericHID/GenericHID.c b/Demos/Device/ClassDriver/GenericHID/GenericHID.c
index 95dd44d16..aae3ea75a 100644
--- a/Demos/Device/ClassDriver/GenericHID/GenericHID.c
+++ b/Demos/Device/ClassDriver/GenericHID/GenericHID.c
@@ -80,12 +80,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
LEDs_Init();
diff --git a/Demos/Device/ClassDriver/GenericHID/GenericHID.h b/Demos/Device/ClassDriver/GenericHID/GenericHID.h
index bb0a6cc7e..7b7ac9cb5 100644
--- a/Demos/Device/ClassDriver/GenericHID/GenericHID.h
+++ b/Demos/Device/ClassDriver/GenericHID/GenericHID.h
@@ -45,9 +45,10 @@
#include "Descriptors.h"
#include "Config/AppConfig.h"
-
+
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
diff --git a/Demos/Device/ClassDriver/GenericHID/GenericHID.txt b/Demos/Device/ClassDriver/GenericHID/GenericHID.txt
index 3d72345f3..140274039 100644
--- a/Demos/Device/ClassDriver/GenericHID/GenericHID.txt
+++ b/Demos/Device/ClassDriver/GenericHID/GenericHID.txt
@@ -14,6 +14,9 @@
* \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
@@ -68,7 +71,7 @@
* <tr>
* <td>GENERIC_REPORT_SIZE</td>
* <td>AppConfig.h</td>
- * <td>This token defines the size of the device reports, both sent and received (including report ID byte). The value
+ * <td>This token defines the size of the device reports, both sent and received (including report ID byte). The value
* must be an integer ranging from 1 to 255.</td>
* </tr>
* </table>
diff --git a/Demos/Device/ClassDriver/GenericHID/asf.xml b/Demos/Device/ClassDriver/GenericHID/asf.xml
index 2b1ee5f8a..f64c7da3d 100644
--- a/Demos/Device/ClassDriver/GenericHID/asf.xml
+++ b/Demos/Device/ClassDriver/GenericHID/asf.xml
@@ -1,14 +1,26 @@
<asf xmlversion="1.0">
- <project caption="Generic HID Device Demo (Class Driver APIs)" id="lufa.demos.device.class.generic_hid.example">
+ <project caption="Generic HID Device Demo (Class Driver APIs)" id="lufa.demos.device.class.generic_hid.example.avr8">
<require idref="lufa.demos.device.class.generic_hid"/>
<require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/>
<device-support value="at90usb1287"/>
- <config name="lufa.drivers.board.name" value="usbkey"/>
+ <config name="lufa.drivers.board.name" value="none"/>
- <build type="define" name="F_CPU" value="8000000UL"/>
- <build type="define" name="F_USB" value="8000000UL"/>
+ <build type="define" name="F_CPU" value="16000000UL"/>
+ <build type="define" name="F_USB" value="16000000UL"/>
+ </project>
+
+ <project caption="Generic HID Device Demo (Class Driver APIs)" id="lufa.demos.device.class.generic_hid.example.xmega">
+ <require idref="lufa.demos.device.class.generic_hid"/>
+ <require idref="lufa.boards.dummy.xmega"/>
+ <generator value="as5_8"/>
+
+ <device-support value="atxmega128a1u"/>
+ <config name="lufa.drivers.board.name" value="none"/>
+
+ <build type="define" name="F_CPU" value="32000000UL"/>
+ <build type="define" name="F_USB" value="48000000UL"/>
</project>
<module type="application" id="lufa.demos.device.class.generic_hid" caption="Generic HID Device Demo (Class Driver APIs)">
diff --git a/Demos/Device/ClassDriver/Joystick/Config/LUFAConfig.h b/Demos/Device/ClassDriver/Joystick/Config/LUFAConfig.h
index 3244d3bb7..3871759b6 100644
--- a/Demos/Device/ClassDriver/Joystick/Config/LUFAConfig.h
+++ b/Demos/Device/ClassDriver/Joystick/Config/LUFAConfig.h
@@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 1
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
diff --git a/Demos/Device/ClassDriver/Joystick/Joystick.c b/Demos/Device/ClassDriver/Joystick/Joystick.c
index c4576ba00..809c41060 100644
--- a/Demos/Device/ClassDriver/Joystick/Joystick.c
+++ b/Demos/Device/ClassDriver/Joystick/Joystick.c
@@ -80,12 +80,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
Joystick_Init();
diff --git a/Demos/Device/ClassDriver/Joystick/Joystick.h b/Demos/Device/ClassDriver/Joystick/Joystick.h
index 5eafa616d..037e03dff 100644
--- a/Demos/Device/ClassDriver/Joystick/Joystick.h
+++ b/Demos/Device/ClassDriver/Joystick/Joystick.h
@@ -49,6 +49,7 @@
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Type Defines: */
/** Type define for the joystick HID report structure, for creating and sending HID reports to the host PC.
diff --git a/Demos/Device/ClassDriver/Joystick/Joystick.txt b/Demos/Device/ClassDriver/Joystick/Joystick.txt
index 55be2c300..e3aec3d70 100644
--- a/Demos/Device/ClassDriver/Joystick/Joystick.txt
+++ b/Demos/Device/ClassDriver/Joystick/Joystick.txt
@@ -14,6 +14,9 @@
* \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
diff --git a/Demos/Device/ClassDriver/Joystick/asf.xml b/Demos/Device/ClassDriver/Joystick/asf.xml
index 2cae1e5be..8810726b8 100644
--- a/Demos/Device/ClassDriver/Joystick/asf.xml
+++ b/Demos/Device/ClassDriver/Joystick/asf.xml
@@ -1,14 +1,26 @@
<asf xmlversion="1.0">
- <project caption="Joystick HID Device Demo (Class Driver APIs)" id="lufa.demos.device.class.joystick.example">
+ <project caption="Joystick HID Device Demo (Class Driver APIs)" id="lufa.demos.device.class.joystick.example.avr8">
<require idref="lufa.demos.device.class.joystick"/>
<require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/>
<device-support value="at90usb1287"/>
- <config name="lufa.drivers.board.name" value="usbkey"/>
+ <config name="lufa.drivers.board.name" value="none"/>
- <build type="define" name="F_CPU" value="8000000UL"/>
- <build type="define" name="F_USB" value="8000000UL"/>
+ <build type="define" name="F_CPU" value="16000000UL"/>
+ <build type="define" name="F_USB" value="16000000UL"/>
+ </project>
+
+ <project caption="Joystick HID Device Demo (Class Driver APIs)" id="lufa.demos.device.class.joystick.example.xmega">
+ <require idref="lufa.demos.device.class.joystick"/>
+ <require idref="lufa.boards.dummy.xmega"/>
+ <generator value="as5_8"/>
+
+ <device-support value="atxmega128a1u"/>
+ <config name="lufa.drivers.board.name" value="none"/>
+
+ <build type="define" name="F_CPU" value="32000000UL"/>
+ <build type="define" name="F_USB" value="48000000UL"/>
</project>
<module type="application" id="lufa.demos.device.class.joystick" caption="Joystick HID Device Demo (Class Driver APIs)">
diff --git a/Demos/Device/ClassDriver/Keyboard/Config/LUFAConfig.h b/Demos/Device/ClassDriver/Keyboard/Config/LUFAConfig.h
index 3244d3bb7..3871759b6 100644
--- a/Demos/Device/ClassDriver/Keyboard/Config/LUFAConfig.h
+++ b/Demos/Device/ClassDriver/Keyboard/Config/LUFAConfig.h
@@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 1
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
diff --git a/Demos/Device/ClassDriver/Keyboard/Keyboard.c b/Demos/Device/ClassDriver/Keyboard/Keyboard.c
index 5c7a6f141..b3cc67e1e 100644
--- a/Demos/Device/ClassDriver/Keyboard/Keyboard.c
+++ b/Demos/Device/ClassDriver/Keyboard/Keyboard.c
@@ -80,12 +80,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware()
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
Joystick_Init();
diff --git a/Demos/Device/ClassDriver/Keyboard/Keyboard.h b/Demos/Device/ClassDriver/Keyboard/Keyboard.h
index 853430a7e..38f50d11d 100644
--- a/Demos/Device/ClassDriver/Keyboard/Keyboard.h
+++ b/Demos/Device/ClassDriver/Keyboard/Keyboard.h
@@ -50,6 +50,7 @@
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
diff --git a/Demos/Device/ClassDriver/Keyboard/Keyboard.txt b/Demos/Device/ClassDriver/Keyboard/Keyboard.txt
index 3e7ff88ed..9b4375b2e 100644
--- a/Demos/Device/ClassDriver/Keyboard/Keyboard.txt
+++ b/Demos/Device/ClassDriver/Keyboard/Keyboard.txt
@@ -14,6 +14,9 @@
* \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
diff --git a/Demos/Device/ClassDriver/Keyboard/asf.xml b/Demos/Device/ClassDriver/Keyboard/asf.xml
index f2989105b..5defbeec4 100644
--- a/Demos/Device/ClassDriver/Keyboard/asf.xml
+++ b/Demos/Device/ClassDriver/Keyboard/asf.xml
@@ -1,14 +1,26 @@
<asf xmlversion="1.0">
- <project caption="Keyboard HID Device Demo (Class Driver APIs)" id="lufa.demos.device.class.keyboard.example">
+ <project caption="Keyboard HID Device Demo (Class Driver APIs)" id="lufa.demos.device.class.keyboard.example.avr8">
<require idref="lufa.demos.device.class.keyboard"/>
<require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/>
<device-support value="at90usb1287"/>
- <config name="lufa.drivers.board.name" value="usbkey"/>
+ <config name="lufa.drivers.board.name" value="none"/>
- <build type="define" name="F_CPU" value="8000000UL"/>
- <build type="define" name="F_USB" value="8000000UL"/>
+ <build type="define" name="F_CPU" value="16000000UL"/>
+ <build type="define" name="F_USB" value="16000000UL"/>
+ </project>
+
+ <project caption="Keyboard HID Device Demo (Class Driver APIs)" id="lufa.demos.device.class.keyboard.example.xmega">
+ <require idref="lufa.demos.device.class.keyboard"/>
+ <require idref="lufa.boards.dummy.xmega"/>
+ <generator value="as5_8"/>
+
+ <device-support value="atxmega128a1u"/>
+ <config name="lufa.drivers.board.name" value="none"/>
+
+ <build type="define" name="F_CPU" value="32000000UL"/>
+ <build type="define" name="F_USB" value="48000000UL"/>
</project>
<module type="application" id="lufa.demos.device.class.keyboard" caption="Keyboard HID Device Demo (Class Driver APIs)">
diff --git a/Demos/Device/ClassDriver/KeyboardMouse/Config/LUFAConfig.h b/Demos/Device/ClassDriver/KeyboardMouse/Config/LUFAConfig.h
index 3244d3bb7..4873f8031 100644
--- a/Demos/Device/ClassDriver/KeyboardMouse/Config/LUFAConfig.h
+++ b/Demos/Device/ClassDriver/KeyboardMouse/Config/LUFAConfig.h
@@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 3
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
diff --git a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c
index 6b2e9bb40..f663f1683 100644
--- a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c
+++ b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c
@@ -106,12 +106,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware()
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
Joystick_Init();
diff --git a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.h b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.h
index 701984901..2f1d01b04 100644
--- a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.h
+++ b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.h
@@ -45,6 +45,7 @@
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
diff --git a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.txt b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.txt
index b994422a8..20c89cc80 100644
--- a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.txt
+++ b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.txt
@@ -14,6 +14,9 @@
* \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
diff --git a/Demos/Device/ClassDriver/KeyboardMouse/asf.xml b/Demos/Device/ClassDriver/KeyboardMouse/asf.xml
index a530eed6d..9e3bd4956 100644
--- a/Demos/Device/ClassDriver/KeyboardMouse/asf.xml
+++ b/Demos/Device/ClassDriver/KeyboardMouse/asf.xml
@@ -1,14 +1,26 @@
<asf xmlversion="1.0">
- <project caption="Keyboard and Mouse HID Device Demo (Class Driver APIs)" id="lufa.demos.device.class.keyboard_mouse.example">
+ <project caption="Keyboard and Mouse HID Device Demo (Class Driver APIs)" id="lufa.demos.device.class.keyboard_mouse.example.avr8">
<require idref="lufa.demos.device.class.keyboard_mouse"/>
<require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/>
<device-support value="at90usb1287"/>
- <config name="lufa.drivers.board.name" value="usbkey"/>
+ <config name="lufa.drivers.board.name" value="none"/>
- <build type="define" name="F_CPU" value="8000000UL"/>
- <build type="define" name="F_USB" value="8000000UL"/>
+ <build type="define" name="F_CPU" value="16000000UL"/>
+ <build type="define" name="F_USB" value="16000000UL"/>
+ </project>
+
+ <project caption="Keyboard and Mouse HID Device Demo (Class Driver APIs)" id="lufa.demos.device.class.keyboard_mouse.example.xmega">
+ <require idref="lufa.demos.device.class.keyboard_mouse"/>
+ <require idref="lufa.boards.dummy.xmega"/>
+ <generator value="as5_8"/>
+
+ <device-support value="atxmega128a1u"/>
+ <config name="lufa.drivers.board.name" value="none"/>
+
+ <build type="define" name="F_CPU" value="32000000UL"/>
+ <build type="define" name="F_USB" value="48000000UL"/>
</project>
<module type="application" id="lufa.demos.device.class.keyboard_mouse" caption="Keyboard and Mouse HID Device Demo (Class Driver APIs)">
diff --git a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Config/LUFAConfig.h b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Config/LUFAConfig.h
index 3244d3bb7..3871759b6 100644
--- a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Config/LUFAConfig.h
+++ b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Config/LUFAConfig.h
@@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 1
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
diff --git a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.c b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.c
index b37104197..f15d134ff 100644
--- a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.c
+++ b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.c
@@ -80,12 +80,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware()
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
Joystick_Init();
diff --git a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.h b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.h
index 701984901..2f1d01b04 100644
--- a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.h
+++ b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.h
@@ -45,6 +45,7 @@
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
diff --git a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.txt b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.txt
index e99a7dc74..6ff910e16 100644
--- a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.txt
+++ b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.txt
@@ -14,6 +14,9 @@
* \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
diff --git a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/asf.xml b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/asf.xml
index 7c6d76dfd..65858aa26 100644
--- a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/asf.xml
+++ b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/asf.xml
@@ -1,14 +1,26 @@
<asf xmlversion="1.0">
- <project caption="Keyboard and Mouse HID (Multi Report) Device Demo (Class Driver APIs)" id="lufa.demos.device.class.keyboard_mouse_mr.example">
+ <project caption="Keyboard and Mouse HID (Multi Report) Device Demo (Class Driver APIs)" id="lufa.demos.device.class.keyboard_mouse_mr.example.avr8">
<require idref="lufa.demos.device.class.keyboard_mouse_mr"/>
<require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/>
<device-support value="at90usb1287"/>
- <config name="lufa.drivers.board.name" value="usbkey"/>
+ <config name="lufa.drivers.board.name" value="none"/>
- <build type="define" name="F_CPU" value="8000000UL"/>
- <build type="define" name="F_USB" value="8000000UL"/>
+ <build type="define" name="F_CPU" value="16000000UL"/>
+ <build type="define" name="F_USB" value="16000000UL"/>
+ </project>
+
+ <project caption="Keyboard and Mouse HID (Multi Report) Device Demo (Class Driver APIs)" id="lufa.demos.device.class.keyboard_mouse_mr.example.xmega">
+ <require idref="lufa.demos.device.class.keyboard_mouse_mr"/>
+ <require idref="lufa.boards.dummy.xmega"/>
+ <generator value="as5_8"/>
+
+ <device-support value="atxmega128a1u"/>
+ <config name="lufa.drivers.board.name" value="none"/>
+
+ <build type="define" name="F_CPU" value="32000000UL"/>
+ <build type="define" name="F_USB" value="48000000UL"/>
</project>
<module type="application" id="lufa.demos.device.class.keyboard_mouse_mr" caption="Keyboard and Mouse HID (Multi Report) Device Demo (Class Driver APIs)">
diff --git a/Demos/Device/ClassDriver/MIDI/Config/LUFAConfig.h b/Demos/Device/ClassDriver/MIDI/Config/LUFAConfig.h
index 3244d3bb7..a4ca3437f 100644
--- a/Demos/Device/ClassDriver/MIDI/Config/LUFAConfig.h
+++ b/Demos/Device/ClassDriver/MIDI/Config/LUFAConfig.h
@@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 2
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
diff --git a/Demos/Device/ClassDriver/MIDI/MIDI.c b/Demos/Device/ClassDriver/MIDI/MIDI.c
index 139c65e34..bec442883 100644
--- a/Demos/Device/ClassDriver/MIDI/MIDI.c
+++ b/Demos/Device/ClassDriver/MIDI/MIDI.c
@@ -92,12 +92,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
Joystick_Init();
diff --git a/Demos/Device/ClassDriver/MIDI/MIDI.h b/Demos/Device/ClassDriver/MIDI/MIDI.h
index 54dbef2ab..ca4fa3b8a 100644
--- a/Demos/Device/ClassDriver/MIDI/MIDI.h
+++ b/Demos/Device/ClassDriver/MIDI/MIDI.h
@@ -50,6 +50,7 @@
#include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
diff --git a/Demos/Device/ClassDriver/MIDI/MIDI.txt b/Demos/Device/ClassDriver/MIDI/MIDI.txt
index 362250c41..9ac3d9ea8 100644
--- a/Demos/Device/ClassDriver/MIDI/MIDI.txt
+++ b/Demos/Device/ClassDriver/MIDI/MIDI.txt
@@ -14,6 +14,9 @@
* \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
diff --git a/Demos/Device/ClassDriver/MIDI/asf.xml b/Demos/Device/ClassDriver/MIDI/asf.xml
index 6212b482a..8a7479d00 100644
--- a/Demos/Device/ClassDriver/MIDI/asf.xml
+++ b/Demos/Device/ClassDriver/MIDI/asf.xml
@@ -1,14 +1,26 @@
<asf xmlversion="1.0">
- <project caption="MIDI Device Demo (Class Driver APIs)" id="lufa.demos.device.class.midi.example">
+ <project caption="MIDI Device Demo (Class Driver APIs)" id="lufa.demos.device.class.midi.example.avr8">
<require idref="lufa.demos.device.class.midi"/>
<require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/>
<device-support value="at90usb1287"/>
- <config name="lufa.drivers.board.name" value="usbkey"/>
+ <config name="lufa.drivers.board.name" value="none"/>
- <build type="define" name="F_CPU" value="8000000UL"/>
- <build type="define" name="F_USB" value="8000000UL"/>
+ <build type="define" name="F_CPU" value="16000000UL"/>
+ <build type="define" name="F_USB" value="16000000UL"/>
+ </project>
+
+ <project caption="MIDI Device Demo (Class Driver APIs)" id="lufa.demos.device.class.midi.example.xmega">
+ <require idref="lufa.demos.device.class.midi"/>
+ <require idref="lufa.boards.dummy.xmega"/>
+ <generator value="as5_8"/>
+
+ <device-support value="atxmega128a1u"/>
+ <config name="lufa.drivers.board.name" value="none"/>
+
+ <build type="define" name="F_CPU" value="32000000UL"/>
+ <build type="define" name="F_USB" value="48000000UL"/>
</project>
<module type="application" id="lufa.demos.device.class.midi" caption="MIDI Device Demo (Class Driver APIs)">
diff --git a/Demos/Device/ClassDriver/MassStorage/Config/LUFAConfig.h b/Demos/Device/ClassDriver/MassStorage/Config/LUFAConfig.h
index 3b33e2d04..da728ec29 100644
--- a/Demos/Device/ClassDriver/MassStorage/Config/LUFAConfig.h
+++ b/Demos/Device/ClassDriver/MassStorage/Config/LUFAConfig.h
@@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 4
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
diff --git a/Demos/Device/ClassDriver/MassStorage/MassStorage.c b/Demos/Device/ClassDriver/MassStorage/MassStorage.c
index 598698a19..a0fa7a2a9 100644
--- a/Demos/Device/ClassDriver/MassStorage/MassStorage.c
+++ b/Demos/Device/ClassDriver/MassStorage/MassStorage.c
@@ -82,12 +82,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
LEDs_Init();
diff --git a/Demos/Device/ClassDriver/MassStorage/MassStorage.h b/Demos/Device/ClassDriver/MassStorage/MassStorage.h
index cfeea8032..55e179666 100644
--- a/Demos/Device/ClassDriver/MassStorage/MassStorage.h
+++ b/Demos/Device/ClassDriver/MassStorage/MassStorage.h
@@ -51,6 +51,7 @@
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
diff --git a/Demos/Device/ClassDriver/MassStorage/MassStorage.txt b/Demos/Device/ClassDriver/MassStorage/MassStorage.txt
index 5bf7c5570..dd71e3bcd 100644
--- a/Demos/Device/ClassDriver/MassStorage/MassStorage.txt
+++ b/Demos/Device/ClassDriver/MassStorage/MassStorage.txt
@@ -14,6 +14,9 @@
* \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
diff --git a/Demos/Device/ClassDriver/MassStorage/asf.xml b/Demos/Device/ClassDriver/MassStorage/asf.xml
index 4d10f3cd7..26152739c 100644
--- a/Demos/Device/ClassDriver/MassStorage/asf.xml
+++ b/Demos/Device/ClassDriver/MassStorage/asf.xml
@@ -1,14 +1,26 @@
<asf xmlversion="1.0">
- <project caption="Mass Storage Device Demo (Class Driver APIs)" id="lufa.demos.device.class.mass_storage.example">
+ <project caption="Mass Storage Device Demo (Class Driver APIs)" id="lufa.demos.device.class.mass_storage.example.avr8">
<require idref="lufa.demos.device.class.mass_storage"/>
<require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/>
<device-support value="at90usb1287"/>
- <config name="lufa.drivers.board.name" value="usbkey"/>
+ <config name="lufa.drivers.board.name" value="none"/>
- <build type="define" name="F_CPU" value="8000000UL"/>
- <build type="define" name="F_USB" value="8000000UL"/>
+ <build type="define" name="F_CPU" value="16000000UL"/>
+ <build type="define" name="F_USB" value="16000000UL"/>
+ </project>
+
+ <project caption="Mass Storage Device Demo (Class Driver APIs)" id="lufa.demos.device.class.mass_storage.example.xmega">
+ <require idref="lufa.demos.device.class.mass_storage"/>
+ <require idref="lufa.boards.dummy.xmega"/>
+ <generator value="as5_8"/>
+
+ <device-support value="atxmega128a1u"/>
+ <config name="lufa.drivers.board.name" value="none"/>
+
+ <build type="define" name="F_CPU" value="32000000UL"/>
+ <build type="define" name="F_USB" value="48000000UL"/>
</project>
<module type="application" id="lufa.demos.device.class.mass_storage" caption="Mass Storage Device Demo (Class Driver APIs)">
diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/Config/LUFAConfig.h b/Demos/Device/ClassDriver/MassStorageKeyboard/Config/LUFAConfig.h
index 3b33e2d04..9d358ed62 100644
--- a/Demos/Device/ClassDriver/MassStorageKeyboard/Config/LUFAConfig.h
+++ b/Demos/Device/ClassDriver/MassStorageKeyboard/Config/LUFAConfig.h
@@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 5
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c
index 00761785c..05fdfbe0c 100644
--- a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c
+++ b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c
@@ -106,12 +106,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
LEDs_Init();
diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.h b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.h
index 2e213c942..05b5a8457 100644
--- a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.h
+++ b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.h
@@ -56,6 +56,7 @@
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.txt b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.txt
index 7cdb47279..d9affad83 100644
--- a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.txt
+++ b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.txt
@@ -14,6 +14,9 @@
* \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/asf.xml b/Demos/Device/ClassDriver/MassStorageKeyboard/asf.xml
index 3b53aec2f..cd0a10114 100644
--- a/Demos/Device/ClassDriver/MassStorageKeyboard/asf.xml
+++ b/Demos/Device/ClassDriver/MassStorageKeyboard/asf.xml
@@ -1,14 +1,26 @@
<asf xmlversion="1.0">
- <project caption="Mass Storage and HID Keyboard Device Demo (Class Driver APIs)" id="lufa.demos.device.class.mass_storage_keyboard.example">
+ <project caption="Mass Storage and HID Keyboard Device Demo (Class Driver APIs)" id="lufa.demos.device.class.mass_storage_keyboard.example.avr8">
<require idref="lufa.demos.device.class.mass_storage_keyboard"/>
<require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/>
<device-support value="at90usb1287"/>
- <config name="lufa.drivers.board.name" value="usbkey"/>
+ <config name="lufa.drivers.board.name" value="none"/>
- <build type="define" name="F_CPU" value="8000000UL"/>
- <build type="define" name="F_USB" value="8000000UL"/>
+ <build type="define" name="F_CPU" value="16000000UL"/>
+ <build type="define" name="F_USB" value="16000000UL"/>
+ </project>
+
+ <project caption="Mass Storage and HID Keyboard Device Demo (Class Driver APIs)" id="lufa.demos.device.class.mass_storage_keyboard.example.xmega">
+ <require idref="lufa.demos.device.class.mass_storage_keyboard"/>
+ <require idref="lufa.boards.dummy.xmega"/>
+ <generator value="as5_8"/>
+
+ <device-support value="atxmega128a1u"/>
+ <config name="lufa.drivers.board.name" value="none"/>
+
+ <build type="define" name="F_CPU" value="32000000UL"/>
+ <build type="define" name="F_USB" value="48000000UL"/>
</project>
<module type="application" id="lufa.demos.device.class.mass_storage_keyboard" caption="Mass Storage and HID Keyboard Device Demo (Class Driver APIs)">
diff --git a/Demos/Device/ClassDriver/Mouse/Config/LUFAConfig.h b/Demos/Device/ClassDriver/Mouse/Config/LUFAConfig.h
index 3244d3bb7..3871759b6 100644
--- a/Demos/Device/ClassDriver/Mouse/Config/LUFAConfig.h
+++ b/Demos/Device/ClassDriver/Mouse/Config/LUFAConfig.h
@@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 1
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
diff --git a/Demos/Device/ClassDriver/Mouse/Mouse.c b/Demos/Device/ClassDriver/Mouse/Mouse.c
index c9caa1cff..8432b65a9 100644
--- a/Demos/Device/ClassDriver/Mouse/Mouse.c
+++ b/Demos/Device/ClassDriver/Mouse/Mouse.c
@@ -80,12 +80,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
Joystick_Init();
diff --git a/Demos/Device/ClassDriver/Mouse/Mouse.h b/Demos/Device/ClassDriver/Mouse/Mouse.h
index 371ef6c3c..e63c9351c 100644
--- a/Demos/Device/ClassDriver/Mouse/Mouse.h
+++ b/Demos/Device/ClassDriver/Mouse/Mouse.h
@@ -51,6 +51,7 @@
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
diff --git a/Demos/Device/ClassDriver/Mouse/Mouse.txt b/Demos/Device/ClassDriver/Mouse/Mouse.txt
index d1277a2d6..e4673aeaa 100644
--- a/Demos/Device/ClassDriver/Mouse/Mouse.txt
+++ b/Demos/Device/ClassDriver/Mouse/Mouse.txt
@@ -14,6 +14,9 @@
* \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
diff --git a/Demos/Device/ClassDriver/Mouse/asf.xml b/Demos/Device/ClassDriver/Mouse/asf.xml
index f501963c4..7ad6b9479 100644
--- a/Demos/Device/ClassDriver/Mouse/asf.xml
+++ b/Demos/Device/ClassDriver/Mouse/asf.xml
@@ -1,14 +1,26 @@
<asf xmlversion="1.0">
- <project caption="Mouse HID Device Demo (Class Driver APIs)" id="lufa.demos.device.class.mouse.example">
+ <project caption="Mouse HID Device Demo (Class Driver APIs)" id="lufa.demos.device.class.mouse.example.avr8">
<require idref="lufa.demos.device.class.mouse"/>
<require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/>
<device-support value="at90usb1287"/>
- <config name="lufa.drivers.board.name" value="usbkey"/>
+ <config name="lufa.drivers.board.name" value="none"/>
- <build type="define" name="F_CPU" value="8000000UL"/>
- <build type="define" name="F_USB" value="8000000UL"/>
+ <build type="define" name="F_CPU" value="16000000UL"/>
+ <build type="define" name="F_USB" value="16000000UL"/>
+ </project>
+
+ <project caption="Mouse HID Device Demo (Class Driver APIs)" id="lufa.demos.device.class.mouse.example.xmega">
+ <require idref="lufa.demos.device.class.mouse"/>
+ <require idref="lufa.boards.dummy.xmega"/>
+ <generator value="as5_8"/>
+
+ <device-support value="atxmega128a1u"/>
+ <config name="lufa.drivers.board.name" value="none"/>
+
+ <build type="define" name="F_CPU" value="32000000UL"/>
+ <build type="define" name="F_USB" value="48000000UL"/>
</project>
<module type="application" id="lufa.demos.device.class.mouse" caption="Mouse HID Device Demo (Class Driver APIs)">
diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Config/LUFAConfig.h b/Demos/Device/ClassDriver/RNDISEthernet/Config/LUFAConfig.h
index 3244d3bb7..4873f8031 100644
--- a/Demos/Device/ClassDriver/RNDISEthernet/Config/LUFAConfig.h
+++ b/Demos/Device/ClassDriver/RNDISEthernet/Config/LUFAConfig.h
@@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 3
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
diff --git a/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c b/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c
index ef643a82e..54d551142 100644
--- a/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c
+++ b/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c
@@ -115,12 +115,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
LEDs_Init();
diff --git a/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.h b/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.h
index 57fdc4ec7..839a53bdd 100644
--- a/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.h
+++ b/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.h
@@ -50,10 +50,11 @@
#include "Lib/ARP.h"
#include "Lib/Webserver.h"
#include "Config/AppConfig.h"
-
+
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
diff --git a/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.txt b/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.txt
index ac72d4ae7..aafa3cc43 100644
--- a/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.txt
+++ b/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.txt
@@ -12,6 +12,9 @@
*
* \li Series 7 USB AVRs (AT90USBxxx7)
* \li Series 6 USB AVRs (AT90USBxxx6)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
diff --git a/Demos/Device/ClassDriver/RNDISEthernet/asf.xml b/Demos/Device/ClassDriver/RNDISEthernet/asf.xml
index 9aef2735e..3084f41fc 100644
--- a/Demos/Device/ClassDriver/RNDISEthernet/asf.xml
+++ b/Demos/Device/ClassDriver/RNDISEthernet/asf.xml
@@ -1,14 +1,26 @@
<asf xmlversion="1.0">
- <project caption="RNDIS Ethernet Device Demo (Class Driver APIs)" id="lufa.demos.device.class.rndis.example">
+ <project caption="RNDIS Ethernet Device Demo (Class Driver APIs)" id="lufa.demos.device.class.rndis.example.avr8">
<require idref="lufa.demos.device.class.rndis"/>
<require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/>
<device-support value="at90usb1287"/>
- <config name="lufa.drivers.board.name" value="usbkey"/>
+ <config name="lufa.drivers.board.name" value="none"/>
- <build type="define" name="F_CPU" value="8000000UL"/>
- <build type="define" name="F_USB" value="8000000UL"/>
+ <build type="define" name="F_CPU" value="16000000UL"/>
+ <build type="define" name="F_USB" value="16000000UL"/>
+ </project>
+
+ <project caption="RNDIS Ethernet Device Demo (Class Driver APIs)" id="lufa.demos.device.class.rndis.example.xmega">
+ <require idref="lufa.demos.device.class.rndis"/>
+ <require idref="lufa.boards.dummy.xmega"/>
+ <generator value="as5_8"/>
+
+ <device-support value="atxmega128a1u"/>
+ <config name="lufa.drivers.board.name" value="none"/>
+
+ <build type="define" name="F_CPU" value="32000000UL"/>
+ <build type="define" name="F_USB" value="48000000UL"/>
</project>
<module type="application" id="lufa.demos.device.class.rndis" caption="RNDIS Ethernet Device Demo (Class Driver APIs)">
diff --git a/Demos/Device/ClassDriver/VirtualSerial/Config/LUFAConfig.h b/Demos/Device/ClassDriver/VirtualSerial/Config/LUFAConfig.h
index 3b33e2d04..da728ec29 100644
--- a/Demos/Device/ClassDriver/VirtualSerial/Config/LUFAConfig.h
+++ b/Demos/Device/ClassDriver/VirtualSerial/Config/LUFAConfig.h
@@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 4
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
diff --git a/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.c b/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.c
index 07bb84295..0079acbfa 100644
--- a/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.c
+++ b/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.c
@@ -100,12 +100,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
Joystick_Init();
diff --git a/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.h b/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.h
index 335399642..2e10366fd 100644
--- a/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.h
+++ b/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.h
@@ -49,6 +49,7 @@
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
diff --git a/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.txt b/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.txt
index e0a3291b4..61b665674 100644
--- a/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.txt
+++ b/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.txt
@@ -14,6 +14,9 @@
* \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
diff --git a/Demos/Device/ClassDriver/VirtualSerial/asf.xml b/Demos/Device/ClassDriver/VirtualSerial/asf.xml
index c71946806..64ce25fd2 100644
--- a/Demos/Device/ClassDriver/VirtualSerial/asf.xml
+++ b/Demos/Device/ClassDriver/VirtualSerial/asf.xml
@@ -1,14 +1,26 @@
<asf xmlversion="1.0">
- <project caption="Virtual Serial CDC Device Demo (Class Driver APIs)" id="lufa.demos.device.class.cdc.example">
+ <project caption="Virtual Serial CDC Device Demo (Class Driver APIs)" id="lufa.demos.device.class.cdc.example.avr8">
<require idref="lufa.demos.device.class.cdc"/>
<require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/>
<device-support value="at90usb1287"/>
- <config name="lufa.drivers.board.name" value="usbkey"/>
+ <config name="lufa.drivers.board.name" value="none"/>
- <build type="define" name="F_CPU" value="8000000UL"/>
- <build type="define" name="F_USB" value="8000000UL"/>
+ <build type="define" name="F_CPU" value="16000000UL"/>
+ <build type="define" name="F_USB" value="16000000UL"/>
+ </project>
+
+ <project caption="Virtual Serial CDC Device Demo (Class Driver APIs)" id="lufa.demos.device.class.cdc.example.xmega">
+ <require idref="lufa.demos.device.class.cdc"/>
+ <require idref="lufa.boards.dummy.xmega"/>
+ <generator value="as5_8"/>
+
+ <device-support value="atxmega128a1u"/>
+ <config name="lufa.drivers.board.name" value="none"/>
+
+ <build type="define" name="F_CPU" value="32000000UL"/>
+ <build type="define" name="F_USB" value="48000000UL"/>
</project>
<module type="application" id="lufa.demos.device.class.cdc" caption="Virtual Serial CDC Device Demo (Class Driver APIs)">
diff --git a/Demos/Device/ClassDriver/VirtualSerialMassStorage/Config/LUFAConfig.h b/Demos/Device/ClassDriver/VirtualSerialMassStorage/Config/LUFAConfig.h
index 3b33e2d04..9d358ed62 100644
--- a/Demos/Device/ClassDriver/VirtualSerialMassStorage/Config/LUFAConfig.h
+++ b/Demos/Device/ClassDriver/VirtualSerialMassStorage/Config/LUFAConfig.h
@@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 5
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
diff --git a/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.c b/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.c
index cc146a9b7..f1dc04992 100644
--- a/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.c
+++ b/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.c
@@ -126,12 +126,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
LEDs_Init();
diff --git a/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.h b/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.h
index 413164df2..c191f098f 100644
--- a/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.h
+++ b/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.h
@@ -52,6 +52,7 @@
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
diff --git a/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.txt b/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.txt
index 042244119..62a7c3da6 100644
--- a/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.txt
+++ b/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.txt
@@ -13,6 +13,9 @@
* \li Series 7 USB AVRs (AT90USBxxx7)
* \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
diff --git a/Demos/Device/ClassDriver/VirtualSerialMassStorage/asf.xml b/Demos/Device/ClassDriver/VirtualSerialMassStorage/asf.xml
index beae95627..6a21768fb 100644
--- a/Demos/Device/ClassDriver/VirtualSerialMassStorage/asf.xml
+++ b/Demos/Device/ClassDriver/VirtualSerialMassStorage/asf.xml
@@ -1,14 +1,26 @@
<asf xmlversion="1.0">
- <project caption="Virtual Serial CDC and Mass Storage Device Demo (Class Driver APIs)" id="lufa.demos.device.class.cdc_ms.example">
+ <project caption="Virtual Serial CDC and Mass Storage Device Demo (Class Driver APIs)" id="lufa.demos.device.class.cdc_ms.example.avr8">
<require idref="lufa.demos.device.class.cdc_ms"/>
<require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/>
<device-support value="at90usb1287"/>
- <config name="lufa.drivers.board.name" value="usbkey"/>
+ <config name="lufa.drivers.board.name" value="none"/>
- <build type="define" name="F_CPU" value="8000000UL"/>
- <build type="define" name="F_USB" value="8000000UL"/>
+ <build type="define" name="F_CPU" value="16000000UL"/>
+ <build type="define" name="F_USB" value="16000000UL"/>
+ </project>
+
+ <project caption="Virtual Serial CDC and Mass Storage Device Demo (Class Driver APIs)" id="lufa.demos.device.class.cdc_ms.example.xmega">
+ <require idref="lufa.demos.device.class.cdc_ms"/>
+ <require idref="lufa.boards.dummy.xmega"/>
+ <generator value="as5_8"/>
+
+ <device-support value="atxmega128a1u"/>
+ <config name="lufa.drivers.board.name" value="none"/>
+
+ <build type="define" name="F_CPU" value="32000000UL"/>
+ <build type="define" name="F_USB" value="48000000UL"/>
</project>
<module type="application" id="lufa.demos.device.class.cdc_ms" caption="Virtual Serial CDC and Mass Storage Device Demo (Class Driver APIs)">
diff --git a/Demos/Device/ClassDriver/VirtualSerialMouse/Config/LUFAConfig.h b/Demos/Device/ClassDriver/VirtualSerialMouse/Config/LUFAConfig.h
index 3b33e2d04..da728ec29 100644
--- a/Demos/Device/ClassDriver/VirtualSerialMouse/Config/LUFAConfig.h
+++ b/Demos/Device/ClassDriver/VirtualSerialMouse/Config/LUFAConfig.h
@@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 4
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
diff --git a/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c b/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c
index 54b8534d9..73f9e3875 100644
--- a/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c
+++ b/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c
@@ -116,12 +116,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
Joystick_Init();
diff --git a/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.h b/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.h
index b4db43342..0e9a72192 100644
--- a/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.h
+++ b/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.h
@@ -49,6 +49,7 @@
#include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
diff --git a/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.txt b/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.txt
index fe6328b73..96b317855 100644
--- a/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.txt
+++ b/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.txt
@@ -14,6 +14,9 @@
* \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
diff --git a/Demos/Device/ClassDriver/VirtualSerialMouse/asf.xml b/Demos/Device/ClassDriver/VirtualSerialMouse/asf.xml
index 61bb17fab..e555710c5 100644
--- a/Demos/Device/ClassDriver/VirtualSerialMouse/asf.xml
+++ b/Demos/Device/ClassDriver/VirtualSerialMouse/asf.xml
@@ -1,14 +1,26 @@
<asf xmlversion="1.0">
- <project caption="Virtual Serial CDC and Mouse HID Device Demo (Class Driver APIs)" id="lufa.demos.device.class.cdc_mouse.example">
+ <project caption="Virtual Serial CDC and Mouse HID Device Demo (Class Driver APIs)" id="lufa.demos.device.class.cdc_mouse.example.avr8">
<require idref="lufa.demos.device.class.cdc_mouse"/>
<require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/>
<device-support value="at90usb1287"/>
- <config name="lufa.drivers.board.name" value="usbkey"/>
+ <config name="lufa.drivers.board.name" value="none"/>
- <build type="define" name="F_CPU" value="8000000UL"/>
- <build type="define" name="F_USB" value="8000000UL"/>
+ <build type="define" name="F_CPU" value="16000000UL"/>
+ <build type="define" name="F_USB" value="16000000UL"/>
+ </project>
+
+ <project caption="Virtual Serial CDC and Mouse HID Device Demo (Class Driver APIs)" id="lufa.demos.device.class.cdc_mouse.example.xmega">
+ <require idref="lufa.demos.device.class.cdc_mouse"/>
+ <require idref="lufa.boards.dummy.xmega"/>
+ <generator value="as5_8"/>
+
+ <device-support value="atxmega128a1u"/>
+ <config name="lufa.drivers.board.name" value="none"/>
+
+ <build type="define" name="F_CPU" value="32000000UL"/>
+ <build type="define" name="F_USB" value="48000000UL"/>
</project>
<module type="application" id="lufa.demos.device.class.cdc_mouse" caption="Virtual Serial CDC and Mouse HID Device Demo (Class Driver APIs)">