Merge branch 'XMEGA-Demo-Ports-ClockOnly'

pull/1469/head
Dean Camera 12 years ago
commit f835323682

@ -51,6 +51,7 @@
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Platform/Platform.h>
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(__OPTIMIZE_SIZE__) #if !defined(__OPTIMIZE_SIZE__)

@ -9,8 +9,8 @@
<config name="config.compiler.optimization.level" value="size"/> <config name="config.compiler.optimization.level" value="size"/>
<build type="define" name="F_CPU" value="8000000UL"/> <build type="define" name="F_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
<build type="define" name="BOOT_START_ADDR" value="0x1F000"/> <build type="define" name="BOOT_START_ADDR" value="0x1F000"/>
<build type="linker-config" subtype="flags" value="--section-start=.text=0x1F000"/> <build type="linker-config" subtype="flags" value="--section-start=.text=0x1F000"/>
@ -33,8 +33,8 @@
<config name="config.compiler.optimization.level" value="size"/> <config name="config.compiler.optimization.level" value="size"/>
<build type="define" name="F_CPU" value="8000000UL"/> <build type="define" name="F_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
<build type="define" name="BOOT_START_ADDR" value="0xF000"/> <build type="define" name="BOOT_START_ADDR" value="0xF000"/>
<build type="linker-config" subtype="flags" value="--section-start=.text=0xF000"/> <build type="linker-config" subtype="flags" value="--section-start=.text=0xF000"/>
@ -57,8 +57,8 @@
<config name="config.compiler.optimization.level" value="size"/> <config name="config.compiler.optimization.level" value="size"/>
<build type="define" name="F_CPU" value="8000000UL"/> <build type="define" name="F_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
<build type="define" name="BOOT_START_ADDR" value="0x7000"/> <build type="define" name="BOOT_START_ADDR" value="0x7000"/>
<build type="linker-config" subtype="flags" value="--section-start=.text=0x7000"/> <build type="linker-config" subtype="flags" value="--section-start=.text=0x7000"/>
@ -81,8 +81,8 @@
<config name="config.compiler.optimization.level" value="size"/> <config name="config.compiler.optimization.level" value="size"/>
<build type="define" name="F_CPU" value="8000000UL"/> <build type="define" name="F_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
<build type="define" name="BOOT_START_ADDR" value="0x3000"/> <build type="define" name="BOOT_START_ADDR" value="0x3000"/>
<build type="linker-config" subtype="flags" value="--section-start=.text=0x3000"/> <build type="linker-config" subtype="flags" value="--section-start=.text=0x3000"/>
@ -105,8 +105,8 @@
<config name="config.compiler.optimization.level" value="size"/> <config name="config.compiler.optimization.level" value="size"/>
<build type="define" name="F_CPU" value="8000000UL"/> <build type="define" name="F_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
<build type="define" name="BOOT_START_ADDR" value="0x1000"/> <build type="define" name="BOOT_START_ADDR" value="0x1000"/>
<build type="linker-config" subtype="flags" value="--section-start=.text=0x1000"/> <build type="linker-config" subtype="flags" value="--section-start=.text=0x1000"/>

@ -53,6 +53,7 @@
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Platform/Platform.h>
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(__OPTIMIZE_SIZE__) #if !defined(__OPTIMIZE_SIZE__)

@ -9,8 +9,8 @@
<config name="config.compiler.optimization.level" value="size"/> <config name="config.compiler.optimization.level" value="size"/>
<build type="define" name="F_CPU" value="8000000UL"/> <build type="define" name="F_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
<build type="define" name="BOOT_START_ADDR" value="0x1F000"/> <build type="define" name="BOOT_START_ADDR" value="0x1F000"/>
<build type="linker-config" subtype="flags" value="--section-start=.text=0x1F000"/> <build type="linker-config" subtype="flags" value="--section-start=.text=0x1F000"/>
@ -33,8 +33,8 @@
<config name="config.compiler.optimization.level" value="size"/> <config name="config.compiler.optimization.level" value="size"/>
<build type="define" name="F_CPU" value="8000000UL"/> <build type="define" name="F_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
<build type="define" name="BOOT_START_ADDR" value="0xF000"/> <build type="define" name="BOOT_START_ADDR" value="0xF000"/>
<build type="linker-config" subtype="flags" value="--section-start=.text=0xF000"/> <build type="linker-config" subtype="flags" value="--section-start=.text=0xF000"/>
@ -57,8 +57,8 @@
<config name="config.compiler.optimization.level" value="size"/> <config name="config.compiler.optimization.level" value="size"/>
<build type="define" name="F_CPU" value="8000000UL"/> <build type="define" name="F_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
<build type="define" name="BOOT_START_ADDR" value="0x7000"/> <build type="define" name="BOOT_START_ADDR" value="0x7000"/>
<build type="linker-config" subtype="flags" value="--section-start=.text=0x7000"/> <build type="linker-config" subtype="flags" value="--section-start=.text=0x7000"/>
@ -79,8 +79,8 @@
<device-support value="atmega16u2"/> <device-support value="atmega16u2"/>
<config name="lufa.drivers.board.name" value="none"/> <config name="lufa.drivers.board.name" value="none"/>
<build type="define" name="F_CPU" value="8000000UL"/> <build type="define" name="F_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
<build type="define" name="BOOT_START_ADDR" value="0x3000"/> <build type="define" name="BOOT_START_ADDR" value="0x3000"/>
<build type="linker-config" subtype="flags" value="--section-start=.text=0x3000"/> <build type="linker-config" subtype="flags" value="--section-start=.text=0x3000"/>
@ -101,8 +101,8 @@
<device-support value="atmega8u2"/> <device-support value="atmega8u2"/>
<config name="lufa.drivers.board.name" value="none"/> <config name="lufa.drivers.board.name" value="none"/>
<build type="define" name="F_CPU" value="8000000UL"/> <build type="define" name="F_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
<build type="define" name="BOOT_START_ADDR" value="0x1000"/> <build type="define" name="BOOT_START_ADDR" value="0x1000"/>
<build type="linker-config" subtype="flags" value="--section-start=.text=0x1000"/> <build type="linker-config" subtype="flags" value="--section-start=.text=0x1000"/>

@ -47,6 +47,7 @@
#include "Descriptors.h" #include "Descriptors.h"
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(__OPTIMIZE_SIZE__) #if !defined(__OPTIMIZE_SIZE__)

@ -9,8 +9,8 @@
<config name="config.compiler.optimization.level" value="size"/> <config name="config.compiler.optimization.level" value="size"/>
<build type="define" name="F_CPU" value="8000000UL"/> <build type="define" name="F_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
<build type="define" name="BOOT_START_ADDR" value="0x1F000"/> <build type="define" name="BOOT_START_ADDR" value="0x1F000"/>
<build type="linker-config" subtype="flags" value="--section-start=.text=0x1F000"/> <build type="linker-config" subtype="flags" value="--section-start=.text=0x1F000"/>
@ -26,8 +26,8 @@
<config name="config.compiler.optimization.level" value="size"/> <config name="config.compiler.optimization.level" value="size"/>
<build type="define" name="F_CPU" value="8000000UL"/> <build type="define" name="F_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
<build type="define" name="BOOT_START_ADDR" value="0xF000"/> <build type="define" name="BOOT_START_ADDR" value="0xF000"/>
<build type="linker-config" subtype="flags" value="--section-start=.text=0xF000"/> <build type="linker-config" subtype="flags" value="--section-start=.text=0xF000"/>
@ -43,8 +43,8 @@
<config name="config.compiler.optimization.level" value="size"/> <config name="config.compiler.optimization.level" value="size"/>
<build type="define" name="F_CPU" value="8000000UL"/> <build type="define" name="F_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
<build type="define" name="BOOT_START_ADDR" value="0x7000"/> <build type="define" name="BOOT_START_ADDR" value="0x7000"/>
<build type="linker-config" subtype="flags" value="--section-start=.text=0x7000"/> <build type="linker-config" subtype="flags" value="--section-start=.text=0x7000"/>
@ -60,8 +60,8 @@
<config name="config.compiler.optimization.level" value="size"/> <config name="config.compiler.optimization.level" value="size"/>
<build type="define" name="F_CPU" value="8000000UL"/> <build type="define" name="F_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
<build type="define" name="BOOT_START_ADDR" value="0x3800"/> <build type="define" name="BOOT_START_ADDR" value="0x3800"/>
<build type="linker-config" subtype="flags" value="--section-start=.text=0x3800"/> <build type="linker-config" subtype="flags" value="--section-start=.text=0x3800"/>
@ -77,8 +77,8 @@
<config name="config.compiler.optimization.level" value="size"/> <config name="config.compiler.optimization.level" value="size"/>
<build type="define" name="F_CPU" value="8000000UL"/> <build type="define" name="F_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
<build type="define" name="BOOT_START_ADDR" value="0x1800"/> <build type="define" name="BOOT_START_ADDR" value="0x1800"/>
<build type="linker-config" subtype="flags" value="--section-start=.text=0x1800"/> <build type="linker-config" subtype="flags" value="--section-start=.text=0x1800"/>

@ -49,6 +49,7 @@
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(__OPTIMIZE_SIZE__) #if !defined(__OPTIMIZE_SIZE__)

