Port the device mode demos to the XMEGA architecture where applicable.
authorDean Camera <dean@fourwalledcubicle.com>
Sun, 19 May 2013 20:59:46 +0000 (22:59 +0200)
committerDean Camera <dean@fourwalledcubicle.com>
Sun, 19 May 2013 20:59:46 +0000 (22:59 +0200)
57 files changed:
Demos/Device/LowLevel/AudioInput/AudioInput.c
Demos/Device/LowLevel/AudioInput/AudioInput.h
Demos/Device/LowLevel/AudioInput/asf.xml
Demos/Device/LowLevel/AudioOutput/AudioOutput.c
Demos/Device/LowLevel/AudioOutput/AudioOutput.h
Demos/Device/LowLevel/AudioOutput/asf.xml
Demos/Device/LowLevel/DualVirtualSerial/Config/LUFAConfig.h
Demos/Device/LowLevel/DualVirtualSerial/Descriptors.h
Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.c
Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.h
Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.txt
Demos/Device/LowLevel/DualVirtualSerial/asf.xml
Demos/Device/LowLevel/GenericHID/Config/LUFAConfig.h
Demos/Device/LowLevel/GenericHID/GenericHID.c
Demos/Device/LowLevel/GenericHID/GenericHID.h
Demos/Device/LowLevel/GenericHID/GenericHID.txt
Demos/Device/LowLevel/GenericHID/asf.xml
Demos/Device/LowLevel/Joystick/Config/LUFAConfig.h
Demos/Device/LowLevel/Joystick/Joystick.c
Demos/Device/LowLevel/Joystick/Joystick.h
Demos/Device/LowLevel/Joystick/Joystick.txt
Demos/Device/LowLevel/Joystick/asf.xml
Demos/Device/LowLevel/Keyboard/Config/LUFAConfig.h
Demos/Device/LowLevel/Keyboard/Keyboard.c
Demos/Device/LowLevel/Keyboard/Keyboard.h
Demos/Device/LowLevel/Keyboard/Keyboard.txt
Demos/Device/LowLevel/Keyboard/asf.xml
Demos/Device/LowLevel/KeyboardMouse/Config/LUFAConfig.h
Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c
Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.h
Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.txt
Demos/Device/LowLevel/KeyboardMouse/asf.xml
Demos/Device/LowLevel/MIDI/Config/LUFAConfig.h
Demos/Device/LowLevel/MIDI/MIDI.c
Demos/Device/LowLevel/MIDI/MIDI.h
Demos/Device/LowLevel/MIDI/MIDI.txt
Demos/Device/LowLevel/MIDI/asf.xml
Demos/Device/LowLevel/MassStorage/Config/LUFAConfig.h
Demos/Device/LowLevel/MassStorage/MassStorage.c
Demos/Device/LowLevel/MassStorage/MassStorage.h
Demos/Device/LowLevel/MassStorage/MassStorage.txt
Demos/Device/LowLevel/MassStorage/asf.xml
Demos/Device/LowLevel/Mouse/Config/LUFAConfig.h
Demos/Device/LowLevel/Mouse/Mouse.c
Demos/Device/LowLevel/Mouse/Mouse.h
Demos/Device/LowLevel/Mouse/Mouse.txt
Demos/Device/LowLevel/Mouse/asf.xml
Demos/Device/LowLevel/RNDISEthernet/Config/LUFAConfig.h
Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c
Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.h
Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.txt
Demos/Device/LowLevel/RNDISEthernet/asf.xml
Demos/Device/LowLevel/VirtualSerial/Config/LUFAConfig.h
Demos/Device/LowLevel/VirtualSerial/VirtualSerial.c
Demos/Device/LowLevel/VirtualSerial/VirtualSerial.h
Demos/Device/LowLevel/VirtualSerial/VirtualSerial.txt
Demos/Device/LowLevel/VirtualSerial/asf.xml

