#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Board/LEDs.h>
+ #include <LUFA/Platform/Platform.h>
/* Preprocessor Checks: */
#if !defined(__OPTIMIZE_SIZE__)
\r
<config name="config.compiler.optimization.level" value="size"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
\r
<build type="define" name="BOOT_START_ADDR" value="0x1F000"/>\r
<build type="linker-config" subtype="flags" value="--section-start=.text=0x1F000"/>\r
\r
<config name="config.compiler.optimization.level" value="size"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
\r
<build type="define" name="BOOT_START_ADDR" value="0xF000"/>\r
<build type="linker-config" subtype="flags" value="--section-start=.text=0xF000"/>\r
\r
<config name="config.compiler.optimization.level" value="size"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
\r
<build type="define" name="BOOT_START_ADDR" value="0x7000"/>\r
<build type="linker-config" subtype="flags" value="--section-start=.text=0x7000"/>\r
\r
<config name="config.compiler.optimization.level" value="size"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
\r
<build type="define" name="BOOT_START_ADDR" value="0x3000"/>\r
<build type="linker-config" subtype="flags" value="--section-start=.text=0x3000"/>\r
\r
<config name="config.compiler.optimization.level" value="size"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
\r
<build type="define" name="BOOT_START_ADDR" value="0x1000"/>\r
<build type="linker-config" subtype="flags" value="--section-start=.text=0x1000"/>\r
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Board/LEDs.h>
+ #include <LUFA/Platform/Platform.h>
/* Preprocessor Checks: */
#if !defined(__OPTIMIZE_SIZE__)
\r
<config name="config.compiler.optimization.level" value="size"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
\r
<build type="define" name="BOOT_START_ADDR" value="0x1F000"/>\r
<build type="linker-config" subtype="flags" value="--section-start=.text=0x1F000"/>\r
\r
<config name="config.compiler.optimization.level" value="size"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
\r
<build type="define" name="BOOT_START_ADDR" value="0xF000"/>\r
<build type="linker-config" subtype="flags" value="--section-start=.text=0xF000"/>\r
\r
<config name="config.compiler.optimization.level" value="size"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
\r
<build type="define" name="BOOT_START_ADDR" value="0x7000"/>\r
<build type="linker-config" subtype="flags" value="--section-start=.text=0x7000"/>\r
<device-support value="atmega16u2"/>\r
<config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
\r
<build type="define" name="BOOT_START_ADDR" value="0x3000"/>\r
<build type="linker-config" subtype="flags" value="--section-start=.text=0x3000"/>\r
<device-support value="atmega8u2"/>\r
<config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
\r
<build type="define" name="BOOT_START_ADDR" value="0x1000"/>\r
<build type="linker-config" subtype="flags" value="--section-start=.text=0x1000"/>\r
#include "Descriptors.h"
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Preprocessor Checks: */
#if !defined(__OPTIMIZE_SIZE__)
\r
<config name="config.compiler.optimization.level" value="size"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
\r
<build type="define" name="BOOT_START_ADDR" value="0x1F000"/>\r
<build type="linker-config" subtype="flags" value="--section-start=.text=0x1F000"/>\r
\r
<config name="config.compiler.optimization.level" value="size"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
\r
<build type="define" name="BOOT_START_ADDR" value="0xF000"/>\r
<build type="linker-config" subtype="flags" value="--section-start=.text=0xF000"/>\r
\r
<config name="config.compiler.optimization.level" value="size"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
\r
<build type="define" name="BOOT_START_ADDR" value="0x7000"/>\r
<build type="linker-config" subtype="flags" value="--section-start=.text=0x7000"/>\r
\r
<config name="config.compiler.optimization.level" value="size"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
\r
<build type="define" name="BOOT_START_ADDR" value="0x3800"/>\r
<build type="linker-config" subtype="flags" value="--section-start=.text=0x3800"/>\r
\r
<config name="config.compiler.optimization.level" value="size"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
\r
<build type="define" name="BOOT_START_ADDR" value="0x1800"/>\r
<build type="linker-config" subtype="flags" value="--section-start=.text=0x1800"/>\r
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Preprocessor Checks: */
#if !defined(__OPTIMIZE_SIZE__)
\r
<config name="config.compiler.optimization.level" value="size"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
\r
<build type="define" name="BOOT_START_ADDR" value="0x1E000"/>\r
<build type="linker-config" subtype="flags" value="--section-start=.text=0x1E000"/>\r
\r
<config name="config.compiler.optimization.level" value="size"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
\r
<build type="define" name="BOOT_START_ADDR" value="0xE000"/>\r
<build type="linker-config" subtype="flags" value="--section-start=.text=0xE000"/>\r
\r
<config name="config.compiler.optimization.level" value="size"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
\r
<build type="define" name="BOOT_START_ADDR" value="0x7000"/>\r
<build type="linker-config" subtype="flags" value="--section-start=.text=0x7000"/>\r
\r
<config name="config.compiler.optimization.level" value="size"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
\r
<build type="define" name="BOOT_START_ADDR" value="0x3000"/>\r
<build type="linker-config" subtype="flags" value="--section-start=.text=0x3000"/>\r
#include "Descriptors.h"
- #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Board/LEDs.h>
+ #include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Preprocessor Checks: */
#if !defined(__OPTIMIZE_SIZE__)
\r
<config name="config.compiler.optimization.level" value="size"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
\r
<build type="define" name="BOOT_START_ADDR" value="0x1F000"/>\r
<build type="linker-config" subtype="flags" value="--section-start=.text=0x1F000"/>\r
\r
<config name="config.compiler.optimization.level" value="size"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
\r
<build type="define" name="BOOT_START_ADDR" value="0xF000"/>\r
<build type="linker-config" subtype="flags" value="--section-start=.text=0xF000"/>\r
\r
<config name="config.compiler.optimization.level" value="size"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
\r
<build type="define" name="BOOT_START_ADDR" value="0x7000"/>\r
<build type="linker-config" subtype="flags" value="--section-start=.text=0x7000"/>\r
\r
<config name="config.compiler.optimization.level" value="size"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
\r
<build type="define" name="BOOT_START_ADDR" value="0x3000"/>\r
<build type="linker-config" subtype="flags" value="--section-start=.text=0x3000"/>\r
\r
<config name="config.compiler.optimization.level" value="size"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
\r
<build type="define" name="BOOT_START_ADDR" value="0x1000"/>\r
<build type="linker-config" subtype="flags" value="--section-start=.text=0x1000"/>\r
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
LEDs_Init();
const uint8_t EntityAddress,
const uint16_t Parameter,
uint16_t* const DataLength,
- uint8_t* Data)
+ uint8_t* Data)
{
/* No audio interface entities in the device descriptor, thus no properties to get or set. */
return false;
#include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/Peripheral/ADC.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
#include "Descriptors.h"
#include "Config/AppConfig.h"
void EVENT_USB_Device_Disconnect(void);
void EVENT_USB_Device_ConfigurationChanged(void);
void EVENT_USB_Device_ControlRequest(void);
-
+
bool CALLBACK_Audio_Device_GetSetEndpointProperty(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo,
const uint8_t EndpointProperty,
const uint8_t EndpointAddress,
<asf xmlversion="1.0">\r
- <project caption="Audio Input Device Demo (Class Driver APIs)" id="lufa.demos.device.class.audio_input.example">\r
+ <project caption="Audio Input Device Demo (Class Driver APIs)" id="lufa.demos.device.class.audio_input.example.avr8">\r
<require idref="lufa.demos.device.class.audio_input"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.device.class.audio_input" caption="Audio Input Device Demo (Class Driver APIs)">\r
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
LEDs_Init();
const uint8_t EntityAddress,
const uint16_t Parameter,
uint16_t* const DataLength,
- uint8_t* Data)
+ uint8_t* Data)
{
/* No audio interface entities in the device descriptor, thus no properties to get or set. */
return false;
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
const uint8_t EntityAddress,
const uint16_t Parameter,
uint16_t* const DataLength,
- uint8_t* Data);
+ uint8_t* Data);
#endif
<asf xmlversion="1.0">\r
- <project caption="Audio Output Device Demo (Class Driver APIs)" id="lufa.demos.device.class.audio_output.example">\r
+ <project caption="Audio Output Device Demo (Class Driver APIs)" id="lufa.demos.device.class.audio_output.example.avr8">\r
<require idref="lufa.demos.device.class.audio_output"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.device.class.audio_output" caption="Audio Output Device Demo (Class Driver APIs)">\r
<require idref="lufa.drivers.usb"/>\r
<require idref="lufa.drivers.board"/>\r
<require idref="lufa.drivers.board.leds"/>\r
- <require idref="lufa.drivers.board.buttons"/>\r
</module>\r
</asf>\r
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 6
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
Joystick_Init();
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
* \li Series 7 USB AVRs (AT90USBxxx7)
* \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
<asf xmlversion="1.0">\r
- <project caption="Dual Virtual Serial Device Demo (Class Driver APIs)" id="lufa.demos.device.class.dual_cdc.example">\r
+ <project caption="Dual Virtual Serial Device Demo (Class Driver APIs)" id="lufa.demos.device.class.dual_cdc.example.avr8">\r
<require idref="lufa.demos.device.class.dual_cdc"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
+ </project>\r
+\r
+ <project caption="Dual Virtual Serial Device Demo (Class Driver APIs)" id="lufa.demos.device.class.dual_cdc.example.xmega">\r
+ <require idref="lufa.demos.device.class.dual_cdc"/>\r
+ <require idref="lufa.boards.dummy.xmega"/>\r
+ <generator value="as5_8"/>\r
+\r
+ <device-support value="atxmega128a1u"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
+\r
+ <build type="define" name="F_CPU" value="32000000UL"/>\r
+ <build type="define" name="F_USB" value="48000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.device.class.dual_cdc" caption="Dual Virtual Serial Device Demo (Class Driver APIs)">\r
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 1
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
LEDs_Init();
#include "Descriptors.h"
#include "Config/AppConfig.h"
-
+
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
* \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
* <tr>
* <td>GENERIC_REPORT_SIZE</td>
* <td>AppConfig.h</td>
- * <td>This token defines the size of the device reports, both sent and received (including report ID byte). The value
+ * <td>This token defines the size of the device reports, both sent and received (including report ID byte). The value
* must be an integer ranging from 1 to 255.</td>
* </tr>
* </table>
<asf xmlversion="1.0">\r
- <project caption="Generic HID Device Demo (Class Driver APIs)" id="lufa.demos.device.class.generic_hid.example">\r
+ <project caption="Generic HID Device Demo (Class Driver APIs)" id="lufa.demos.device.class.generic_hid.example.avr8">\r
<require idref="lufa.demos.device.class.generic_hid"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
+ </project>\r
+\r
+ <project caption="Generic HID Device Demo (Class Driver APIs)" id="lufa.demos.device.class.generic_hid.example.xmega">\r
+ <require idref="lufa.demos.device.class.generic_hid"/>\r
+ <require idref="lufa.boards.dummy.xmega"/>\r
+ <generator value="as5_8"/>\r
+\r
+ <device-support value="atxmega128a1u"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
+\r
+ <build type="define" name="F_CPU" value="32000000UL"/>\r
+ <build type="define" name="F_USB" value="48000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.device.class.generic_hid" caption="Generic HID Device Demo (Class Driver APIs)">\r
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 1
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
Joystick_Init();
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Type Defines: */
/** Type define for the joystick HID report structure, for creating and sending HID reports to the host PC.
* \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
<asf xmlversion="1.0">\r
- <project caption="Joystick HID Device Demo (Class Driver APIs)" id="lufa.demos.device.class.joystick.example">\r
+ <project caption="Joystick HID Device Demo (Class Driver APIs)" id="lufa.demos.device.class.joystick.example.avr8">\r
<require idref="lufa.demos.device.class.joystick"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
+ </project>\r
+\r
+ <project caption="Joystick HID Device Demo (Class Driver APIs)" id="lufa.demos.device.class.joystick.example.xmega">\r
+ <require idref="lufa.demos.device.class.joystick"/>\r
+ <require idref="lufa.boards.dummy.xmega"/>\r
+ <generator value="as5_8"/>\r
+\r
+ <device-support value="atxmega128a1u"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
+\r
+ <build type="define" name="F_CPU" value="32000000UL"/>\r
+ <build type="define" name="F_USB" value="48000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.device.class.joystick" caption="Joystick HID Device Demo (Class Driver APIs)">\r
<require idref="lufa.drivers.usb"/>\r
<require idref="lufa.drivers.board"/>\r
<require idref="lufa.drivers.board.leds"/>\r
+ <require idref="lufa.drivers.board.buttons"/>\r
<require idref="lufa.drivers.board.joystick"/>\r
</module>\r
</asf>\r
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 1
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware()
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
Joystick_Init();
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
* \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
<asf xmlversion="1.0">\r
- <project caption="Keyboard HID Device Demo (Class Driver APIs)" id="lufa.demos.device.class.keyboard.example">\r
+ <project caption="Keyboard HID Device Demo (Class Driver APIs)" id="lufa.demos.device.class.keyboard.example.avr8">\r
<require idref="lufa.demos.device.class.keyboard"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
+ </project>\r
+\r
+ <project caption="Keyboard HID Device Demo (Class Driver APIs)" id="lufa.demos.device.class.keyboard.example.xmega">\r
+ <require idref="lufa.demos.device.class.keyboard"/>\r
+ <require idref="lufa.boards.dummy.xmega"/>\r
+ <generator value="as5_8"/>\r
+\r
+ <device-support value="atxmega128a1u"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
+\r
+ <build type="define" name="F_CPU" value="32000000UL"/>\r
+ <build type="define" name="F_USB" value="48000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.device.class.keyboard" caption="Keyboard HID Device Demo (Class Driver APIs)">\r
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 3
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware()
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
Joystick_Init();
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
* \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
<asf xmlversion="1.0">\r
- <project caption="Keyboard and Mouse HID Device Demo (Class Driver APIs)" id="lufa.demos.device.class.keyboard_mouse.example">\r
+ <project caption="Keyboard and Mouse HID Device Demo (Class Driver APIs)" id="lufa.demos.device.class.keyboard_mouse.example.avr8">\r
<require idref="lufa.demos.device.class.keyboard_mouse"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
+ </project>\r
+\r
+ <project caption="Keyboard and Mouse HID Device Demo (Class Driver APIs)" id="lufa.demos.device.class.keyboard_mouse.example.xmega">\r
+ <require idref="lufa.demos.device.class.keyboard_mouse"/>\r
+ <require idref="lufa.boards.dummy.xmega"/>\r
+ <generator value="as5_8"/>\r
+\r
+ <device-support value="atxmega128a1u"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
+\r
+ <build type="define" name="F_CPU" value="32000000UL"/>\r
+ <build type="define" name="F_USB" value="48000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.device.class.keyboard_mouse" caption="Keyboard and Mouse HID Device Demo (Class Driver APIs)">\r
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 1
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware()
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
Joystick_Init();
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
* \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
<asf xmlversion="1.0">\r
- <project caption="Keyboard and Mouse HID (Multi Report) Device Demo (Class Driver APIs)" id="lufa.demos.device.class.keyboard_mouse_mr.example">\r
+ <project caption="Keyboard and Mouse HID (Multi Report) Device Demo (Class Driver APIs)" id="lufa.demos.device.class.keyboard_mouse_mr.example.avr8">\r
<require idref="lufa.demos.device.class.keyboard_mouse_mr"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
+ </project>\r
+\r
+ <project caption="Keyboard and Mouse HID (Multi Report) Device Demo (Class Driver APIs)" id="lufa.demos.device.class.keyboard_mouse_mr.example.xmega">\r
+ <require idref="lufa.demos.device.class.keyboard_mouse_mr"/>\r
+ <require idref="lufa.boards.dummy.xmega"/>\r
+ <generator value="as5_8"/>\r
+\r
+ <device-support value="atxmega128a1u"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
+\r
+ <build type="define" name="F_CPU" value="32000000UL"/>\r
+ <build type="define" name="F_USB" value="48000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.device.class.keyboard_mouse_mr" caption="Keyboard and Mouse HID (Multi Report) Device Demo (Class Driver APIs)">\r
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 2
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
Joystick_Init();
#include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
* \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
<asf xmlversion="1.0">\r
- <project caption="MIDI Device Demo (Class Driver APIs)" id="lufa.demos.device.class.midi.example">\r
+ <project caption="MIDI Device Demo (Class Driver APIs)" id="lufa.demos.device.class.midi.example.avr8">\r
<require idref="lufa.demos.device.class.midi"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
+ </project>\r
+\r
+ <project caption="MIDI Device Demo (Class Driver APIs)" id="lufa.demos.device.class.midi.example.xmega">\r
+ <require idref="lufa.demos.device.class.midi"/>\r
+ <require idref="lufa.boards.dummy.xmega"/>\r
+ <generator value="as5_8"/>\r
+\r
+ <device-support value="atxmega128a1u"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
+\r
+ <build type="define" name="F_CPU" value="32000000UL"/>\r
+ <build type="define" name="F_USB" value="48000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.device.class.midi" caption="MIDI Device Demo (Class Driver APIs)">\r
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 4
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
LEDs_Init();
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
* \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
<asf xmlversion="1.0">\r
- <project caption="Mass Storage Device Demo (Class Driver APIs)" id="lufa.demos.device.class.mass_storage.example">\r
+ <project caption="Mass Storage Device Demo (Class Driver APIs)" id="lufa.demos.device.class.mass_storage.example.avr8">\r
<require idref="lufa.demos.device.class.mass_storage"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
+ </project>\r
+\r
+ <project caption="Mass Storage Device Demo (Class Driver APIs)" id="lufa.demos.device.class.mass_storage.example.xmega">\r
+ <require idref="lufa.demos.device.class.mass_storage"/>\r
+ <require idref="lufa.boards.dummy.xmega"/>\r
+ <generator value="as5_8"/>\r
+\r
+ <device-support value="atxmega128a1u"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
+\r
+ <build type="define" name="F_CPU" value="32000000UL"/>\r
+ <build type="define" name="F_USB" value="48000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.device.class.mass_storage" caption="Mass Storage Device Demo (Class Driver APIs)">\r
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 5
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
LEDs_Init();
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
* \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
<asf xmlversion="1.0">\r
- <project caption="Mass Storage and HID Keyboard Device Demo (Class Driver APIs)" id="lufa.demos.device.class.mass_storage_keyboard.example">\r
+ <project caption="Mass Storage and HID Keyboard Device Demo (Class Driver APIs)" id="lufa.demos.device.class.mass_storage_keyboard.example.avr8">\r
<require idref="lufa.demos.device.class.mass_storage_keyboard"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
+ </project>\r
+\r
+ <project caption="Mass Storage and HID Keyboard Device Demo (Class Driver APIs)" id="lufa.demos.device.class.mass_storage_keyboard.example.xmega">\r
+ <require idref="lufa.demos.device.class.mass_storage_keyboard"/>\r
+ <require idref="lufa.boards.dummy.xmega"/>\r
+ <generator value="as5_8"/>\r
+\r
+ <device-support value="atxmega128a1u"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
+\r
+ <build type="define" name="F_CPU" value="32000000UL"/>\r
+ <build type="define" name="F_USB" value="48000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.device.class.mass_storage_keyboard" caption="Mass Storage and HID Keyboard Device Demo (Class Driver APIs)">\r
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 1
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
Joystick_Init();
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
* \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
<asf xmlversion="1.0">\r
- <project caption="Mouse HID Device Demo (Class Driver APIs)" id="lufa.demos.device.class.mouse.example">\r
+ <project caption="Mouse HID Device Demo (Class Driver APIs)" id="lufa.demos.device.class.mouse.example.avr8">\r
<require idref="lufa.demos.device.class.mouse"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
+ </project>\r
+\r
+ <project caption="Mouse HID Device Demo (Class Driver APIs)" id="lufa.demos.device.class.mouse.example.xmega">\r
+ <require idref="lufa.demos.device.class.mouse"/>\r
+ <require idref="lufa.boards.dummy.xmega"/>\r
+ <generator value="as5_8"/>\r
+\r
+ <device-support value="atxmega128a1u"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
+\r
+ <build type="define" name="F_CPU" value="32000000UL"/>\r
+ <build type="define" name="F_USB" value="48000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.device.class.mouse" caption="Mouse HID Device Demo (Class Driver APIs)">\r
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 3
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
LEDs_Init();
#include "Lib/ARP.h"
#include "Lib/Webserver.h"
#include "Config/AppConfig.h"
-
+
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
*
* \li Series 7 USB AVRs (AT90USBxxx7)
* \li Series 6 USB AVRs (AT90USBxxx6)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
<asf xmlversion="1.0">\r
- <project caption="RNDIS Ethernet Device Demo (Class Driver APIs)" id="lufa.demos.device.class.rndis.example">\r
+ <project caption="RNDIS Ethernet Device Demo (Class Driver APIs)" id="lufa.demos.device.class.rndis.example.avr8">\r
<require idref="lufa.demos.device.class.rndis"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
+ </project>\r
+\r
+ <project caption="RNDIS Ethernet Device Demo (Class Driver APIs)" id="lufa.demos.device.class.rndis.example.xmega">\r
+ <require idref="lufa.demos.device.class.rndis"/>\r
+ <require idref="lufa.boards.dummy.xmega"/>\r
+ <generator value="as5_8"/>\r
+\r
+ <device-support value="atxmega128a1u"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
+\r
+ <build type="define" name="F_CPU" value="32000000UL"/>\r
+ <build type="define" name="F_USB" value="48000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.device.class.rndis" caption="RNDIS Ethernet Device Demo (Class Driver APIs)">\r
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 4
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
Joystick_Init();
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
* \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
<asf xmlversion="1.0">\r
- <project caption="Virtual Serial CDC Device Demo (Class Driver APIs)" id="lufa.demos.device.class.cdc.example">\r
+ <project caption="Virtual Serial CDC Device Demo (Class Driver APIs)" id="lufa.demos.device.class.cdc.example.avr8">\r
<require idref="lufa.demos.device.class.cdc"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
+ </project>\r
+\r
+ <project caption="Virtual Serial CDC Device Demo (Class Driver APIs)" id="lufa.demos.device.class.cdc.example.xmega">\r
+ <require idref="lufa.demos.device.class.cdc"/>\r
+ <require idref="lufa.boards.dummy.xmega"/>\r
+ <generator value="as5_8"/>\r
+\r
+ <device-support value="atxmega128a1u"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
+\r
+ <build type="define" name="F_CPU" value="32000000UL"/>\r
+ <build type="define" name="F_USB" value="48000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.device.class.cdc" caption="Virtual Serial CDC Device Demo (Class Driver APIs)">\r
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 5
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
LEDs_Init();
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
* \li Series 7 USB AVRs (AT90USBxxx7)
* \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
<asf xmlversion="1.0">\r
- <project caption="Virtual Serial CDC and Mass Storage Device Demo (Class Driver APIs)" id="lufa.demos.device.class.cdc_ms.example">\r
+ <project caption="Virtual Serial CDC and Mass Storage Device Demo (Class Driver APIs)" id="lufa.demos.device.class.cdc_ms.example.avr8">\r
<require idref="lufa.demos.device.class.cdc_ms"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
+ </project>\r
+\r
+ <project caption="Virtual Serial CDC and Mass Storage Device Demo (Class Driver APIs)" id="lufa.demos.device.class.cdc_ms.example.xmega">\r
+ <require idref="lufa.demos.device.class.cdc_ms"/>\r
+ <require idref="lufa.boards.dummy.xmega"/>\r
+ <generator value="as5_8"/>\r
+\r
+ <device-support value="atxmega128a1u"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
+\r
+ <build type="define" name="F_CPU" value="32000000UL"/>\r
+ <build type="define" name="F_USB" value="48000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.device.class.cdc_ms" caption="Virtual Serial CDC and Mass Storage Device Demo (Class Driver APIs)">\r
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 4
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
Joystick_Init();
#include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
* \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
<asf xmlversion="1.0">\r
- <project caption="Virtual Serial CDC and Mouse HID Device Demo (Class Driver APIs)" id="lufa.demos.device.class.cdc_mouse.example">\r
+ <project caption="Virtual Serial CDC and Mouse HID Device Demo (Class Driver APIs)" id="lufa.demos.device.class.cdc_mouse.example.avr8">\r
<require idref="lufa.demos.device.class.cdc_mouse"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
+ </project>\r
+\r
+ <project caption="Virtual Serial CDC and Mouse HID Device Demo (Class Driver APIs)" id="lufa.demos.device.class.cdc_mouse.example.xmega">\r
+ <require idref="lufa.demos.device.class.cdc_mouse"/>\r
+ <require idref="lufa.boards.dummy.xmega"/>\r
+ <generator value="as5_8"/>\r
+\r
+ <device-support value="atxmega128a1u"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
+\r
+ <build type="define" name="F_CPU" value="32000000UL"/>\r
+ <build type="define" name="F_USB" value="48000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.device.class.cdc_mouse" caption="Virtual Serial CDC and Mouse HID Device Demo (Class Driver APIs)">\r
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 4
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
LEDs_Init();
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
-
+
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
+ without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
+ permission notice and warranty disclaimer appear in supporting
+ documentation, and that the name of the author not be used in
+ advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaims all warranties with regard to this
#include "Descriptors.h"
- #include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Board/LEDs.h>
+ #include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
/** LED mask for the library LED driver, to indicate that an error has occurred in the USB interface. */
#define LEDMASK_USB_ERROR (LEDS_LED1 | LEDS_LED3)
-
+
/** LED mask for the library LED driver, to indicate that the USB interface is busy. */
#define LEDMASK_USB_BUSY LEDS_LED2
#define Req_CheckClearStatus 0x06
#define Req_GetCapabilities 0x07
#define Req_IndicatorPulse 0x40
-
+
#define TMC_STATUS_SUCCESS 0x01
#define TMC_STATUS_PENDING 0x02
#define TMC_STATUS_FAILED 0x80
#define TMC_STATUS_TRANSFER_NOT_IN_PROGRESS 0x81
#define TMC_STATUS_SPLIT_NOT_IN_PROGRESS 0x82
#define TMC_STATUS_SPLIT_IN_PROGRESS 0x83
-
+
#define TMC_MESSAGEID_DEV_DEP_MSG_OUT 0x01
#define TMC_MESSAGEID_DEV_DEP_MSG_IN 0x02
#define TMC_MESSAGEID_DEV_VENDOR_OUT 0x7E
uint8_t Reserved;
uint16_t TMCVersion;
-
+
struct
{
unsigned ListenOnly : 1;
unsigned PulseIndicateSupported : 1;
unsigned Reserved : 5;
} Interface;
-
+
struct
{
unsigned SupportsAbortINOnMatch : 1;
unsigned Reserved : 7;
} Device;
-
+
uint8_t Reserved2[6];
- uint8_t Reserved3[12];
+ uint8_t Reserved3[12];
} TMC_Capabilities_t;
-
+
typedef struct
{
uint8_t LastMessageTransaction;
uint8_t InverseTag;
uint8_t Reserved;
uint32_t TransferSize;
-
+
union
{
TMC_DevOUTMessageHeader_t DeviceOUT;
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
LEDs_Init();
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/Peripheral/ADC.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** Maximum audio sample value for the microphone input. */
<asf xmlversion="1.0">\r
- <project caption="Audio Input Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.audio_input.example">\r
+ <project caption="Audio Input Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.audio_input.example.avr8">\r
<require idref="lufa.demos.device.lowlevel.audio_input"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.device.lowlevel.audio_input" caption="Audio Input Device Demo (Low Level APIs)">\r
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
LEDs_Init();
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Board/LEDs.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
<asf xmlversion="1.0">\r
- <project caption="Audio Output Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.audio_output.example">\r
+ <project caption="Audio Output Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.audio_output.example.avr8">\r
<require idref="lufa.demos.device.lowlevel.audio_output"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.device.lowlevel.audio_output" caption="Audio Output Device Demo (Low Level APIs)">\r
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 6
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
#define CDC2_RX_EPADDR (ENDPOINT_DIR_OUT | 5)
/** Endpoint address of the second CDC interface's device-to-host notification IN endpoint. */
- #define CDC2_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 6)
+ #define CDC2_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 6)
/** Size in bytes of the CDC device-to-host notification IN endpoints. */
#define CDC_NOTIFICATION_EPSIZE 8
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
Joystick_Init();
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/Board/LEDs.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
* \li Series 7 USB AVRs (AT90USBxxx7)
* \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
<asf xmlversion="1.0">\r
- <project caption="Dual Virtual Serial Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.dual_cdc.example">\r
+ <project caption="Dual Virtual Serial Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.dual_cdc.example.avr8">\r
<require idref="lufa.demos.device.lowlevel.dual_cdc"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
+ </project>\r
+\r
+ <project caption="Dual Virtual Serial Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.dual_cdc.example.xmega">\r
+ <require idref="lufa.demos.device.lowlevel.dual_cdc"/>\r
+ <require idref="lufa.boards.dummy.xmega"/>\r
+ <generator value="as5_8"/>\r
+\r
+ <device-support value="atxmega128a1u"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
+\r
+ <build type="define" name="F_CPU" value="32000000UL"/>\r
+ <build type="define" name="F_USB" value="48000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.device.lowlevel.dual_cdc" caption="Dual Virtual Serial Device Demo (Low Level APIs)">\r
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 2
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
LEDs_Init();
#include "Descriptors.h"
#include "Config/AppConfig.h"
-
+
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Board/LEDs.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
* \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
* <tr>
* <td>GENERIC_REPORT_SIZE</td>
* <td>AppConfig.h</td>
- * <td>This token defines the size of the device reports, both sent and received (including report ID byte). The value
+ * <td>This token defines the size of the device reports, both sent and received (including report ID byte). The value
* must be an integer ranging from 1 to 255.</td>
* </tr>
* </table>
<asf xmlversion="1.0">\r
- <project caption="Generic HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.generic_hid.example">\r
+ <project caption="Generic HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.generic_hid.example.avr8">\r
<require idref="lufa.demos.device.lowlevel.generic_hid"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
+ </project>\r
+\r
+ <project caption="Generic HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.generic_hid.example.xmega">\r
+ <require idref="lufa.demos.device.lowlevel.generic_hid"/>\r
+ <require idref="lufa.boards.dummy.xmega"/>\r
+ <generator value="as5_8"/>\r
+\r
+ <device-support value="atxmega128a1u"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
+\r
+ <build type="define" name="F_CPU" value="32000000UL"/>\r
+ <build type="define" name="F_USB" value="48000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.device.lowlevel.generic_hid" caption="Generic HID Device Demo (Low Level APIs)">\r
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 1
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
Joystick_Init();
#include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
* \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
<asf xmlversion="1.0">\r
- <project caption="Joystick HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.joystick.example">\r
+ <project caption="Joystick HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.joystick.example.avr8">\r
<require idref="lufa.demos.device.lowlevel.joystick"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
+ </project>\r
+\r
+ <project caption="Joystick HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.joystick.example.xmega">\r
+ <require idref="lufa.demos.device.lowlevel.joystick"/>\r
+ <require idref="lufa.boards.dummy.xmega"/>\r
+ <generator value="as5_8"/>\r
+\r
+ <device-support value="atxmega128a1u"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
+\r
+ <build type="define" name="F_CPU" value="32000000UL"/>\r
+ <build type="define" name="F_USB" value="48000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.device.lowlevel.joystick" caption="Joystick HID Device Demo (Low Level APIs)">\r
<require idref="lufa.drivers.usb"/>\r
<require idref="lufa.drivers.board"/>\r
<require idref="lufa.drivers.board.leds"/>\r
+ <require idref="lufa.drivers.board.buttons"/>\r
<require idref="lufa.drivers.board.joystick"/>\r
</module>\r
</asf>\r
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 2
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
Joystick_Init();
else
{
/* Check to see if the report data has changed - if so a report MUST be sent */
- SendReport = (memcmp(&PrevKeyboardReportData, &KeyboardReportData, sizeof(USB_KeyboardReport_Data_t)) != 0);
+ SendReport = (memcmp(&PrevKeyboardReportData, &KeyboardReportData, sizeof(USB_KeyboardReport_Data_t)) != 0);
}
/* Select the Keyboard Report Endpoint */
#include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/Board/LEDs.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
* \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
<asf xmlversion="1.0">\r
- <project caption="Keyboard HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.keyboard.example">\r
+ <project caption="Keyboard HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.keyboard.example.avr8">\r
<require idref="lufa.demos.device.lowlevel.keyboard"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
+ </project>\r
+\r
+ <project caption="Keyboard HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.keyboard.example.xmega">\r
+ <require idref="lufa.demos.device.lowlevel.keyboard"/>\r
+ <require idref="lufa.boards.dummy.xmega"/>\r
+ <generator value="as5_8"/>\r
+\r
+ <device-support value="atxmega128a1u"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
+\r
+ <build type="define" name="F_CPU" value="32000000UL"/>\r
+ <build type="define" name="F_USB" value="48000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.device.lowlevel.keyboard" caption="Keyboard HID Device Demo (Low Level APIs)">\r
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 3
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
Joystick_Init();
#include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
* \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
<asf xmlversion="1.0">\r
- <project caption="Keyboard and Mouse HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.keyboard_mouse.example">\r
+ <project caption="Keyboard and Mouse HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.keyboard_mouse.example.avr8">\r
<require idref="lufa.demos.device.lowlevel.keyboard_mouse"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
+ </project>\r
+\r
+ <project caption="Keyboard and Mouse HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.keyboard_mouse.example.xmega">\r
+ <require idref="lufa.demos.device.lowlevel.keyboard_mouse"/>\r
+ <require idref="lufa.boards.dummy.xmega"/>\r
+ <generator value="as5_8"/>\r
+\r
+ <device-support value="atxmega128a1u"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
+\r
+ <build type="define" name="F_CPU" value="32000000UL"/>\r
+ <build type="define" name="F_USB" value="48000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.device.lowlevel.keyboard_mouse" caption="Keyboard and Mouse HID Device Demo (Low Level APIs)">\r
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 2
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
Joystick_Init();
#include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
* \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
<asf xmlversion="1.0">\r
- <project caption="MIDI Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.midi.example">\r
+ <project caption="MIDI Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.midi.example.avr8">\r
<require idref="lufa.demos.device.lowlevel.midi"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
+ </project>\r
+\r
+ <project caption="MIDI Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.midi.example.xmega">\r
+ <require idref="lufa.demos.device.lowlevel.midi"/>\r
+ <require idref="lufa.boards.dummy.xmega"/>\r
+ <generator value="as5_8"/>\r
+\r
+ <device-support value="atxmega128a1u"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
+\r
+ <build type="define" name="F_CPU" value="32000000UL"/>\r
+ <build type="define" name="F_USB" value="48000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.device.lowlevel.midi" caption="MIDI Device Demo (Low Level APIs)">\r
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 4
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
LEDs_Init();
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Dataflash.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
* \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
<asf xmlversion="1.0">\r
- <project caption="Mass Storage Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.mass_storage.example">\r
+ <project caption="Mass Storage Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.mass_storage.example.avr8">\r
<require idref="lufa.demos.device.lowlevel.mass_storage"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
+ </project>\r
+\r
+ <project caption="Mass Storage Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.mass_storage.example.xmega">\r
+ <require idref="lufa.demos.device.lowlevel.mass_storage"/>\r
+ <require idref="lufa.boards.dummy.xmega"/>\r
+ <generator value="as5_8"/>\r
+\r
+ <device-support value="atxmega128a1u"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
+\r
+ <build type="define" name="F_CPU" value="32000000UL"/>\r
+ <build type="define" name="F_USB" value="48000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.device.lowlevel.mass_storage" caption="Mass Storage Device Demo (Low Level APIs)">\r
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 1
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
Joystick_Init();
#include <string.h>
#include "Descriptors.h"
-
+
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
* \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
<asf xmlversion="1.0">\r
- <project caption="Mouse HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.mouse.example">\r
+ <project caption="Mouse HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.mouse.example.avr8">\r
<require idref="lufa.demos.device.lowlevel.mouse"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
+ </project>\r
+\r
+ <project caption="Mouse HID Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.mouse.example.xmega">\r
+ <require idref="lufa.demos.device.lowlevel.mouse"/>\r
+ <require idref="lufa.boards.dummy.xmega"/>\r
+ <generator value="as5_8"/>\r
+\r
+ <device-support value="atxmega128a1u"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
+\r
+ <build type="define" name="F_CPU" value="32000000UL"/>\r
+ <build type="define" name="F_USB" value="48000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.device.lowlevel.mouse" caption="Mouse HID Device Demo (Low Level APIs)">\r
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 3
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
LEDs_Init();
#include "Lib/ARP.h"
#include "Lib/Webserver.h"
#include "Config/AppConfig.h"
-
+
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Peripheral/Serial.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** Notification value to indicate that a frame is ready to be read by the host. */
*
* \li Series 7 USB AVRs (AT90USBxxx7)
* \li Series 6 USB AVRs (AT90USBxxx6)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
<asf xmlversion="1.0">\r
- <project caption="RNDIS Ethernet Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.rndis.example">\r
+ <project caption="RNDIS Ethernet Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.rndis.example.avr8">\r
<require idref="lufa.demos.device.lowlevel.rndis"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
+ </project>\r
+\r
+ <project caption="RNDIS Ethernet Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.rndis.example.xmega">\r
+ <require idref="lufa.demos.device.lowlevel.rndis"/>\r
+ <require idref="lufa.boards.dummy.xmega"/>\r
+ <generator value="as5_8"/>\r
+\r
+ <device-support value="atxmega128a1u"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
+\r
+ <build type="define" name="F_CPU" value="32000000UL"/>\r
+ <build type="define" name="F_USB" value="48000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.device.lowlevel.rndis" caption="RNDIS Ethernet Device Demo (Low Level APIs)">\r
// #define NO_AUTO_VBUS_MANAGEMENT
// #define INVERTED_VBUS_ENABLE_LINE
+ #elif (ARCH == ARCH_XMEGA)
+
+ /* Non-USB Related Configuration Tokens: */
+// #define DISABLE_TERMINAL_CODES
+
+ /* USB Class Driver Related Tokens: */
+// #define HID_HOST_BOOT_PROTOCOL_ONLY
+// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here}
+// #define HID_USAGE_STACK_DEPTH {Insert Value Here}
+// #define HID_MAX_COLLECTIONS {Insert Value Here}
+// #define HID_MAX_REPORTITEMS {Insert Value Here}
+// #define HID_MAX_REPORT_IDS {Insert Value Here}
+// #define NO_CLASS_DRIVER_AUTOFLUSH
+
+ /* General USB Driver Related Tokens: */
+ #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH)
+// #define USB_STREAM_TIMEOUT_MS {Insert Value Here}
+// #define NO_LIMITED_CONTROLLER_CONNECT
+// #define NO_SOF_EVENTS
+
+ /* USB Device Mode Driver Related Tokens: */
+// #define USE_RAM_DESCRIPTORS
+ #define USE_FLASH_DESCRIPTORS
+// #define USE_EEPROM_DESCRIPTORS
+// #define NO_INTERNAL_SERIAL
+ #define FIXED_CONTROL_ENDPOINT_SIZE 8
+// #define DEVICE_STATE_AS_GPIOR {Insert Value Here}
+ #define FIXED_NUM_CONFIGURATIONS 1
+// #define CONTROL_ONLY_DEVICE
+ #define MAX_ENDPOINT_INDEX 4
+// #define NO_DEVICE_REMOTE_WAKEUP
+// #define NO_DEVICE_SELF_POWER
+
#else
#error Unsupported architecture for this LUFA configuration file.
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#elif (ARCH == ARCH_XMEGA)
+ /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */
+ XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU);
+ XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL);
+
+ /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */
+ XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ);
+ XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB);
+
+ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm;
+#endif
/* Hardware Initialization */
Joystick_Init();
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/Board/LEDs.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
* \li Series 6 USB AVRs (AT90USBxxx6)
* \li Series 4 USB AVRs (ATMEGAxxU4)
* \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2)
+ * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU)
+ * \li Series B XMEGA AVRs (ATXMEGAxxxBxU)
+ * \li Series C XMEGA AVRs (ATXMEGAxxxCxU)
*
* \section Sec_Info USB Information:
*
<asf xmlversion="1.0">\r
- <project caption="Virtual Serial CDC Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.cdc.example">\r
+ <project caption="Virtual Serial CDC Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.cdc.example.avr8">\r
<require idref="lufa.demos.device.lowlevel.cdc"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
+ </project>\r
+\r
+ <project caption="Virtual Serial CDC Device Demo (Low Level APIs)" id="lufa.demos.device.lowlevel.cdc.example.xmega">\r
+ <require idref="lufa.demos.device.lowlevel.cdc"/>\r
+ <require idref="lufa.boards.dummy.xmega"/>\r
+ <generator value="as5_8"/>\r
+\r
+ <device-support value="atxmega128a1u"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
+\r
+ <build type="define" name="F_CPU" value="32000000UL"/>\r
+ <build type="define" name="F_USB" value="48000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.device.lowlevel.cdc" caption="Virtual Serial CDC Device Demo (Low Level APIs)">\r
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
Serial_Init(9600, false);
#include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
#include "Descriptors.h"
#include "DeviceFunctions.h"
/* Function Prototypes: */
void SetupHardware(void);
-
+
void EVENT_USB_UIDChange(void);
#endif
<asf xmlversion="1.0">\r
- <project caption="Mouse HID Dual USB Mode Demo (Class Driver APIs)" id="lufa.demos.dualrole.class.mouse.example">\r
+ <project caption="Mouse HID Dual USB Mode Demo (Class Driver APIs)" id="lufa.demos.dualrole.class.mouse.example.avr8">\r
<require idref="lufa.demos.dualrole.class.mouse"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.dualrole.class.mouse" caption="Mouse HID Dual USB Mode Demo (Class Driver APIs)">\r
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
Serial_Init(9600, false);
#include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
<asf xmlversion="1.0">\r
- <project caption="Android Accessory Host Demo (Class Driver APIs)" id="lufa.demos.host.class.android.example">\r
+ <project caption="Android Accessory Host Demo (Class Driver APIs)" id="lufa.demos.host.class.android.example.avr8">\r
<require idref="lufa.demos.host.class.android"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.host.class.android" caption="Android Accessory Host Demo (Class Driver APIs)">\r
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
Serial_Init(9600, false);
#include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
<asf xmlversion="1.0">\r
- <project caption="Audio Input Host Demo (Class Driver APIs)" id="lufa.demos.host.class.audio_input.example">\r
+ <project caption="Audio Input Host Demo (Class Driver APIs)" id="lufa.demos.host.class.audio_input.example.avr8">\r
<require idref="lufa.demos.host.class.audio_input"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.host.class.audio_input" caption="Audio Input Host Demo (Class Driver APIs)">\r
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
Serial_Init(9600, false);
/* Create a stdio stream for the serial port for stdin and stdout */
Serial_CreateStream(NULL);
-
+
/* Start the ADC conversion in free running mode */
- ADC_StartReading(ADC_REFERENCE_AVCC | ADC_RIGHT_ADJUSTED | ADC_GET_CHANNEL_MASK(MIC_IN_ADC_CHANNEL));
+ ADC_StartReading(ADC_REFERENCE_AVCC | ADC_RIGHT_ADJUSTED | ADC_GET_CHANNEL_MASK(MIC_IN_ADC_CHANNEL));
}
/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h>
-
+ #include <LUFA/Platform/Platform.h>
+
#include "Config/AppConfig.h"
/* Macros: */
<asf xmlversion="1.0">\r
- <project caption="Audio Output Host Demo (Class Driver APIs)" id="lufa.demos.host.class.audio_output.example">\r
+ <project caption="Audio Output Host Demo (Class Driver APIs)" id="lufa.demos.host.class.audio_output.example.avr8">\r
<require idref="lufa.demos.host.class.audio_output"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.host.class.audio_output" caption="Audio Output Host Demo (Class Driver APIs)">\r
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
Serial_Init(9600, false);
#include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
<asf xmlversion="1.0">\r
- <project caption="Joystick HID (with parser) Host Demo (Class Driver APIs)" id="lufa.demos.host.class.joystick_parser.example">\r
+ <project caption="Joystick HID (with parser) Host Demo (Class Driver APIs)" id="lufa.demos.host.class.joystick_parser.example.avr8">\r
<require idref="lufa.demos.host.class.joystick_parser"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.host.class.joystick_parser" caption="Joystick HID (with parser) Host Demo (Class Driver APIs)">\r
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
Serial_Init(9600, false);
#include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
<asf xmlversion="1.0">\r
- <project caption="Keyboard HID Host Demo (Class Driver APIs)" id="lufa.demos.host.class.keyboard.example">\r
+ <project caption="Keyboard HID Host Demo (Class Driver APIs)" id="lufa.demos.host.class.keyboard.example.avr8">\r
<require idref="lufa.demos.host.class.keyboard"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.host.class.keyboard" caption="Keyboard HID Host Demo (Class Driver APIs)">\r
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
Serial_Init(9600, false);
#include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
<asf xmlversion="1.0">\r
- <project caption="Keyboard HID (with parser) Host Demo (Class Driver APIs)" id="lufa.demos.host.class.keyboard_parser.example">\r
+ <project caption="Keyboard HID (with parser) Host Demo (Class Driver APIs)" id="lufa.demos.host.class.keyboard_parser.example.avr8">\r
<require idref="lufa.demos.host.class.keyboard_parser"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.host.class.keyboard_parser" caption="Keyboard HID (with parser) Host Demo (Class Driver APIs)">\r
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
Serial_Init(9600, false);
#include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
<asf xmlversion="1.0">\r
- <project caption="MIDI Host Demo (Class Driver APIs)" id="lufa.demos.host.class.midi.example">\r
+ <project caption="MIDI Host Demo (Class Driver APIs)" id="lufa.demos.host.class.midi.example.avr8">\r
<require idref="lufa.demos.host.class.midi"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.host.class.midi" caption="MIDI Host Demo (Class Driver APIs)">\r
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
Serial_Init(9600, false);
#include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
<asf xmlversion="1.0">\r
- <project caption="Mass Storage Host Demo (Class Driver APIs)" id="lufa.demos.host.class.ms.example">\r
+ <project caption="Mass Storage Host Demo (Class Driver APIs)" id="lufa.demos.host.class.ms.example.avr8">\r
<require idref="lufa.demos.host.class.ms"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.host.class.ms" caption="Mass Storage Host Demo (Class Driver APIs)">\r
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
Serial_Init(9600, false);
#include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
<asf xmlversion="1.0">\r
- <project caption="Mouse HID Host Demo (Class Driver APIs)" id="lufa.demos.host.class.mouse.example">\r
+ <project caption="Mouse HID Host Demo (Class Driver APIs)" id="lufa.demos.host.class.mouse.example.avr8">\r
<require idref="lufa.demos.host.class.mouse"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.host.class.mouse" caption="Mouse HID Host Demo (Class Driver APIs)">\r
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
Serial_Init(9600, false);
#include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
<asf xmlversion="1.0">\r
- <project caption="Mouse HID (with parser) Host Demo (Class Driver APIs)" id="lufa.demos.host.class.mouse_parser.example">\r
+ <project caption="Mouse HID (with parser) Host Demo (Class Driver APIs)" id="lufa.demos.host.class.mouse_parser.example.avr8">\r
<require idref="lufa.demos.host.class.mouse_parser"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.host.class.mouse_parser" caption="Mouse HID (with parser) Host Demo (Class Driver APIs)">\r
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
Serial_Init(9600, false);
#include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
<asf xmlversion="1.0">\r
- <project caption="Printer Host Demo (Class Driver APIs)" id="lufa.demos.host.class.printer.example">\r
+ <project caption="Printer Host Demo (Class Driver APIs)" id="lufa.demos.host.class.printer.example.avr8">\r
<require idref="lufa.demos.host.class.printer"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.host.class.printer" caption="Printer Host Demo (Class Driver APIs)">\r
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
Serial_Init(9600, false);
#include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
<asf xmlversion="1.0">\r
- <project caption="RNDIS Ethernet Host Demo (Class Driver APIs)" id="lufa.demos.host.class.rndis.example">\r
+ <project caption="RNDIS Ethernet Host Demo (Class Driver APIs)" id="lufa.demos.host.class.rndis.example.avr8">\r
<require idref="lufa.demos.host.class.rndis"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.host.class.rndis" caption="RNDIS Ethernet Host Demo (Class Driver APIs)">\r
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
Serial_Init(9600, false);
#include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
<asf xmlversion="1.0">\r
- <project caption="Still Image Host Demo (Class Driver APIs)" id="lufa.demos.host.class.si.example">\r
+ <project caption="Still Image Host Demo (Class Driver APIs)" id="lufa.demos.host.class.si.example.avr8">\r
<require idref="lufa.demos.host.class.si"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.host.class.si" caption="Still Image Host Demo (Class Driver APIs)">\r
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
Serial_Init(9600, false);
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
return;
}
-
+
VirtualSerial_CDC_Interface.State.LineEncoding.BaudRateBPS = 9600;
VirtualSerial_CDC_Interface.State.LineEncoding.CharFormat = CDC_LINEENCODING_OneStopBit;
VirtualSerial_CDC_Interface.State.LineEncoding.ParityType = CDC_PARITY_None;
VirtualSerial_CDC_Interface.State.LineEncoding.DataBits = 8;
-
+
if (CDC_Host_SetLineEncoding(&VirtualSerial_CDC_Interface))
{
puts_P(PSTR("Error Setting Device Line Encoding.\r\n"));
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
- return;
+ return;
}
puts_P(PSTR("CDC Device Enumerated.\r\n"));
#include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
<asf xmlversion="1.0">\r
- <project caption="Virtual Serial CDC Host Demo (Class Driver APIs)" id="lufa.demos.host.class.cdc.example">\r
+ <project caption="Virtual Serial CDC Host Demo (Class Driver APIs)" id="lufa.demos.host.class.cdc.example.avr8">\r
<require idref="lufa.demos.host.class.cdc"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.host.class.cdc" caption="Virtual Serial CDC Host Demo (Class Driver APIs)">\r
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
Serial_Init(9600, false);
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
<asf xmlversion="1.0">\r
- <project caption="Android Accessory Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.android.example">\r
+ <project caption="Android Accessory Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.android.example.avr8">\r
<require idref="lufa.demos.host.lowlevel.android"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.host.lowlevel.android" caption="Android Accessory Host Demo (Low Level APIs)">\r
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
Serial_Init(9600, false);
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h>
+ #include <LUFA/Platform/Platform.h>
#include "ConfigDescriptor.h"
<asf xmlversion="1.0">\r
- <project caption="Audio Input Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.audio_input.example">\r
+ <project caption="Audio Input Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.audio_input.example.avr8">\r
<require idref="lufa.demos.host.lowlevel.audio_input"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.host.lowlevel.audio_input" caption="Audio Input Host Demo (Low Level APIs)">\r
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
Serial_Init(9600, false);
Serial_CreateStream(NULL);
/* Start the ADC conversion in free running mode */
- ADC_StartReading(ADC_REFERENCE_AVCC | ADC_RIGHT_ADJUSTED | ADC_GET_CHANNEL_MASK(MIC_IN_ADC_CHANNEL));
+ ADC_StartReading(ADC_REFERENCE_AVCC | ADC_RIGHT_ADJUSTED | ADC_GET_CHANNEL_MASK(MIC_IN_ADC_CHANNEL));
}
/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and
#include <LUFA/Drivers/Peripheral/ADC.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h>
+ #include <LUFA/Platform/Platform.h>
#include "ConfigDescriptor.h"
#include "Config/AppConfig.h"
<asf xmlversion="1.0">\r
- <project caption="Audio Output Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.audio_output.example">\r
+ <project caption="Audio Output Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.audio_output.example.avr8">\r
<require idref="lufa.demos.host.lowlevel.audio_output"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.host.lowlevel.audio_output" caption="Audio Output Host Demo (Low Level APIs)">\r
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
Serial_Init(9600, false);
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h>
+ #include <LUFA/Platform/Platform.h>
#include "ConfigDescriptor.h"
<asf xmlversion="1.0">\r
- <project caption="Generic HID Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.generic_hid.example">\r
+ <project caption="Generic HID Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.generic_hid.example.avr8">\r
<require idref="lufa.demos.host.lowlevel.generic_hid"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.host.lowlevel.generic_hid" caption="Generic HID Host Demo (Low Level APIs)">\r
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
Serial_Init(9600, false);
#include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
#include "ConfigDescriptor.h"
#include "HIDReport.h"
<asf xmlversion="1.0">\r
- <project caption="Joystick HID (with parser) Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.joystick_parser.example">\r
+ <project caption="Joystick HID (with parser) Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.joystick_parser.example.avr8">\r
<require idref="lufa.demos.host.lowlevel.joystick_parser"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.host.lowlevel.joystick_parser" caption="Joystick HID (with parser) Host Demo (Low Level APIs)">\r
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
Serial_Init(9600, false);
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h>
+ #include <LUFA/Platform/Platform.h>
#include "ConfigDescriptor.h"
<asf xmlversion="1.0">\r
- <project caption="Keyboard HID Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.keyboard.example">\r
+ <project caption="Keyboard HID Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.keyboard.example.avr8">\r
<require idref="lufa.demos.host.lowlevel.keyboard"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.host.lowlevel.keyboard" caption="Keyboard HID Host Demo (Low Level APIs)">\r
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
Serial_Init(9600, false);
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h>
+ #include <LUFA/Platform/Platform.h>
#include "ConfigDescriptor.h"
#include "HIDReport.h"
<asf xmlversion="1.0">\r
- <project caption="Keyboard HID (with parser) Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.keyboard_parser.example">\r
+ <project caption="Keyboard HID (with parser) Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.keyboard_parser.example.avr8">\r
<require idref="lufa.demos.host.lowlevel.keyboard_parser"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.host.lowlevel.keyboard_parser" caption="Keyboard HID (with parser) Host Demo (Low Level APIs)">\r
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
Serial_Init(9600, false);
MIDIEvent.Data2, MIDIEvent.Data3);
}
}
-
+
Pipe_Freeze();
Pipe_SelectPipe(MIDI_DATA_OUT_PIPE);
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/Board/Joystick.h>
+ #include <LUFA/Platform/Platform.h>
#include "ConfigDescriptor.h"
<asf xmlversion="1.0">\r
- <project caption="MIDI Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.midi.example">\r
+ <project caption="MIDI Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.midi.example.avr8">\r
<require idref="lufa.demos.host.lowlevel.midi"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.host.lowlevel.midi" caption="MIDI Host Demo (Low Level APIs)">\r
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
Serial_Init(9600, false);
#include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
<asf xmlversion="1.0">\r
- <project caption="Mass Storage Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.ms.example">\r
+ <project caption="Mass Storage Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.ms.example.avr8">\r
<require idref="lufa.demos.host.lowlevel.ms"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.host.lowlevel.ms" caption="Mass Storage Host Demo (Low Level APIs)">\r
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
Serial_Init(9600, false);
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h>
+ #include <LUFA/Platform/Platform.h>
#include "ConfigDescriptor.h"
<asf xmlversion="1.0">\r
- <project caption="Mouse HID Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.mouse.example">\r
+ <project caption="Mouse HID Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.mouse.example.avr8">\r
<require idref="lufa.demos.host.lowlevel.mouse"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.host.lowlevel.mouse" caption="Mouse HID Host Demo (Low Level APIs)">\r
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
Serial_Init(9600, false);
#include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
#include "ConfigDescriptor.h"
#include "HIDReport.h"
<asf xmlversion="1.0">\r
- <project caption="Mouse HID (with parser) Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.mouse_parser.example">\r
+ <project caption="Mouse HID (with parser) Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.mouse_parser.example.avr8">\r
<require idref="lufa.demos.host.lowlevel.mouse_parser"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.host.lowlevel.mouse_parser" caption="Mouse HID (with parser) Host Demo (Low Level APIs)">\r
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
Serial_Init(9600, false);
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
<asf xmlversion="1.0">\r
- <project caption="Printer Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.printer.example">\r
+ <project caption="Printer Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.printer.example.avr8">\r
<require idref="lufa.demos.host.lowlevel.printer"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.host.lowlevel.printer" caption="Printer Host Demo (Low Level APIs)">\r
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
Serial_Init(9600, false);
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h>
+ #include <LUFA/Platform/Platform.h>
#include "Lib/RNDISCommands.h"
<asf xmlversion="1.0">\r
- <project caption="RNDIS Ethernet Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.rndis.example">\r
+ <project caption="RNDIS Ethernet Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.rndis.example.avr8">\r
<require idref="lufa.demos.host.lowlevel.rndis"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.host.lowlevel.rndis" caption="RNDIS Ethernet Host Demo (Low Level APIs)">\r
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
- /* Disable Clock Division */
- CLKPR = (1 << CLKPCE);
- CLKPR = 0;
+ /* Disable clock division */
+ clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
Serial_Init(9600, false);
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
<asf xmlversion="1.0">\r
- <project caption="Still Image Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.si.example">\r
+ <project caption="Still Image Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.si.example.avr8">\r
<require idref="lufa.demos.host.lowlevel.si"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.host.lowlevel.si" caption="Still Image Host Demo (Low Level APIs)">\r
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
Serial_Init(9600, false);
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h>
+ #include <LUFA/Platform/Platform.h>
#include "ConfigDescriptor.h"
<asf xmlversion="1.0">\r
- <project caption="Virtual Serial CDC Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.cdc.example">\r
+ <project caption="Virtual Serial CDC Host Demo (Low Level APIs)" id="lufa.demos.host.lowlevel.cdc.example.avr8">\r
<require idref="lufa.demos.host.lowlevel.cdc"/>\r
<require idref="lufa.boards.dummy.avr8"/>\r
<generator value="as5_8"/>\r
\r
<device-support value="at90usb1287"/>\r
- <config name="lufa.drivers.board.name" value="usbkey"/>\r
+ <config name="lufa.drivers.board.name" value="none"/>\r
\r
- <build type="define" name="F_CPU" value="8000000UL"/>\r
- <build type="define" name="F_USB" value="8000000UL"/>\r
+ <build type="define" name="F_CPU" value="16000000UL"/>\r
+ <build type="define" name="F_USB" value="16000000UL"/>\r
</project>\r
\r
<module type="application" id="lufa.demos.host.lowlevel.cdc" caption="Virtual Serial CDC Host Demo (Low Level APIs)">\r
* - Library Applications:
* - Added new Printer class bootloader
* - Added new Mass Storage class bootloader
+ * - Added XMEGA support for class driver device demos (where applicable)
*
* <b>Changed:</b>
* - Core:
* - 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)
+ * - All board drivers now implement dummy functions and constants when BOARD is set to NONE
*
* <b>Fixed:</b>
* - Core:
#include "../../Common/Common.h"
#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)
#include "AVR8/USBKEY/Buttons.h"
#elif (BOARD == BOARD_STK525)
/* Includes: */
#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)
#include "AVR8/USBKEY/Dataflash.h"
#elif (BOARD == BOARD_STK525)
* \code
* // Initialize the board Joystick driver before first use
* Joystick_Init();
- *
+ *
* printf("Waiting for joystick movement...\r\n");
- *
+ *
* // Loop until a the joystick has been moved
* uint8_t JoystickMovement;
* while (!(JoystickMovement = Joystick_GetStatus())) {};
- *
+ *
* // Display which direction the joystick was moved in
* printf("Joystick moved:\r\n");
- *
+ *
* if (JoystickMovement & (JOY_UP | JOY_DOWN))
* printf("%s ", (JoystickMovement & JOY_UP) ? "Up" : "Down");
- *
+ *
* if (JoystickMovement & (JOY_LEFT | JOY_RIGHT))
* printf("%s ", (JoystickMovement & JOY_LEFT) ? "Left" : "Right");
- *
+ *
* if (JoystickMovement & JOY_PRESS)
* printf("Pressed");
* \endcode
#include "../../Common/Common.h"
#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)
#include "AVR8/USBKEY/Joystick.h"
#elif (BOARD == BOARD_STK525)
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
LEDs_Init();
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
#if defined(ADC)
#include <LUFA/Drivers/Peripheral/ADC.h>
void EVENT_USB_Device_Connect(void);
void EVENT_USB_Device_Disconnect(void);
void EVENT_USB_Device_ConfigurationChanged(void);
-
+
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
const uint8_t wIndex,
const void** const DescriptorAddress,
uint8_t* const DescriptorMemorySpace)
- ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3) ATTR_NON_NULL_PTR_ARG(4);
+ ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3) ATTR_NON_NULL_PTR_ARG(4);
#endif
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
+ /* Disable clock division */
+ clock_prescale_set(clock_div_1);
+#endif
+
/* Hardware Initialization */
LEDs_Init();
USB_Init();
#include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Misc/RingBuffer.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate TX activity. */
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
Serial_Init(9600, false);
#include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
LEDs_Init();
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Function Prototypes: */
void SetupHardware(void);
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
LEDs_Init();
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
Magstripe_Init();
#include "Config/AppConfig.h"
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** Total number of tracks which can be read from the card, between 1 and 3. */
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware()
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
Joystick_Init();
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
LEDs_Init();
#include <LUFA/Drivers/Board/Buttons.h>
#include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/Board/LEDs.h>
+ #include <LUFA/Platform/Platform.h>
#include "ConfigDescriptor.h"
/** Configures the board hardware and chip peripherals for the project's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
USB_Init();
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
#define RELAY1 (1 << 7)
this software.
*/
-/** \file
+/** \file
*
* Main source file for the SerialToLCD program. This file contains the main tasks of
* the project and is responsible for the initial application hardware configuration.
{
static uint8_t EscapePending = 0;
int16_t HD44780Byte = RingBuffer_Remove(&FromHost_Buffer);
-
+
if (HD44780Byte == COMMAND_ESCAPE)
{
if (EscapePending)
/** Configures the board hardware and chip peripherals for the application's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
USB_Init();
/* Power up the HD44780 Interface */
HD44780_Initialize();
HD44780_WriteCommand(CMD_DISPLAY_ON);
-
+
/* Start the flush timer so that overflows occur rapidly to push received bytes to the USB interface */
TCCR0B = (1 << CS02);
}
#include <LUFA/Version.h>
#include <LUFA/Drivers/Misc/RingBuffer.h>
#include <LUFA/Drivers/USB/USB.h>
-
+ #include <LUFA/Platform/Platform.h>
+
/* Macros: */
#define COMMAND_ESCAPE 0x1B
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
LEDs_Init();
#include "Lib/FATFs/ff.h"
#include "Lib/DS1307.h"
#include "Config/AppConfig.h"
-
+
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Temperature.h>
#include <LUFA/Drivers/Peripheral/ADC.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
LEDs_Init();
#include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Misc/RingBuffer.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Hardware Initialization */
SPI_Init(SPI_SPEED_FCPU_DIV_2 | SPI_SCK_LEAD_FALLING | SPI_SAMPLE_TRAILING | SPI_MODE_MASTER);
#include <LUFA/Drivers/Board/Dataflash.h>
#include <LUFA/Drivers/Peripheral/SPI.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
#include "USBDeviceMode.h"
#include "USBHostMode.h"
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
+#if (ARCH == ARCH_AVR8)
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
+#endif
/* Disable JTAG debugging */
MCUCR |= (1 << JTD);
#if defined(RESET_TOGGLES_LIBUSB_COMPAT)
UpdateCurrentCompatibilityMode();
#endif
-
- /* USB Stack Initialization */
+
+ /* USB Stack Initialization */
USB_Init();
}
#include "USARTDescriptors.h"
- #include "AVRISPDescriptors.h"
+ #include "AVRISPDescriptors.h"
#include "Lib/V2Protocol.h"
#include "Lib/SoftUART.h"
#include "Config/AppConfig.h"
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Misc/RingBuffer.h>
#include <LUFA/Drivers/USB/USB.h>
+ #include <LUFA/Platform/Platform.h>
/* Macros: */
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
const uint8_t wIndex,
const void** const DescriptorAddress,
uint8_t* const DescriptorMemorySpace)
- ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3) ATTR_NON_NULL_PTR_ARG(4);
+ ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3) ATTR_NON_NULL_PTR_ARG(4);
#endif