@ -9,8 +9,8 @@
<config name="config.compiler.optimization.level" value="size"/> <config name="config.compiler.optimization.level" value="size"/>
<build type="define" name="F_CPU" value="8000000UL"/> <build type="define" name="F_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
<build type="define" name="BOOT_START_ADDR" value="0x1E000"/> <build type="define" name="BOOT_START_ADDR" value="0x1E000"/>
<build type="linker-config" subtype="flags" value="--section-start=.text=0x1E000"/> <build type="linker-config" subtype="flags" value="--section-start=.text=0x1E000"/>
@ -35,8 +35,8 @@
<config name="config.compiler.optimization.level" value="size"/> <config name="config.compiler.optimization.level" value="size"/>
<build type="define" name="F_CPU" value="8000000UL"/> <build type="define" name="F_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
<build type="define" name="BOOT_START_ADDR" value="0xE000"/> <build type="define" name="BOOT_START_ADDR" value="0xE000"/>
<build type="linker-config" subtype="flags" value="--section-start=.text=0xE000"/> <build type="linker-config" subtype="flags" value="--section-start=.text=0xE000"/>
@ -61,8 +61,8 @@
<config name="config.compiler.optimization.level" value="size"/> <config name="config.compiler.optimization.level" value="size"/>
<build type="define" name="F_CPU" value="8000000UL"/> <build type="define" name="F_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
<build type="define" name="BOOT_START_ADDR" value="0x7000"/> <build type="define" name="BOOT_START_ADDR" value="0x7000"/>
<build type="linker-config" subtype="flags" value="--section-start=.text=0x7000"/> <build type="linker-config" subtype="flags" value="--section-start=.text=0x7000"/>
@ -90,8 +90,8 @@
<config name="config.compiler.optimization.level" value="size"/> <config name="config.compiler.optimization.level" value="size"/>
<build type="define" name="F_CPU" value="8000000UL"/> <build type="define" name="F_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
<build type="define" name="BOOT_START_ADDR" value="0x3000"/> <build type="define" name="BOOT_START_ADDR" value="0x3000"/>
<build type="linker-config" subtype="flags" value="--section-start=.text=0x3000"/> <build type="linker-config" subtype="flags" value="--section-start=.text=0x3000"/>

@ -44,8 +44,9 @@
#include "Descriptors.h" #include "Descriptors.h"
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if !defined(__OPTIMIZE_SIZE__) #if !defined(__OPTIMIZE_SIZE__)

@ -9,8 +9,8 @@
<config name="config.compiler.optimization.level" value="size"/> <config name="config.compiler.optimization.level" value="size"/>
<build type="define" name="F_CPU" value="8000000UL"/> <build type="define" name="F_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
<build type="define" name="BOOT_START_ADDR" value="0x1F000"/> <build type="define" name="BOOT_START_ADDR" value="0x1F000"/>
<build type="linker-config" subtype="flags" value="--section-start=.text=0x1F000"/> <build type="linker-config" subtype="flags" value="--section-start=.text=0x1F000"/>
@ -33,8 +33,8 @@
<config name="config.compiler.optimization.level" value="size"/> <config name="config.compiler.optimization.level" value="size"/>
<build type="define" name="F_CPU" value="8000000UL"/> <build type="define" name="F_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
<build type="define" name="BOOT_START_ADDR" value="0xF000"/> <build type="define" name="BOOT_START_ADDR" value="0xF000"/>
<build type="linker-config" subtype="flags" value="--section-start=.text=0xF000"/> <build type="linker-config" subtype="flags" value="--section-start=.text=0xF000"/>
@ -57,8 +57,8 @@
<config name="config.compiler.optimization.level" value="size"/> <config name="config.compiler.optimization.level" value="size"/>
<build type="define" name="F_CPU" value="8000000UL"/> <build type="define" name="F_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
<build type="define" name="BOOT_START_ADDR" value="0x7000"/> <build type="define" name="BOOT_START_ADDR" value="0x7000"/>
<build type="linker-config" subtype="flags" value="--section-start=.text=0x7000"/> <build type="linker-config" subtype="flags" value="--section-start=.text=0x7000"/>
@ -81,8 +81,8 @@
<config name="config.compiler.optimization.level" value="size"/> <config name="config.compiler.optimization.level" value="size"/>
<build type="define" name="F_CPU" value="8000000UL"/> <build type="define" name="F_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
<build type="define" name="BOOT_START_ADDR" value="0x3000"/> <build type="define" name="BOOT_START_ADDR" value="0x3000"/>
<build type="linker-config" subtype="flags" value="--section-start=.text=0x3000"/> <build type="linker-config" subtype="flags" value="--section-start=.text=0x3000"/>
@ -105,8 +105,8 @@
<config name="config.compiler.optimization.level" value="size"/> <config name="config.compiler.optimization.level" value="size"/>
<build type="define" name="F_CPU" value="8000000UL"/> <build type="define" name="F_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
<build type="define" name="BOOT_START_ADDR" value="0x1000"/> <build type="define" name="BOOT_START_ADDR" value="0x1000"/>
<build type="linker-config" subtype="flags" value="--section-start=.text=0x1000"/> <build type="linker-config" subtype="flags" value="--section-start=.text=0x1000"/>

@ -79,12 +79,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
LEDs_Init(); LEDs_Init();

@ -46,6 +46,7 @@
#include <LUFA/Drivers/Board/Buttons.h> #include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/Peripheral/ADC.h> #include <LUFA/Drivers/Peripheral/ADC.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
#include "Descriptors.h" #include "Descriptors.h"
#include "Config/AppConfig.h" #include "Config/AppConfig.h"

@ -1,14 +1,14 @@
<asf xmlversion="1.0"> <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.demos.device.class.audio_input"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project> </project>
<module type="application" id="lufa.demos.device.class.audio_input" caption="Audio Input Device Demo (Class Driver APIs)"> <module type="application" id="lufa.demos.device.class.audio_input" caption="Audio Input Device Demo (Class Driver APIs)">

@ -79,12 +79,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
LEDs_Init(); LEDs_Init();

@ -48,6 +48,7 @@
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -1,14 +1,14 @@
<asf xmlversion="1.0"> <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.demos.device.class.audio_output"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project> </project>
<module type="application" id="lufa.demos.device.class.audio_output" caption="Audio Output Device Demo (Class Driver APIs)"> <module type="application" id="lufa.demos.device.class.audio_output" caption="Audio Output Device Demo (Class Driver APIs)">
@ -45,6 +45,5 @@
<require idref="lufa.drivers.usb"/> <require idref="lufa.drivers.usb"/>
<require idref="lufa.drivers.board"/> <require idref="lufa.drivers.board"/>
<require idref="lufa.drivers.board.leds"/> <require idref="lufa.drivers.board.leds"/>
<require idref="lufa.drivers.board.buttons"/>
</module> </module>
</asf> </asf>

@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT // #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE // #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 #else
#error Unsupported architecture for this LUFA configuration file. #error Unsupported architecture for this LUFA configuration file.

@ -131,12 +131,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); 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 */ /* Hardware Initialization */
Joystick_Init(); Joystick_Init();

@ -48,6 +48,7 @@
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Joystick.h> #include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -13,6 +13,9 @@
* \li Series 7 USB AVRs (AT90USBxxx7) * \li Series 7 USB AVRs (AT90USBxxx7)
* \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4) * \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: * \section Sec_Info USB Information:
* *

@ -1,14 +1,26 @@
<asf xmlversion="1.0"> <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.demos.device.class.dual_cdc"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <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> </project>
<module type="application" id="lufa.demos.device.class.dual_cdc" caption="Dual Virtual Serial Device Demo (Class Driver APIs)"> <module type="application" id="lufa.demos.device.class.dual_cdc" caption="Dual Virtual Serial Device Demo (Class Driver APIs)">

@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT // #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE // #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 #else
#error Unsupported architecture for this LUFA configuration file. #error Unsupported architecture for this LUFA configuration file.

@ -80,12 +80,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); 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 */ /* Hardware Initialization */
LEDs_Init(); LEDs_Init();

@ -48,6 +48,7 @@
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -14,6 +14,9 @@
* \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) * \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: * \section Sec_Info USB Information:
* *

@ -1,14 +1,26 @@
<asf xmlversion="1.0"> <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.demos.device.class.generic_hid"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <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> </project>
<module type="application" id="lufa.demos.device.class.generic_hid" caption="Generic HID Device Demo (Class Driver APIs)"> <module type="application" id="lufa.demos.device.class.generic_hid" caption="Generic HID Device Demo (Class Driver APIs)">

@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT // #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE // #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 #else
#error Unsupported architecture for this LUFA configuration file. #error Unsupported architecture for this LUFA configuration file.

@ -80,12 +80,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); 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 */ /* Hardware Initialization */
Joystick_Init(); Joystick_Init();

@ -49,6 +49,7 @@
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h> #include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Type Defines: */ /* Type Defines: */
/** Type define for the joystick HID report structure, for creating and sending HID reports to the host PC. /** Type define for the joystick HID report structure, for creating and sending HID reports to the host PC.

@ -14,6 +14,9 @@
* \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) * \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: * \section Sec_Info USB Information:
* *

@ -1,14 +1,26 @@
<asf xmlversion="1.0"> <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.demos.device.class.joystick"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <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> </project>
<module type="application" id="lufa.demos.device.class.joystick" caption="Joystick HID Device Demo (Class Driver APIs)"> <module type="application" id="lufa.demos.device.class.joystick" caption="Joystick HID Device Demo (Class Driver APIs)">
@ -43,6 +55,7 @@
<require idref="lufa.drivers.usb"/> <require idref="lufa.drivers.usb"/>
<require idref="lufa.drivers.board"/> <require idref="lufa.drivers.board"/>
<require idref="lufa.drivers.board.leds"/> <require idref="lufa.drivers.board.leds"/>
<require idref="lufa.drivers.board.buttons"/>
<require idref="lufa.drivers.board.joystick"/> <require idref="lufa.drivers.board.joystick"/>
</module> </module>
</asf> </asf>

@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT // #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE // #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 #else
#error Unsupported architecture for this LUFA configuration file. #error Unsupported architecture for this LUFA configuration file.

@ -80,12 +80,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware() void SetupHardware()
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); 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 */ /* Hardware Initialization */
Joystick_Init(); Joystick_Init();