index 1544f09..6c7bd1d 100644 (file)
@@ -62,12 +62,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();
index b7727a8..6701f8e 100644 (file)
@@ -49,6 +49,7 @@
                #include <LUFA/Drivers/Board/LEDs.h>
                #include <LUFA/Drivers/Board/Buttons.h>
                #include <LUFA/Drivers/Peripheral/ADC.h>
+               #include <LUFA/Platform/Platform.h>
 
        /* Macros: */
                /** Maximum audio sample value for the microphone input. */
index 767b3fd..3fdfb65 100644 (file)
@@ -1,14 +1,14 @@
 <asf xmlversion="1.0">\r
-       <project caption="Audio Input Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.audio_input.example">\r
+       <project caption="Audio Input Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.audio_input.example.avr8">\r
                <require idref="lufa.demos.device.lowlevel.audio_input"/>\r
                <require idref="lufa.boards.dummy.avr8"/>\r
                <generator value="as5_8"/>\r
 \r
                <device-support value="at90usb1287"/>\r
-               <config name="lufa.drivers.board.name" value="usbkey"/>\r
+               <config name="lufa.drivers.board.name" value="none"/>\r
 \r
-               <build type="define" name="F_CPU" value="8000000UL"/>\r
-               <build type="define" name="F_USB" value="8000000UL"/>\r
+               <build type="define" name="F_CPU" value="16000000UL"/>\r
+               <build type="define" name="F_USB" value="16000000UL"/>\r
        </project>\r
 \r
        <module type="application" id="lufa.demos.device.lowlevel.audio_input" caption="Audio Input Device Demo (Low Level APIs)">\r
index e77b041..d47381d 100644 (file)
@@ -62,12 +62,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();
index 2094090..45f0d4a 100644 (file)
@@ -47,6 +47,7 @@
 
                #include <LUFA/Drivers/USB/USB.h>
                #include <LUFA/Drivers/Board/LEDs.h>
+               #include <LUFA/Platform/Platform.h>
 
        /* Macros: */
                /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
index 458a8b9..19c15c3 100644 (file)
@@ -1,14 +1,14 @@
 <asf xmlversion="1.0">\r
-       <project caption="Audio Output Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.audio_output.example">\r
+       <project caption="Audio Output Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.audio_output.example.avr8">\r
                <require idref="lufa.demos.device.lowlevel.audio_output"/>\r
                <require idref="lufa.boards.dummy.avr8"/>\r
                <generator value="as5_8"/>\r
 \r
                <device-support value="at90usb1287"/>\r
-               <config name="lufa.drivers.board.name" value="usbkey"/>\r
+               <config name="lufa.drivers.board.name" value="none"/>\r
 \r
-               <build type="define" name="F_CPU" value="8000000UL"/>\r
-               <build type="define" name="F_USB" value="8000000UL"/>\r
+               <build type="define" name="F_CPU" value="16000000UL"/>\r
+               <build type="define" name="F_USB" value="16000000UL"/>\r
        </project>\r
 \r
        <module type="application" id="lufa.demos.device.lowlevel.audio_output" caption="Audio Output Device Demo (Low Level APIs)">\r
index 3b33e2d..d2f780a 100644 (file)
 //             #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.
index 154ed0c..a5a87dc 100644 (file)
@@ -58,7 +58,7 @@
                #define CDC2_RX_EPADDR                 (ENDPOINT_DIR_OUT | 5)
 
                /** Endpoint address of the second CDC interface's device-to-host notification IN endpoint. */
-               #define CDC2_NOTIFICATION_EPADDR       (ENDPOINT_DIR_IN | 6)
+               #define CDC2_NOTIFICATION_EPADDR       (ENDPOINT_DIR_IN  | 6)
 
                /** Size in bytes of the CDC device-to-host notification IN endpoints. */
                #define CDC_NOTIFICATION_EPSIZE        8