@ -50,6 +50,7 @@
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h> #include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -14,6 +14,9 @@
* \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) * \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: * \section Sec_Info USB Information:
* *

@ -1,14 +1,26 @@
<asf xmlversion="1.0"> <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.demos.device.class.keyboard"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <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> </project>
<module type="application" id="lufa.demos.device.class.keyboard" caption="Keyboard HID Device Demo (Class Driver APIs)"> <module type="application" id="lufa.demos.device.class.keyboard" caption="Keyboard HID Device Demo (Class Driver APIs)">

@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT // #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE // #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 #else
#error Unsupported architecture for this LUFA configuration file. #error Unsupported architecture for this LUFA configuration file.

@ -106,12 +106,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware() void SetupHardware()
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); 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 */ /* Hardware Initialization */
Joystick_Init(); Joystick_Init();

@ -45,6 +45,7 @@
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h> #include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -14,6 +14,9 @@
* \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) * \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: * \section Sec_Info USB Information:
* *

@ -1,14 +1,26 @@
<asf xmlversion="1.0"> <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.demos.device.class.keyboard_mouse"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <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> </project>
<module type="application" id="lufa.demos.device.class.keyboard_mouse" caption="Keyboard and Mouse HID Device Demo (Class Driver APIs)"> <module type="application" id="lufa.demos.device.class.keyboard_mouse" caption="Keyboard and Mouse HID Device Demo (Class Driver APIs)">

@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT // #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE // #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 #else
#error Unsupported architecture for this LUFA configuration file. #error Unsupported architecture for this LUFA configuration file.

@ -80,12 +80,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware() void SetupHardware()
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); 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 */ /* Hardware Initialization */
Joystick_Init(); Joystick_Init();

@ -45,6 +45,7 @@
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h> #include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -14,6 +14,9 @@
* \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) * \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: * \section Sec_Info USB Information:
* *

@ -1,14 +1,26 @@
<asf xmlversion="1.0"> <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.demos.device.class.keyboard_mouse_mr"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <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> </project>
<module type="application" id="lufa.demos.device.class.keyboard_mouse_mr" caption="Keyboard and Mouse HID (Multi Report) Device Demo (Class Driver APIs)"> <module type="application" id="lufa.demos.device.class.keyboard_mouse_mr" caption="Keyboard and Mouse HID (Multi Report) Device Demo (Class Driver APIs)">

@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT // #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE // #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 #else
#error Unsupported architecture for this LUFA configuration file. #error Unsupported architecture for this LUFA configuration file.

@ -92,12 +92,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); 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 */ /* Hardware Initialization */
Joystick_Init(); Joystick_Init();

@ -50,6 +50,7 @@
#include <LUFA/Drivers/Board/Joystick.h> #include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/Board/Buttons.h> #include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -14,6 +14,9 @@
* \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) * \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: * \section Sec_Info USB Information:
* *

@ -1,14 +1,26 @@
<asf xmlversion="1.0"> <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.demos.device.class.midi"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <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> </project>
<module type="application" id="lufa.demos.device.class.midi" caption="MIDI Device Demo (Class Driver APIs)"> <module type="application" id="lufa.demos.device.class.midi" caption="MIDI Device Demo (Class Driver APIs)">

@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT // #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE // #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 #else
#error Unsupported architecture for this LUFA configuration file. #error Unsupported architecture for this LUFA configuration file.

@ -82,12 +82,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); 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 */ /* Hardware Initialization */
LEDs_Init(); LEDs_Init();

@ -51,6 +51,7 @@
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -14,6 +14,9 @@
* \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) * \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: * \section Sec_Info USB Information:
* *

@ -1,14 +1,26 @@
<asf xmlversion="1.0"> <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.demos.device.class.mass_storage"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <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> </project>
<module type="application" id="lufa.demos.device.class.mass_storage" caption="Mass Storage Device Demo (Class Driver APIs)"> <module type="application" id="lufa.demos.device.class.mass_storage" caption="Mass Storage Device Demo (Class Driver APIs)">

@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT // #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE // #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 #else
#error Unsupported architecture for this LUFA configuration file. #error Unsupported architecture for this LUFA configuration file.

@ -106,12 +106,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); 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 */ /* Hardware Initialization */
LEDs_Init(); LEDs_Init();

@ -56,6 +56,7 @@
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h> #include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -14,6 +14,9 @@
* \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) * \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: * \section Sec_Info USB Information:
* *

@ -1,14 +1,26 @@
<asf xmlversion="1.0"> <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.demos.device.class.mass_storage_keyboard"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <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> </project>
<module type="application" id="lufa.demos.device.class.mass_storage_keyboard" caption="Mass Storage and HID Keyboard Device Demo (Class Driver APIs)"> <module type="application" id="lufa.demos.device.class.mass_storage_keyboard" caption="Mass Storage and HID Keyboard Device Demo (Class Driver APIs)">

@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT // #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE // #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 #else
#error Unsupported architecture for this LUFA configuration file. #error Unsupported architecture for this LUFA configuration file.

@ -80,12 +80,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); 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 */ /* Hardware Initialization */
Joystick_Init(); Joystick_Init();

@ -51,6 +51,7 @@
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h> #include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -14,6 +14,9 @@
* \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) * \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: * \section Sec_Info USB Information:
* *

@ -1,14 +1,26 @@
<asf xmlversion="1.0"> <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.demos.device.class.mouse"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <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> </project>
<module type="application" id="lufa.demos.device.class.mouse" caption="Mouse HID Device Demo (Class Driver APIs)"> <module type="application" id="lufa.demos.device.class.mouse" caption="Mouse HID Device Demo (Class Driver APIs)">

@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT // #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE // #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 #else
#error Unsupported architecture for this LUFA configuration file. #error Unsupported architecture for this LUFA configuration file.

@ -115,12 +115,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); 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 */ /* Hardware Initialization */
LEDs_Init(); LEDs_Init();

@ -54,6 +54,7 @@
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Peripheral/Serial.h> #include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -12,6 +12,9 @@
* *
* \li Series 7 USB AVRs (AT90USBxxx7) * \li Series 7 USB AVRs (AT90USBxxx7)
* \li Series 6 USB AVRs (AT90USBxxx6) * \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: * \section Sec_Info USB Information:
* *

@ -1,14 +1,26 @@
<asf xmlversion="1.0"> <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.demos.device.class.rndis"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <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> </project>
<module type="application" id="lufa.demos.device.class.rndis" caption="RNDIS Ethernet Device Demo (Class Driver APIs)"> <module type="application" id="lufa.demos.device.class.rndis" caption="RNDIS Ethernet Device Demo (Class Driver APIs)">

@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT // #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE // #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 #else
#error Unsupported architecture for this LUFA configuration file. #error Unsupported architecture for this LUFA configuration file.

@ -100,12 +100,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); 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 */ /* Hardware Initialization */
Joystick_Init(); Joystick_Init();

@ -49,6 +49,7 @@
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Joystick.h> #include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -14,6 +14,9 @@
* \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) * \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: * \section Sec_Info USB Information:
* *

@ -1,14 +1,26 @@
<asf xmlversion="1.0"> <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.demos.device.class.cdc"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <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> </project>
<module type="application" id="lufa.demos.device.class.cdc" caption="Virtual Serial CDC Device Demo (Class Driver APIs)"> <module type="application" id="lufa.demos.device.class.cdc" caption="Virtual Serial CDC Device Demo (Class Driver APIs)">

@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT // #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE // #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 #else
#error Unsupported architecture for this LUFA configuration file. #error Unsupported architecture for this LUFA configuration file.

@ -126,12 +126,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); 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 */ /* Hardware Initialization */
LEDs_Init(); LEDs_Init();

@ -52,6 +52,7 @@
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Joystick.h> #include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -13,6 +13,9 @@
* \li Series 7 USB AVRs (AT90USBxxx7) * \li Series 7 USB AVRs (AT90USBxxx7)
* \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4) * \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: * \section Sec_Info USB Information:
* *

@ -1,14 +1,26 @@
<asf xmlversion="1.0"> <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.demos.device.class.cdc_ms"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <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> </project>
<module type="application" id="lufa.demos.device.class.cdc_ms" caption="Virtual Serial CDC and Mass Storage Device Demo (Class Driver APIs)"> <module type="application" id="lufa.demos.device.class.cdc_ms" caption="Virtual Serial CDC and Mass Storage Device Demo (Class Driver APIs)">

@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT // #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE // #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 #else
#error Unsupported architecture for this LUFA configuration file. #error Unsupported architecture for this LUFA configuration file.

@ -116,12 +116,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); 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 */ /* Hardware Initialization */
Joystick_Init(); Joystick_Init();

@ -49,6 +49,7 @@
#include <LUFA/Drivers/Board/Joystick.h> #include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/Board/Buttons.h> #include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -14,6 +14,9 @@
* \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) * \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: * \section Sec_Info USB Information:
* *

@ -1,14 +1,26 @@
<asf xmlversion="1.0"> <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.demos.device.class.cdc_mouse"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <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> </project>
<module type="application" id="lufa.demos.device.class.cdc_mouse" caption="Virtual Serial CDC and Mouse HID Device Demo (Class Driver APIs)"> <module type="application" id="lufa.demos.device.class.cdc_mouse" caption="Virtual Serial CDC and Mouse HID Device Demo (Class Driver APIs)">

@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT // #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE // #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 #else
#error Unsupported architecture for this LUFA configuration file. #error Unsupported architecture for this LUFA configuration file.

@ -93,12 +93,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); 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 */ /* Hardware Initialization */
LEDs_Init(); LEDs_Init();

@ -39,8 +39,9 @@
#include "Descriptors.h" #include "Descriptors.h"
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -62,12 +62,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
LEDs_Init(); LEDs_Init();