index a803b41..45790b1 100644 (file)
@@ -84,12 +84,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();
index 6e7c73d..63f1f08 100644 (file)
@@ -48,6 +48,7 @@
                #include <LUFA/Drivers/USB/USB.h>
                #include <LUFA/Drivers/Board/Joystick.h>
                #include <LUFA/Drivers/Board/LEDs.h>
+               #include <LUFA/Platform/Platform.h>
 
        /* Macros: */
                /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
index 0897bf9..af263cc 100644 (file)
@@ -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:
  *
index d304568..4628f4b 100644 (file)
@@ -1,14 +1,26 @@
 <asf xmlversion="1.0">\r
-       <project caption="Dual Virtual Serial Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.dual_cdc.example">\r
+       <project caption="Dual Virtual Serial Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.dual_cdc.example.avr8">\r
                <require idref="lufa.demos.device.lowlevel.dual_cdc"/>\r
                <require idref="lufa.boards.dummy.avr8"/>\r
                <generator value="as5_8"/>\r
 \r
                <device-support value="at90usb1287"/>\r
-               <config name="lufa.drivers.board.name" value="usbkey"/>\r
+               <config name="lufa.drivers.board.name" value="none"/>\r
 \r
-               <build type="define" name="F_CPU" value="8000000UL"/>\r
-               <build type="define" name="F_USB" value="8000000UL"/>\r
+               <build type="define" name="F_CPU" value="16000000UL"/>\r
+               <build type="define" name="F_USB" value="16000000UL"/>\r
+       </project>\r
+\r
+       <project caption="Dual Virtual Serial Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.dual_cdc.example.xmega">\r
+               <require idref="lufa.demos.device.lowlevel.dual_cdc"/>\r
+               <require idref="lufa.boards.dummy.xmega"/>\r
+               <generator value="as5_8"/>\r
+\r
+               <device-support value="atxmega128a1u"/>\r
+               <config name="lufa.drivers.board.name" value="none"/>\r
+\r
+               <build type="define" name="F_CPU" value="32000000UL"/>\r
+               <build type="define" name="F_USB" value="48000000UL"/>\r
        </project>\r
 \r
        <module type="application" id="lufa.demos.device.lowlevel.dual_cdc" caption="Dual Virtual Serial Device Demo (Low Level APIs)">\r
index 3244d3b..a4ca343 100644 (file)
 //             #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.
index 10b344f..2c55196 100644 (file)
@@ -57,12 +57,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();
index 806eda0..3a3c86c 100644 (file)
 
                #include "Descriptors.h"
                #include "Config/AppConfig.h"
-               
+
                #include <LUFA/Drivers/USB/USB.h>
                #include <LUFA/Drivers/Board/LEDs.h>
+               #include <LUFA/Platform/Platform.h>
 
        /* Macros: */
                /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
index 3d72345..1402740 100644 (file)
@@ -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>
index 27e09ca..44fa5cf 100644 (file)
@@ -1,14 +1,26 @@
 <asf xmlversion="1.0">\r
-       <project caption="Generic HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.generic_hid.example">\r
+       <project caption="Generic HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.generic_hid.example.avr8">\r
                <require idref="lufa.demos.device.lowlevel.generic_hid"/>\r
                <require idref="lufa.boards.dummy.avr8"/>\r
                <generator value="as5_8"/>\r
 \r
                <device-support value="at90usb1287"/>\r
-               <config name="lufa.drivers.board.name" value="usbkey"/>\r
+               <config name="lufa.drivers.board.name" value="none"/>\r
 \r
-               <build type="define" name="F_CPU" value="8000000UL"/>\r
-               <build type="define" name="F_USB" value="8000000UL"/>\r
+               <build type="define" name="F_CPU" value="16000000UL"/>\r
+               <build type="define" name="F_USB" value="16000000UL"/>\r
+       </project>\r
+\r
+       <project caption="Generic HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.generic_hid.example.xmega">\r
+               <require idref="lufa.demos.device.lowlevel.generic_hid"/>\r
+               <require idref="lufa.boards.dummy.xmega"/>\r
+               <generator value="as5_8"/>\r
+\r
+               <device-support value="atxmega128a1u"/>\r
+               <config name="lufa.drivers.board.name" value="none"/>\r
+\r
+               <build type="define" name="F_CPU" value="32000000UL"/>\r
+               <build type="define" name="F_USB" value="48000000UL"/>\r
        </project>\r
 \r
        <module type="application" id="lufa.demos.device.lowlevel.generic_hid" caption="Generic HID Device Demo (Low Level APIs)">\r
index 3244d3b..3871759 100644 (file)
 //             #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.
index 4e5af8d..2af5e28 100644 (file)
@@ -56,12 +56,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();
index 02a85f5..0cc17a5 100644 (file)
@@ -49,6 +49,7 @@
                #include <LUFA/Drivers/Board/Joystick.h>
                #include <LUFA/Drivers/Board/LEDs.h>
                #include <LUFA/Drivers/Board/Buttons.h>
+               #include <LUFA/Platform/Platform.h>
 
        /* Macros: */
                /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
index 55be2c3..e3aec3d 100644 (file)
@@ -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:
  *
index 05cc157..3780930 100644 (file)
@@ -1,14 +1,26 @@
 <asf xmlversion="1.0">\r
-       <project caption="Joystick HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.joystick.example">\r
+       <project caption="Joystick HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.joystick.example.avr8">\r
                <require idref="lufa.demos.device.lowlevel.joystick"/>\r
                <require idref="lufa.boards.dummy.avr8"/>\r
                <generator value="as5_8"/>\r
 \r
                <device-support value="at90usb1287"/>\r
-               <config name="lufa.drivers.board.name" value="usbkey"/>\r
+               <config name="lufa.drivers.board.name" value="none"/>\r
 \r
-               <build type="define" name="F_CPU" value="8000000UL"/>\r
-               <build type="define" name="F_USB" value="8000000UL"/>\r
+               <build type="define" name="F_CPU" value="16000000UL"/>\r
+               <build type="define" name="F_USB" value="16000000UL"/>\r
+       </project>\r
+\r
+       <project caption="Joystick HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.joystick.example.xmega">\r
+               <require idref="lufa.demos.device.lowlevel.joystick"/>\r
+               <require idref="lufa.boards.dummy.xmega"/>\r
+               <generator value="as5_8"/>\r
+\r
+               <device-support value="atxmega128a1u"/>\r
+               <config name="lufa.drivers.board.name" value="none"/>\r
+\r
+               <build type="define" name="F_CPU" value="32000000UL"/>\r
+               <build type="define" name="F_USB" value="48000000UL"/>\r
        </project>\r
 \r
        <module type="application" id="lufa.demos.device.lowlevel.joystick" caption="Joystick HID Device Demo (Low Level APIs)">\r
index 3244d3b..a4ca343 100644 (file)
 //             #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.
index 5ffe72f..18fde65 100644 (file)
@@ -74,12 +74,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();
@@ -311,7 +323,7 @@ void SendNextReport(void)
        else
        {
                /* Check to see if the report data has changed - if so a report MUST be sent */
-               SendReport = (memcmp(&PrevKeyboardReportData, &KeyboardReportData, sizeof(USB_KeyboardReport_Data_t)) != 0);    
+               SendReport = (memcmp(&PrevKeyboardReportData, &KeyboardReportData, sizeof(USB_KeyboardReport_Data_t)) != 0);
        }
 
        /* Select the Keyboard Report Endpoint */
index 4b25e34..a2fcf5a 100644 (file)
@@ -51,6 +51,7 @@
                #include <LUFA/Drivers/Board/Joystick.h>
                #include <LUFA/Drivers/Board/Buttons.h>
                #include <LUFA/Drivers/Board/LEDs.h>
+               #include <LUFA/Platform/Platform.h>
 
        /* Macros: */
                /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
index f7e2829..a1582a8 100644 (file)
@@ -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:
  *
index bae9848..d242754 100644 (file)
@@ -1,14 +1,26 @@
 <asf xmlversion="1.0">\r