@ -49,6 +49,7 @@
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h> #include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/Peripheral/ADC.h> #include <LUFA/Drivers/Peripheral/ADC.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** Maximum audio sample value for the microphone input. */ /** Maximum audio sample value for the microphone input. */

@ -1,14 +1,14 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="Audio Input Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.audio_input.example"> <project caption="Audio Input Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.audio_input.example.avr8">
<require idref="lufa.demos.device.lowlevel.audio_input"/> <require idref="lufa.demos.device.lowlevel.audio_input"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project> </project>
<module type="application" id="lufa.demos.device.lowlevel.audio_input" caption="Audio Input Device Demo (Low Level APIs)"> <module type="application" id="lufa.demos.device.lowlevel.audio_input" caption="Audio Input Device Demo (Low Level APIs)">

@ -62,12 +62,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
LEDs_Init(); LEDs_Init();

@ -47,6 +47,7 @@
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -1,14 +1,14 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="Audio Output Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.audio_output.example"> <project caption="Audio Output Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.audio_output.example.avr8">
<require idref="lufa.demos.device.lowlevel.audio_output"/> <require idref="lufa.demos.device.lowlevel.audio_output"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project> </project>
<module type="application" id="lufa.demos.device.lowlevel.audio_output" caption="Audio Output Device Demo (Low Level APIs)"> <module type="application" id="lufa.demos.device.lowlevel.audio_output" caption="Audio Output Device Demo (Low Level APIs)">

@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT // #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE // #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 #else
#error Unsupported architecture for this LUFA configuration file. #error Unsupported architecture for this LUFA configuration file.

@ -84,12 +84,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); 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 */ /* Hardware Initialization */
Joystick_Init(); Joystick_Init();

@ -48,6 +48,7 @@
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Board/Joystick.h> #include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -13,6 +13,9 @@
* \li Series 7 USB AVRs (AT90USBxxx7) * \li Series 7 USB AVRs (AT90USBxxx7)
* \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4) * \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: * \section Sec_Info USB Information:
* *

@ -1,14 +1,26 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="Dual Virtual Serial Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.dual_cdc.example"> <project caption="Dual Virtual Serial Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.dual_cdc.example.avr8">
<require idref="lufa.demos.device.lowlevel.dual_cdc"/> <require idref="lufa.demos.device.lowlevel.dual_cdc"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project>
<project caption="Dual Virtual Serial Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.dual_cdc.example.xmega">
<require idref="lufa.demos.device.lowlevel.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> </project>
<module type="application" id="lufa.demos.device.lowlevel.dual_cdc" caption="Dual Virtual Serial Device Demo (Low Level APIs)"> <module type="application" id="lufa.demos.device.lowlevel.dual_cdc" caption="Dual Virtual Serial Device Demo (Low Level APIs)">

@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT // #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE // #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 #else
#error Unsupported architecture for this LUFA configuration file. #error Unsupported architecture for this LUFA configuration file.

@ -57,12 +57,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); 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 */ /* Hardware Initialization */
LEDs_Init(); LEDs_Init();

@ -49,6 +49,7 @@
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -14,6 +14,9 @@
* \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) * \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: * \section Sec_Info USB Information:
* *

@ -1,14 +1,26 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="Generic HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.generic_hid.example"> <project caption="Generic HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.generic_hid.example.avr8">
<require idref="lufa.demos.device.lowlevel.generic_hid"/> <require idref="lufa.demos.device.lowlevel.generic_hid"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project>
<project caption="Generic HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.generic_hid.example.xmega">
<require idref="lufa.demos.device.lowlevel.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> </project>
<module type="application" id="lufa.demos.device.lowlevel.generic_hid" caption="Generic HID Device Demo (Low Level APIs)"> <module type="application" id="lufa.demos.device.lowlevel.generic_hid" caption="Generic HID Device Demo (Low Level APIs)">

@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT // #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE // #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 #else
#error Unsupported architecture for this LUFA configuration file. #error Unsupported architecture for this LUFA configuration file.

@ -56,12 +56,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); 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 */ /* Hardware Initialization */
Joystick_Init(); Joystick_Init();

@ -49,6 +49,7 @@
#include <LUFA/Drivers/Board/Joystick.h> #include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h> #include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -14,6 +14,9 @@
* \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) * \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: * \section Sec_Info USB Information:
* *

@ -1,14 +1,26 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="Joystick HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.joystick.example"> <project caption="Joystick HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.joystick.example.avr8">
<require idref="lufa.demos.device.lowlevel.joystick"/> <require idref="lufa.demos.device.lowlevel.joystick"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project>
<project caption="Joystick HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.joystick.example.xmega">
<require idref="lufa.demos.device.lowlevel.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> </project>
<module type="application" id="lufa.demos.device.lowlevel.joystick" caption="Joystick HID Device Demo (Low Level APIs)"> <module type="application" id="lufa.demos.device.lowlevel.joystick" caption="Joystick HID Device Demo (Low Level APIs)">
@ -43,6 +55,7 @@
<require idref="lufa.drivers.usb"/> <require idref="lufa.drivers.usb"/>
<require idref="lufa.drivers.board"/> <require idref="lufa.drivers.board"/>
<require idref="lufa.drivers.board.leds"/> <require idref="lufa.drivers.board.leds"/>
<require idref="lufa.drivers.board.buttons"/>
<require idref="lufa.drivers.board.joystick"/> <require idref="lufa.drivers.board.joystick"/>
</module> </module>
</asf> </asf>

@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT // #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE // #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 #else
#error Unsupported architecture for this LUFA configuration file. #error Unsupported architecture for this LUFA configuration file.

@ -74,12 +74,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); 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 */ /* Hardware Initialization */
Joystick_Init(); Joystick_Init();

@ -51,6 +51,7 @@
#include <LUFA/Drivers/Board/Joystick.h> #include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/Board/Buttons.h> #include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -14,6 +14,9 @@
* \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) * \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: * \section Sec_Info USB Information:
* *

@ -1,14 +1,26 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="Keyboard HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.keyboard.example"> <project caption="Keyboard HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.keyboard.example.avr8">
<require idref="lufa.demos.device.lowlevel.keyboard"/> <require idref="lufa.demos.device.lowlevel.keyboard"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project>
<project caption="Keyboard HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.keyboard.example.xmega">
<require idref="lufa.demos.device.lowlevel.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> </project>
<module type="application" id="lufa.demos.device.lowlevel.keyboard" caption="Keyboard HID Device Demo (Low Level APIs)"> <module type="application" id="lufa.demos.device.lowlevel.keyboard" caption="Keyboard HID Device Demo (Low Level APIs)">

@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT // #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE // #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 #else
#error Unsupported architecture for this LUFA configuration file. #error Unsupported architecture for this LUFA configuration file.

@ -65,12 +65,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); 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 */ /* Hardware Initialization */
Joystick_Init(); Joystick_Init();

@ -46,6 +46,7 @@
#include <LUFA/Drivers/Board/Joystick.h> #include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h> #include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -14,6 +14,9 @@
* \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) * \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: * \section Sec_Info USB Information:
* *

@ -1,14 +1,26 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="Keyboard and Mouse HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.keyboard_mouse.example"> <project caption="Keyboard and Mouse HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.keyboard_mouse.example.avr8">
<require idref="lufa.demos.device.lowlevel.keyboard_mouse"/> <require idref="lufa.demos.device.lowlevel.keyboard_mouse"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project>
<project caption="Keyboard and Mouse HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.keyboard_mouse.example.xmega">
<require idref="lufa.demos.device.lowlevel.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> </project>
<module type="application" id="lufa.demos.device.lowlevel.keyboard_mouse" caption="Keyboard and Mouse HID Device Demo (Low Level APIs)"> <module type="application" id="lufa.demos.device.lowlevel.keyboard_mouse" caption="Keyboard and Mouse HID Device Demo (Low Level APIs)">

@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT // #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE // #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 #else
#error Unsupported architecture for this LUFA configuration file. #error Unsupported architecture for this LUFA configuration file.

@ -56,12 +56,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); 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 */ /* Hardware Initialization */
Joystick_Init(); Joystick_Init();

@ -49,6 +49,7 @@
#include <LUFA/Drivers/Board/Joystick.h> #include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h> #include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -14,6 +14,9 @@
* \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) * \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: * \section Sec_Info USB Information:
* *

@ -1,14 +1,26 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="MIDI Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.midi.example"> <project caption="MIDI Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.midi.example.avr8">
<require idref="lufa.demos.device.lowlevel.midi"/> <require idref="lufa.demos.device.lowlevel.midi"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project>
<project caption="MIDI Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.midi.example.xmega">
<require idref="lufa.demos.device.lowlevel.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> </project>
<module type="application" id="lufa.demos.device.lowlevel.midi" caption="MIDI Device Demo (Low Level APIs)"> <module type="application" id="lufa.demos.device.lowlevel.midi" caption="MIDI Device Demo (Low Level APIs)">

@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT // #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE // #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 #else
#error Unsupported architecture for this LUFA configuration file. #error Unsupported architecture for this LUFA configuration file.

@ -67,12 +67,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); 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 */ /* Hardware Initialization */
LEDs_Init(); LEDs_Init();

@ -51,6 +51,7 @@
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Dataflash.h> #include <LUFA/Drivers/Board/Dataflash.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -14,6 +14,9 @@
* \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) * \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: * \section Sec_Info USB Information:
* *

@ -1,14 +1,26 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="Mass Storage Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.mass_storage.example"> <project caption="Mass Storage Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.mass_storage.example.avr8">
<require idref="lufa.demos.device.lowlevel.mass_storage"/> <require idref="lufa.demos.device.lowlevel.mass_storage"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project>
<project caption="Mass Storage Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.mass_storage.example.xmega">
<require idref="lufa.demos.device.lowlevel.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> </project>
<module type="application" id="lufa.demos.device.lowlevel.mass_storage" caption="Mass Storage Device Demo (Low Level APIs)"> <module type="application" id="lufa.demos.device.lowlevel.mass_storage" caption="Mass Storage Device Demo (Low Level APIs)">