-       <project caption="Keyboard HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.keyboard.example">\r
+       <project caption="Keyboard HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.keyboard.example.avr8">\r
                <require idref="lufa.demos.device.lowlevel.keyboard"/>\r
                <require idref="lufa.boards.dummy.avr8"/>\r
                <generator value="as5_8"/>\r
 \r
                <device-support value="at90usb1287"/>\r
-               <config name="lufa.drivers.board.name" value="usbkey"/>\r
+               <config name="lufa.drivers.board.name" value="none"/>\r
 \r
-               <build type="define" name="F_CPU" value="8000000UL"/>\r
-               <build type="define" name="F_USB" value="8000000UL"/>\r
+               <build type="define" name="F_CPU" value="16000000UL"/>\r
+               <build type="define" name="F_USB" value="16000000UL"/>\r
+       </project>\r
+\r
+       <project caption="Keyboard HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.keyboard.example.xmega">\r
+               <require idref="lufa.demos.device.lowlevel.keyboard"/>\r
+               <require idref="lufa.boards.dummy.xmega"/>\r
+               <generator value="as5_8"/>\r
+\r
+               <device-support value="atxmega128a1u"/>\r
+               <config name="lufa.drivers.board.name" value="none"/>\r
+\r
+               <build type="define" name="F_CPU" value="32000000UL"/>\r
+               <build type="define" name="F_USB" value="48000000UL"/>\r
        </project>\r
 \r
        <module type="application" id="lufa.demos.device.lowlevel.keyboard" caption="Keyboard HID Device Demo (Low Level APIs)">\r
index 3244d3b..4873f80 100644 (file)
 //             #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.
index 3eba6c3..c924bac 100644 (file)
@@ -65,12 +65,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();
index ac42b34..d74482f 100644 (file)
@@ -46,6 +46,7 @@
                #include <LUFA/Drivers/Board/Joystick.h>
                #include <LUFA/Drivers/Board/LEDs.h>
                #include <LUFA/Drivers/Board/Buttons.h>
+               #include <LUFA/Platform/Platform.h>
 
        /* Macros: */
                /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
index b994422..20c89cc 100644 (file)
@@ -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:
  *
index 247eeea..d3eca33 100644 (file)
@@ -1,14 +1,26 @@
 <asf xmlversion="1.0">\r
-       <project caption="Keyboard and Mouse HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.keyboard_mouse.example">\r
+       <project caption="Keyboard and Mouse HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.keyboard_mouse.example.avr8">\r
                <require idref="lufa.demos.device.lowlevel.keyboard_mouse"/>\r
                <require idref="lufa.boards.dummy.avr8"/>\r
                <generator value="as5_8"/>\r
 \r
                <device-support value="at90usb1287"/>\r
-               <config name="lufa.drivers.board.name" value="usbkey"/>\r
+               <config name="lufa.drivers.board.name" value="none"/>\r
 \r
-               <build type="define" name="F_CPU" value="8000000UL"/>\r
-               <build type="define" name="F_USB" value="8000000UL"/>\r
+               <build type="define" name="F_CPU" value="16000000UL"/>\r
+               <build type="define" name="F_USB" value="16000000UL"/>\r
+       </project>\r
+\r
+       <project caption="Keyboard and Mouse HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.keyboard_mouse.example.xmega">\r
+               <require idref="lufa.demos.device.lowlevel.keyboard_mouse"/>\r
+               <require idref="lufa.boards.dummy.xmega"/>\r
+               <generator value="as5_8"/>\r
+\r
+               <device-support value="atxmega128a1u"/>\r
+               <config name="lufa.drivers.board.name" value="none"/>\r
+\r
+               <build type="define" name="F_CPU" value="32000000UL"/>\r
+               <build type="define" name="F_USB" value="48000000UL"/>\r
        </project>\r
 \r
        <module type="application" id="lufa.demos.device.lowlevel.keyboard_mouse" caption="Keyboard and Mouse HID Device Demo (Low Level APIs)">\r