@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT // #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE // #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 #else
#error Unsupported architecture for this LUFA configuration file. #error Unsupported architecture for this LUFA configuration file.

@ -73,12 +73,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); 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 */ /* Hardware Initialization */
Joystick_Init(); Joystick_Init();

@ -50,6 +50,7 @@
#include <LUFA/Drivers/Board/Joystick.h> #include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h> #include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -14,6 +14,9 @@
* \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) * \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: * \section Sec_Info USB Information:
* *

@ -1,14 +1,26 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="Mouse HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.mouse.example"> <project caption="Mouse HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.mouse.example.avr8">
<require idref="lufa.demos.device.lowlevel.mouse"/> <require idref="lufa.demos.device.lowlevel.mouse"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project>
<project caption="Mouse HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.mouse.example.xmega">
<require idref="lufa.demos.device.lowlevel.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> </project>
<module type="application" id="lufa.demos.device.lowlevel.mouse" caption="Mouse HID Device Demo (Low Level APIs)"> <module type="application" id="lufa.demos.device.lowlevel.mouse" caption="Mouse HID Device Demo (Low Level APIs)">

@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT // #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE // #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 #else
#error Unsupported architecture for this LUFA configuration file. #error Unsupported architecture for this LUFA configuration file.

@ -62,12 +62,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); 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 */ /* Hardware Initialization */
LEDs_Init(); LEDs_Init();

@ -55,6 +55,7 @@
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Peripheral/Serial.h> #include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** Notification value to indicate that a frame is ready to be read by the host. */ /** Notification value to indicate that a frame is ready to be read by the host. */

@ -12,6 +12,9 @@
* *
* \li Series 7 USB AVRs (AT90USBxxx7) * \li Series 7 USB AVRs (AT90USBxxx7)
* \li Series 6 USB AVRs (AT90USBxxx6) * \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: * \section Sec_Info USB Information:
* *

@ -1,14 +1,26 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="RNDIS Ethernet Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.rndis.example"> <project caption="RNDIS Ethernet Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.rndis.example.avr8">
<require idref="lufa.demos.device.lowlevel.rndis"/> <require idref="lufa.demos.device.lowlevel.rndis"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project>
<project caption="RNDIS Ethernet Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.rndis.example.xmega">
<require idref="lufa.demos.device.lowlevel.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> </project>
<module type="application" id="lufa.demos.device.lowlevel.rndis" caption="RNDIS Ethernet Device Demo (Low Level APIs)"> <module type="application" id="lufa.demos.device.lowlevel.rndis" caption="RNDIS Ethernet Device Demo (Low Level APIs)">

@ -85,6 +85,39 @@
// #define NO_AUTO_VBUS_MANAGEMENT // #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE // #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 #else
#error Unsupported architecture for this LUFA configuration file. #error Unsupported architecture for this LUFA configuration file.

@ -70,12 +70,24 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); 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 */ /* Hardware Initialization */
Joystick_Init(); Joystick_Init();

@ -48,6 +48,7 @@
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Board/Joystick.h> #include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -14,6 +14,9 @@
* \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) * \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: * \section Sec_Info USB Information:
* *

@ -1,14 +1,26 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="Virtual Serial CDC Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.cdc.example"> <project caption="Virtual Serial CDC Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.cdc.example.avr8">
<require idref="lufa.demos.device.lowlevel.cdc"/> <require idref="lufa.demos.device.lowlevel.cdc"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project>
<project caption="Virtual Serial CDC Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.cdc.example.xmega">
<require idref="lufa.demos.device.lowlevel.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> </project>
<module type="application" id="lufa.demos.device.lowlevel.cdc" caption="Virtual Serial CDC Device Demo (Low Level APIs)"> <module type="application" id="lufa.demos.device.lowlevel.cdc" caption="Virtual Serial CDC Device Demo (Low Level APIs)">

@ -68,12 +68,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
Serial_Init(9600, false); Serial_Init(9600, false);

@ -50,6 +50,7 @@
#include <LUFA/Drivers/Board/Joystick.h> #include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/Board/Buttons.h> #include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
#include "Descriptors.h" #include "Descriptors.h"
#include "DeviceFunctions.h" #include "DeviceFunctions.h"

@ -1,14 +1,14 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="Mouse HID Dual USB Mode Demo (Class Driver APIs)" id="lufa.demos.dualrole.class.mouse.example"> <project caption="Mouse HID Dual USB Mode Demo (Class Driver APIs)" id="lufa.demos.dualrole.class.mouse.example.avr8">
<require idref="lufa.demos.dualrole.class.mouse"/> <require idref="lufa.demos.dualrole.class.mouse"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project> </project>
<module type="application" id="lufa.demos.dualrole.class.mouse" caption="Mouse HID Dual USB Mode Demo (Class Driver APIs)"> <module type="application" id="lufa.demos.dualrole.class.mouse" caption="Mouse HID Dual USB Mode Demo (Class Driver APIs)">

@ -91,12 +91,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
Serial_Init(9600, false); Serial_Init(9600, false);

@ -48,6 +48,7 @@
#include <LUFA/Drivers/Peripheral/Serial.h> #include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -1,14 +1,14 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="Android Accessory Host Demo (Class Driver APIs)" id="lufa.demos.host.class.android.example"> <project caption="Android Accessory Host Demo (Class Driver APIs)" id="lufa.demos.host.class.android.example.avr8">
<require idref="lufa.demos.host.class.android"/> <require idref="lufa.demos.host.class.android"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project> </project>
<module type="application" id="lufa.demos.host.class.android" caption="Android Accessory Host Demo (Class Driver APIs)"> <module type="application" id="lufa.demos.host.class.android" caption="Android Accessory Host Demo (Class Driver APIs)">

@ -106,12 +106,14 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
Serial_Init(9600, false); Serial_Init(9600, false);

@ -48,6 +48,7 @@
#include <LUFA/Drivers/Peripheral/Serial.h> #include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -1,14 +1,14 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="Audio Input Host Demo (Class Driver APIs)" id="lufa.demos.host.class.audio_input.example"> <project caption="Audio Input Host Demo (Class Driver APIs)" id="lufa.demos.host.class.audio_input.example.avr8">
<require idref="lufa.demos.host.class.audio_input"/> <require idref="lufa.demos.host.class.audio_input"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project> </project>
<module type="application" id="lufa.demos.host.class.audio_input" caption="Audio Input Host Demo (Class Driver APIs)"> <module type="application" id="lufa.demos.host.class.audio_input" caption="Audio Input Host Demo (Class Driver APIs)">

@ -111,12 +111,14 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
Serial_Init(9600, false); Serial_Init(9600, false);

@ -50,6 +50,7 @@
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h> #include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
#include "Config/AppConfig.h" #include "Config/AppConfig.h"

@ -1,14 +1,14 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="Audio Output Host Demo (Class Driver APIs)" id="lufa.demos.host.class.audio_output.example"> <project caption="Audio Output Host Demo (Class Driver APIs)" id="lufa.demos.host.class.audio_output.example.avr8">
<require idref="lufa.demos.host.class.audio_output"/> <require idref="lufa.demos.host.class.audio_output"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project> </project>
<module type="application" id="lufa.demos.host.class.audio_output" caption="Audio Output Host Demo (Class Driver APIs)"> <module type="application" id="lufa.demos.host.class.audio_output" caption="Audio Output Host Demo (Class Driver APIs)">

@ -87,12 +87,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
Serial_Init(9600, false); Serial_Init(9600, false);

@ -48,6 +48,7 @@
#include <LUFA/Drivers/Peripheral/Serial.h> #include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -1,14 +1,14 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="Joystick HID (with parser) Host Demo (Class Driver APIs)" id="lufa.demos.host.class.joystick_parser.example"> <project caption="Joystick HID (with parser) Host Demo (Class Driver APIs)" id="lufa.demos.host.class.joystick_parser.example.avr8">
<require idref="lufa.demos.host.class.joystick_parser"/> <require idref="lufa.demos.host.class.joystick_parser"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project> </project>
<module type="application" id="lufa.demos.host.class.joystick_parser" caption="Joystick HID (with parser) Host Demo (Class Driver APIs)"> <module type="application" id="lufa.demos.host.class.joystick_parser" caption="Joystick HID (with parser) Host Demo (Class Driver APIs)">

@ -83,12 +83,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
Serial_Init(9600, false); Serial_Init(9600, false);

@ -48,6 +48,7 @@
#include <LUFA/Drivers/Peripheral/Serial.h> #include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -1,14 +1,14 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="Keyboard HID Host Demo (Class Driver APIs)" id="lufa.demos.host.class.keyboard.example"> <project caption="Keyboard HID Host Demo (Class Driver APIs)" id="lufa.demos.host.class.keyboard.example.avr8">
<require idref="lufa.demos.host.class.keyboard"/> <require idref="lufa.demos.host.class.keyboard"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project> </project>
<module type="application" id="lufa.demos.host.class.keyboard" caption="Keyboard HID Host Demo (Class Driver APIs)"> <module type="application" id="lufa.demos.host.class.keyboard" caption="Keyboard HID Host Demo (Class Driver APIs)">

@ -87,12 +87,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
Serial_Init(9600, false); Serial_Init(9600, false);