index 3244d3b..a4ca343 100644 (file)
 //             #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.
index deb0561..15e0839 100644 (file)
@@ -56,12 +56,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();
index b97678a..fd07f62 100644 (file)
@@ -49,6 +49,7 @@
                #include <LUFA/Drivers/Board/Joystick.h>
                #include <LUFA/Drivers/Board/LEDs.h>
                #include <LUFA/Drivers/Board/Buttons.h>
+               #include <LUFA/Platform/Platform.h>
 
    /* Macros: */
                /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
index 362250c..9ac3d9e 100644 (file)
@@ -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:
  *
index 652d51a..de8a016 100644 (file)
@@ -1,14 +1,26 @@
 <asf xmlversion="1.0">\r
-       <project caption="MIDI Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.midi.example">\r
+       <project caption="MIDI Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.midi.example.avr8">\r
                <require idref="lufa.demos.device.lowlevel.midi"/>\r
                <require idref="lufa.boards.dummy.avr8"/>\r
                <generator value="as5_8"/>\r
 \r
                <device-support value="at90usb1287"/>\r
-               <config name="lufa.drivers.board.name" value="usbkey"/>\r
+               <config name="lufa.drivers.board.name" value="none"/>\r
 \r
-               <build type="define" name="F_CPU" value="8000000UL"/>\r
-               <build type="define" name="F_USB" value="8000000UL"/>\r
+               <build type="define" name="F_CPU" value="16000000UL"/>\r
+               <build type="define" name="F_USB" value="16000000UL"/>\r
+       </project>\r
+\r
+       <project caption="MIDI Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.midi.example.xmega">\r
+               <require idref="lufa.demos.device.lowlevel.midi"/>\r
+               <require idref="lufa.boards.dummy.xmega"/>\r
+               <generator value="as5_8"/>\r
+\r
+               <device-support value="atxmega128a1u"/>\r
+               <config name="lufa.drivers.board.name" value="none"/>\r
+\r
+               <build type="define" name="F_CPU" value="32000000UL"/>\r
+               <build type="define" name="F_USB" value="48000000UL"/>\r
        </project>\r
 \r
        <module type="application" id="lufa.demos.device.lowlevel.midi" caption="MIDI Device Demo (Low Level APIs)">\r
index 3b33e2d..da728ec 100644 (file)
 //             #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.
index 7e8bcc4..cfb1686 100644 (file)
@@ -67,12 +67,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();
index edb3b85..634ed09 100644 (file)
@@ -51,6 +51,7 @@
                #include <LUFA/Drivers/USB/USB.h>
                #include <LUFA/Drivers/Board/LEDs.h>
                #include <LUFA/Drivers/Board/Dataflash.h>
+               #include <LUFA/Platform/Platform.h>
 
        /* Macros: */
                /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
index b5f9f9c..528dbe7 100644 (file)
@@ -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:
  *
index a859733..46f25cc 100644 (file)
@@ -1,14 +1,26 @@
 <asf xmlversion="1.0">\r
-       <project caption="Mass Storage Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.mass_storage.example">\r
+       <project caption="Mass Storage Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.mass_storage.example.avr8">\r
                <require idref="lufa.demos.device.lowlevel.mass_storage"/>\r
                <require idref="lufa.boards.dummy.avr8"/>\r
                <generator value="as5_8"/>\r
 \r
                <device-support value="at90usb1287"/>\r
-               <config name="lufa.drivers.board.name" value="usbkey"/>\r
+               <config name="lufa.drivers.board.name" value="none"/>\r
 \r
-               <build type="define" name="F_CPU" value="8000000UL"/>\r
-               <build type="define" name="F_USB" value="8000000UL"/>\r
+               <build type="define" name="F_CPU" value="16000000UL"/>\r
+               <build type="define" name="F_USB" value="16000000UL"/>\r
+       </project>\r
+\r
+       <project caption="Mass Storage Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.mass_storage.example.xmega">\r
+               <require idref="lufa.demos.device.lowlevel.mass_storage"/>\r
+               <require idref="lufa.boards.dummy.xmega"/>\r
+               <generator value="as5_8"/>\r
+\r
+               <device-support value="atxmega128a1u"/>\r
+               <config name="lufa.drivers.board.name" value="none"/>\r
+\r
+               <build type="define" name="F_CPU" value="32000000UL"/>\r
+               <build type="define" name="F_USB" value="48000000UL"/>\r
        </project>\r
 \r
        <module type="application" id="lufa.demos.device.lowlevel.mass_storage" caption="Mass Storage Device Demo (Low Level APIs)">\r
index 3244d3b..3871759 100644 (file)
 //             #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.
index 7575a81..601eebe 100644 (file)
@@ -73,12 +73,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();
index e11b1fa..23cf133 100644 (file)
                #include <string.h>
 
                #include "Descriptors.h"
-               
+
                #include <LUFA/Drivers/USB/USB.h>
                #include <LUFA/Drivers/Board/Joystick.h>
                #include <LUFA/Drivers/Board/LEDs.h>
                #include <LUFA/Drivers/Board/Buttons.h>
+               #include <LUFA/Platform/Platform.h>
 
        /* Macros: */
                /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
index 0664cba..7f1c384 100644 (file)
@@ -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:
  *
index ed0c537..0f471ff 100644 (file)
@@ -1,14 +1,26 @@
 <asf xmlversion="1.0">\r
-       <project caption="Mouse HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.mouse.example">\r
+       <project caption="Mouse HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.mouse.example.avr8">\r
                <require idref="lufa.demos.device.lowlevel.mouse"/>\r
                <require idref="lufa.boards.dummy.avr8"/>\r
                <generator value="as5_8"/>\r
 \r
                <device-support value="at90usb1287"/>\r
-               <config name="lufa.drivers.board.name" value="usbkey"/>\r
+               <config name="lufa.drivers.board.name" value="none"/>\r
 \r
-               <build type="define" name="F_CPU" value="8000000UL"/>\r
-               <build type="define" name="F_USB" value="8000000UL"/>\r
+               <build type="define" name="F_CPU" value="16000000UL"/>\r
+               <build type="define" name="F_USB" value="16000000UL"/>\r
+       </project>\r
+\r
+       <project caption="Mouse HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.mouse.example.xmega">\r
+               <require idref="lufa.demos.device.lowlevel.mouse"/>\r
+               <require idref="lufa.boards.dummy.xmega"/>\r
+               <generator value="as5_8"/>\r
+\r
+               <device-support value="atxmega128a1u"/>\r
+               <config name="lufa.drivers.board.name" value="none"/>\r
+\r
+               <build type="define" name="F_CPU" value="32000000UL"/>\r
+               <build type="define" name="F_USB" value="48000000UL"/>\r
        </project>\r
 \r
        <module type="application" id="lufa.demos.device.lowlevel.mouse" caption="Mouse HID Device Demo (Low Level APIs)">\r
index 3244d3b..4873f80 100644 (file)
 //             #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.
index 52085f8..2837a10 100644 (file)
@@ -62,12 +62,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();
index ec53e7b..37affda 100644 (file)
                #include "Lib/ARP.h"
                #include "Lib/Webserver.h"
                #include "Config/AppConfig.h"
-               
+
                #include <LUFA/Drivers/USB/USB.h>
                #include <LUFA/Drivers/Board/LEDs.h>
                #include <LUFA/Drivers/Peripheral/Serial.h>
+               #include <LUFA/Platform/Platform.h>
 
        /* Macros: */
                /** Notification value to indicate that a frame is ready to be read by the host. */
index ac72d4a..aafa3cc 100644 (file)
@@ -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:
  *
index 59c373a..12fc761 100644 (file)
@@ -1,14 +1,26 @@
 <asf xmlversion="1.0">\r