@ -48,6 +48,7 @@
#include <LUFA/Drivers/Peripheral/Serial.h> #include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -1,14 +1,14 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="Keyboard HID (with parser) Host Demo (Class Driver APIs)" id="lufa.demos.host.class.keyboard_parser.example"> <project caption="Keyboard HID (with parser) Host Demo (Class Driver APIs)" id="lufa.demos.host.class.keyboard_parser.example.avr8">
<require idref="lufa.demos.host.class.keyboard_parser"/> <require idref="lufa.demos.host.class.keyboard_parser"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project> </project>
<module type="application" id="lufa.demos.host.class.keyboard_parser" caption="Keyboard HID (with parser) Host Demo (Class Driver APIs)"> <module type="application" id="lufa.demos.host.class.keyboard_parser" caption="Keyboard HID (with parser) Host Demo (Class Driver APIs)">

@ -82,12 +82,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
Serial_Init(9600, false); Serial_Init(9600, false);

@ -50,6 +50,7 @@
#include <LUFA/Drivers/Board/Buttons.h> #include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/Board/Joystick.h> #include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -1,14 +1,14 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="MIDI Host Demo (Class Driver APIs)" id="lufa.demos.host.class.midi.example"> <project caption="MIDI Host Demo (Class Driver APIs)" id="lufa.demos.host.class.midi.example.avr8">
<require idref="lufa.demos.host.class.midi"/> <require idref="lufa.demos.host.class.midi"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project> </project>
<module type="application" id="lufa.demos.host.class.midi" caption="MIDI Host Demo (Class Driver APIs)"> <module type="application" id="lufa.demos.host.class.midi" caption="MIDI Host Demo (Class Driver APIs)">

@ -82,12 +82,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
Serial_Init(9600, false); Serial_Init(9600, false);

@ -49,6 +49,7 @@
#include <LUFA/Drivers/Peripheral/Serial.h> #include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -1,14 +1,14 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="Mass Storage Host Demo (Class Driver APIs)" id="lufa.demos.host.class.ms.example"> <project caption="Mass Storage Host Demo (Class Driver APIs)" id="lufa.demos.host.class.ms.example.avr8">
<require idref="lufa.demos.host.class.ms"/> <require idref="lufa.demos.host.class.ms"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project> </project>
<module type="application" id="lufa.demos.host.class.ms" caption="Mass Storage Host Demo (Class Driver APIs)"> <module type="application" id="lufa.demos.host.class.ms" caption="Mass Storage Host Demo (Class Driver APIs)">

@ -83,12 +83,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
Serial_Init(9600, false); Serial_Init(9600, false);

@ -48,6 +48,7 @@
#include <LUFA/Drivers/Peripheral/Serial.h> #include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -1,14 +1,14 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="Mouse HID Host Demo (Class Driver APIs)" id="lufa.demos.host.class.mouse.example"> <project caption="Mouse HID Host Demo (Class Driver APIs)" id="lufa.demos.host.class.mouse.example.avr8">
<require idref="lufa.demos.host.class.mouse"/> <require idref="lufa.demos.host.class.mouse"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project> </project>
<module type="application" id="lufa.demos.host.class.mouse" caption="Mouse HID Host Demo (Class Driver APIs)"> <module type="application" id="lufa.demos.host.class.mouse" caption="Mouse HID Host Demo (Class Driver APIs)">

@ -87,12 +87,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
Serial_Init(9600, false); Serial_Init(9600, false);

@ -48,6 +48,7 @@
#include <LUFA/Drivers/Peripheral/Serial.h> #include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -1,14 +1,14 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="Mouse HID (with parser) Host Demo (Class Driver APIs)" id="lufa.demos.host.class.mouse_parser.example"> <project caption="Mouse HID (with parser) Host Demo (Class Driver APIs)" id="lufa.demos.host.class.mouse_parser.example.avr8">
<require idref="lufa.demos.host.class.mouse_parser"/> <require idref="lufa.demos.host.class.mouse_parser"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project> </project>
<module type="application" id="lufa.demos.host.class.mouse_parser" caption="Mouse HID (with parser) Host Demo (Class Driver APIs)"> <module type="application" id="lufa.demos.host.class.mouse_parser" caption="Mouse HID (with parser) Host Demo (Class Driver APIs)">

@ -82,12 +82,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
Serial_Init(9600, false); Serial_Init(9600, false);

@ -48,6 +48,7 @@
#include <LUFA/Drivers/Peripheral/Serial.h> #include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -1,14 +1,14 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="Printer Host Demo (Class Driver APIs)" id="lufa.demos.host.class.printer.example"> <project caption="Printer Host Demo (Class Driver APIs)" id="lufa.demos.host.class.printer.example.avr8">
<require idref="lufa.demos.host.class.printer"/> <require idref="lufa.demos.host.class.printer"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project> </project>
<module type="application" id="lufa.demos.host.class.printer" caption="Printer Host Demo (Class Driver APIs)"> <module type="application" id="lufa.demos.host.class.printer" caption="Printer Host Demo (Class Driver APIs)">