-       <project caption="RNDIS Ethernet Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.rndis.example">\r
+       <project caption="RNDIS Ethernet Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.rndis.example.avr8">\r
                <require idref="lufa.demos.device.lowlevel.rndis"/>\r
                <require idref="lufa.boards.dummy.avr8"/>\r
                <generator value="as5_8"/>\r
 \r
                <device-support value="at90usb1287"/>\r
-               <config name="lufa.drivers.board.name" value="usbkey"/>\r
+               <config name="lufa.drivers.board.name" value="none"/>\r
 \r
-               <build type="define" name="F_CPU" value="8000000UL"/>\r
-               <build type="define" name="F_USB" value="8000000UL"/>\r
+               <build type="define" name="F_CPU" value="16000000UL"/>\r
+               <build type="define" name="F_USB" value="16000000UL"/>\r
+       </project>\r
+\r
+       <project caption="RNDIS Ethernet Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.rndis.example.xmega">\r
+               <require idref="lufa.demos.device.lowlevel.rndis"/>\r
+               <require idref="lufa.boards.dummy.xmega"/>\r
+               <generator value="as5_8"/>\r
+\r
+               <device-support value="atxmega128a1u"/>\r
+               <config name="lufa.drivers.board.name" value="none"/>\r
+\r
+               <build type="define" name="F_CPU" value="32000000UL"/>\r
+               <build type="define" name="F_USB" value="48000000UL"/>\r
        </project>\r
 \r
        <module type="application" id="lufa.demos.device.lowlevel.rndis" caption="RNDIS Ethernet Device Demo (Low Level APIs)">\r
index 3244d3b..7b4e026 100644 (file)
 //             #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.
index 998aede..3c005f7 100644 (file)
@@ -70,12 +70,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();
index 5b985ce..db5fe9d 100644 (file)
@@ -48,6 +48,7 @@
                #include <LUFA/Drivers/USB/USB.h>
                #include <LUFA/Drivers/Board/Joystick.h>
                #include <LUFA/Drivers/Board/LEDs.h>
+               #include <LUFA/Platform/Platform.h>
 
        /* Macros: */
                /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
index e0a3291..61b6656 100644 (file)
@@ -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:
  *
index bb2c0fc..091bb1d 100644 (file)
@@ -1,14 +1,26 @@
 <asf xmlversion="1.0">\r
-       <project caption="Virtual Serial CDC Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.cdc.example">\r
+       <project caption="Virtual Serial CDC Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.cdc.example.avr8">\r
                <require idref="lufa.demos.device.lowlevel.cdc"/>\r
                <require idref="lufa.boards.dummy.avr8"/>\r
                <generator value="as5_8"/>\r
 \r
                <device-support value="at90usb1287"/>\r
-               <config name="lufa.drivers.board.name" value="usbkey"/>\r
+               <config name="lufa.drivers.board.name" value="none"/>\r
 \r
-               <build type="define" name="F_CPU" value="8000000UL"/>\r
-               <build type="define" name="F_USB" value="8000000UL"/>\r
+               <build type="define" name="F_CPU" value="16000000UL"/>\r
+               <build type="define" name="F_USB" value="16000000UL"/>\r
+       </project>\r
+\r
+       <project caption="Virtual Serial CDC Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.cdc.example.xmega">\r
+               <require idref="lufa.demos.device.lowlevel.cdc"/>\r
+               <require idref="lufa.boards.dummy.xmega"/>\r
+               <generator value="as5_8"/>\r
+\r
+               <device-support value="atxmega128a1u"/>\r
+               <config name="lufa.drivers.board.name" value="none"/>\r
+\r
+               <build type="define" name="F_CPU" value="32000000UL"/>\r
+               <build type="define" name="F_USB" value="48000000UL"/>\r
        </project>\r
 \r
        <module type="application" id="lufa.demos.device.lowlevel.cdc" caption="Virtual Serial CDC Device Demo (Low Level APIs)">\r