@ -117,12 +117,14 @@ void RNDISHost_Task(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
Serial_Init(9600, false); Serial_Init(9600, false);

@ -48,6 +48,7 @@
#include <LUFA/Drivers/Peripheral/Serial.h> #include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -1,14 +1,14 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="RNDIS Ethernet Host Demo (Class Driver APIs)" id="lufa.demos.host.class.rndis.example"> <project caption="RNDIS Ethernet Host Demo (Class Driver APIs)" id="lufa.demos.host.class.rndis.example.avr8">
<require idref="lufa.demos.host.class.rndis"/> <require idref="lufa.demos.host.class.rndis"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project> </project>
<module type="application" id="lufa.demos.host.class.rndis" caption="RNDIS Ethernet Host Demo (Class Driver APIs)"> <module type="application" id="lufa.demos.host.class.rndis" caption="RNDIS Ethernet Host Demo (Class Driver APIs)">

@ -87,12 +87,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
Serial_Init(9600, false); Serial_Init(9600, false);

@ -48,6 +48,7 @@
#include <LUFA/Drivers/Peripheral/Serial.h> #include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -1,14 +1,14 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="Still Image Host Demo (Class Driver APIs)" id="lufa.demos.host.class.si.example"> <project caption="Still Image Host Demo (Class Driver APIs)" id="lufa.demos.host.class.si.example.avr8">
<require idref="lufa.demos.host.class.si"/> <require idref="lufa.demos.host.class.si"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project> </project>
<module type="application" id="lufa.demos.host.class.si" caption="Still Image Host Demo (Class Driver APIs)"> <module type="application" id="lufa.demos.host.class.si" caption="Still Image Host Demo (Class Driver APIs)">

@ -87,12 +87,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
Serial_Init(9600, false); Serial_Init(9600, false);

@ -48,6 +48,7 @@
#include <LUFA/Drivers/Peripheral/Serial.h> #include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -1,14 +1,14 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="Virtual Serial CDC Host Demo (Class Driver APIs)" id="lufa.demos.host.class.cdc.example"> <project caption="Virtual Serial CDC Host Demo (Class Driver APIs)" id="lufa.demos.host.class.cdc.example.avr8">
<require idref="lufa.demos.host.class.cdc"/> <require idref="lufa.demos.host.class.cdc"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project> </project>
<module type="application" id="lufa.demos.host.class.cdc" caption="Virtual Serial CDC Host Demo (Class Driver APIs)"> <module type="application" id="lufa.demos.host.class.cdc" caption="Virtual Serial CDC Host Demo (Class Driver APIs)">

@ -58,12 +58,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
Serial_Init(9600, false); Serial_Init(9600, false);

@ -52,6 +52,7 @@
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Peripheral/Serial.h> #include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -1,14 +1,14 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="Android Accessory Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.android.example"> <project caption="Android Accessory Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.android.example.avr8">
<require idref="lufa.demos.host.lowlevel.android"/> <require idref="lufa.demos.host.lowlevel.android"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project> </project>
<module type="application" id="lufa.demos.host.lowlevel.android" caption="Android Accessory Host Demo (Low Level APIs)"> <module type="application" id="lufa.demos.host.lowlevel.android" caption="Android Accessory Host Demo (Low Level APIs)">

@ -57,12 +57,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
Serial_Init(9600, false); Serial_Init(9600, false);

@ -48,6 +48,7 @@
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Peripheral/Serial.h> #include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Platform/Platform.h>
#include "ConfigDescriptor.h" #include "ConfigDescriptor.h"

@ -1,14 +1,14 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="Audio Input Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.audio_input.example"> <project caption="Audio Input Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.audio_input.example.avr8">
<require idref="lufa.demos.host.lowlevel.audio_input"/> <require idref="lufa.demos.host.lowlevel.audio_input"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project> </project>
<module type="application" id="lufa.demos.host.lowlevel.audio_input" caption="Audio Input Host Demo (Low Level APIs)"> <module type="application" id="lufa.demos.host.lowlevel.audio_input" caption="Audio Input Host Demo (Low Level APIs)">

@ -57,12 +57,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
Serial_Init(9600, false); Serial_Init(9600, false);

@ -50,6 +50,7 @@
#include <LUFA/Drivers/Peripheral/ADC.h> #include <LUFA/Drivers/Peripheral/ADC.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h> #include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Platform/Platform.h>
#include "ConfigDescriptor.h" #include "ConfigDescriptor.h"
#include "Config/AppConfig.h" #include "Config/AppConfig.h"

@ -1,14 +1,14 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="Audio Output Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.audio_output.example"> <project caption="Audio Output Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.audio_output.example.avr8">
<require idref="lufa.demos.host.lowlevel.audio_output"/> <require idref="lufa.demos.host.lowlevel.audio_output"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project> </project>
<module type="application" id="lufa.demos.host.lowlevel.audio_output" caption="Audio Output Host Demo (Low Level APIs)"> <module type="application" id="lufa.demos.host.lowlevel.audio_output" caption="Audio Output Host Demo (Low Level APIs)">

@ -59,12 +59,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
Serial_Init(9600, false); Serial_Init(9600, false);

@ -48,6 +48,7 @@
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Peripheral/Serial.h> #include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Platform/Platform.h>
#include "ConfigDescriptor.h" #include "ConfigDescriptor.h"

@ -1,14 +1,14 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="Generic HID Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.generic_hid.example"> <project caption="Generic HID Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.generic_hid.example.avr8">
<require idref="lufa.demos.host.lowlevel.generic_hid"/> <require idref="lufa.demos.host.lowlevel.generic_hid"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project> </project>
<module type="application" id="lufa.demos.host.lowlevel.generic_hid" caption="Generic HID Host Demo (Low Level APIs)"> <module type="application" id="lufa.demos.host.lowlevel.generic_hid" caption="Generic HID Host Demo (Low Level APIs)">

@ -59,12 +59,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
Serial_Init(9600, false); Serial_Init(9600, false);

@ -48,6 +48,7 @@
#include <LUFA/Drivers/Peripheral/Serial.h> #include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
#include "ConfigDescriptor.h" #include "ConfigDescriptor.h"
#include "HIDReport.h" #include "HIDReport.h"

@ -1,14 +1,14 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="Joystick HID (with parser) Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.joystick_parser.example"> <project caption="Joystick HID (with parser) Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.joystick_parser.example.avr8">
<require idref="lufa.demos.host.lowlevel.joystick_parser"/> <require idref="lufa.demos.host.lowlevel.joystick_parser"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project> </project>
<module type="application" id="lufa.demos.host.lowlevel.joystick_parser" caption="Joystick HID (with parser) Host Demo (Low Level APIs)"> <module type="application" id="lufa.demos.host.lowlevel.joystick_parser" caption="Joystick HID (with parser) Host Demo (Low Level APIs)">

@ -59,12 +59,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
Serial_Init(9600, false); Serial_Init(9600, false);

@ -48,6 +48,7 @@
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Peripheral/Serial.h> #include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Platform/Platform.h>
#include "ConfigDescriptor.h" #include "ConfigDescriptor.h"

@ -1,14 +1,14 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="Keyboard HID Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.keyboard.example"> <project caption="Keyboard HID Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.keyboard.example.avr8">
<require idref="lufa.demos.host.lowlevel.keyboard"/> <require idref="lufa.demos.host.lowlevel.keyboard"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project> </project>
<module type="application" id="lufa.demos.host.lowlevel.keyboard" caption="Keyboard HID Host Demo (Low Level APIs)"> <module type="application" id="lufa.demos.host.lowlevel.keyboard" caption="Keyboard HID Host Demo (Low Level APIs)">

@ -59,12 +59,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
Serial_Init(9600, false); Serial_Init(9600, false);

@ -43,6 +43,7 @@
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Peripheral/Serial.h> #include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Platform/Platform.h>
#include "ConfigDescriptor.h" #include "ConfigDescriptor.h"
#include "HIDReport.h" #include "HIDReport.h"

@ -1,14 +1,14 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="Keyboard HID (with parser) Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.keyboard_parser.example"> <project caption="Keyboard HID (with parser) Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.keyboard_parser.example.avr8">
<require idref="lufa.demos.host.lowlevel.keyboard_parser"/> <require idref="lufa.demos.host.lowlevel.keyboard_parser"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project> </project>
<module type="application" id="lufa.demos.host.lowlevel.keyboard_parser" caption="Keyboard HID (with parser) Host Demo (Low Level APIs)"> <module type="application" id="lufa.demos.host.lowlevel.keyboard_parser" caption="Keyboard HID (with parser) Host Demo (Low Level APIs)">

@ -59,12 +59,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
Serial_Init(9600, false); Serial_Init(9600, false);

@ -50,6 +50,7 @@
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h> #include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/Board/Joystick.h> #include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Platform/Platform.h>
#include "ConfigDescriptor.h" #include "ConfigDescriptor.h"

@ -1,14 +1,14 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="MIDI Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.midi.example"> <project caption="MIDI Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.midi.example.avr8">
<require idref="lufa.demos.host.lowlevel.midi"/> <require idref="lufa.demos.host.lowlevel.midi"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project> </project>
<module type="application" id="lufa.demos.host.lowlevel.midi" caption="MIDI Host Demo (Low Level APIs)"> <module type="application" id="lufa.demos.host.lowlevel.midi" caption="MIDI Host Demo (Low Level APIs)">

@ -63,12 +63,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
Serial_Init(9600, false); Serial_Init(9600, false);

@ -55,6 +55,7 @@
#include <LUFA/Drivers/Peripheral/Serial.h> #include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h> #include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -1,14 +1,14 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="Mass Storage Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.ms.example"> <project caption="Mass Storage Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.ms.example.avr8">
<require idref="lufa.demos.host.lowlevel.ms"/> <require idref="lufa.demos.host.lowlevel.ms"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project> </project>
<module type="application" id="lufa.demos.host.lowlevel.ms" caption="Mass Storage Host Demo (Low Level APIs)"> <module type="application" id="lufa.demos.host.lowlevel.ms" caption="Mass Storage Host Demo (Low Level APIs)">

@ -59,12 +59,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
Serial_Init(9600, false); Serial_Init(9600, false);

@ -48,6 +48,7 @@
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Peripheral/Serial.h> #include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Platform/Platform.h>
#include "ConfigDescriptor.h" #include "ConfigDescriptor.h"

@ -1,14 +1,14 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="Mouse HID Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.mouse.example"> <project caption="Mouse HID Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.mouse.example.avr8">
<require idref="lufa.demos.host.lowlevel.mouse"/> <require idref="lufa.demos.host.lowlevel.mouse"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project> </project>
<module type="application" id="lufa.demos.host.lowlevel.mouse" caption="Mouse HID Host Demo (Low Level APIs)"> <module type="application" id="lufa.demos.host.lowlevel.mouse" caption="Mouse HID Host Demo (Low Level APIs)">

@ -59,12 +59,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
Serial_Init(9600, false); Serial_Init(9600, false);

@ -48,6 +48,7 @@
#include <LUFA/Drivers/Peripheral/Serial.h> #include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
#include "ConfigDescriptor.h" #include "ConfigDescriptor.h"
#include "HIDReport.h" #include "HIDReport.h"

@ -1,14 +1,14 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="Mouse HID (with parser) Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.mouse_parser.example"> <project caption="Mouse HID (with parser) Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.mouse_parser.example.avr8">
<require idref="lufa.demos.host.lowlevel.mouse_parser"/> <require idref="lufa.demos.host.lowlevel.mouse_parser"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project> </project>
<module type="application" id="lufa.demos.host.lowlevel.mouse_parser" caption="Mouse HID (with parser) Host Demo (Low Level APIs)"> <module type="application" id="lufa.demos.host.lowlevel.mouse_parser" caption="Mouse HID (with parser) Host Demo (Low Level APIs)">

@ -59,12 +59,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
Serial_Init(9600, false); Serial_Init(9600, false);

@ -52,6 +52,7 @@
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Peripheral/Serial.h> #include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -1,14 +1,14 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="Printer Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.printer.example"> <project caption="Printer Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.printer.example.avr8">
<require idref="lufa.demos.host.lowlevel.printer"/> <require idref="lufa.demos.host.lowlevel.printer"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project> </project>
<module type="application" id="lufa.demos.host.lowlevel.printer" caption="Printer Host Demo (Low Level APIs)"> <module type="application" id="lufa.demos.host.lowlevel.printer" caption="Printer Host Demo (Low Level APIs)">

@ -59,12 +59,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
Serial_Init(9600, false); Serial_Init(9600, false);

@ -48,6 +48,7 @@
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Peripheral/Serial.h> #include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Platform/Platform.h>
#include "Lib/RNDISCommands.h" #include "Lib/RNDISCommands.h"

@ -1,14 +1,14 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="RNDIS Ethernet Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.rndis.example"> <project caption="RNDIS Ethernet Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.rndis.example.avr8">
<require idref="lufa.demos.host.lowlevel.rndis"/> <require idref="lufa.demos.host.lowlevel.rndis"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project> </project>
<module type="application" id="lufa.demos.host.lowlevel.rndis" caption="RNDIS Ethernet Host Demo (Low Level APIs)"> <module type="application" id="lufa.demos.host.lowlevel.rndis" caption="RNDIS Ethernet Host Demo (Low Level APIs)">

@ -59,13 +59,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable Clock Division */ /* Disable clock division */
CLKPR = (1 << CLKPCE); clock_prescale_set(clock_div_1);
CLKPR = 0; #endif
/* Hardware Initialization */ /* Hardware Initialization */
Serial_Init(9600, false); Serial_Init(9600, false);

@ -51,6 +51,7 @@
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Peripheral/Serial.h> #include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -1,14 +1,14 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="Still Image Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.si.example"> <project caption="Still Image Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.si.example.avr8">
<require idref="lufa.demos.host.lowlevel.si"/> <require idref="lufa.demos.host.lowlevel.si"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project> </project>
<module type="application" id="lufa.demos.host.lowlevel.si" caption="Still Image Host Demo (Low Level APIs)"> <module type="application" id="lufa.demos.host.lowlevel.si" caption="Still Image Host Demo (Low Level APIs)">

@ -59,12 +59,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
Serial_Init(9600, false); Serial_Init(9600, false);

@ -48,6 +48,7 @@
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Peripheral/Serial.h> #include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Platform/Platform.h>
#include "ConfigDescriptor.h" #include "ConfigDescriptor.h"

@ -1,14 +1,14 @@
<asf xmlversion="1.0"> <asf xmlversion="1.0">
<project caption="Virtual Serial CDC Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.cdc.example"> <project caption="Virtual Serial CDC Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.cdc.example.avr8">
<require idref="lufa.demos.host.lowlevel.cdc"/> <require idref="lufa.demos.host.lowlevel.cdc"/>
<require idref="lufa.boards.dummy.avr8"/> <require idref="lufa.boards.dummy.avr8"/>
<generator value="as5_8"/> <generator value="as5_8"/>
<device-support value="at90usb1287"/> <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_CPU" value="16000000UL"/>
<build type="define" name="F_USB" value="8000000UL"/> <build type="define" name="F_USB" value="16000000UL"/>
</project> </project>
<module type="application" id="lufa.demos.host.lowlevel.cdc" caption="Virtual Serial CDC Host Demo (Low Level APIs)"> <module type="application" id="lufa.demos.host.lowlevel.cdc" caption="Virtual Serial CDC Host Demo (Low Level APIs)">

@ -16,11 +16,13 @@
* - Library Applications: * - Library Applications:
* - Added new Printer class bootloader * - Added new Printer class bootloader
* - Added new Mass Storage class bootloader * - Added new Mass Storage class bootloader
* - Added XMEGA support for class driver device demos (where applicable)
* *
* <b>Changed:</b> * <b>Changed:</b>
* - Core: * - Core:
* - Updated the BUILD build system module to produce binary BIN files in addition to Intel HEX files * - Updated the BUILD build system module to produce binary BIN files in addition to Intel HEX files
* - Updated the Android Accessory Class to accept version 2 protocol devices (with version 1 functionality) * - Updated the Android Accessory Class to accept version 2 protocol devices (with version 1 functionality)
* - All board drivers now implement dummy functions and constants when BOARD is set to NONE
* *
* <b>Fixed:</b> * <b>Fixed:</b>
* - Core: * - Core:

@ -92,7 +92,9 @@
#include "../../Common/Common.h" #include "../../Common/Common.h"
#if (BOARD == BOARD_NONE) #if (BOARD == BOARD_NONE)
#error The Board Buttons driver cannot be used if the makefile BOARD option is not set. #define BUTTONS_BUTTON1 0
static inline void Buttons_Init(void) {};
static inline uint_reg_t Buttons_GetStatus(void) { return 0; };
#elif (BOARD == BOARD_USBKEY) #elif (BOARD == BOARD_USBKEY)
#include "AVR8/USBKEY/Buttons.h" #include "AVR8/USBKEY/Buttons.h"
#elif (BOARD == BOARD_STK525) #elif (BOARD == BOARD_STK525)

@ -220,7 +220,23 @@
/* Includes: */ /* Includes: */
#if (BOARD == BOARD_NONE) #if (BOARD == BOARD_NONE)
#error The Board Dataflash driver cannot be used if the makefile BOARD option is not set. #define DATAFLASH_TOTALCHIPS 0
#define DATAFLASH_NO_CHIP 0
#define DATAFLASH_CHIP1 0
#define DATAFLASH_PAGE_SIZE 0
#define DATAFLASH_PAGES 0
static inline void Dataflash_Init(void) {};
static inline uint8_t Dataflash_TransferByte(const uint8_t Byte) { return 0; };
static inline void Dataflash_SendByte(const uint8_t Byte) {};
static inline uint8_t Dataflash_ReceiveByte(void) { return 0; };
static inline uint8_t Dataflash_GetSelectedChip(void) { return 0; };
static inline void Dataflash_SelectChip(const uint8_t ChipMask) {};
static inline void Dataflash_DeselectChip(void) {};
static inline void Dataflash_SelectChipFromPage(const uint16_t PageAddress) {};
static inline void Dataflash_ToggleSelectedChipCS(void) {};
static inline void Dataflash_WaitWhileBusy(void) {};
static inline void Dataflash_SendAddressBytes(uint16_t PageAddress,
const uint16_t BufferByte) {};
#elif (BOARD == BOARD_USBKEY) #elif (BOARD == BOARD_USBKEY)
#include "AVR8/USBKEY/Dataflash.h" #include "AVR8/USBKEY/Dataflash.h"
#elif (BOARD == BOARD_STK525) #elif (BOARD == BOARD_STK525)

@ -100,7 +100,13 @@
#include "../../Common/Common.h" #include "../../Common/Common.h"
#if (BOARD == BOARD_NONE) #if (BOARD == BOARD_NONE)
#error The Board Joystick driver cannot be used if the makefile BOARD option is not set. #define JOY_UP 0
#define JOY_DOWN 0
#define JOY_LEFT 0
#define JOY_RIGHT 0
#define JOY_PRESS 0
static inline void Joystick_Init(void) {};
static inline uint_reg_t Joystick_GetStatus(void) { return 0; };
#elif (BOARD == BOARD_USBKEY) #elif (BOARD == BOARD_USBKEY)
#include "AVR8/USBKEY/Joystick.h" #include "AVR8/USBKEY/Joystick.h"
#elif (BOARD == BOARD_STK525) #elif (BOARD == BOARD_STK525)

@ -63,12 +63,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
LEDs_Init(); LEDs_Init();

@ -44,6 +44,7 @@
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
#if defined(ADC) #if defined(ADC)
#include <LUFA/Drivers/Peripheral/ADC.h> #include <LUFA/Drivers/Peripheral/ADC.h>

@ -171,10 +171,15 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
LEDs_Init(); LEDs_Init();
USB_Init(); USB_Init();

@ -48,6 +48,7 @@
#include <LUFA/Drivers/Peripheral/Serial.h> #include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Misc/RingBuffer.h> #include <LUFA/Drivers/Misc/RingBuffer.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate TX activity. */ /** LED mask for the library LED driver, to indicate TX activity. */

@ -202,12 +202,14 @@ void OutputCollectionPath(const HID_CollectionPath_t* const CollectionPath)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
Serial_Init(9600, false); Serial_Init(9600, false);

@ -49,6 +49,7 @@
#include <LUFA/Drivers/Peripheral/Serial.h> #include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -142,12 +142,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
LEDs_Init(); LEDs_Init();

@ -48,6 +48,7 @@
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Function Prototypes: */ /* Function Prototypes: */
void SetupHardware(void); void SetupHardware(void);

@ -185,12 +185,14 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
LEDs_Init(); LEDs_Init();

@ -49,6 +49,7 @@
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -94,12 +94,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
Magstripe_Init(); Magstripe_Init();

@ -49,6 +49,7 @@
#include "Config/AppConfig.h" #include "Config/AppConfig.h"
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** Total number of tracks which can be read from the card, between 1 and 3. */ /** Total number of tracks which can be read from the card, between 1 and 3. */

@ -80,12 +80,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware() void SetupHardware()
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
Joystick_Init(); Joystick_Init();

@ -50,6 +50,7 @@
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h> #include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -112,12 +112,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
LEDs_Init(); LEDs_Init();

@ -49,6 +49,7 @@
#include <LUFA/Drivers/Board/Buttons.h> #include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/Board/Joystick.h> #include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Platform/Platform.h>
#include "ConfigDescriptor.h" #include "ConfigDescriptor.h"

@ -54,12 +54,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the project's functionality. */ /** Configures the board hardware and chip peripherals for the project's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
USB_Init(); USB_Init();

@ -47,6 +47,7 @@
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
#define RELAY1 (1 << 7) #define RELAY1 (1 << 7)

@ -137,12 +137,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the application's functionality. */ /** Configures the board hardware and chip peripherals for the application's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
USB_Init(); USB_Init();

@ -49,6 +49,7 @@
#include <LUFA/Version.h> #include <LUFA/Version.h>
#include <LUFA/Drivers/Misc/RingBuffer.h> #include <LUFA/Drivers/Misc/RingBuffer.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
#define COMMAND_ESCAPE 0x1B #define COMMAND_ESCAPE 0x1B

@ -190,12 +190,14 @@ void CloseLogFile(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
LEDs_Init(); LEDs_Init();

@ -55,6 +55,7 @@
#include <LUFA/Drivers/Board/Temperature.h> #include <LUFA/Drivers/Board/Temperature.h>
#include <LUFA/Drivers/Peripheral/ADC.h> #include <LUFA/Drivers/Peripheral/ADC.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -145,12 +145,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
LEDs_Init(); LEDs_Init();

@ -48,6 +48,7 @@
#include <LUFA/Drivers/Peripheral/Serial.h> #include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Misc/RingBuffer.h> #include <LUFA/Drivers/Misc/RingBuffer.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

@ -60,12 +60,14 @@ int main(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Hardware Initialization */ /* Hardware Initialization */
SPI_Init(SPI_SPEED_FCPU_DIV_2 | SPI_SCK_LEAD_FALLING | SPI_SAMPLE_TRAILING | SPI_MODE_MASTER); SPI_Init(SPI_SPEED_FCPU_DIV_2 | SPI_SCK_LEAD_FALLING | SPI_SAMPLE_TRAILING | SPI_MODE_MASTER);

@ -47,6 +47,7 @@
#include <LUFA/Drivers/Board/Dataflash.h> #include <LUFA/Drivers/Board/Dataflash.h>
#include <LUFA/Drivers/Peripheral/SPI.h> #include <LUFA/Drivers/Peripheral/SPI.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
#include "USBDeviceMode.h" #include "USBDeviceMode.h"
#include "USBHostMode.h" #include "USBHostMode.h"

@ -169,12 +169,14 @@ void UARTBridge_Task(void)
/** Configures the board hardware and chip peripherals for the demo's functionality. */ /** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void) void SetupHardware(void)
{ {
#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */ /* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */ /* Disable clock division */
clock_prescale_set(clock_div_1); clock_prescale_set(clock_div_1);
#endif
/* Disable JTAG debugging */ /* Disable JTAG debugging */
MCUCR |= (1 << JTD); MCUCR |= (1 << JTD);

@ -53,6 +53,7 @@
#include <LUFA/Drivers/Board/LEDs.h> #include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Misc/RingBuffer.h> #include <LUFA/Drivers/Misc/RingBuffer.h>
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Platform/Platform.h>
/* Macros: */ /* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */

Loading…
Cancel
Save