diff --git a/Bootloaders/CDC/BootloaderCDC.h b/Bootloaders/CDC/BootloaderCDC.h index b0d08d8805..89f90a6a23 100644 --- a/Bootloaders/CDC/BootloaderCDC.h +++ b/Bootloaders/CDC/BootloaderCDC.h @@ -51,6 +51,7 @@ #include #include + #include /* Preprocessor Checks: */ #if !defined(__OPTIMIZE_SIZE__) diff --git a/Bootloaders/CDC/asf.xml b/Bootloaders/CDC/asf.xml index 6f0fa643c5..bddbcffc28 100644 --- a/Bootloaders/CDC/asf.xml +++ b/Bootloaders/CDC/asf.xml @@ -9,8 +9,8 @@ - - + + @@ -33,8 +33,8 @@ - - + + @@ -57,8 +57,8 @@ - - + + @@ -81,8 +81,8 @@ - - + + @@ -105,8 +105,8 @@ - - + + diff --git a/Bootloaders/DFU/BootloaderDFU.h b/Bootloaders/DFU/BootloaderDFU.h index 72bb691d42..3d6d906494 100644 --- a/Bootloaders/DFU/BootloaderDFU.h +++ b/Bootloaders/DFU/BootloaderDFU.h @@ -53,6 +53,7 @@ #include #include + #include /* Preprocessor Checks: */ #if !defined(__OPTIMIZE_SIZE__) diff --git a/Bootloaders/DFU/asf.xml b/Bootloaders/DFU/asf.xml index 746dca72f5..0a547c336f 100644 --- a/Bootloaders/DFU/asf.xml +++ b/Bootloaders/DFU/asf.xml @@ -9,8 +9,8 @@ - - + + @@ -33,8 +33,8 @@ - - + + @@ -57,8 +57,8 @@ - - + + @@ -79,8 +79,8 @@ - - + + @@ -101,8 +101,8 @@ - - + + diff --git a/Bootloaders/HID/BootloaderHID.h b/Bootloaders/HID/BootloaderHID.h index df9e39e377..92304dc8de 100644 --- a/Bootloaders/HID/BootloaderHID.h +++ b/Bootloaders/HID/BootloaderHID.h @@ -47,6 +47,7 @@ #include "Descriptors.h" #include + #include /* Preprocessor Checks: */ #if !defined(__OPTIMIZE_SIZE__) diff --git a/Bootloaders/HID/asf.xml b/Bootloaders/HID/asf.xml index 793b3e55d3..91fb35ebfa 100644 --- a/Bootloaders/HID/asf.xml +++ b/Bootloaders/HID/asf.xml @@ -9,8 +9,8 @@ - - + + @@ -26,8 +26,8 @@ - - + + @@ -43,8 +43,8 @@ - - + + @@ -60,8 +60,8 @@ - - + + @@ -77,8 +77,8 @@ - - + + diff --git a/Bootloaders/MassStorage/BootloaderMassStorage.h b/Bootloaders/MassStorage/BootloaderMassStorage.h index ec66d940e7..1fcce9063c 100644 --- a/Bootloaders/MassStorage/BootloaderMassStorage.h +++ b/Bootloaders/MassStorage/BootloaderMassStorage.h @@ -49,6 +49,7 @@ #include #include + #include /* Preprocessor Checks: */ #if !defined(__OPTIMIZE_SIZE__) diff --git a/Bootloaders/MassStorage/asf.xml b/Bootloaders/MassStorage/asf.xml index 07a6f80078..11633dc5a6 100644 --- a/Bootloaders/MassStorage/asf.xml +++ b/Bootloaders/MassStorage/asf.xml @@ -9,8 +9,8 @@ - - + + @@ -35,8 +35,8 @@ - - + + @@ -61,8 +61,8 @@ - - + + @@ -90,8 +90,8 @@ - - + + diff --git a/Bootloaders/Printer/BootloaderPrinter.h b/Bootloaders/Printer/BootloaderPrinter.h index 67789de0c4..1e91288581 100644 --- a/Bootloaders/Printer/BootloaderPrinter.h +++ b/Bootloaders/Printer/BootloaderPrinter.h @@ -44,8 +44,9 @@ #include "Descriptors.h" - #include #include + #include + #include /* Preprocessor Checks: */ #if !defined(__OPTIMIZE_SIZE__) diff --git a/Bootloaders/Printer/asf.xml b/Bootloaders/Printer/asf.xml index 5773bf6ea2..b7621ac1ba 100644 --- a/Bootloaders/Printer/asf.xml +++ b/Bootloaders/Printer/asf.xml @@ -9,8 +9,8 @@ - - + + @@ -33,8 +33,8 @@ - - + + @@ -57,8 +57,8 @@ - - + + @@ -81,8 +81,8 @@ - - + + @@ -105,8 +105,8 @@ - - + + diff --git a/Demos/Device/ClassDriver/AudioInput/AudioInput.c b/Demos/Device/ClassDriver/AudioInput/AudioInput.c index c5ba9bca13..9eec39ca25 100644 --- a/Demos/Device/ClassDriver/AudioInput/AudioInput.c +++ b/Demos/Device/ClassDriver/AudioInput/AudioInput.c @@ -79,12 +79,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ LEDs_Init(); @@ -265,7 +267,7 @@ bool CALLBACK_Audio_Device_GetSetInterfaceProperty(USB_ClassInfo_Audio_Device_t* const uint8_t EntityAddress, const uint16_t Parameter, uint16_t* const DataLength, - uint8_t* Data) + uint8_t* Data) { /* No audio interface entities in the device descriptor, thus no properties to get or set. */ return false; diff --git a/Demos/Device/ClassDriver/AudioInput/AudioInput.h b/Demos/Device/ClassDriver/AudioInput/AudioInput.h index 093f3eefa4..14bbd2ea0d 100644 --- a/Demos/Device/ClassDriver/AudioInput/AudioInput.h +++ b/Demos/Device/ClassDriver/AudioInput/AudioInput.h @@ -46,6 +46,7 @@ #include #include #include + #include #include "Descriptors.h" #include "Config/AppConfig.h" @@ -76,7 +77,7 @@ void EVENT_USB_Device_Disconnect(void); void EVENT_USB_Device_ConfigurationChanged(void); void EVENT_USB_Device_ControlRequest(void); - + bool CALLBACK_Audio_Device_GetSetEndpointProperty(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo, const uint8_t EndpointProperty, const uint8_t EndpointAddress, diff --git a/Demos/Device/ClassDriver/AudioInput/asf.xml b/Demos/Device/ClassDriver/AudioInput/asf.xml index b61714e9f9..2a60a1eb12 100644 --- a/Demos/Device/ClassDriver/AudioInput/asf.xml +++ b/Demos/Device/ClassDriver/AudioInput/asf.xml @@ -1,14 +1,14 @@ - + - + - - + + diff --git a/Demos/Device/ClassDriver/AudioOutput/AudioOutput.c b/Demos/Device/ClassDriver/AudioOutput/AudioOutput.c index 22d19a4d55..81fd95b169 100644 --- a/Demos/Device/ClassDriver/AudioOutput/AudioOutput.c +++ b/Demos/Device/ClassDriver/AudioOutput/AudioOutput.c @@ -79,12 +79,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ LEDs_Init(); @@ -302,7 +304,7 @@ bool CALLBACK_Audio_Device_GetSetInterfaceProperty(USB_ClassInfo_Audio_Device_t* const uint8_t EntityAddress, const uint16_t Parameter, uint16_t* const DataLength, - uint8_t* Data) + uint8_t* Data) { /* No audio interface entities in the device descriptor, thus no properties to get or set. */ return false; diff --git a/Demos/Device/ClassDriver/AudioOutput/AudioOutput.h b/Demos/Device/ClassDriver/AudioOutput/AudioOutput.h index 802bec9246..bf2d3c8a7b 100644 --- a/Demos/Device/ClassDriver/AudioOutput/AudioOutput.h +++ b/Demos/Device/ClassDriver/AudioOutput/AudioOutput.h @@ -48,6 +48,7 @@ #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ @@ -81,6 +82,6 @@ const uint8_t EntityAddress, const uint16_t Parameter, uint16_t* const DataLength, - uint8_t* Data); + uint8_t* Data); #endif diff --git a/Demos/Device/ClassDriver/AudioOutput/asf.xml b/Demos/Device/ClassDriver/AudioOutput/asf.xml index dacdbd5c6a..c7b0768ed0 100644 --- a/Demos/Device/ClassDriver/AudioOutput/asf.xml +++ b/Demos/Device/ClassDriver/AudioOutput/asf.xml @@ -1,14 +1,14 @@ - + - + - - + + @@ -45,6 +45,5 @@ - diff --git a/Demos/Device/ClassDriver/DualVirtualSerial/Config/LUFAConfig.h b/Demos/Device/ClassDriver/DualVirtualSerial/Config/LUFAConfig.h index 3b33e2d04a..d2f780a0b6 100644 --- a/Demos/Device/ClassDriver/DualVirtualSerial/Config/LUFAConfig.h +++ b/Demos/Device/ClassDriver/DualVirtualSerial/Config/LUFAConfig.h @@ -85,6 +85,39 @@ // #define NO_AUTO_VBUS_MANAGEMENT // #define INVERTED_VBUS_ENABLE_LINE + #elif (ARCH == ARCH_XMEGA) + + /* Non-USB Related Configuration Tokens: */ +// #define DISABLE_TERMINAL_CODES + + /* USB Class Driver Related Tokens: */ +// #define HID_HOST_BOOT_PROTOCOL_ONLY +// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here} +// #define HID_USAGE_STACK_DEPTH {Insert Value Here} +// #define HID_MAX_COLLECTIONS {Insert Value Here} +// #define HID_MAX_REPORTITEMS {Insert Value Here} +// #define HID_MAX_REPORT_IDS {Insert Value Here} +// #define NO_CLASS_DRIVER_AUTOFLUSH + + /* General USB Driver Related Tokens: */ + #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH) +// #define USB_STREAM_TIMEOUT_MS {Insert Value Here} +// #define NO_LIMITED_CONTROLLER_CONNECT +// #define NO_SOF_EVENTS + + /* USB Device Mode Driver Related Tokens: */ +// #define USE_RAM_DESCRIPTORS + #define USE_FLASH_DESCRIPTORS +// #define USE_EEPROM_DESCRIPTORS +// #define NO_INTERNAL_SERIAL + #define FIXED_CONTROL_ENDPOINT_SIZE 8 +// #define DEVICE_STATE_AS_GPIOR {Insert Value Here} + #define FIXED_NUM_CONFIGURATIONS 1 +// #define CONTROL_ONLY_DEVICE + #define MAX_ENDPOINT_INDEX 6 +// #define NO_DEVICE_REMOTE_WAKEUP +// #define NO_DEVICE_SELF_POWER + #else #error Unsupported architecture for this LUFA configuration file. diff --git a/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.c b/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.c index b7d0455051..eaba6185ab 100644 --- a/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.c +++ b/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.c @@ -131,12 +131,24 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#elif (ARCH == ARCH_XMEGA) + /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */ + XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU); + XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL); + + /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */ + XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ); + XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB); + + PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm; +#endif /* Hardware Initialization */ Joystick_Init(); diff --git a/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.h b/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.h index 0f4ae58929..c0447af8e2 100644 --- a/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.h +++ b/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.h @@ -48,6 +48,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.txt b/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.txt index 70e95ad51d..1e8d3c5317 100644 --- a/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.txt +++ b/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.txt @@ -13,6 +13,9 @@ * \li Series 7 USB AVRs (AT90USBxxx7) * \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 4 USB AVRs (ATMEGAxxU4) + * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU) + * \li Series B XMEGA AVRs (ATXMEGAxxxBxU) + * \li Series C XMEGA AVRs (ATXMEGAxxxCxU) * * \section Sec_Info USB Information: * diff --git a/Demos/Device/ClassDriver/DualVirtualSerial/asf.xml b/Demos/Device/ClassDriver/DualVirtualSerial/asf.xml index 11a23eb214..78ca488ca5 100644 --- a/Demos/Device/ClassDriver/DualVirtualSerial/asf.xml +++ b/Demos/Device/ClassDriver/DualVirtualSerial/asf.xml @@ -1,14 +1,26 @@ - + - + - - + + + + + + + + + + + + + + diff --git a/Demos/Device/ClassDriver/GenericHID/Config/LUFAConfig.h b/Demos/Device/ClassDriver/GenericHID/Config/LUFAConfig.h index 3244d3bb7b..3871759b67 100644 --- a/Demos/Device/ClassDriver/GenericHID/Config/LUFAConfig.h +++ b/Demos/Device/ClassDriver/GenericHID/Config/LUFAConfig.h @@ -85,6 +85,39 @@ // #define NO_AUTO_VBUS_MANAGEMENT // #define INVERTED_VBUS_ENABLE_LINE + #elif (ARCH == ARCH_XMEGA) + + /* Non-USB Related Configuration Tokens: */ +// #define DISABLE_TERMINAL_CODES + + /* USB Class Driver Related Tokens: */ +// #define HID_HOST_BOOT_PROTOCOL_ONLY +// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here} +// #define HID_USAGE_STACK_DEPTH {Insert Value Here} +// #define HID_MAX_COLLECTIONS {Insert Value Here} +// #define HID_MAX_REPORTITEMS {Insert Value Here} +// #define HID_MAX_REPORT_IDS {Insert Value Here} +// #define NO_CLASS_DRIVER_AUTOFLUSH + + /* General USB Driver Related Tokens: */ + #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH) +// #define USB_STREAM_TIMEOUT_MS {Insert Value Here} +// #define NO_LIMITED_CONTROLLER_CONNECT +// #define NO_SOF_EVENTS + + /* USB Device Mode Driver Related Tokens: */ +// #define USE_RAM_DESCRIPTORS + #define USE_FLASH_DESCRIPTORS +// #define USE_EEPROM_DESCRIPTORS +// #define NO_INTERNAL_SERIAL + #define FIXED_CONTROL_ENDPOINT_SIZE 8 +// #define DEVICE_STATE_AS_GPIOR {Insert Value Here} + #define FIXED_NUM_CONFIGURATIONS 1 +// #define CONTROL_ONLY_DEVICE + #define MAX_ENDPOINT_INDEX 1 +// #define NO_DEVICE_REMOTE_WAKEUP +// #define NO_DEVICE_SELF_POWER + #else #error Unsupported architecture for this LUFA configuration file. diff --git a/Demos/Device/ClassDriver/GenericHID/GenericHID.c b/Demos/Device/ClassDriver/GenericHID/GenericHID.c index 95dd44d16c..aae3ea75a4 100644 --- a/Demos/Device/ClassDriver/GenericHID/GenericHID.c +++ b/Demos/Device/ClassDriver/GenericHID/GenericHID.c @@ -80,12 +80,24 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#elif (ARCH == ARCH_XMEGA) + /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */ + XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU); + XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL); + + /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */ + XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ); + XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB); + + PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm; +#endif /* Hardware Initialization */ LEDs_Init(); diff --git a/Demos/Device/ClassDriver/GenericHID/GenericHID.h b/Demos/Device/ClassDriver/GenericHID/GenericHID.h index bb0a6cc7e7..7b7ac9cb58 100644 --- a/Demos/Device/ClassDriver/GenericHID/GenericHID.h +++ b/Demos/Device/ClassDriver/GenericHID/GenericHID.h @@ -45,9 +45,10 @@ #include "Descriptors.h" #include "Config/AppConfig.h" - + #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Device/ClassDriver/GenericHID/GenericHID.txt b/Demos/Device/ClassDriver/GenericHID/GenericHID.txt index 3d72345f32..1402740399 100644 --- a/Demos/Device/ClassDriver/GenericHID/GenericHID.txt +++ b/Demos/Device/ClassDriver/GenericHID/GenericHID.txt @@ -14,6 +14,9 @@ * \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) + * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU) + * \li Series B XMEGA AVRs (ATXMEGAxxxBxU) + * \li Series C XMEGA AVRs (ATXMEGAxxxCxU) * * \section Sec_Info USB Information: * @@ -68,7 +71,7 @@ * * GENERIC_REPORT_SIZE * AppConfig.h - * This token defines the size of the device reports, both sent and received (including report ID byte). The value + * 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. * * diff --git a/Demos/Device/ClassDriver/GenericHID/asf.xml b/Demos/Device/ClassDriver/GenericHID/asf.xml index 2b1ee5f8ac..f64c7da3d7 100644 --- a/Demos/Device/ClassDriver/GenericHID/asf.xml +++ b/Demos/Device/ClassDriver/GenericHID/asf.xml @@ -1,14 +1,26 @@ - + - + - - + + + + + + + + + + + + + + diff --git a/Demos/Device/ClassDriver/Joystick/Config/LUFAConfig.h b/Demos/Device/ClassDriver/Joystick/Config/LUFAConfig.h index 3244d3bb7b..3871759b67 100644 --- a/Demos/Device/ClassDriver/Joystick/Config/LUFAConfig.h +++ b/Demos/Device/ClassDriver/Joystick/Config/LUFAConfig.h @@ -85,6 +85,39 @@ // #define NO_AUTO_VBUS_MANAGEMENT // #define INVERTED_VBUS_ENABLE_LINE + #elif (ARCH == ARCH_XMEGA) + + /* Non-USB Related Configuration Tokens: */ +// #define DISABLE_TERMINAL_CODES + + /* USB Class Driver Related Tokens: */ +// #define HID_HOST_BOOT_PROTOCOL_ONLY +// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here} +// #define HID_USAGE_STACK_DEPTH {Insert Value Here} +// #define HID_MAX_COLLECTIONS {Insert Value Here} +// #define HID_MAX_REPORTITEMS {Insert Value Here} +// #define HID_MAX_REPORT_IDS {Insert Value Here} +// #define NO_CLASS_DRIVER_AUTOFLUSH + + /* General USB Driver Related Tokens: */ + #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH) +// #define USB_STREAM_TIMEOUT_MS {Insert Value Here} +// #define NO_LIMITED_CONTROLLER_CONNECT +// #define NO_SOF_EVENTS + + /* USB Device Mode Driver Related Tokens: */ +// #define USE_RAM_DESCRIPTORS + #define USE_FLASH_DESCRIPTORS +// #define USE_EEPROM_DESCRIPTORS +// #define NO_INTERNAL_SERIAL + #define FIXED_CONTROL_ENDPOINT_SIZE 8 +// #define DEVICE_STATE_AS_GPIOR {Insert Value Here} + #define FIXED_NUM_CONFIGURATIONS 1 +// #define CONTROL_ONLY_DEVICE + #define MAX_ENDPOINT_INDEX 1 +// #define NO_DEVICE_REMOTE_WAKEUP +// #define NO_DEVICE_SELF_POWER + #else #error Unsupported architecture for this LUFA configuration file. diff --git a/Demos/Device/ClassDriver/Joystick/Joystick.c b/Demos/Device/ClassDriver/Joystick/Joystick.c index c4576ba00a..809c410608 100644 --- a/Demos/Device/ClassDriver/Joystick/Joystick.c +++ b/Demos/Device/ClassDriver/Joystick/Joystick.c @@ -80,12 +80,24 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#elif (ARCH == ARCH_XMEGA) + /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */ + XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU); + XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL); + + /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */ + XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ); + XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB); + + PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm; +#endif /* Hardware Initialization */ Joystick_Init(); diff --git a/Demos/Device/ClassDriver/Joystick/Joystick.h b/Demos/Device/ClassDriver/Joystick/Joystick.h index 5eafa616da..037e03dff9 100644 --- a/Demos/Device/ClassDriver/Joystick/Joystick.h +++ b/Demos/Device/ClassDriver/Joystick/Joystick.h @@ -49,6 +49,7 @@ #include #include #include + #include /* Type Defines: */ /** Type define for the joystick HID report structure, for creating and sending HID reports to the host PC. diff --git a/Demos/Device/ClassDriver/Joystick/Joystick.txt b/Demos/Device/ClassDriver/Joystick/Joystick.txt index 55be2c3005..e3aec3d703 100644 --- a/Demos/Device/ClassDriver/Joystick/Joystick.txt +++ b/Demos/Device/ClassDriver/Joystick/Joystick.txt @@ -14,6 +14,9 @@ * \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) + * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU) + * \li Series B XMEGA AVRs (ATXMEGAxxxBxU) + * \li Series C XMEGA AVRs (ATXMEGAxxxCxU) * * \section Sec_Info USB Information: * diff --git a/Demos/Device/ClassDriver/Joystick/asf.xml b/Demos/Device/ClassDriver/Joystick/asf.xml index 2cae1e5be1..e43b1c607f 100644 --- a/Demos/Device/ClassDriver/Joystick/asf.xml +++ b/Demos/Device/ClassDriver/Joystick/asf.xml @@ -1,14 +1,26 @@ - + - + - - + + + + + + + + + + + + + + @@ -43,6 +55,7 @@ + diff --git a/Demos/Device/ClassDriver/Keyboard/Config/LUFAConfig.h b/Demos/Device/ClassDriver/Keyboard/Config/LUFAConfig.h index 3244d3bb7b..3871759b67 100644 --- a/Demos/Device/ClassDriver/Keyboard/Config/LUFAConfig.h +++ b/Demos/Device/ClassDriver/Keyboard/Config/LUFAConfig.h @@ -85,6 +85,39 @@ // #define NO_AUTO_VBUS_MANAGEMENT // #define INVERTED_VBUS_ENABLE_LINE + #elif (ARCH == ARCH_XMEGA) + + /* Non-USB Related Configuration Tokens: */ +// #define DISABLE_TERMINAL_CODES + + /* USB Class Driver Related Tokens: */ +// #define HID_HOST_BOOT_PROTOCOL_ONLY +// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here} +// #define HID_USAGE_STACK_DEPTH {Insert Value Here} +// #define HID_MAX_COLLECTIONS {Insert Value Here} +// #define HID_MAX_REPORTITEMS {Insert Value Here} +// #define HID_MAX_REPORT_IDS {Insert Value Here} +// #define NO_CLASS_DRIVER_AUTOFLUSH + + /* General USB Driver Related Tokens: */ + #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH) +// #define USB_STREAM_TIMEOUT_MS {Insert Value Here} +// #define NO_LIMITED_CONTROLLER_CONNECT +// #define NO_SOF_EVENTS + + /* USB Device Mode Driver Related Tokens: */ +// #define USE_RAM_DESCRIPTORS + #define USE_FLASH_DESCRIPTORS +// #define USE_EEPROM_DESCRIPTORS +// #define NO_INTERNAL_SERIAL + #define FIXED_CONTROL_ENDPOINT_SIZE 8 +// #define DEVICE_STATE_AS_GPIOR {Insert Value Here} + #define FIXED_NUM_CONFIGURATIONS 1 +// #define CONTROL_ONLY_DEVICE + #define MAX_ENDPOINT_INDEX 1 +// #define NO_DEVICE_REMOTE_WAKEUP +// #define NO_DEVICE_SELF_POWER + #else #error Unsupported architecture for this LUFA configuration file. diff --git a/Demos/Device/ClassDriver/Keyboard/Keyboard.c b/Demos/Device/ClassDriver/Keyboard/Keyboard.c index 5c7a6f1410..b3cc67e1e6 100644 --- a/Demos/Device/ClassDriver/Keyboard/Keyboard.c +++ b/Demos/Device/ClassDriver/Keyboard/Keyboard.c @@ -80,12 +80,24 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware() { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#elif (ARCH == ARCH_XMEGA) + /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */ + XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU); + XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL); + + /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */ + XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ); + XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB); + + PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm; +#endif /* Hardware Initialization */ Joystick_Init(); diff --git a/Demos/Device/ClassDriver/Keyboard/Keyboard.h b/Demos/Device/ClassDriver/Keyboard/Keyboard.h index 853430a7e8..38f50d11de 100644 --- a/Demos/Device/ClassDriver/Keyboard/Keyboard.h +++ b/Demos/Device/ClassDriver/Keyboard/Keyboard.h @@ -50,6 +50,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Device/ClassDriver/Keyboard/Keyboard.txt b/Demos/Device/ClassDriver/Keyboard/Keyboard.txt index 3e7ff88ed6..9b4375b2e3 100644 --- a/Demos/Device/ClassDriver/Keyboard/Keyboard.txt +++ b/Demos/Device/ClassDriver/Keyboard/Keyboard.txt @@ -14,6 +14,9 @@ * \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) + * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU) + * \li Series B XMEGA AVRs (ATXMEGAxxxBxU) + * \li Series C XMEGA AVRs (ATXMEGAxxxCxU) * * \section Sec_Info USB Information: * diff --git a/Demos/Device/ClassDriver/Keyboard/asf.xml b/Demos/Device/ClassDriver/Keyboard/asf.xml index f2989105b3..5defbeec4d 100644 --- a/Demos/Device/ClassDriver/Keyboard/asf.xml +++ b/Demos/Device/ClassDriver/Keyboard/asf.xml @@ -1,14 +1,26 @@ - + - + - - + + + + + + + + + + + + + + diff --git a/Demos/Device/ClassDriver/KeyboardMouse/Config/LUFAConfig.h b/Demos/Device/ClassDriver/KeyboardMouse/Config/LUFAConfig.h index 3244d3bb7b..4873f80315 100644 --- a/Demos/Device/ClassDriver/KeyboardMouse/Config/LUFAConfig.h +++ b/Demos/Device/ClassDriver/KeyboardMouse/Config/LUFAConfig.h @@ -85,6 +85,39 @@ // #define NO_AUTO_VBUS_MANAGEMENT // #define INVERTED_VBUS_ENABLE_LINE + #elif (ARCH == ARCH_XMEGA) + + /* Non-USB Related Configuration Tokens: */ +// #define DISABLE_TERMINAL_CODES + + /* USB Class Driver Related Tokens: */ +// #define HID_HOST_BOOT_PROTOCOL_ONLY +// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here} +// #define HID_USAGE_STACK_DEPTH {Insert Value Here} +// #define HID_MAX_COLLECTIONS {Insert Value Here} +// #define HID_MAX_REPORTITEMS {Insert Value Here} +// #define HID_MAX_REPORT_IDS {Insert Value Here} +// #define NO_CLASS_DRIVER_AUTOFLUSH + + /* General USB Driver Related Tokens: */ + #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH) +// #define USB_STREAM_TIMEOUT_MS {Insert Value Here} +// #define NO_LIMITED_CONTROLLER_CONNECT +// #define NO_SOF_EVENTS + + /* USB Device Mode Driver Related Tokens: */ +// #define USE_RAM_DESCRIPTORS + #define USE_FLASH_DESCRIPTORS +// #define USE_EEPROM_DESCRIPTORS +// #define NO_INTERNAL_SERIAL + #define FIXED_CONTROL_ENDPOINT_SIZE 8 +// #define DEVICE_STATE_AS_GPIOR {Insert Value Here} + #define FIXED_NUM_CONFIGURATIONS 1 +// #define CONTROL_ONLY_DEVICE + #define MAX_ENDPOINT_INDEX 3 +// #define NO_DEVICE_REMOTE_WAKEUP +// #define NO_DEVICE_SELF_POWER + #else #error Unsupported architecture for this LUFA configuration file. diff --git a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c index 6b2e9bb404..f663f1683d 100644 --- a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c +++ b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c @@ -106,12 +106,24 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware() { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#elif (ARCH == ARCH_XMEGA) + /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */ + XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU); + XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL); + + /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */ + XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ); + XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB); + + PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm; +#endif /* Hardware Initialization */ Joystick_Init(); diff --git a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.h b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.h index 7019849019..2f1d01b043 100644 --- a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.h +++ b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.h @@ -45,6 +45,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.txt b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.txt index b994422a8f..20c89cc80c 100644 --- a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.txt +++ b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.txt @@ -14,6 +14,9 @@ * \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) + * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU) + * \li Series B XMEGA AVRs (ATXMEGAxxxBxU) + * \li Series C XMEGA AVRs (ATXMEGAxxxCxU) * * \section Sec_Info USB Information: * diff --git a/Demos/Device/ClassDriver/KeyboardMouse/asf.xml b/Demos/Device/ClassDriver/KeyboardMouse/asf.xml index a530eed6d4..9e3bd49566 100644 --- a/Demos/Device/ClassDriver/KeyboardMouse/asf.xml +++ b/Demos/Device/ClassDriver/KeyboardMouse/asf.xml @@ -1,14 +1,26 @@ - + - + - - + + + + + + + + + + + + + + diff --git a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Config/LUFAConfig.h b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Config/LUFAConfig.h index 3244d3bb7b..3871759b67 100644 --- a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Config/LUFAConfig.h +++ b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Config/LUFAConfig.h @@ -85,6 +85,39 @@ // #define NO_AUTO_VBUS_MANAGEMENT // #define INVERTED_VBUS_ENABLE_LINE + #elif (ARCH == ARCH_XMEGA) + + /* Non-USB Related Configuration Tokens: */ +// #define DISABLE_TERMINAL_CODES + + /* USB Class Driver Related Tokens: */ +// #define HID_HOST_BOOT_PROTOCOL_ONLY +// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here} +// #define HID_USAGE_STACK_DEPTH {Insert Value Here} +// #define HID_MAX_COLLECTIONS {Insert Value Here} +// #define HID_MAX_REPORTITEMS {Insert Value Here} +// #define HID_MAX_REPORT_IDS {Insert Value Here} +// #define NO_CLASS_DRIVER_AUTOFLUSH + + /* General USB Driver Related Tokens: */ + #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH) +// #define USB_STREAM_TIMEOUT_MS {Insert Value Here} +// #define NO_LIMITED_CONTROLLER_CONNECT +// #define NO_SOF_EVENTS + + /* USB Device Mode Driver Related Tokens: */ +// #define USE_RAM_DESCRIPTORS + #define USE_FLASH_DESCRIPTORS +// #define USE_EEPROM_DESCRIPTORS +// #define NO_INTERNAL_SERIAL + #define FIXED_CONTROL_ENDPOINT_SIZE 8 +// #define DEVICE_STATE_AS_GPIOR {Insert Value Here} + #define FIXED_NUM_CONFIGURATIONS 1 +// #define CONTROL_ONLY_DEVICE + #define MAX_ENDPOINT_INDEX 1 +// #define NO_DEVICE_REMOTE_WAKEUP +// #define NO_DEVICE_SELF_POWER + #else #error Unsupported architecture for this LUFA configuration file. diff --git a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.c b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.c index b371041975..f15d134ffc 100644 --- a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.c +++ b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.c @@ -80,12 +80,24 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware() { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#elif (ARCH == ARCH_XMEGA) + /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */ + XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU); + XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL); + + /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */ + XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ); + XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB); + + PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm; +#endif /* Hardware Initialization */ Joystick_Init(); diff --git a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.h b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.h index 7019849019..2f1d01b043 100644 --- a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.h +++ b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.h @@ -45,6 +45,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.txt b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.txt index e99a7dc74b..6ff910e167 100644 --- a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.txt +++ b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.txt @@ -14,6 +14,9 @@ * \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) + * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU) + * \li Series B XMEGA AVRs (ATXMEGAxxxBxU) + * \li Series C XMEGA AVRs (ATXMEGAxxxCxU) * * \section Sec_Info USB Information: * diff --git a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/asf.xml b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/asf.xml index 7c6d76dfd5..65858aa26a 100644 --- a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/asf.xml +++ b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/asf.xml @@ -1,14 +1,26 @@ - + - + - - + + + + + + + + + + + + + + diff --git a/Demos/Device/ClassDriver/MIDI/Config/LUFAConfig.h b/Demos/Device/ClassDriver/MIDI/Config/LUFAConfig.h index 3244d3bb7b..a4ca3437f8 100644 --- a/Demos/Device/ClassDriver/MIDI/Config/LUFAConfig.h +++ b/Demos/Device/ClassDriver/MIDI/Config/LUFAConfig.h @@ -85,6 +85,39 @@ // #define NO_AUTO_VBUS_MANAGEMENT // #define INVERTED_VBUS_ENABLE_LINE + #elif (ARCH == ARCH_XMEGA) + + /* Non-USB Related Configuration Tokens: */ +// #define DISABLE_TERMINAL_CODES + + /* USB Class Driver Related Tokens: */ +// #define HID_HOST_BOOT_PROTOCOL_ONLY +// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here} +// #define HID_USAGE_STACK_DEPTH {Insert Value Here} +// #define HID_MAX_COLLECTIONS {Insert Value Here} +// #define HID_MAX_REPORTITEMS {Insert Value Here} +// #define HID_MAX_REPORT_IDS {Insert Value Here} +// #define NO_CLASS_DRIVER_AUTOFLUSH + + /* General USB Driver Related Tokens: */ + #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH) +// #define USB_STREAM_TIMEOUT_MS {Insert Value Here} +// #define NO_LIMITED_CONTROLLER_CONNECT +// #define NO_SOF_EVENTS + + /* USB Device Mode Driver Related Tokens: */ +// #define USE_RAM_DESCRIPTORS + #define USE_FLASH_DESCRIPTORS +// #define USE_EEPROM_DESCRIPTORS +// #define NO_INTERNAL_SERIAL + #define FIXED_CONTROL_ENDPOINT_SIZE 8 +// #define DEVICE_STATE_AS_GPIOR {Insert Value Here} + #define FIXED_NUM_CONFIGURATIONS 1 +// #define CONTROL_ONLY_DEVICE + #define MAX_ENDPOINT_INDEX 2 +// #define NO_DEVICE_REMOTE_WAKEUP +// #define NO_DEVICE_SELF_POWER + #else #error Unsupported architecture for this LUFA configuration file. diff --git a/Demos/Device/ClassDriver/MIDI/MIDI.c b/Demos/Device/ClassDriver/MIDI/MIDI.c index 139c65e343..bec442883f 100644 --- a/Demos/Device/ClassDriver/MIDI/MIDI.c +++ b/Demos/Device/ClassDriver/MIDI/MIDI.c @@ -92,12 +92,24 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#elif (ARCH == ARCH_XMEGA) + /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */ + XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU); + XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL); + + /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */ + XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ); + XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB); + + PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm; +#endif /* Hardware Initialization */ Joystick_Init(); diff --git a/Demos/Device/ClassDriver/MIDI/MIDI.h b/Demos/Device/ClassDriver/MIDI/MIDI.h index 54dbef2ab6..ca4fa3b8a0 100644 --- a/Demos/Device/ClassDriver/MIDI/MIDI.h +++ b/Demos/Device/ClassDriver/MIDI/MIDI.h @@ -50,6 +50,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Device/ClassDriver/MIDI/MIDI.txt b/Demos/Device/ClassDriver/MIDI/MIDI.txt index 362250c41e..9ac3d9ea82 100644 --- a/Demos/Device/ClassDriver/MIDI/MIDI.txt +++ b/Demos/Device/ClassDriver/MIDI/MIDI.txt @@ -14,6 +14,9 @@ * \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) + * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU) + * \li Series B XMEGA AVRs (ATXMEGAxxxBxU) + * \li Series C XMEGA AVRs (ATXMEGAxxxCxU) * * \section Sec_Info USB Information: * diff --git a/Demos/Device/ClassDriver/MIDI/asf.xml b/Demos/Device/ClassDriver/MIDI/asf.xml index 6212b482a8..8a7479d002 100644 --- a/Demos/Device/ClassDriver/MIDI/asf.xml +++ b/Demos/Device/ClassDriver/MIDI/asf.xml @@ -1,14 +1,26 @@ - + - + - - + + + + + + + + + + + + + + diff --git a/Demos/Device/ClassDriver/MassStorage/Config/LUFAConfig.h b/Demos/Device/ClassDriver/MassStorage/Config/LUFAConfig.h index 3b33e2d04a..da728ec292 100644 --- a/Demos/Device/ClassDriver/MassStorage/Config/LUFAConfig.h +++ b/Demos/Device/ClassDriver/MassStorage/Config/LUFAConfig.h @@ -85,6 +85,39 @@ // #define NO_AUTO_VBUS_MANAGEMENT // #define INVERTED_VBUS_ENABLE_LINE + #elif (ARCH == ARCH_XMEGA) + + /* Non-USB Related Configuration Tokens: */ +// #define DISABLE_TERMINAL_CODES + + /* USB Class Driver Related Tokens: */ +// #define HID_HOST_BOOT_PROTOCOL_ONLY +// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here} +// #define HID_USAGE_STACK_DEPTH {Insert Value Here} +// #define HID_MAX_COLLECTIONS {Insert Value Here} +// #define HID_MAX_REPORTITEMS {Insert Value Here} +// #define HID_MAX_REPORT_IDS {Insert Value Here} +// #define NO_CLASS_DRIVER_AUTOFLUSH + + /* General USB Driver Related Tokens: */ + #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH) +// #define USB_STREAM_TIMEOUT_MS {Insert Value Here} +// #define NO_LIMITED_CONTROLLER_CONNECT +// #define NO_SOF_EVENTS + + /* USB Device Mode Driver Related Tokens: */ +// #define USE_RAM_DESCRIPTORS + #define USE_FLASH_DESCRIPTORS +// #define USE_EEPROM_DESCRIPTORS +// #define NO_INTERNAL_SERIAL + #define FIXED_CONTROL_ENDPOINT_SIZE 8 +// #define DEVICE_STATE_AS_GPIOR {Insert Value Here} + #define FIXED_NUM_CONFIGURATIONS 1 +// #define CONTROL_ONLY_DEVICE + #define MAX_ENDPOINT_INDEX 4 +// #define NO_DEVICE_REMOTE_WAKEUP +// #define NO_DEVICE_SELF_POWER + #else #error Unsupported architecture for this LUFA configuration file. diff --git a/Demos/Device/ClassDriver/MassStorage/MassStorage.c b/Demos/Device/ClassDriver/MassStorage/MassStorage.c index 598698a198..a0fa7a2a9b 100644 --- a/Demos/Device/ClassDriver/MassStorage/MassStorage.c +++ b/Demos/Device/ClassDriver/MassStorage/MassStorage.c @@ -82,12 +82,24 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#elif (ARCH == ARCH_XMEGA) + /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */ + XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU); + XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL); + + /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */ + XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ); + XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB); + + PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm; +#endif /* Hardware Initialization */ LEDs_Init(); diff --git a/Demos/Device/ClassDriver/MassStorage/MassStorage.h b/Demos/Device/ClassDriver/MassStorage/MassStorage.h index cfeea8032b..55e1796667 100644 --- a/Demos/Device/ClassDriver/MassStorage/MassStorage.h +++ b/Demos/Device/ClassDriver/MassStorage/MassStorage.h @@ -51,6 +51,7 @@ #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Device/ClassDriver/MassStorage/MassStorage.txt b/Demos/Device/ClassDriver/MassStorage/MassStorage.txt index 5bf7c55703..dd71e3bcd6 100644 --- a/Demos/Device/ClassDriver/MassStorage/MassStorage.txt +++ b/Demos/Device/ClassDriver/MassStorage/MassStorage.txt @@ -14,6 +14,9 @@ * \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) + * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU) + * \li Series B XMEGA AVRs (ATXMEGAxxxBxU) + * \li Series C XMEGA AVRs (ATXMEGAxxxCxU) * * \section Sec_Info USB Information: * diff --git a/Demos/Device/ClassDriver/MassStorage/asf.xml b/Demos/Device/ClassDriver/MassStorage/asf.xml index 4d10f3cd7b..26152739cd 100644 --- a/Demos/Device/ClassDriver/MassStorage/asf.xml +++ b/Demos/Device/ClassDriver/MassStorage/asf.xml @@ -1,14 +1,26 @@ - + - + - - + + + + + + + + + + + + + + diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/Config/LUFAConfig.h b/Demos/Device/ClassDriver/MassStorageKeyboard/Config/LUFAConfig.h index 3b33e2d04a..9d358ed622 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/Config/LUFAConfig.h +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/Config/LUFAConfig.h @@ -85,6 +85,39 @@ // #define NO_AUTO_VBUS_MANAGEMENT // #define INVERTED_VBUS_ENABLE_LINE + #elif (ARCH == ARCH_XMEGA) + + /* Non-USB Related Configuration Tokens: */ +// #define DISABLE_TERMINAL_CODES + + /* USB Class Driver Related Tokens: */ +// #define HID_HOST_BOOT_PROTOCOL_ONLY +// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here} +// #define HID_USAGE_STACK_DEPTH {Insert Value Here} +// #define HID_MAX_COLLECTIONS {Insert Value Here} +// #define HID_MAX_REPORTITEMS {Insert Value Here} +// #define HID_MAX_REPORT_IDS {Insert Value Here} +// #define NO_CLASS_DRIVER_AUTOFLUSH + + /* General USB Driver Related Tokens: */ + #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH) +// #define USB_STREAM_TIMEOUT_MS {Insert Value Here} +// #define NO_LIMITED_CONTROLLER_CONNECT +// #define NO_SOF_EVENTS + + /* USB Device Mode Driver Related Tokens: */ +// #define USE_RAM_DESCRIPTORS + #define USE_FLASH_DESCRIPTORS +// #define USE_EEPROM_DESCRIPTORS +// #define NO_INTERNAL_SERIAL + #define FIXED_CONTROL_ENDPOINT_SIZE 8 +// #define DEVICE_STATE_AS_GPIOR {Insert Value Here} + #define FIXED_NUM_CONFIGURATIONS 1 +// #define CONTROL_ONLY_DEVICE + #define MAX_ENDPOINT_INDEX 5 +// #define NO_DEVICE_REMOTE_WAKEUP +// #define NO_DEVICE_SELF_POWER + #else #error Unsupported architecture for this LUFA configuration file. diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c index 00761785c1..05fdfbe0c8 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c @@ -106,12 +106,24 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#elif (ARCH == ARCH_XMEGA) + /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */ + XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU); + XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL); + + /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */ + XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ); + XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB); + + PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm; +#endif /* Hardware Initialization */ LEDs_Init(); diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.h b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.h index 2e213c942b..05b5a84571 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.h +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.h @@ -56,6 +56,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.txt b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.txt index 7cdb47279d..d9affad832 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.txt +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.txt @@ -14,6 +14,9 @@ * \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) + * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU) + * \li Series B XMEGA AVRs (ATXMEGAxxxBxU) + * \li Series C XMEGA AVRs (ATXMEGAxxxCxU) * * \section Sec_Info USB Information: * diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/asf.xml b/Demos/Device/ClassDriver/MassStorageKeyboard/asf.xml index 3b53aec2f9..cd0a101148 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/asf.xml +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/asf.xml @@ -1,14 +1,26 @@ - + - + - - + + + + + + + + + + + + + + diff --git a/Demos/Device/ClassDriver/Mouse/Config/LUFAConfig.h b/Demos/Device/ClassDriver/Mouse/Config/LUFAConfig.h index 3244d3bb7b..3871759b67 100644 --- a/Demos/Device/ClassDriver/Mouse/Config/LUFAConfig.h +++ b/Demos/Device/ClassDriver/Mouse/Config/LUFAConfig.h @@ -85,6 +85,39 @@ // #define NO_AUTO_VBUS_MANAGEMENT // #define INVERTED_VBUS_ENABLE_LINE + #elif (ARCH == ARCH_XMEGA) + + /* Non-USB Related Configuration Tokens: */ +// #define DISABLE_TERMINAL_CODES + + /* USB Class Driver Related Tokens: */ +// #define HID_HOST_BOOT_PROTOCOL_ONLY +// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here} +// #define HID_USAGE_STACK_DEPTH {Insert Value Here} +// #define HID_MAX_COLLECTIONS {Insert Value Here} +// #define HID_MAX_REPORTITEMS {Insert Value Here} +// #define HID_MAX_REPORT_IDS {Insert Value Here} +// #define NO_CLASS_DRIVER_AUTOFLUSH + + /* General USB Driver Related Tokens: */ + #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH) +// #define USB_STREAM_TIMEOUT_MS {Insert Value Here} +// #define NO_LIMITED_CONTROLLER_CONNECT +// #define NO_SOF_EVENTS + + /* USB Device Mode Driver Related Tokens: */ +// #define USE_RAM_DESCRIPTORS + #define USE_FLASH_DESCRIPTORS +// #define USE_EEPROM_DESCRIPTORS +// #define NO_INTERNAL_SERIAL + #define FIXED_CONTROL_ENDPOINT_SIZE 8 +// #define DEVICE_STATE_AS_GPIOR {Insert Value Here} + #define FIXED_NUM_CONFIGURATIONS 1 +// #define CONTROL_ONLY_DEVICE + #define MAX_ENDPOINT_INDEX 1 +// #define NO_DEVICE_REMOTE_WAKEUP +// #define NO_DEVICE_SELF_POWER + #else #error Unsupported architecture for this LUFA configuration file. diff --git a/Demos/Device/ClassDriver/Mouse/Mouse.c b/Demos/Device/ClassDriver/Mouse/Mouse.c index c9caa1cffd..8432b65a92 100644 --- a/Demos/Device/ClassDriver/Mouse/Mouse.c +++ b/Demos/Device/ClassDriver/Mouse/Mouse.c @@ -80,12 +80,24 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#elif (ARCH == ARCH_XMEGA) + /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */ + XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU); + XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL); + + /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */ + XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ); + XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB); + + PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm; +#endif /* Hardware Initialization */ Joystick_Init(); diff --git a/Demos/Device/ClassDriver/Mouse/Mouse.h b/Demos/Device/ClassDriver/Mouse/Mouse.h index 371ef6c3cb..e63c9351c4 100644 --- a/Demos/Device/ClassDriver/Mouse/Mouse.h +++ b/Demos/Device/ClassDriver/Mouse/Mouse.h @@ -51,6 +51,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Device/ClassDriver/Mouse/Mouse.txt b/Demos/Device/ClassDriver/Mouse/Mouse.txt index d1277a2d69..e4673aeaa9 100644 --- a/Demos/Device/ClassDriver/Mouse/Mouse.txt +++ b/Demos/Device/ClassDriver/Mouse/Mouse.txt @@ -14,6 +14,9 @@ * \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) + * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU) + * \li Series B XMEGA AVRs (ATXMEGAxxxBxU) + * \li Series C XMEGA AVRs (ATXMEGAxxxCxU) * * \section Sec_Info USB Information: * diff --git a/Demos/Device/ClassDriver/Mouse/asf.xml b/Demos/Device/ClassDriver/Mouse/asf.xml index f501963c4f..7ad6b9479b 100644 --- a/Demos/Device/ClassDriver/Mouse/asf.xml +++ b/Demos/Device/ClassDriver/Mouse/asf.xml @@ -1,14 +1,26 @@ - + - + - - + + + + + + + + + + + + + + diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Config/LUFAConfig.h b/Demos/Device/ClassDriver/RNDISEthernet/Config/LUFAConfig.h index 3244d3bb7b..4873f80315 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Config/LUFAConfig.h +++ b/Demos/Device/ClassDriver/RNDISEthernet/Config/LUFAConfig.h @@ -85,6 +85,39 @@ // #define NO_AUTO_VBUS_MANAGEMENT // #define INVERTED_VBUS_ENABLE_LINE + #elif (ARCH == ARCH_XMEGA) + + /* Non-USB Related Configuration Tokens: */ +// #define DISABLE_TERMINAL_CODES + + /* USB Class Driver Related Tokens: */ +// #define HID_HOST_BOOT_PROTOCOL_ONLY +// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here} +// #define HID_USAGE_STACK_DEPTH {Insert Value Here} +// #define HID_MAX_COLLECTIONS {Insert Value Here} +// #define HID_MAX_REPORTITEMS {Insert Value Here} +// #define HID_MAX_REPORT_IDS {Insert Value Here} +// #define NO_CLASS_DRIVER_AUTOFLUSH + + /* General USB Driver Related Tokens: */ + #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH) +// #define USB_STREAM_TIMEOUT_MS {Insert Value Here} +// #define NO_LIMITED_CONTROLLER_CONNECT +// #define NO_SOF_EVENTS + + /* USB Device Mode Driver Related Tokens: */ +// #define USE_RAM_DESCRIPTORS + #define USE_FLASH_DESCRIPTORS +// #define USE_EEPROM_DESCRIPTORS +// #define NO_INTERNAL_SERIAL + #define FIXED_CONTROL_ENDPOINT_SIZE 8 +// #define DEVICE_STATE_AS_GPIOR {Insert Value Here} + #define FIXED_NUM_CONFIGURATIONS 1 +// #define CONTROL_ONLY_DEVICE + #define MAX_ENDPOINT_INDEX 3 +// #define NO_DEVICE_REMOTE_WAKEUP +// #define NO_DEVICE_SELF_POWER + #else #error Unsupported architecture for this LUFA configuration file. diff --git a/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c b/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c index ef643a82ed..54d5511428 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c +++ b/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c @@ -115,12 +115,24 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#elif (ARCH == ARCH_XMEGA) + /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */ + XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU); + XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL); + + /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */ + XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ); + XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB); + + PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm; +#endif /* Hardware Initialization */ LEDs_Init(); diff --git a/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.h b/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.h index 57fdc4ec74..839a53bdd4 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.h +++ b/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.h @@ -50,10 +50,11 @@ #include "Lib/ARP.h" #include "Lib/Webserver.h" #include "Config/AppConfig.h" - + #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.txt b/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.txt index ac72d4ae7f..aafa3cc439 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.txt +++ b/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.txt @@ -12,6 +12,9 @@ * * \li Series 7 USB AVRs (AT90USBxxx7) * \li Series 6 USB AVRs (AT90USBxxx6) + * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU) + * \li Series B XMEGA AVRs (ATXMEGAxxxBxU) + * \li Series C XMEGA AVRs (ATXMEGAxxxCxU) * * \section Sec_Info USB Information: * diff --git a/Demos/Device/ClassDriver/RNDISEthernet/asf.xml b/Demos/Device/ClassDriver/RNDISEthernet/asf.xml index 9aef2735e0..3084f41fc8 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/asf.xml +++ b/Demos/Device/ClassDriver/RNDISEthernet/asf.xml @@ -1,14 +1,26 @@ - + - + - - + + + + + + + + + + + + + + diff --git a/Demos/Device/ClassDriver/VirtualSerial/Config/LUFAConfig.h b/Demos/Device/ClassDriver/VirtualSerial/Config/LUFAConfig.h index 3b33e2d04a..da728ec292 100644 --- a/Demos/Device/ClassDriver/VirtualSerial/Config/LUFAConfig.h +++ b/Demos/Device/ClassDriver/VirtualSerial/Config/LUFAConfig.h @@ -85,6 +85,39 @@ // #define NO_AUTO_VBUS_MANAGEMENT // #define INVERTED_VBUS_ENABLE_LINE + #elif (ARCH == ARCH_XMEGA) + + /* Non-USB Related Configuration Tokens: */ +// #define DISABLE_TERMINAL_CODES + + /* USB Class Driver Related Tokens: */ +// #define HID_HOST_BOOT_PROTOCOL_ONLY +// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here} +// #define HID_USAGE_STACK_DEPTH {Insert Value Here} +// #define HID_MAX_COLLECTIONS {Insert Value Here} +// #define HID_MAX_REPORTITEMS {Insert Value Here} +// #define HID_MAX_REPORT_IDS {Insert Value Here} +// #define NO_CLASS_DRIVER_AUTOFLUSH + + /* General USB Driver Related Tokens: */ + #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH) +// #define USB_STREAM_TIMEOUT_MS {Insert Value Here} +// #define NO_LIMITED_CONTROLLER_CONNECT +// #define NO_SOF_EVENTS + + /* USB Device Mode Driver Related Tokens: */ +// #define USE_RAM_DESCRIPTORS + #define USE_FLASH_DESCRIPTORS +// #define USE_EEPROM_DESCRIPTORS +// #define NO_INTERNAL_SERIAL + #define FIXED_CONTROL_ENDPOINT_SIZE 8 +// #define DEVICE_STATE_AS_GPIOR {Insert Value Here} + #define FIXED_NUM_CONFIGURATIONS 1 +// #define CONTROL_ONLY_DEVICE + #define MAX_ENDPOINT_INDEX 4 +// #define NO_DEVICE_REMOTE_WAKEUP +// #define NO_DEVICE_SELF_POWER + #else #error Unsupported architecture for this LUFA configuration file. diff --git a/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.c b/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.c index 07bb84295e..0079acbfaa 100644 --- a/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.c +++ b/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.c @@ -100,12 +100,24 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#elif (ARCH == ARCH_XMEGA) + /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */ + XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU); + XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL); + + /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */ + XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ); + XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB); + + PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm; +#endif /* Hardware Initialization */ Joystick_Init(); diff --git a/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.h b/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.h index 335399642f..2e10366fd7 100644 --- a/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.h +++ b/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.h @@ -49,6 +49,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.txt b/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.txt index e0a3291b4f..61b665674f 100644 --- a/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.txt +++ b/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.txt @@ -14,6 +14,9 @@ * \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) + * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU) + * \li Series B XMEGA AVRs (ATXMEGAxxxBxU) + * \li Series C XMEGA AVRs (ATXMEGAxxxCxU) * * \section Sec_Info USB Information: * diff --git a/Demos/Device/ClassDriver/VirtualSerial/asf.xml b/Demos/Device/ClassDriver/VirtualSerial/asf.xml index c719468066..64ce25fd2f 100644 --- a/Demos/Device/ClassDriver/VirtualSerial/asf.xml +++ b/Demos/Device/ClassDriver/VirtualSerial/asf.xml @@ -1,14 +1,26 @@ - + - + - - + + + + + + + + + + + + + + diff --git a/Demos/Device/ClassDriver/VirtualSerialMassStorage/Config/LUFAConfig.h b/Demos/Device/ClassDriver/VirtualSerialMassStorage/Config/LUFAConfig.h index 3b33e2d04a..9d358ed622 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMassStorage/Config/LUFAConfig.h +++ b/Demos/Device/ClassDriver/VirtualSerialMassStorage/Config/LUFAConfig.h @@ -85,6 +85,39 @@ // #define NO_AUTO_VBUS_MANAGEMENT // #define INVERTED_VBUS_ENABLE_LINE + #elif (ARCH == ARCH_XMEGA) + + /* Non-USB Related Configuration Tokens: */ +// #define DISABLE_TERMINAL_CODES + + /* USB Class Driver Related Tokens: */ +// #define HID_HOST_BOOT_PROTOCOL_ONLY +// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here} +// #define HID_USAGE_STACK_DEPTH {Insert Value Here} +// #define HID_MAX_COLLECTIONS {Insert Value Here} +// #define HID_MAX_REPORTITEMS {Insert Value Here} +// #define HID_MAX_REPORT_IDS {Insert Value Here} +// #define NO_CLASS_DRIVER_AUTOFLUSH + + /* General USB Driver Related Tokens: */ + #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH) +// #define USB_STREAM_TIMEOUT_MS {Insert Value Here} +// #define NO_LIMITED_CONTROLLER_CONNECT +// #define NO_SOF_EVENTS + + /* USB Device Mode Driver Related Tokens: */ +// #define USE_RAM_DESCRIPTORS + #define USE_FLASH_DESCRIPTORS +// #define USE_EEPROM_DESCRIPTORS +// #define NO_INTERNAL_SERIAL + #define FIXED_CONTROL_ENDPOINT_SIZE 8 +// #define DEVICE_STATE_AS_GPIOR {Insert Value Here} + #define FIXED_NUM_CONFIGURATIONS 1 +// #define CONTROL_ONLY_DEVICE + #define MAX_ENDPOINT_INDEX 5 +// #define NO_DEVICE_REMOTE_WAKEUP +// #define NO_DEVICE_SELF_POWER + #else #error Unsupported architecture for this LUFA configuration file. diff --git a/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.c b/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.c index cc146a9b7a..f1dc04992d 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.c +++ b/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.c @@ -126,12 +126,24 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#elif (ARCH == ARCH_XMEGA) + /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */ + XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU); + XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL); + + /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */ + XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ); + XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB); + + PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm; +#endif /* Hardware Initialization */ LEDs_Init(); diff --git a/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.h b/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.h index 413164df25..c191f098fa 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.h +++ b/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.h @@ -52,6 +52,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.txt b/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.txt index 042244119d..62a7c3da68 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.txt +++ b/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.txt @@ -13,6 +13,9 @@ * \li Series 7 USB AVRs (AT90USBxxx7) * \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 4 USB AVRs (ATMEGAxxU4) + * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU) + * \li Series B XMEGA AVRs (ATXMEGAxxxBxU) + * \li Series C XMEGA AVRs (ATXMEGAxxxCxU) * * \section Sec_Info USB Information: * diff --git a/Demos/Device/ClassDriver/VirtualSerialMassStorage/asf.xml b/Demos/Device/ClassDriver/VirtualSerialMassStorage/asf.xml index beae956276..6a21768fb8 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMassStorage/asf.xml +++ b/Demos/Device/ClassDriver/VirtualSerialMassStorage/asf.xml @@ -1,14 +1,26 @@ - + - + - - + + + + + + + + + + + + + + diff --git a/Demos/Device/ClassDriver/VirtualSerialMouse/Config/LUFAConfig.h b/Demos/Device/ClassDriver/VirtualSerialMouse/Config/LUFAConfig.h index 3b33e2d04a..da728ec292 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMouse/Config/LUFAConfig.h +++ b/Demos/Device/ClassDriver/VirtualSerialMouse/Config/LUFAConfig.h @@ -85,6 +85,39 @@ // #define NO_AUTO_VBUS_MANAGEMENT // #define INVERTED_VBUS_ENABLE_LINE + #elif (ARCH == ARCH_XMEGA) + + /* Non-USB Related Configuration Tokens: */ +// #define DISABLE_TERMINAL_CODES + + /* USB Class Driver Related Tokens: */ +// #define HID_HOST_BOOT_PROTOCOL_ONLY +// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here} +// #define HID_USAGE_STACK_DEPTH {Insert Value Here} +// #define HID_MAX_COLLECTIONS {Insert Value Here} +// #define HID_MAX_REPORTITEMS {Insert Value Here} +// #define HID_MAX_REPORT_IDS {Insert Value Here} +// #define NO_CLASS_DRIVER_AUTOFLUSH + + /* General USB Driver Related Tokens: */ + #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH) +// #define USB_STREAM_TIMEOUT_MS {Insert Value Here} +// #define NO_LIMITED_CONTROLLER_CONNECT +// #define NO_SOF_EVENTS + + /* USB Device Mode Driver Related Tokens: */ +// #define USE_RAM_DESCRIPTORS + #define USE_FLASH_DESCRIPTORS +// #define USE_EEPROM_DESCRIPTORS +// #define NO_INTERNAL_SERIAL + #define FIXED_CONTROL_ENDPOINT_SIZE 8 +// #define DEVICE_STATE_AS_GPIOR {Insert Value Here} + #define FIXED_NUM_CONFIGURATIONS 1 +// #define CONTROL_ONLY_DEVICE + #define MAX_ENDPOINT_INDEX 4 +// #define NO_DEVICE_REMOTE_WAKEUP +// #define NO_DEVICE_SELF_POWER + #else #error Unsupported architecture for this LUFA configuration file. diff --git a/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c b/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c index 54b8534d98..73f9e38759 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c +++ b/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c @@ -116,12 +116,24 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#elif (ARCH == ARCH_XMEGA) + /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */ + XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU); + XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL); + + /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */ + XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ); + XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB); + + PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm; +#endif /* Hardware Initialization */ Joystick_Init(); diff --git a/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.h b/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.h index b4db433422..0e9a72192b 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.h +++ b/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.h @@ -49,6 +49,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.txt b/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.txt index fe6328b73a..96b317855e 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.txt +++ b/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.txt @@ -14,6 +14,9 @@ * \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) + * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU) + * \li Series B XMEGA AVRs (ATXMEGAxxxBxU) + * \li Series C XMEGA AVRs (ATXMEGAxxxCxU) * * \section Sec_Info USB Information: * diff --git a/Demos/Device/ClassDriver/VirtualSerialMouse/asf.xml b/Demos/Device/ClassDriver/VirtualSerialMouse/asf.xml index 61bb17fabe..e555710c55 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMouse/asf.xml +++ b/Demos/Device/ClassDriver/VirtualSerialMouse/asf.xml @@ -1,14 +1,26 @@ - + - + - - + + + + + + + + + + + + + + diff --git a/Demos/Device/Incomplete/TestAndMeasurement/Config/LUFAConfig.h b/Demos/Device/Incomplete/TestAndMeasurement/Config/LUFAConfig.h index 3b33e2d04a..da728ec292 100644 --- a/Demos/Device/Incomplete/TestAndMeasurement/Config/LUFAConfig.h +++ b/Demos/Device/Incomplete/TestAndMeasurement/Config/LUFAConfig.h @@ -85,6 +85,39 @@ // #define NO_AUTO_VBUS_MANAGEMENT // #define INVERTED_VBUS_ENABLE_LINE + #elif (ARCH == ARCH_XMEGA) + + /* Non-USB Related Configuration Tokens: */ +// #define DISABLE_TERMINAL_CODES + + /* USB Class Driver Related Tokens: */ +// #define HID_HOST_BOOT_PROTOCOL_ONLY +// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here} +// #define HID_USAGE_STACK_DEPTH {Insert Value Here} +// #define HID_MAX_COLLECTIONS {Insert Value Here} +// #define HID_MAX_REPORTITEMS {Insert Value Here} +// #define HID_MAX_REPORT_IDS {Insert Value Here} +// #define NO_CLASS_DRIVER_AUTOFLUSH + + /* General USB Driver Related Tokens: */ + #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH) +// #define USB_STREAM_TIMEOUT_MS {Insert Value Here} +// #define NO_LIMITED_CONTROLLER_CONNECT +// #define NO_SOF_EVENTS + + /* USB Device Mode Driver Related Tokens: */ +// #define USE_RAM_DESCRIPTORS + #define USE_FLASH_DESCRIPTORS +// #define USE_EEPROM_DESCRIPTORS +// #define NO_INTERNAL_SERIAL + #define FIXED_CONTROL_ENDPOINT_SIZE 8 +// #define DEVICE_STATE_AS_GPIOR {Insert Value Here} + #define FIXED_NUM_CONFIGURATIONS 1 +// #define CONTROL_ONLY_DEVICE + #define MAX_ENDPOINT_INDEX 4 +// #define NO_DEVICE_REMOTE_WAKEUP +// #define NO_DEVICE_SELF_POWER + #else #error Unsupported architecture for this LUFA configuration file. diff --git a/Demos/Device/Incomplete/TestAndMeasurement/TestAndMeasurement.c b/Demos/Device/Incomplete/TestAndMeasurement/TestAndMeasurement.c index bd972e27fe..4bd702701e 100644 --- a/Demos/Device/Incomplete/TestAndMeasurement/TestAndMeasurement.c +++ b/Demos/Device/Incomplete/TestAndMeasurement/TestAndMeasurement.c @@ -93,12 +93,24 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#elif (ARCH == ARCH_XMEGA) + /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */ + XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU); + XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL); + + /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */ + XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ); + XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB); + + PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm; +#endif /* Hardware Initialization */ LEDs_Init(); diff --git a/Demos/Device/Incomplete/TestAndMeasurement/TestAndMeasurement.h b/Demos/Device/Incomplete/TestAndMeasurement/TestAndMeasurement.h index ed02033434..0c86cc882c 100644 --- a/Demos/Device/Incomplete/TestAndMeasurement/TestAndMeasurement.h +++ b/Demos/Device/Incomplete/TestAndMeasurement/TestAndMeasurement.h @@ -1,7 +1,7 @@ /* LUFA Library Copyright (C) Dean Camera, 2013. - + dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ @@ -9,13 +9,13 @@ /* 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 @@ -39,8 +39,9 @@ #include "Descriptors.h" - #include #include + #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ @@ -54,7 +55,7 @@ /** 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 @@ -66,14 +67,14 @@ #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 @@ -86,7 +87,7 @@ uint8_t Reserved; uint16_t TMCVersion; - + struct { unsigned ListenOnly : 1; @@ -94,17 +95,17 @@ 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; @@ -125,7 +126,7 @@ uint8_t InverseTag; uint8_t Reserved; uint32_t TransferSize; - + union { TMC_DevOUTMessageHeader_t DeviceOUT; diff --git a/Demos/Device/LowLevel/AudioInput/AudioInput.c b/Demos/Device/LowLevel/AudioInput/AudioInput.c index 1544f0964d..6c7bd1df40 100644 --- a/Demos/Device/LowLevel/AudioInput/AudioInput.c +++ b/Demos/Device/LowLevel/AudioInput/AudioInput.c @@ -62,12 +62,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ LEDs_Init(); diff --git a/Demos/Device/LowLevel/AudioInput/AudioInput.h b/Demos/Device/LowLevel/AudioInput/AudioInput.h index b7727a81b2..6701f8ee58 100644 --- a/Demos/Device/LowLevel/AudioInput/AudioInput.h +++ b/Demos/Device/LowLevel/AudioInput/AudioInput.h @@ -49,6 +49,7 @@ #include #include #include + #include /* Macros: */ /** Maximum audio sample value for the microphone input. */ diff --git a/Demos/Device/LowLevel/AudioInput/asf.xml b/Demos/Device/LowLevel/AudioInput/asf.xml index 767b3fd4a8..3fdfb657a0 100644 --- a/Demos/Device/LowLevel/AudioInput/asf.xml +++ b/Demos/Device/LowLevel/AudioInput/asf.xml @@ -1,14 +1,14 @@ - + - + - - + + diff --git a/Demos/Device/LowLevel/AudioOutput/AudioOutput.c b/Demos/Device/LowLevel/AudioOutput/AudioOutput.c index e77b041bd0..d47381d547 100644 --- a/Demos/Device/LowLevel/AudioOutput/AudioOutput.c +++ b/Demos/Device/LowLevel/AudioOutput/AudioOutput.c @@ -62,12 +62,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ LEDs_Init(); diff --git a/Demos/Device/LowLevel/AudioOutput/AudioOutput.h b/Demos/Device/LowLevel/AudioOutput/AudioOutput.h index 2094090352..45f0d4ab6e 100644 --- a/Demos/Device/LowLevel/AudioOutput/AudioOutput.h +++ b/Demos/Device/LowLevel/AudioOutput/AudioOutput.h @@ -47,6 +47,7 @@ #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Device/LowLevel/AudioOutput/asf.xml b/Demos/Device/LowLevel/AudioOutput/asf.xml index 458a8b9748..19c15c3cbf 100644 --- a/Demos/Device/LowLevel/AudioOutput/asf.xml +++ b/Demos/Device/LowLevel/AudioOutput/asf.xml @@ -1,14 +1,14 @@ - + - + - - + + diff --git a/Demos/Device/LowLevel/DualVirtualSerial/Config/LUFAConfig.h b/Demos/Device/LowLevel/DualVirtualSerial/Config/LUFAConfig.h index 3b33e2d04a..d2f780a0b6 100644 --- a/Demos/Device/LowLevel/DualVirtualSerial/Config/LUFAConfig.h +++ b/Demos/Device/LowLevel/DualVirtualSerial/Config/LUFAConfig.h @@ -85,6 +85,39 @@ // #define NO_AUTO_VBUS_MANAGEMENT // #define INVERTED_VBUS_ENABLE_LINE + #elif (ARCH == ARCH_XMEGA) + + /* Non-USB Related Configuration Tokens: */ +// #define DISABLE_TERMINAL_CODES + + /* USB Class Driver Related Tokens: */ +// #define HID_HOST_BOOT_PROTOCOL_ONLY +// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here} +// #define HID_USAGE_STACK_DEPTH {Insert Value Here} +// #define HID_MAX_COLLECTIONS {Insert Value Here} +// #define HID_MAX_REPORTITEMS {Insert Value Here} +// #define HID_MAX_REPORT_IDS {Insert Value Here} +// #define NO_CLASS_DRIVER_AUTOFLUSH + + /* General USB Driver Related Tokens: */ + #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH) +// #define USB_STREAM_TIMEOUT_MS {Insert Value Here} +// #define NO_LIMITED_CONTROLLER_CONNECT +// #define NO_SOF_EVENTS + + /* USB Device Mode Driver Related Tokens: */ +// #define USE_RAM_DESCRIPTORS + #define USE_FLASH_DESCRIPTORS +// #define USE_EEPROM_DESCRIPTORS +// #define NO_INTERNAL_SERIAL + #define FIXED_CONTROL_ENDPOINT_SIZE 8 +// #define DEVICE_STATE_AS_GPIOR {Insert Value Here} + #define FIXED_NUM_CONFIGURATIONS 1 +// #define CONTROL_ONLY_DEVICE + #define MAX_ENDPOINT_INDEX 6 +// #define NO_DEVICE_REMOTE_WAKEUP +// #define NO_DEVICE_SELF_POWER + #else #error Unsupported architecture for this LUFA configuration file. diff --git a/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.h b/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.h index 154ed0c094..a5a87dc3df 100644 --- a/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.h +++ b/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.h @@ -58,7 +58,7 @@ #define CDC2_RX_EPADDR (ENDPOINT_DIR_OUT | 5) /** Endpoint address of the second CDC interface's device-to-host notification IN endpoint. */ - #define CDC2_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 6) + #define CDC2_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 6) /** Size in bytes of the CDC device-to-host notification IN endpoints. */ #define CDC_NOTIFICATION_EPSIZE 8 diff --git a/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.c b/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.c index a803b4142e..45790b1e32 100644 --- a/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.c +++ b/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.c @@ -84,12 +84,24 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#elif (ARCH == ARCH_XMEGA) + /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */ + XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU); + XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL); + + /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */ + XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ); + XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB); + + PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm; +#endif /* Hardware Initialization */ Joystick_Init(); diff --git a/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.h b/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.h index 6e7c73d798..63f1f08099 100644 --- a/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.h +++ b/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.h @@ -48,6 +48,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.txt b/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.txt index 0897bf90bd..af263cc751 100644 --- a/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.txt +++ b/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.txt @@ -13,6 +13,9 @@ * \li Series 7 USB AVRs (AT90USBxxx7) * \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 4 USB AVRs (ATMEGAxxU4) + * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU) + * \li Series B XMEGA AVRs (ATXMEGAxxxBxU) + * \li Series C XMEGA AVRs (ATXMEGAxxxCxU) * * \section Sec_Info USB Information: * diff --git a/Demos/Device/LowLevel/DualVirtualSerial/asf.xml b/Demos/Device/LowLevel/DualVirtualSerial/asf.xml index d3045683b3..4628f4b611 100644 --- a/Demos/Device/LowLevel/DualVirtualSerial/asf.xml +++ b/Demos/Device/LowLevel/DualVirtualSerial/asf.xml @@ -1,14 +1,26 @@ - + - + - - + + + + + + + + + + + + + + diff --git a/Demos/Device/LowLevel/GenericHID/Config/LUFAConfig.h b/Demos/Device/LowLevel/GenericHID/Config/LUFAConfig.h index 3244d3bb7b..a4ca3437f8 100644 --- a/Demos/Device/LowLevel/GenericHID/Config/LUFAConfig.h +++ b/Demos/Device/LowLevel/GenericHID/Config/LUFAConfig.h @@ -85,6 +85,39 @@ // #define NO_AUTO_VBUS_MANAGEMENT // #define INVERTED_VBUS_ENABLE_LINE + #elif (ARCH == ARCH_XMEGA) + + /* Non-USB Related Configuration Tokens: */ +// #define DISABLE_TERMINAL_CODES + + /* USB Class Driver Related Tokens: */ +// #define HID_HOST_BOOT_PROTOCOL_ONLY +// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here} +// #define HID_USAGE_STACK_DEPTH {Insert Value Here} +// #define HID_MAX_COLLECTIONS {Insert Value Here} +// #define HID_MAX_REPORTITEMS {Insert Value Here} +// #define HID_MAX_REPORT_IDS {Insert Value Here} +// #define NO_CLASS_DRIVER_AUTOFLUSH + + /* General USB Driver Related Tokens: */ + #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH) +// #define USB_STREAM_TIMEOUT_MS {Insert Value Here} +// #define NO_LIMITED_CONTROLLER_CONNECT +// #define NO_SOF_EVENTS + + /* USB Device Mode Driver Related Tokens: */ +// #define USE_RAM_DESCRIPTORS + #define USE_FLASH_DESCRIPTORS +// #define USE_EEPROM_DESCRIPTORS +// #define NO_INTERNAL_SERIAL + #define FIXED_CONTROL_ENDPOINT_SIZE 8 +// #define DEVICE_STATE_AS_GPIOR {Insert Value Here} + #define FIXED_NUM_CONFIGURATIONS 1 +// #define CONTROL_ONLY_DEVICE + #define MAX_ENDPOINT_INDEX 2 +// #define NO_DEVICE_REMOTE_WAKEUP +// #define NO_DEVICE_SELF_POWER + #else #error Unsupported architecture for this LUFA configuration file. diff --git a/Demos/Device/LowLevel/GenericHID/GenericHID.c b/Demos/Device/LowLevel/GenericHID/GenericHID.c index 10b344f7d9..2c55196039 100644 --- a/Demos/Device/LowLevel/GenericHID/GenericHID.c +++ b/Demos/Device/LowLevel/GenericHID/GenericHID.c @@ -57,12 +57,24 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#elif (ARCH == ARCH_XMEGA) + /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */ + XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU); + XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL); + + /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */ + XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ); + XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB); + + PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm; +#endif /* Hardware Initialization */ LEDs_Init(); diff --git a/Demos/Device/LowLevel/GenericHID/GenericHID.h b/Demos/Device/LowLevel/GenericHID/GenericHID.h index 806eda0df6..3a3c86cd68 100644 --- a/Demos/Device/LowLevel/GenericHID/GenericHID.h +++ b/Demos/Device/LowLevel/GenericHID/GenericHID.h @@ -46,9 +46,10 @@ #include "Descriptors.h" #include "Config/AppConfig.h" - + #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Device/LowLevel/GenericHID/GenericHID.txt b/Demos/Device/LowLevel/GenericHID/GenericHID.txt index 3d72345f32..1402740399 100644 --- a/Demos/Device/LowLevel/GenericHID/GenericHID.txt +++ b/Demos/Device/LowLevel/GenericHID/GenericHID.txt @@ -14,6 +14,9 @@ * \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) + * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU) + * \li Series B XMEGA AVRs (ATXMEGAxxxBxU) + * \li Series C XMEGA AVRs (ATXMEGAxxxCxU) * * \section Sec_Info USB Information: * @@ -68,7 +71,7 @@ * * GENERIC_REPORT_SIZE * AppConfig.h - * This token defines the size of the device reports, both sent and received (including report ID byte). The value + * 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. * * diff --git a/Demos/Device/LowLevel/GenericHID/asf.xml b/Demos/Device/LowLevel/GenericHID/asf.xml index 27e09ca17d..44fa5cf29b 100644 --- a/Demos/Device/LowLevel/GenericHID/asf.xml +++ b/Demos/Device/LowLevel/GenericHID/asf.xml @@ -1,14 +1,26 @@ - + - + - - + + + + + + + + + + + + + + diff --git a/Demos/Device/LowLevel/Joystick/Config/LUFAConfig.h b/Demos/Device/LowLevel/Joystick/Config/LUFAConfig.h index 3244d3bb7b..3871759b67 100644 --- a/Demos/Device/LowLevel/Joystick/Config/LUFAConfig.h +++ b/Demos/Device/LowLevel/Joystick/Config/LUFAConfig.h @@ -85,6 +85,39 @@ // #define NO_AUTO_VBUS_MANAGEMENT // #define INVERTED_VBUS_ENABLE_LINE + #elif (ARCH == ARCH_XMEGA) + + /* Non-USB Related Configuration Tokens: */ +// #define DISABLE_TERMINAL_CODES + + /* USB Class Driver Related Tokens: */ +// #define HID_HOST_BOOT_PROTOCOL_ONLY +// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here} +// #define HID_USAGE_STACK_DEPTH {Insert Value Here} +// #define HID_MAX_COLLECTIONS {Insert Value Here} +// #define HID_MAX_REPORTITEMS {Insert Value Here} +// #define HID_MAX_REPORT_IDS {Insert Value Here} +// #define NO_CLASS_DRIVER_AUTOFLUSH + + /* General USB Driver Related Tokens: */ + #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH) +// #define USB_STREAM_TIMEOUT_MS {Insert Value Here} +// #define NO_LIMITED_CONTROLLER_CONNECT +// #define NO_SOF_EVENTS + + /* USB Device Mode Driver Related Tokens: */ +// #define USE_RAM_DESCRIPTORS + #define USE_FLASH_DESCRIPTORS +// #define USE_EEPROM_DESCRIPTORS +// #define NO_INTERNAL_SERIAL + #define FIXED_CONTROL_ENDPOINT_SIZE 8 +// #define DEVICE_STATE_AS_GPIOR {Insert Value Here} + #define FIXED_NUM_CONFIGURATIONS 1 +// #define CONTROL_ONLY_DEVICE + #define MAX_ENDPOINT_INDEX 1 +// #define NO_DEVICE_REMOTE_WAKEUP +// #define NO_DEVICE_SELF_POWER + #else #error Unsupported architecture for this LUFA configuration file. diff --git a/Demos/Device/LowLevel/Joystick/Joystick.c b/Demos/Device/LowLevel/Joystick/Joystick.c index 4e5af8d2cc..2af5e285d4 100644 --- a/Demos/Device/LowLevel/Joystick/Joystick.c +++ b/Demos/Device/LowLevel/Joystick/Joystick.c @@ -56,12 +56,24 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#elif (ARCH == ARCH_XMEGA) + /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */ + XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU); + XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL); + + /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */ + XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ); + XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB); + + PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm; +#endif /* Hardware Initialization */ Joystick_Init(); diff --git a/Demos/Device/LowLevel/Joystick/Joystick.h b/Demos/Device/LowLevel/Joystick/Joystick.h index 02a85f564e..0cc17a59dc 100644 --- a/Demos/Device/LowLevel/Joystick/Joystick.h +++ b/Demos/Device/LowLevel/Joystick/Joystick.h @@ -49,6 +49,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Device/LowLevel/Joystick/Joystick.txt b/Demos/Device/LowLevel/Joystick/Joystick.txt index 55be2c3005..e3aec3d703 100644 --- a/Demos/Device/LowLevel/Joystick/Joystick.txt +++ b/Demos/Device/LowLevel/Joystick/Joystick.txt @@ -14,6 +14,9 @@ * \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) + * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU) + * \li Series B XMEGA AVRs (ATXMEGAxxxBxU) + * \li Series C XMEGA AVRs (ATXMEGAxxxCxU) * * \section Sec_Info USB Information: * diff --git a/Demos/Device/LowLevel/Joystick/asf.xml b/Demos/Device/LowLevel/Joystick/asf.xml index 05cc1576b4..e7df499275 100644 --- a/Demos/Device/LowLevel/Joystick/asf.xml +++ b/Demos/Device/LowLevel/Joystick/asf.xml @@ -1,14 +1,26 @@ - + - + - - + + + + + + + + + + + + + + @@ -43,6 +55,7 @@ + diff --git a/Demos/Device/LowLevel/Keyboard/Config/LUFAConfig.h b/Demos/Device/LowLevel/Keyboard/Config/LUFAConfig.h index 3244d3bb7b..a4ca3437f8 100644 --- a/Demos/Device/LowLevel/Keyboard/Config/LUFAConfig.h +++ b/Demos/Device/LowLevel/Keyboard/Config/LUFAConfig.h @@ -85,6 +85,39 @@ // #define NO_AUTO_VBUS_MANAGEMENT // #define INVERTED_VBUS_ENABLE_LINE + #elif (ARCH == ARCH_XMEGA) + + /* Non-USB Related Configuration Tokens: */ +// #define DISABLE_TERMINAL_CODES + + /* USB Class Driver Related Tokens: */ +// #define HID_HOST_BOOT_PROTOCOL_ONLY +// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here} +// #define HID_USAGE_STACK_DEPTH {Insert Value Here} +// #define HID_MAX_COLLECTIONS {Insert Value Here} +// #define HID_MAX_REPORTITEMS {Insert Value Here} +// #define HID_MAX_REPORT_IDS {Insert Value Here} +// #define NO_CLASS_DRIVER_AUTOFLUSH + + /* General USB Driver Related Tokens: */ + #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH) +// #define USB_STREAM_TIMEOUT_MS {Insert Value Here} +// #define NO_LIMITED_CONTROLLER_CONNECT +// #define NO_SOF_EVENTS + + /* USB Device Mode Driver Related Tokens: */ +// #define USE_RAM_DESCRIPTORS + #define USE_FLASH_DESCRIPTORS +// #define USE_EEPROM_DESCRIPTORS +// #define NO_INTERNAL_SERIAL + #define FIXED_CONTROL_ENDPOINT_SIZE 8 +// #define DEVICE_STATE_AS_GPIOR {Insert Value Here} + #define FIXED_NUM_CONFIGURATIONS 1 +// #define CONTROL_ONLY_DEVICE + #define MAX_ENDPOINT_INDEX 2 +// #define NO_DEVICE_REMOTE_WAKEUP +// #define NO_DEVICE_SELF_POWER + #else #error Unsupported architecture for this LUFA configuration file. diff --git a/Demos/Device/LowLevel/Keyboard/Keyboard.c b/Demos/Device/LowLevel/Keyboard/Keyboard.c index 5ffe72f21f..18fde65dd9 100644 --- a/Demos/Device/LowLevel/Keyboard/Keyboard.c +++ b/Demos/Device/LowLevel/Keyboard/Keyboard.c @@ -74,12 +74,24 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#elif (ARCH == ARCH_XMEGA) + /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */ + XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU); + XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL); + + /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */ + XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ); + XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB); + + PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm; +#endif /* Hardware Initialization */ Joystick_Init(); @@ -311,7 +323,7 @@ void SendNextReport(void) else { /* Check to see if the report data has changed - if so a report MUST be sent */ - SendReport = (memcmp(&PrevKeyboardReportData, &KeyboardReportData, sizeof(USB_KeyboardReport_Data_t)) != 0); + SendReport = (memcmp(&PrevKeyboardReportData, &KeyboardReportData, sizeof(USB_KeyboardReport_Data_t)) != 0); } /* Select the Keyboard Report Endpoint */ diff --git a/Demos/Device/LowLevel/Keyboard/Keyboard.h b/Demos/Device/LowLevel/Keyboard/Keyboard.h index 4b25e34bc3..a2fcf5aa6b 100644 --- a/Demos/Device/LowLevel/Keyboard/Keyboard.h +++ b/Demos/Device/LowLevel/Keyboard/Keyboard.h @@ -51,6 +51,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Device/LowLevel/Keyboard/Keyboard.txt b/Demos/Device/LowLevel/Keyboard/Keyboard.txt index f7e2829614..a1582a8f94 100644 --- a/Demos/Device/LowLevel/Keyboard/Keyboard.txt +++ b/Demos/Device/LowLevel/Keyboard/Keyboard.txt @@ -14,6 +14,9 @@ * \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) + * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU) + * \li Series B XMEGA AVRs (ATXMEGAxxxBxU) + * \li Series C XMEGA AVRs (ATXMEGAxxxCxU) * * \section Sec_Info USB Information: * diff --git a/Demos/Device/LowLevel/Keyboard/asf.xml b/Demos/Device/LowLevel/Keyboard/asf.xml index bae98489e2..d242754fec 100644 --- a/Demos/Device/LowLevel/Keyboard/asf.xml +++ b/Demos/Device/LowLevel/Keyboard/asf.xml @@ -1,14 +1,26 @@ - + - + - - + + + + + + + + + + + + + + diff --git a/Demos/Device/LowLevel/KeyboardMouse/Config/LUFAConfig.h b/Demos/Device/LowLevel/KeyboardMouse/Config/LUFAConfig.h index 3244d3bb7b..4873f80315 100644 --- a/Demos/Device/LowLevel/KeyboardMouse/Config/LUFAConfig.h +++ b/Demos/Device/LowLevel/KeyboardMouse/Config/LUFAConfig.h @@ -85,6 +85,39 @@ // #define NO_AUTO_VBUS_MANAGEMENT // #define INVERTED_VBUS_ENABLE_LINE + #elif (ARCH == ARCH_XMEGA) + + /* Non-USB Related Configuration Tokens: */ +// #define DISABLE_TERMINAL_CODES + + /* USB Class Driver Related Tokens: */ +// #define HID_HOST_BOOT_PROTOCOL_ONLY +// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here} +// #define HID_USAGE_STACK_DEPTH {Insert Value Here} +// #define HID_MAX_COLLECTIONS {Insert Value Here} +// #define HID_MAX_REPORTITEMS {Insert Value Here} +// #define HID_MAX_REPORT_IDS {Insert Value Here} +// #define NO_CLASS_DRIVER_AUTOFLUSH + + /* General USB Driver Related Tokens: */ + #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH) +// #define USB_STREAM_TIMEOUT_MS {Insert Value Here} +// #define NO_LIMITED_CONTROLLER_CONNECT +// #define NO_SOF_EVENTS + + /* USB Device Mode Driver Related Tokens: */ +// #define USE_RAM_DESCRIPTORS + #define USE_FLASH_DESCRIPTORS +// #define USE_EEPROM_DESCRIPTORS +// #define NO_INTERNAL_SERIAL + #define FIXED_CONTROL_ENDPOINT_SIZE 8 +// #define DEVICE_STATE_AS_GPIOR {Insert Value Here} + #define FIXED_NUM_CONFIGURATIONS 1 +// #define CONTROL_ONLY_DEVICE + #define MAX_ENDPOINT_INDEX 3 +// #define NO_DEVICE_REMOTE_WAKEUP +// #define NO_DEVICE_SELF_POWER + #else #error Unsupported architecture for this LUFA configuration file. diff --git a/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c b/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c index 3eba6c383b..c924bacb70 100644 --- a/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c +++ b/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c @@ -65,12 +65,24 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#elif (ARCH == ARCH_XMEGA) + /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */ + XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU); + XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL); + + /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */ + XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ); + XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB); + + PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm; +#endif /* Hardware Initialization */ Joystick_Init(); diff --git a/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.h b/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.h index ac42b346eb..d74482fba2 100644 --- a/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.h +++ b/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.h @@ -46,6 +46,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.txt b/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.txt index b994422a8f..20c89cc80c 100644 --- a/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.txt +++ b/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.txt @@ -14,6 +14,9 @@ * \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) + * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU) + * \li Series B XMEGA AVRs (ATXMEGAxxxBxU) + * \li Series C XMEGA AVRs (ATXMEGAxxxCxU) * * \section Sec_Info USB Information: * diff --git a/Demos/Device/LowLevel/KeyboardMouse/asf.xml b/Demos/Device/LowLevel/KeyboardMouse/asf.xml index 247eeea7f4..d3eca33a40 100644 --- a/Demos/Device/LowLevel/KeyboardMouse/asf.xml +++ b/Demos/Device/LowLevel/KeyboardMouse/asf.xml @@ -1,14 +1,26 @@ - + - + - - + + + + + + + + + + + + + + diff --git a/Demos/Device/LowLevel/MIDI/Config/LUFAConfig.h b/Demos/Device/LowLevel/MIDI/Config/LUFAConfig.h index 3244d3bb7b..a4ca3437f8 100644 --- a/Demos/Device/LowLevel/MIDI/Config/LUFAConfig.h +++ b/Demos/Device/LowLevel/MIDI/Config/LUFAConfig.h @@ -85,6 +85,39 @@ // #define NO_AUTO_VBUS_MANAGEMENT // #define INVERTED_VBUS_ENABLE_LINE + #elif (ARCH == ARCH_XMEGA) + + /* Non-USB Related Configuration Tokens: */ +// #define DISABLE_TERMINAL_CODES + + /* USB Class Driver Related Tokens: */ +// #define HID_HOST_BOOT_PROTOCOL_ONLY +// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here} +// #define HID_USAGE_STACK_DEPTH {Insert Value Here} +// #define HID_MAX_COLLECTIONS {Insert Value Here} +// #define HID_MAX_REPORTITEMS {Insert Value Here} +// #define HID_MAX_REPORT_IDS {Insert Value Here} +// #define NO_CLASS_DRIVER_AUTOFLUSH + + /* General USB Driver Related Tokens: */ + #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH) +// #define USB_STREAM_TIMEOUT_MS {Insert Value Here} +// #define NO_LIMITED_CONTROLLER_CONNECT +// #define NO_SOF_EVENTS + + /* USB Device Mode Driver Related Tokens: */ +// #define USE_RAM_DESCRIPTORS + #define USE_FLASH_DESCRIPTORS +// #define USE_EEPROM_DESCRIPTORS +// #define NO_INTERNAL_SERIAL + #define FIXED_CONTROL_ENDPOINT_SIZE 8 +// #define DEVICE_STATE_AS_GPIOR {Insert Value Here} + #define FIXED_NUM_CONFIGURATIONS 1 +// #define CONTROL_ONLY_DEVICE + #define MAX_ENDPOINT_INDEX 2 +// #define NO_DEVICE_REMOTE_WAKEUP +// #define NO_DEVICE_SELF_POWER + #else #error Unsupported architecture for this LUFA configuration file. diff --git a/Demos/Device/LowLevel/MIDI/MIDI.c b/Demos/Device/LowLevel/MIDI/MIDI.c index deb05614f2..15e08392ba 100644 --- a/Demos/Device/LowLevel/MIDI/MIDI.c +++ b/Demos/Device/LowLevel/MIDI/MIDI.c @@ -56,12 +56,24 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#elif (ARCH == ARCH_XMEGA) + /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */ + XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU); + XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL); + + /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */ + XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ); + XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB); + + PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm; +#endif /* Hardware Initialization */ Joystick_Init(); diff --git a/Demos/Device/LowLevel/MIDI/MIDI.h b/Demos/Device/LowLevel/MIDI/MIDI.h index b97678a2fc..fd07f62f76 100644 --- a/Demos/Device/LowLevel/MIDI/MIDI.h +++ b/Demos/Device/LowLevel/MIDI/MIDI.h @@ -49,6 +49,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Device/LowLevel/MIDI/MIDI.txt b/Demos/Device/LowLevel/MIDI/MIDI.txt index 362250c41e..9ac3d9ea82 100644 --- a/Demos/Device/LowLevel/MIDI/MIDI.txt +++ b/Demos/Device/LowLevel/MIDI/MIDI.txt @@ -14,6 +14,9 @@ * \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) + * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU) + * \li Series B XMEGA AVRs (ATXMEGAxxxBxU) + * \li Series C XMEGA AVRs (ATXMEGAxxxCxU) * * \section Sec_Info USB Information: * diff --git a/Demos/Device/LowLevel/MIDI/asf.xml b/Demos/Device/LowLevel/MIDI/asf.xml index 652d51acd4..de8a016a95 100644 --- a/Demos/Device/LowLevel/MIDI/asf.xml +++ b/Demos/Device/LowLevel/MIDI/asf.xml @@ -1,14 +1,26 @@ - + - + - - + + + + + + + + + + + + + + diff --git a/Demos/Device/LowLevel/MassStorage/Config/LUFAConfig.h b/Demos/Device/LowLevel/MassStorage/Config/LUFAConfig.h index 3b33e2d04a..da728ec292 100644 --- a/Demos/Device/LowLevel/MassStorage/Config/LUFAConfig.h +++ b/Demos/Device/LowLevel/MassStorage/Config/LUFAConfig.h @@ -85,6 +85,39 @@ // #define NO_AUTO_VBUS_MANAGEMENT // #define INVERTED_VBUS_ENABLE_LINE + #elif (ARCH == ARCH_XMEGA) + + /* Non-USB Related Configuration Tokens: */ +// #define DISABLE_TERMINAL_CODES + + /* USB Class Driver Related Tokens: */ +// #define HID_HOST_BOOT_PROTOCOL_ONLY +// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here} +// #define HID_USAGE_STACK_DEPTH {Insert Value Here} +// #define HID_MAX_COLLECTIONS {Insert Value Here} +// #define HID_MAX_REPORTITEMS {Insert Value Here} +// #define HID_MAX_REPORT_IDS {Insert Value Here} +// #define NO_CLASS_DRIVER_AUTOFLUSH + + /* General USB Driver Related Tokens: */ + #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH) +// #define USB_STREAM_TIMEOUT_MS {Insert Value Here} +// #define NO_LIMITED_CONTROLLER_CONNECT +// #define NO_SOF_EVENTS + + /* USB Device Mode Driver Related Tokens: */ +// #define USE_RAM_DESCRIPTORS + #define USE_FLASH_DESCRIPTORS +// #define USE_EEPROM_DESCRIPTORS +// #define NO_INTERNAL_SERIAL + #define FIXED_CONTROL_ENDPOINT_SIZE 8 +// #define DEVICE_STATE_AS_GPIOR {Insert Value Here} + #define FIXED_NUM_CONFIGURATIONS 1 +// #define CONTROL_ONLY_DEVICE + #define MAX_ENDPOINT_INDEX 4 +// #define NO_DEVICE_REMOTE_WAKEUP +// #define NO_DEVICE_SELF_POWER + #else #error Unsupported architecture for this LUFA configuration file. diff --git a/Demos/Device/LowLevel/MassStorage/MassStorage.c b/Demos/Device/LowLevel/MassStorage/MassStorage.c index 7e8bcc4e57..cfb1686fd9 100644 --- a/Demos/Device/LowLevel/MassStorage/MassStorage.c +++ b/Demos/Device/LowLevel/MassStorage/MassStorage.c @@ -67,12 +67,24 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#elif (ARCH == ARCH_XMEGA) + /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */ + XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU); + XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL); + + /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */ + XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ); + XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB); + + PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm; +#endif /* Hardware Initialization */ LEDs_Init(); diff --git a/Demos/Device/LowLevel/MassStorage/MassStorage.h b/Demos/Device/LowLevel/MassStorage/MassStorage.h index edb3b855e4..634ed09c73 100644 --- a/Demos/Device/LowLevel/MassStorage/MassStorage.h +++ b/Demos/Device/LowLevel/MassStorage/MassStorage.h @@ -51,6 +51,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Device/LowLevel/MassStorage/MassStorage.txt b/Demos/Device/LowLevel/MassStorage/MassStorage.txt index b5f9f9cef7..528dbe7536 100644 --- a/Demos/Device/LowLevel/MassStorage/MassStorage.txt +++ b/Demos/Device/LowLevel/MassStorage/MassStorage.txt @@ -14,6 +14,9 @@ * \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) + * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU) + * \li Series B XMEGA AVRs (ATXMEGAxxxBxU) + * \li Series C XMEGA AVRs (ATXMEGAxxxCxU) * * \section Sec_Info USB Information: * diff --git a/Demos/Device/LowLevel/MassStorage/asf.xml b/Demos/Device/LowLevel/MassStorage/asf.xml index a859733f58..46f25cca51 100644 --- a/Demos/Device/LowLevel/MassStorage/asf.xml +++ b/Demos/Device/LowLevel/MassStorage/asf.xml @@ -1,14 +1,26 @@ - + - + - - + + + + + + + + + + + + + + diff --git a/Demos/Device/LowLevel/Mouse/Config/LUFAConfig.h b/Demos/Device/LowLevel/Mouse/Config/LUFAConfig.h index 3244d3bb7b..3871759b67 100644 --- a/Demos/Device/LowLevel/Mouse/Config/LUFAConfig.h +++ b/Demos/Device/LowLevel/Mouse/Config/LUFAConfig.h @@ -85,6 +85,39 @@ // #define NO_AUTO_VBUS_MANAGEMENT // #define INVERTED_VBUS_ENABLE_LINE + #elif (ARCH == ARCH_XMEGA) + + /* Non-USB Related Configuration Tokens: */ +// #define DISABLE_TERMINAL_CODES + + /* USB Class Driver Related Tokens: */ +// #define HID_HOST_BOOT_PROTOCOL_ONLY +// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here} +// #define HID_USAGE_STACK_DEPTH {Insert Value Here} +// #define HID_MAX_COLLECTIONS {Insert Value Here} +// #define HID_MAX_REPORTITEMS {Insert Value Here} +// #define HID_MAX_REPORT_IDS {Insert Value Here} +// #define NO_CLASS_DRIVER_AUTOFLUSH + + /* General USB Driver Related Tokens: */ + #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH) +// #define USB_STREAM_TIMEOUT_MS {Insert Value Here} +// #define NO_LIMITED_CONTROLLER_CONNECT +// #define NO_SOF_EVENTS + + /* USB Device Mode Driver Related Tokens: */ +// #define USE_RAM_DESCRIPTORS + #define USE_FLASH_DESCRIPTORS +// #define USE_EEPROM_DESCRIPTORS +// #define NO_INTERNAL_SERIAL + #define FIXED_CONTROL_ENDPOINT_SIZE 8 +// #define DEVICE_STATE_AS_GPIOR {Insert Value Here} + #define FIXED_NUM_CONFIGURATIONS 1 +// #define CONTROL_ONLY_DEVICE + #define MAX_ENDPOINT_INDEX 1 +// #define NO_DEVICE_REMOTE_WAKEUP +// #define NO_DEVICE_SELF_POWER + #else #error Unsupported architecture for this LUFA configuration file. diff --git a/Demos/Device/LowLevel/Mouse/Mouse.c b/Demos/Device/LowLevel/Mouse/Mouse.c index 7575a81f56..601eebec58 100644 --- a/Demos/Device/LowLevel/Mouse/Mouse.c +++ b/Demos/Device/LowLevel/Mouse/Mouse.c @@ -73,12 +73,24 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#elif (ARCH == ARCH_XMEGA) + /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */ + XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU); + XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL); + + /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */ + XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ); + XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB); + + PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm; +#endif /* Hardware Initialization */ Joystick_Init(); diff --git a/Demos/Device/LowLevel/Mouse/Mouse.h b/Demos/Device/LowLevel/Mouse/Mouse.h index e11b1fac84..23cf1335ca 100644 --- a/Demos/Device/LowLevel/Mouse/Mouse.h +++ b/Demos/Device/LowLevel/Mouse/Mouse.h @@ -45,11 +45,12 @@ #include #include "Descriptors.h" - + #include #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Device/LowLevel/Mouse/Mouse.txt b/Demos/Device/LowLevel/Mouse/Mouse.txt index 0664cba635..7f1c38430f 100644 --- a/Demos/Device/LowLevel/Mouse/Mouse.txt +++ b/Demos/Device/LowLevel/Mouse/Mouse.txt @@ -14,6 +14,9 @@ * \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) + * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU) + * \li Series B XMEGA AVRs (ATXMEGAxxxBxU) + * \li Series C XMEGA AVRs (ATXMEGAxxxCxU) * * \section Sec_Info USB Information: * diff --git a/Demos/Device/LowLevel/Mouse/asf.xml b/Demos/Device/LowLevel/Mouse/asf.xml index ed0c537c8b..0f471ff08f 100644 --- a/Demos/Device/LowLevel/Mouse/asf.xml +++ b/Demos/Device/LowLevel/Mouse/asf.xml @@ -1,14 +1,26 @@ - + - + - - + + + + + + + + + + + + + + diff --git a/Demos/Device/LowLevel/RNDISEthernet/Config/LUFAConfig.h b/Demos/Device/LowLevel/RNDISEthernet/Config/LUFAConfig.h index 3244d3bb7b..4873f80315 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Config/LUFAConfig.h +++ b/Demos/Device/LowLevel/RNDISEthernet/Config/LUFAConfig.h @@ -85,6 +85,39 @@ // #define NO_AUTO_VBUS_MANAGEMENT // #define INVERTED_VBUS_ENABLE_LINE + #elif (ARCH == ARCH_XMEGA) + + /* Non-USB Related Configuration Tokens: */ +// #define DISABLE_TERMINAL_CODES + + /* USB Class Driver Related Tokens: */ +// #define HID_HOST_BOOT_PROTOCOL_ONLY +// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here} +// #define HID_USAGE_STACK_DEPTH {Insert Value Here} +// #define HID_MAX_COLLECTIONS {Insert Value Here} +// #define HID_MAX_REPORTITEMS {Insert Value Here} +// #define HID_MAX_REPORT_IDS {Insert Value Here} +// #define NO_CLASS_DRIVER_AUTOFLUSH + + /* General USB Driver Related Tokens: */ + #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH) +// #define USB_STREAM_TIMEOUT_MS {Insert Value Here} +// #define NO_LIMITED_CONTROLLER_CONNECT +// #define NO_SOF_EVENTS + + /* USB Device Mode Driver Related Tokens: */ +// #define USE_RAM_DESCRIPTORS + #define USE_FLASH_DESCRIPTORS +// #define USE_EEPROM_DESCRIPTORS +// #define NO_INTERNAL_SERIAL + #define FIXED_CONTROL_ENDPOINT_SIZE 8 +// #define DEVICE_STATE_AS_GPIOR {Insert Value Here} + #define FIXED_NUM_CONFIGURATIONS 1 +// #define CONTROL_ONLY_DEVICE + #define MAX_ENDPOINT_INDEX 3 +// #define NO_DEVICE_REMOTE_WAKEUP +// #define NO_DEVICE_SELF_POWER + #else #error Unsupported architecture for this LUFA configuration file. diff --git a/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c b/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c index 52085f89c2..2837a1088b 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c +++ b/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c @@ -62,12 +62,24 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#elif (ARCH == ARCH_XMEGA) + /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */ + XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU); + XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL); + + /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */ + XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ); + XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB); + + PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm; +#endif /* Hardware Initialization */ LEDs_Init(); diff --git a/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.h b/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.h index ec53e7bcad..37affda8d6 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.h +++ b/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.h @@ -51,10 +51,11 @@ #include "Lib/ARP.h" #include "Lib/Webserver.h" #include "Config/AppConfig.h" - + #include #include #include + #include /* Macros: */ /** Notification value to indicate that a frame is ready to be read by the host. */ diff --git a/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.txt b/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.txt index ac72d4ae7f..aafa3cc439 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.txt +++ b/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.txt @@ -12,6 +12,9 @@ * * \li Series 7 USB AVRs (AT90USBxxx7) * \li Series 6 USB AVRs (AT90USBxxx6) + * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU) + * \li Series B XMEGA AVRs (ATXMEGAxxxBxU) + * \li Series C XMEGA AVRs (ATXMEGAxxxCxU) * * \section Sec_Info USB Information: * diff --git a/Demos/Device/LowLevel/RNDISEthernet/asf.xml b/Demos/Device/LowLevel/RNDISEthernet/asf.xml index 59c373a0e2..12fc761f8e 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/asf.xml +++ b/Demos/Device/LowLevel/RNDISEthernet/asf.xml @@ -1,14 +1,26 @@ - + - + - - + + + + + + + + + + + + + + diff --git a/Demos/Device/LowLevel/VirtualSerial/Config/LUFAConfig.h b/Demos/Device/LowLevel/VirtualSerial/Config/LUFAConfig.h index 3244d3bb7b..7b4e026a14 100644 --- a/Demos/Device/LowLevel/VirtualSerial/Config/LUFAConfig.h +++ b/Demos/Device/LowLevel/VirtualSerial/Config/LUFAConfig.h @@ -85,6 +85,39 @@ // #define NO_AUTO_VBUS_MANAGEMENT // #define INVERTED_VBUS_ENABLE_LINE + #elif (ARCH == ARCH_XMEGA) + + /* Non-USB Related Configuration Tokens: */ +// #define DISABLE_TERMINAL_CODES + + /* USB Class Driver Related Tokens: */ +// #define HID_HOST_BOOT_PROTOCOL_ONLY +// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here} +// #define HID_USAGE_STACK_DEPTH {Insert Value Here} +// #define HID_MAX_COLLECTIONS {Insert Value Here} +// #define HID_MAX_REPORTITEMS {Insert Value Here} +// #define HID_MAX_REPORT_IDS {Insert Value Here} +// #define NO_CLASS_DRIVER_AUTOFLUSH + + /* General USB Driver Related Tokens: */ + #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_RC32MCLKSRC | USB_OPT_BUSEVENT_PRIHIGH) +// #define USB_STREAM_TIMEOUT_MS {Insert Value Here} +// #define NO_LIMITED_CONTROLLER_CONNECT +// #define NO_SOF_EVENTS + + /* USB Device Mode Driver Related Tokens: */ +// #define USE_RAM_DESCRIPTORS + #define USE_FLASH_DESCRIPTORS +// #define USE_EEPROM_DESCRIPTORS +// #define NO_INTERNAL_SERIAL + #define FIXED_CONTROL_ENDPOINT_SIZE 8 +// #define DEVICE_STATE_AS_GPIOR {Insert Value Here} + #define FIXED_NUM_CONFIGURATIONS 1 +// #define CONTROL_ONLY_DEVICE + #define MAX_ENDPOINT_INDEX 4 +// #define NO_DEVICE_REMOTE_WAKEUP +// #define NO_DEVICE_SELF_POWER + #else #error Unsupported architecture for this LUFA configuration file. diff --git a/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.c b/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.c index 998aede8ae..3c005f7d34 100644 --- a/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.c +++ b/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.c @@ -70,12 +70,24 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#elif (ARCH == ARCH_XMEGA) + /* Start the PLL to multiply the 2MHz RC oscillator to 32MHz and switch the CPU core to run from it */ + XMEGACLK_StartPLL(CLOCK_SRC_INT_RC2MHZ, 2000000, F_CPU); + XMEGACLK_SetCPUClockSource(CLOCK_SRC_PLL); + + /* Start the 32MHz internal RC oscillator and start the DFLL to increase it to 48MHz using the USB SOF as a reference */ + XMEGACLK_StartInternalOscillator(CLOCK_SRC_INT_RC32MHZ); + XMEGACLK_StartDFLL(CLOCK_SRC_INT_RC32MHZ, DFLL_REF_INT_USBSOF, F_USB); + + PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm; +#endif /* Hardware Initialization */ Joystick_Init(); diff --git a/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.h b/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.h index 5b985ced54..db5fe9d047 100644 --- a/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.h +++ b/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.h @@ -48,6 +48,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.txt b/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.txt index e0a3291b4f..61b665674f 100644 --- a/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.txt +++ b/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.txt @@ -14,6 +14,9 @@ * \li Series 6 USB AVRs (AT90USBxxx6) * \li Series 4 USB AVRs (ATMEGAxxU4) * \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) + * \li Series AU XMEGA AVRs (ATXMEGAxxxAxU) + * \li Series B XMEGA AVRs (ATXMEGAxxxBxU) + * \li Series C XMEGA AVRs (ATXMEGAxxxCxU) * * \section Sec_Info USB Information: * diff --git a/Demos/Device/LowLevel/VirtualSerial/asf.xml b/Demos/Device/LowLevel/VirtualSerial/asf.xml index bb2c0fcc83..091bb1dd0c 100644 --- a/Demos/Device/LowLevel/VirtualSerial/asf.xml +++ b/Demos/Device/LowLevel/VirtualSerial/asf.xml @@ -1,14 +1,26 @@ - + - + - - + + + + + + + + + + + + + + diff --git a/Demos/DualRole/ClassDriver/MouseHostDevice/MouseHostDevice.c b/Demos/DualRole/ClassDriver/MouseHostDevice/MouseHostDevice.c index 620e809b47..f7c3c01ce7 100644 --- a/Demos/DualRole/ClassDriver/MouseHostDevice/MouseHostDevice.c +++ b/Demos/DualRole/ClassDriver/MouseHostDevice/MouseHostDevice.c @@ -68,12 +68,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ Serial_Init(9600, false); diff --git a/Demos/DualRole/ClassDriver/MouseHostDevice/MouseHostDevice.h b/Demos/DualRole/ClassDriver/MouseHostDevice/MouseHostDevice.h index 48b6389eea..12699398a2 100644 --- a/Demos/DualRole/ClassDriver/MouseHostDevice/MouseHostDevice.h +++ b/Demos/DualRole/ClassDriver/MouseHostDevice/MouseHostDevice.h @@ -50,6 +50,7 @@ #include #include #include + #include #include "Descriptors.h" #include "DeviceFunctions.h" @@ -70,7 +71,7 @@ /* Function Prototypes: */ void SetupHardware(void); - + void EVENT_USB_UIDChange(void); #endif diff --git a/Demos/DualRole/ClassDriver/MouseHostDevice/asf.xml b/Demos/DualRole/ClassDriver/MouseHostDevice/asf.xml index d2b4214bdf..19a0905f0a 100644 --- a/Demos/DualRole/ClassDriver/MouseHostDevice/asf.xml +++ b/Demos/DualRole/ClassDriver/MouseHostDevice/asf.xml @@ -1,14 +1,14 @@ - + - + - - + + diff --git a/Demos/Host/ClassDriver/AndroidAccessoryHost/AndroidAccessoryHost.c b/Demos/Host/ClassDriver/AndroidAccessoryHost/AndroidAccessoryHost.c index d103b5d336..a4248e2011 100644 --- a/Demos/Host/ClassDriver/AndroidAccessoryHost/AndroidAccessoryHost.c +++ b/Demos/Host/ClassDriver/AndroidAccessoryHost/AndroidAccessoryHost.c @@ -91,12 +91,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ Serial_Init(9600, false); diff --git a/Demos/Host/ClassDriver/AndroidAccessoryHost/AndroidAccessoryHost.h b/Demos/Host/ClassDriver/AndroidAccessoryHost/AndroidAccessoryHost.h index d0abfeff69..58b18e94cc 100644 --- a/Demos/Host/ClassDriver/AndroidAccessoryHost/AndroidAccessoryHost.h +++ b/Demos/Host/ClassDriver/AndroidAccessoryHost/AndroidAccessoryHost.h @@ -48,6 +48,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Host/ClassDriver/AndroidAccessoryHost/asf.xml b/Demos/Host/ClassDriver/AndroidAccessoryHost/asf.xml index 19c6348c24..c31e66320f 100644 --- a/Demos/Host/ClassDriver/AndroidAccessoryHost/asf.xml +++ b/Demos/Host/ClassDriver/AndroidAccessoryHost/asf.xml @@ -1,14 +1,14 @@ - + - + - - + + diff --git a/Demos/Host/ClassDriver/AudioInputHost/AudioInputHost.c b/Demos/Host/ClassDriver/AudioInputHost/AudioInputHost.c index bc6ade835a..fe02356886 100644 --- a/Demos/Host/ClassDriver/AudioInputHost/AudioInputHost.c +++ b/Demos/Host/ClassDriver/AudioInputHost/AudioInputHost.c @@ -106,12 +106,14 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK) /** 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); diff --git a/Demos/Host/ClassDriver/AudioInputHost/AudioInputHost.h b/Demos/Host/ClassDriver/AudioInputHost/AudioInputHost.h index b802a58ac4..3da8d88f40 100644 --- a/Demos/Host/ClassDriver/AudioInputHost/AudioInputHost.h +++ b/Demos/Host/ClassDriver/AudioInputHost/AudioInputHost.h @@ -48,6 +48,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Host/ClassDriver/AudioInputHost/asf.xml b/Demos/Host/ClassDriver/AudioInputHost/asf.xml index 5c28af91c7..ac0d067fb6 100644 --- a/Demos/Host/ClassDriver/AudioInputHost/asf.xml +++ b/Demos/Host/ClassDriver/AudioInputHost/asf.xml @@ -1,14 +1,14 @@ - + - + - - + + diff --git a/Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.c b/Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.c index 30e60e5da5..6faa8fe30b 100644 --- a/Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.c +++ b/Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.c @@ -111,12 +111,14 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK) /** 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); @@ -128,9 +130,9 @@ void SetupHardware(void) /* 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 diff --git a/Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.h b/Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.h index 35f881cd5a..543f88ddce 100644 --- a/Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.h +++ b/Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.h @@ -50,7 +50,8 @@ #include #include #include - + #include + #include "Config/AppConfig.h" /* Macros: */ diff --git a/Demos/Host/ClassDriver/AudioOutputHost/asf.xml b/Demos/Host/ClassDriver/AudioOutputHost/asf.xml index 19f915c01f..5b53faffd0 100644 --- a/Demos/Host/ClassDriver/AudioOutputHost/asf.xml +++ b/Demos/Host/ClassDriver/AudioOutputHost/asf.xml @@ -1,14 +1,14 @@ - + - + - - + + diff --git a/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c b/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c index e2f49bcd63..dc0532e6a0 100644 --- a/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c +++ b/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c @@ -87,12 +87,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ Serial_Init(9600, false); diff --git a/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.h b/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.h index e290407901..b66216e1bd 100644 --- a/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.h +++ b/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.h @@ -48,6 +48,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Host/ClassDriver/JoystickHostWithParser/asf.xml b/Demos/Host/ClassDriver/JoystickHostWithParser/asf.xml index 29eb917645..54a5a2ce52 100644 --- a/Demos/Host/ClassDriver/JoystickHostWithParser/asf.xml +++ b/Demos/Host/ClassDriver/JoystickHostWithParser/asf.xml @@ -1,14 +1,14 @@ - + - + - - + + diff --git a/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c b/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c index 95b96cd3f4..ee86cfcdd0 100644 --- a/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c +++ b/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c @@ -83,12 +83,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ Serial_Init(9600, false); diff --git a/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.h b/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.h index e890df455e..aaf0477a27 100644 --- a/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.h +++ b/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.h @@ -48,6 +48,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Host/ClassDriver/KeyboardHost/asf.xml b/Demos/Host/ClassDriver/KeyboardHost/asf.xml index 76762067fc..f9d6067e0e 100644 --- a/Demos/Host/ClassDriver/KeyboardHost/asf.xml +++ b/Demos/Host/ClassDriver/KeyboardHost/asf.xml @@ -1,14 +1,14 @@ - + - + - - + + diff --git a/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c b/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c index 58c5029f66..c47d719eeb 100644 --- a/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c +++ b/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c @@ -87,12 +87,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ Serial_Init(9600, false); diff --git a/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.h b/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.h index 63078fb0f4..643e2f3afe 100644 --- a/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.h +++ b/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.h @@ -48,6 +48,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Host/ClassDriver/KeyboardHostWithParser/asf.xml b/Demos/Host/ClassDriver/KeyboardHostWithParser/asf.xml index c7352f641e..fdd3e79972 100644 --- a/Demos/Host/ClassDriver/KeyboardHostWithParser/asf.xml +++ b/Demos/Host/ClassDriver/KeyboardHostWithParser/asf.xml @@ -1,14 +1,14 @@ - + - + - - + + diff --git a/Demos/Host/ClassDriver/MIDIHost/MIDIHost.c b/Demos/Host/ClassDriver/MIDIHost/MIDIHost.c index 6e8c3e2441..1160f63199 100644 --- a/Demos/Host/ClassDriver/MIDIHost/MIDIHost.c +++ b/Demos/Host/ClassDriver/MIDIHost/MIDIHost.c @@ -82,12 +82,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ Serial_Init(9600, false); diff --git a/Demos/Host/ClassDriver/MIDIHost/MIDIHost.h b/Demos/Host/ClassDriver/MIDIHost/MIDIHost.h index 1b8619d7e7..db1aaf6127 100644 --- a/Demos/Host/ClassDriver/MIDIHost/MIDIHost.h +++ b/Demos/Host/ClassDriver/MIDIHost/MIDIHost.h @@ -50,6 +50,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Host/ClassDriver/MIDIHost/asf.xml b/Demos/Host/ClassDriver/MIDIHost/asf.xml index 3ae82cbf8b..b52521f479 100644 --- a/Demos/Host/ClassDriver/MIDIHost/asf.xml +++ b/Demos/Host/ClassDriver/MIDIHost/asf.xml @@ -1,14 +1,14 @@ - + - + - - + + diff --git a/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c b/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c index a09ae54e96..ead53a801b 100644 --- a/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c +++ b/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c @@ -82,12 +82,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ Serial_Init(9600, false); diff --git a/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.h b/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.h index d3a906a613..519aad7137 100644 --- a/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.h +++ b/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.h @@ -49,6 +49,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Host/ClassDriver/MassStorageHost/asf.xml b/Demos/Host/ClassDriver/MassStorageHost/asf.xml index 7eb2a6b549..dbc871e9d4 100644 --- a/Demos/Host/ClassDriver/MassStorageHost/asf.xml +++ b/Demos/Host/ClassDriver/MassStorageHost/asf.xml @@ -1,14 +1,14 @@ - + - + - - + + diff --git a/Demos/Host/ClassDriver/MouseHost/MouseHost.c b/Demos/Host/ClassDriver/MouseHost/MouseHost.c index e56590262a..7b3d20b541 100644 --- a/Demos/Host/ClassDriver/MouseHost/MouseHost.c +++ b/Demos/Host/ClassDriver/MouseHost/MouseHost.c @@ -83,12 +83,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ Serial_Init(9600, false); diff --git a/Demos/Host/ClassDriver/MouseHost/MouseHost.h b/Demos/Host/ClassDriver/MouseHost/MouseHost.h index d6c50f9e5d..b256641742 100644 --- a/Demos/Host/ClassDriver/MouseHost/MouseHost.h +++ b/Demos/Host/ClassDriver/MouseHost/MouseHost.h @@ -48,6 +48,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Host/ClassDriver/MouseHost/asf.xml b/Demos/Host/ClassDriver/MouseHost/asf.xml index 1bc0a31040..ecc6218544 100644 --- a/Demos/Host/ClassDriver/MouseHost/asf.xml +++ b/Demos/Host/ClassDriver/MouseHost/asf.xml @@ -1,14 +1,14 @@ - + - + - - + + diff --git a/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c b/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c index 0ecab535f2..265a8f66c5 100644 --- a/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c +++ b/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c @@ -87,12 +87,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ Serial_Init(9600, false); diff --git a/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.h b/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.h index cb5c3130f2..d0dd9a9ff5 100644 --- a/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.h +++ b/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.h @@ -48,6 +48,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Host/ClassDriver/MouseHostWithParser/asf.xml b/Demos/Host/ClassDriver/MouseHostWithParser/asf.xml index c1a4755787..a9ca34bff7 100644 --- a/Demos/Host/ClassDriver/MouseHostWithParser/asf.xml +++ b/Demos/Host/ClassDriver/MouseHostWithParser/asf.xml @@ -1,14 +1,14 @@ - + - + - - + + diff --git a/Demos/Host/ClassDriver/PrinterHost/PrinterHost.c b/Demos/Host/ClassDriver/PrinterHost/PrinterHost.c index 4c82291907..3a19a7efdd 100644 --- a/Demos/Host/ClassDriver/PrinterHost/PrinterHost.c +++ b/Demos/Host/ClassDriver/PrinterHost/PrinterHost.c @@ -82,12 +82,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ Serial_Init(9600, false); diff --git a/Demos/Host/ClassDriver/PrinterHost/PrinterHost.h b/Demos/Host/ClassDriver/PrinterHost/PrinterHost.h index 0bbec9ff19..6d289d18a6 100644 --- a/Demos/Host/ClassDriver/PrinterHost/PrinterHost.h +++ b/Demos/Host/ClassDriver/PrinterHost/PrinterHost.h @@ -48,6 +48,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Host/ClassDriver/PrinterHost/asf.xml b/Demos/Host/ClassDriver/PrinterHost/asf.xml index 69b4e13146..fa704ff5ed 100644 --- a/Demos/Host/ClassDriver/PrinterHost/asf.xml +++ b/Demos/Host/ClassDriver/PrinterHost/asf.xml @@ -1,14 +1,14 @@ - + - + - - + + diff --git a/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.c b/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.c index b512735d18..50e2e50b35 100644 --- a/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.c +++ b/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.c @@ -117,12 +117,14 @@ void RNDISHost_Task(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 */ Serial_Init(9600, false); diff --git a/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.h b/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.h index 602421c804..965ff447a0 100644 --- a/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.h +++ b/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.h @@ -48,6 +48,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Host/ClassDriver/RNDISEthernetHost/asf.xml b/Demos/Host/ClassDriver/RNDISEthernetHost/asf.xml index 5c55c5a70c..8199f2d927 100644 --- a/Demos/Host/ClassDriver/RNDISEthernetHost/asf.xml +++ b/Demos/Host/ClassDriver/RNDISEthernetHost/asf.xml @@ -1,14 +1,14 @@ - + - + - - + + diff --git a/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c b/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c index 35a98eb239..a08be21155 100644 --- a/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c +++ b/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c @@ -87,12 +87,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ Serial_Init(9600, false); diff --git a/Demos/Host/ClassDriver/StillImageHost/StillImageHost.h b/Demos/Host/ClassDriver/StillImageHost/StillImageHost.h index abe0e05811..e8110a6d9f 100644 --- a/Demos/Host/ClassDriver/StillImageHost/StillImageHost.h +++ b/Demos/Host/ClassDriver/StillImageHost/StillImageHost.h @@ -48,6 +48,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Host/ClassDriver/StillImageHost/asf.xml b/Demos/Host/ClassDriver/StillImageHost/asf.xml index 3703164f4c..947178288b 100644 --- a/Demos/Host/ClassDriver/StillImageHost/asf.xml +++ b/Demos/Host/ClassDriver/StillImageHost/asf.xml @@ -1,14 +1,14 @@ - + - + - - + + diff --git a/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.c b/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.c index 13c8018edb..c20a7dead5 100644 --- a/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.c +++ b/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.c @@ -87,12 +87,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ Serial_Init(9600, false); @@ -170,17 +172,17 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void) 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")); diff --git a/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.h b/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.h index 4aec83051b..1c63166ec5 100644 --- a/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.h +++ b/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.h @@ -48,6 +48,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Host/ClassDriver/VirtualSerialHost/asf.xml b/Demos/Host/ClassDriver/VirtualSerialHost/asf.xml index 67eb347cd6..4d0ebb0f83 100644 --- a/Demos/Host/ClassDriver/VirtualSerialHost/asf.xml +++ b/Demos/Host/ClassDriver/VirtualSerialHost/asf.xml @@ -1,14 +1,14 @@ - + - + - - + + diff --git a/Demos/Host/LowLevel/AndroidAccessoryHost/AndroidAccessoryHost.c b/Demos/Host/LowLevel/AndroidAccessoryHost/AndroidAccessoryHost.c index 72190a42bd..e84b877b89 100644 --- a/Demos/Host/LowLevel/AndroidAccessoryHost/AndroidAccessoryHost.c +++ b/Demos/Host/LowLevel/AndroidAccessoryHost/AndroidAccessoryHost.c @@ -58,12 +58,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ Serial_Init(9600, false); diff --git a/Demos/Host/LowLevel/AndroidAccessoryHost/AndroidAccessoryHost.h b/Demos/Host/LowLevel/AndroidAccessoryHost/AndroidAccessoryHost.h index 5383d86c4d..395206d404 100644 --- a/Demos/Host/LowLevel/AndroidAccessoryHost/AndroidAccessoryHost.h +++ b/Demos/Host/LowLevel/AndroidAccessoryHost/AndroidAccessoryHost.h @@ -52,6 +52,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Host/LowLevel/AndroidAccessoryHost/asf.xml b/Demos/Host/LowLevel/AndroidAccessoryHost/asf.xml index 0100f60ee0..9d95cb5d23 100644 --- a/Demos/Host/LowLevel/AndroidAccessoryHost/asf.xml +++ b/Demos/Host/LowLevel/AndroidAccessoryHost/asf.xml @@ -1,14 +1,14 @@ - + - + - - + + diff --git a/Demos/Host/LowLevel/AudioInputHost/AudioInputHost.c b/Demos/Host/LowLevel/AudioInputHost/AudioInputHost.c index 9e6ddd3605..a4d083b9f3 100644 --- a/Demos/Host/LowLevel/AudioInputHost/AudioInputHost.c +++ b/Demos/Host/LowLevel/AudioInputHost/AudioInputHost.c @@ -57,12 +57,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ Serial_Init(9600, false); diff --git a/Demos/Host/LowLevel/AudioInputHost/AudioInputHost.h b/Demos/Host/LowLevel/AudioInputHost/AudioInputHost.h index febd6eae7b..abf19732c7 100644 --- a/Demos/Host/LowLevel/AudioInputHost/AudioInputHost.h +++ b/Demos/Host/LowLevel/AudioInputHost/AudioInputHost.h @@ -48,6 +48,7 @@ #include #include #include + #include #include "ConfigDescriptor.h" diff --git a/Demos/Host/LowLevel/AudioInputHost/asf.xml b/Demos/Host/LowLevel/AudioInputHost/asf.xml index f043fb9ed2..6c565b3bc5 100644 --- a/Demos/Host/LowLevel/AudioInputHost/asf.xml +++ b/Demos/Host/LowLevel/AudioInputHost/asf.xml @@ -1,14 +1,14 @@ - + - + - - + + diff --git a/Demos/Host/LowLevel/AudioOutputHost/AudioOutputHost.c b/Demos/Host/LowLevel/AudioOutputHost/AudioOutputHost.c index dfe0609a80..5d62508826 100644 --- a/Demos/Host/LowLevel/AudioOutputHost/AudioOutputHost.c +++ b/Demos/Host/LowLevel/AudioOutputHost/AudioOutputHost.c @@ -57,12 +57,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ Serial_Init(9600, false); @@ -76,7 +78,7 @@ void SetupHardware(void) 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 diff --git a/Demos/Host/LowLevel/AudioOutputHost/AudioOutputHost.h b/Demos/Host/LowLevel/AudioOutputHost/AudioOutputHost.h index 58655ba28f..3c4ef5b808 100644 --- a/Demos/Host/LowLevel/AudioOutputHost/AudioOutputHost.h +++ b/Demos/Host/LowLevel/AudioOutputHost/AudioOutputHost.h @@ -50,6 +50,7 @@ #include #include #include + #include #include "ConfigDescriptor.h" #include "Config/AppConfig.h" diff --git a/Demos/Host/LowLevel/AudioOutputHost/asf.xml b/Demos/Host/LowLevel/AudioOutputHost/asf.xml index 2008324525..a56c84d099 100644 --- a/Demos/Host/LowLevel/AudioOutputHost/asf.xml +++ b/Demos/Host/LowLevel/AudioOutputHost/asf.xml @@ -1,14 +1,14 @@ - + - + - - + + diff --git a/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.c b/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.c index 392620461d..35794df0ec 100644 --- a/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.c +++ b/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.c @@ -59,12 +59,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ Serial_Init(9600, false); diff --git a/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.h b/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.h index ac9cd24bc1..8c05d301ec 100644 --- a/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.h +++ b/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.h @@ -48,6 +48,7 @@ #include #include #include + #include #include "ConfigDescriptor.h" diff --git a/Demos/Host/LowLevel/GenericHIDHost/asf.xml b/Demos/Host/LowLevel/GenericHIDHost/asf.xml index 17cc78aa0c..12df51faa6 100644 --- a/Demos/Host/LowLevel/GenericHIDHost/asf.xml +++ b/Demos/Host/LowLevel/GenericHIDHost/asf.xml @@ -1,14 +1,14 @@ - + - + - - + + diff --git a/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.c b/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.c index bc5a457dad..35e34692b8 100644 --- a/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.c +++ b/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.c @@ -59,12 +59,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ Serial_Init(9600, false); diff --git a/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.h b/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.h index a6acd1a249..90bc70f410 100644 --- a/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.h +++ b/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.h @@ -48,6 +48,7 @@ #include #include #include + #include #include "ConfigDescriptor.h" #include "HIDReport.h" diff --git a/Demos/Host/LowLevel/JoystickHostWithParser/asf.xml b/Demos/Host/LowLevel/JoystickHostWithParser/asf.xml index 2450519958..cf877064d2 100644 --- a/Demos/Host/LowLevel/JoystickHostWithParser/asf.xml +++ b/Demos/Host/LowLevel/JoystickHostWithParser/asf.xml @@ -1,14 +1,14 @@ - + - + - - + + diff --git a/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.c b/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.c index a5a24aba96..f10191a0e7 100644 --- a/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.c +++ b/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.c @@ -59,12 +59,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ Serial_Init(9600, false); diff --git a/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.h b/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.h index 0f38db74f8..e11e63f7f9 100644 --- a/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.h +++ b/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.h @@ -48,6 +48,7 @@ #include #include #include + #include #include "ConfigDescriptor.h" diff --git a/Demos/Host/LowLevel/KeyboardHost/asf.xml b/Demos/Host/LowLevel/KeyboardHost/asf.xml index db3efd16bd..32a88aff82 100644 --- a/Demos/Host/LowLevel/KeyboardHost/asf.xml +++ b/Demos/Host/LowLevel/KeyboardHost/asf.xml @@ -1,14 +1,14 @@ - + - + - - + + diff --git a/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c b/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c index 9587d71088..e02d583e53 100644 --- a/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c +++ b/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c @@ -59,12 +59,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ Serial_Init(9600, false); diff --git a/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.h b/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.h index 7d384d6d24..14a56931a7 100644 --- a/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.h +++ b/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.h @@ -43,6 +43,7 @@ #include #include #include + #include #include "ConfigDescriptor.h" #include "HIDReport.h" diff --git a/Demos/Host/LowLevel/KeyboardHostWithParser/asf.xml b/Demos/Host/LowLevel/KeyboardHostWithParser/asf.xml index e6f343deba..1b781972c3 100644 --- a/Demos/Host/LowLevel/KeyboardHostWithParser/asf.xml +++ b/Demos/Host/LowLevel/KeyboardHostWithParser/asf.xml @@ -1,14 +1,14 @@ - + - + - - + + diff --git a/Demos/Host/LowLevel/MIDIHost/MIDIHost.c b/Demos/Host/LowLevel/MIDIHost/MIDIHost.c index 7cef4427d5..620cbc988a 100644 --- a/Demos/Host/LowLevel/MIDIHost/MIDIHost.c +++ b/Demos/Host/LowLevel/MIDIHost/MIDIHost.c @@ -59,12 +59,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ Serial_Init(9600, false); @@ -188,7 +190,7 @@ void MIDIHost_Task(void) MIDIEvent.Data2, MIDIEvent.Data3); } } - + Pipe_Freeze(); Pipe_SelectPipe(MIDI_DATA_OUT_PIPE); diff --git a/Demos/Host/LowLevel/MIDIHost/MIDIHost.h b/Demos/Host/LowLevel/MIDIHost/MIDIHost.h index 73933c03ab..fd250016c6 100644 --- a/Demos/Host/LowLevel/MIDIHost/MIDIHost.h +++ b/Demos/Host/LowLevel/MIDIHost/MIDIHost.h @@ -50,6 +50,7 @@ #include #include #include + #include #include "ConfigDescriptor.h" diff --git a/Demos/Host/LowLevel/MIDIHost/asf.xml b/Demos/Host/LowLevel/MIDIHost/asf.xml index 1ecde005af..862f71928d 100644 --- a/Demos/Host/LowLevel/MIDIHost/asf.xml +++ b/Demos/Host/LowLevel/MIDIHost/asf.xml @@ -1,14 +1,14 @@ - + - + - - + + diff --git a/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c b/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c index b3757981c6..ff32da5bf6 100644 --- a/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c +++ b/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c @@ -63,12 +63,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ Serial_Init(9600, false); diff --git a/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.h b/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.h index 2229ff3b93..429193dd63 100644 --- a/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.h +++ b/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.h @@ -55,6 +55,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Host/LowLevel/MassStorageHost/asf.xml b/Demos/Host/LowLevel/MassStorageHost/asf.xml index fd93fc644f..1ee5870ba5 100644 --- a/Demos/Host/LowLevel/MassStorageHost/asf.xml +++ b/Demos/Host/LowLevel/MassStorageHost/asf.xml @@ -1,14 +1,14 @@ - + - + - - + + diff --git a/Demos/Host/LowLevel/MouseHost/MouseHost.c b/Demos/Host/LowLevel/MouseHost/MouseHost.c index b24d1ae725..a9225a1dfb 100644 --- a/Demos/Host/LowLevel/MouseHost/MouseHost.c +++ b/Demos/Host/LowLevel/MouseHost/MouseHost.c @@ -59,12 +59,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ Serial_Init(9600, false); diff --git a/Demos/Host/LowLevel/MouseHost/MouseHost.h b/Demos/Host/LowLevel/MouseHost/MouseHost.h index 6bbb71a1eb..4dddd20749 100644 --- a/Demos/Host/LowLevel/MouseHost/MouseHost.h +++ b/Demos/Host/LowLevel/MouseHost/MouseHost.h @@ -48,6 +48,7 @@ #include #include #include + #include #include "ConfigDescriptor.h" diff --git a/Demos/Host/LowLevel/MouseHost/asf.xml b/Demos/Host/LowLevel/MouseHost/asf.xml index 8fca686c1e..30aa33dbc9 100644 --- a/Demos/Host/LowLevel/MouseHost/asf.xml +++ b/Demos/Host/LowLevel/MouseHost/asf.xml @@ -1,14 +1,14 @@ - + - + - - + + diff --git a/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c b/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c index 81c734395b..438c6fee90 100644 --- a/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c +++ b/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c @@ -59,12 +59,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ Serial_Init(9600, false); diff --git a/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.h b/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.h index 8d907d7df8..d0744e522b 100644 --- a/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.h +++ b/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.h @@ -48,6 +48,7 @@ #include #include #include + #include #include "ConfigDescriptor.h" #include "HIDReport.h" diff --git a/Demos/Host/LowLevel/MouseHostWithParser/asf.xml b/Demos/Host/LowLevel/MouseHostWithParser/asf.xml index afc321afe0..f5a76a3651 100644 --- a/Demos/Host/LowLevel/MouseHostWithParser/asf.xml +++ b/Demos/Host/LowLevel/MouseHostWithParser/asf.xml @@ -1,14 +1,14 @@ - + - + - - + + diff --git a/Demos/Host/LowLevel/PrinterHost/PrinterHost.c b/Demos/Host/LowLevel/PrinterHost/PrinterHost.c index 31b0145b46..c028f2823b 100644 --- a/Demos/Host/LowLevel/PrinterHost/PrinterHost.c +++ b/Demos/Host/LowLevel/PrinterHost/PrinterHost.c @@ -59,12 +59,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ Serial_Init(9600, false); diff --git a/Demos/Host/LowLevel/PrinterHost/PrinterHost.h b/Demos/Host/LowLevel/PrinterHost/PrinterHost.h index 7998b98a94..69cfb9129c 100644 --- a/Demos/Host/LowLevel/PrinterHost/PrinterHost.h +++ b/Demos/Host/LowLevel/PrinterHost/PrinterHost.h @@ -52,6 +52,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Host/LowLevel/PrinterHost/asf.xml b/Demos/Host/LowLevel/PrinterHost/asf.xml index abe73c5aee..f24a1e1640 100644 --- a/Demos/Host/LowLevel/PrinterHost/asf.xml +++ b/Demos/Host/LowLevel/PrinterHost/asf.xml @@ -1,14 +1,14 @@ - + - + - - + + diff --git a/Demos/Host/LowLevel/RNDISEthernetHost/RNDISEthernetHost.c b/Demos/Host/LowLevel/RNDISEthernetHost/RNDISEthernetHost.c index e92b3146b5..d01bc3a907 100644 --- a/Demos/Host/LowLevel/RNDISEthernetHost/RNDISEthernetHost.c +++ b/Demos/Host/LowLevel/RNDISEthernetHost/RNDISEthernetHost.c @@ -59,12 +59,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ Serial_Init(9600, false); diff --git a/Demos/Host/LowLevel/RNDISEthernetHost/RNDISEthernetHost.h b/Demos/Host/LowLevel/RNDISEthernetHost/RNDISEthernetHost.h index cb77075f9e..9843b64a29 100644 --- a/Demos/Host/LowLevel/RNDISEthernetHost/RNDISEthernetHost.h +++ b/Demos/Host/LowLevel/RNDISEthernetHost/RNDISEthernetHost.h @@ -48,6 +48,7 @@ #include #include #include + #include #include "Lib/RNDISCommands.h" diff --git a/Demos/Host/LowLevel/RNDISEthernetHost/asf.xml b/Demos/Host/LowLevel/RNDISEthernetHost/asf.xml index fafffbf081..7f64c8415e 100644 --- a/Demos/Host/LowLevel/RNDISEthernetHost/asf.xml +++ b/Demos/Host/LowLevel/RNDISEthernetHost/asf.xml @@ -1,14 +1,14 @@ - + - + - - + + diff --git a/Demos/Host/LowLevel/StillImageHost/StillImageHost.c b/Demos/Host/LowLevel/StillImageHost/StillImageHost.c index 779827a9c8..89e7996f7a 100644 --- a/Demos/Host/LowLevel/StillImageHost/StillImageHost.c +++ b/Demos/Host/LowLevel/StillImageHost/StillImageHost.c @@ -59,13 +59,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); - /* Disable Clock Division */ - CLKPR = (1 << CLKPCE); - CLKPR = 0; + /* Disable clock division */ + clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ Serial_Init(9600, false); diff --git a/Demos/Host/LowLevel/StillImageHost/StillImageHost.h b/Demos/Host/LowLevel/StillImageHost/StillImageHost.h index 8ce267d0ec..2d2181c94d 100644 --- a/Demos/Host/LowLevel/StillImageHost/StillImageHost.h +++ b/Demos/Host/LowLevel/StillImageHost/StillImageHost.h @@ -51,6 +51,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Demos/Host/LowLevel/StillImageHost/asf.xml b/Demos/Host/LowLevel/StillImageHost/asf.xml index 5645c292ab..6592bf3b1a 100644 --- a/Demos/Host/LowLevel/StillImageHost/asf.xml +++ b/Demos/Host/LowLevel/StillImageHost/asf.xml @@ -1,14 +1,14 @@ - + - + - - + + diff --git a/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.c b/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.c index 73a5b9c74c..59bd2b4783 100644 --- a/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.c +++ b/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.c @@ -59,12 +59,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ Serial_Init(9600, false); diff --git a/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.h b/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.h index 05d94a8d8c..486aed188d 100644 --- a/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.h +++ b/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.h @@ -48,6 +48,7 @@ #include #include #include + #include #include "ConfigDescriptor.h" diff --git a/Demos/Host/LowLevel/VirtualSerialHost/asf.xml b/Demos/Host/LowLevel/VirtualSerialHost/asf.xml index 783862d7b1..cfe4e2f869 100644 --- a/Demos/Host/LowLevel/VirtualSerialHost/asf.xml +++ b/Demos/Host/LowLevel/VirtualSerialHost/asf.xml @@ -1,14 +1,14 @@ - + - + - - + + diff --git a/LUFA/DoxygenPages/ChangeLog.txt b/LUFA/DoxygenPages/ChangeLog.txt index b147384396..aec199cb0b 100644 --- a/LUFA/DoxygenPages/ChangeLog.txt +++ b/LUFA/DoxygenPages/ChangeLog.txt @@ -16,11 +16,13 @@ * - Library Applications: * - Added new Printer class bootloader * - Added new Mass Storage class bootloader + * - Added XMEGA support for class driver device demos (where applicable) * * Changed: * - 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 * * Fixed: * - Core: diff --git a/LUFA/Drivers/Board/Buttons.h b/LUFA/Drivers/Board/Buttons.h index 8727507dad..395d7901a0 100644 --- a/LUFA/Drivers/Board/Buttons.h +++ b/LUFA/Drivers/Board/Buttons.h @@ -92,7 +92,9 @@ #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) diff --git a/LUFA/Drivers/Board/Dataflash.h b/LUFA/Drivers/Board/Dataflash.h index cc4aa2ee29..7b99371ede 100644 --- a/LUFA/Drivers/Board/Dataflash.h +++ b/LUFA/Drivers/Board/Dataflash.h @@ -220,7 +220,23 @@ /* 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) diff --git a/LUFA/Drivers/Board/Joystick.h b/LUFA/Drivers/Board/Joystick.h index e39c225e45..c3b306e062 100644 --- a/LUFA/Drivers/Board/Joystick.h +++ b/LUFA/Drivers/Board/Joystick.h @@ -67,22 +67,22 @@ * \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 @@ -100,7 +100,13 @@ #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) diff --git a/Projects/AVRISP-MKII/AVRISP-MKII.c b/Projects/AVRISP-MKII/AVRISP-MKII.c index 24b14b8bae..685d7c6113 100644 --- a/Projects/AVRISP-MKII/AVRISP-MKII.c +++ b/Projects/AVRISP-MKII/AVRISP-MKII.c @@ -63,12 +63,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ LEDs_Init(); diff --git a/Projects/AVRISP-MKII/AVRISP-MKII.h b/Projects/AVRISP-MKII/AVRISP-MKII.h index 0418f213fc..138947a48a 100644 --- a/Projects/AVRISP-MKII/AVRISP-MKII.h +++ b/Projects/AVRISP-MKII/AVRISP-MKII.h @@ -44,6 +44,7 @@ #include #include + #include #if defined(ADC) #include @@ -79,12 +80,12 @@ 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 diff --git a/Projects/Benito/Benito.c b/Projects/Benito/Benito.c index 7f5d507cf9..a89e6caf63 100644 --- a/Projects/Benito/Benito.c +++ b/Projects/Benito/Benito.c @@ -171,10 +171,15 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); + /* Disable clock division */ + clock_prescale_set(clock_div_1); +#endif + /* Hardware Initialization */ LEDs_Init(); USB_Init(); diff --git a/Projects/Benito/Benito.h b/Projects/Benito/Benito.h index 938680bf70..beac29f93c 100644 --- a/Projects/Benito/Benito.h +++ b/Projects/Benito/Benito.h @@ -48,6 +48,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate TX activity. */ diff --git a/Projects/HIDReportViewer/HIDReportViewer.c b/Projects/HIDReportViewer/HIDReportViewer.c index 70b2f9e14f..6ca33e5722 100644 --- a/Projects/HIDReportViewer/HIDReportViewer.c +++ b/Projects/HIDReportViewer/HIDReportViewer.c @@ -202,12 +202,14 @@ void OutputCollectionPath(const HID_CollectionPath_t* const CollectionPath) /** 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); diff --git a/Projects/HIDReportViewer/HIDReportViewer.h b/Projects/HIDReportViewer/HIDReportViewer.h index 781cfb074f..ffe4e00a80 100644 --- a/Projects/HIDReportViewer/HIDReportViewer.h +++ b/Projects/HIDReportViewer/HIDReportViewer.h @@ -49,6 +49,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Projects/LEDNotifier/LEDNotifier.c b/Projects/LEDNotifier/LEDNotifier.c index 886bf53c64..d6a8fdca30 100644 --- a/Projects/LEDNotifier/LEDNotifier.c +++ b/Projects/LEDNotifier/LEDNotifier.c @@ -142,12 +142,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ LEDs_Init(); diff --git a/Projects/LEDNotifier/LEDNotifier.h b/Projects/LEDNotifier/LEDNotifier.h index 4bb9c04926..0b8579f413 100644 --- a/Projects/LEDNotifier/LEDNotifier.h +++ b/Projects/LEDNotifier/LEDNotifier.h @@ -48,6 +48,7 @@ #include #include + #include /* Function Prototypes: */ void SetupHardware(void); diff --git a/Projects/MIDIToneGenerator/MIDIToneGenerator.c b/Projects/MIDIToneGenerator/MIDIToneGenerator.c index 2505a3eebf..662c815bc7 100644 --- a/Projects/MIDIToneGenerator/MIDIToneGenerator.c +++ b/Projects/MIDIToneGenerator/MIDIToneGenerator.c @@ -185,12 +185,14 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK) /** 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(); diff --git a/Projects/MIDIToneGenerator/MIDIToneGenerator.h b/Projects/MIDIToneGenerator/MIDIToneGenerator.h index 27ee34bed5..ab434f30e9 100644 --- a/Projects/MIDIToneGenerator/MIDIToneGenerator.h +++ b/Projects/MIDIToneGenerator/MIDIToneGenerator.h @@ -49,6 +49,7 @@ #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Projects/Magstripe/Magstripe.c b/Projects/Magstripe/Magstripe.c index 85df8b5ea2..8dba7370be 100644 --- a/Projects/Magstripe/Magstripe.c +++ b/Projects/Magstripe/Magstripe.c @@ -94,12 +94,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ Magstripe_Init(); diff --git a/Projects/Magstripe/Magstripe.h b/Projects/Magstripe/Magstripe.h index 6d349dfe53..1291f3d62f 100644 --- a/Projects/Magstripe/Magstripe.h +++ b/Projects/Magstripe/Magstripe.h @@ -49,6 +49,7 @@ #include "Config/AppConfig.h" #include + #include /* Macros: */ /** Total number of tracks which can be read from the card, between 1 and 3. */ diff --git a/Projects/MediaController/MediaController.c b/Projects/MediaController/MediaController.c index f1bf649d23..d12a21aac2 100644 --- a/Projects/MediaController/MediaController.c +++ b/Projects/MediaController/MediaController.c @@ -80,12 +80,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware() { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ Joystick_Init(); diff --git a/Projects/MediaController/MediaController.h b/Projects/MediaController/MediaController.h index 99f0e1274d..d68e2764fe 100644 --- a/Projects/MediaController/MediaController.h +++ b/Projects/MediaController/MediaController.h @@ -50,6 +50,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Projects/MissileLauncher/MissileLauncher.c b/Projects/MissileLauncher/MissileLauncher.c index 14134d75cd..6294f2dcf3 100644 --- a/Projects/MissileLauncher/MissileLauncher.c +++ b/Projects/MissileLauncher/MissileLauncher.c @@ -112,12 +112,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ LEDs_Init(); diff --git a/Projects/MissileLauncher/MissileLauncher.h b/Projects/MissileLauncher/MissileLauncher.h index 5b51b6e791..4e728295b2 100644 --- a/Projects/MissileLauncher/MissileLauncher.h +++ b/Projects/MissileLauncher/MissileLauncher.h @@ -49,6 +49,7 @@ #include #include #include + #include #include "ConfigDescriptor.h" diff --git a/Projects/RelayBoard/RelayBoard.c b/Projects/RelayBoard/RelayBoard.c index 2c236de97a..f2ba464ec7 100644 --- a/Projects/RelayBoard/RelayBoard.c +++ b/Projects/RelayBoard/RelayBoard.c @@ -54,12 +54,14 @@ int main(void) /** 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(); diff --git a/Projects/RelayBoard/RelayBoard.h b/Projects/RelayBoard/RelayBoard.h index e43eb2b152..149685a682 100644 --- a/Projects/RelayBoard/RelayBoard.h +++ b/Projects/RelayBoard/RelayBoard.h @@ -47,6 +47,7 @@ #include #include + #include /* Macros: */ #define RELAY1 (1 << 7) diff --git a/Projects/SerialToLCD/SerialToLCD.c b/Projects/SerialToLCD/SerialToLCD.c index 385bcdee3c..aac4fadfb7 100644 --- a/Projects/SerialToLCD/SerialToLCD.c +++ b/Projects/SerialToLCD/SerialToLCD.c @@ -29,7 +29,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. @@ -101,7 +101,7 @@ int main(void) { static uint8_t EscapePending = 0; int16_t HD44780Byte = RingBuffer_Remove(&FromHost_Buffer); - + if (HD44780Byte == COMMAND_ESCAPE) { if (EscapePending) @@ -137,12 +137,14 @@ int main(void) /** 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(); @@ -150,7 +152,7 @@ void SetupHardware(void) /* 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); } diff --git a/Projects/SerialToLCD/SerialToLCD.h b/Projects/SerialToLCD/SerialToLCD.h index b67b84cf73..22537d6090 100644 --- a/Projects/SerialToLCD/SerialToLCD.h +++ b/Projects/SerialToLCD/SerialToLCD.h @@ -49,7 +49,8 @@ #include #include #include - + #include + /* Macros: */ #define COMMAND_ESCAPE 0x1B diff --git a/Projects/TempDataLogger/TempDataLogger.c b/Projects/TempDataLogger/TempDataLogger.c index 415ad9f504..7590aeea38 100644 --- a/Projects/TempDataLogger/TempDataLogger.c +++ b/Projects/TempDataLogger/TempDataLogger.c @@ -190,12 +190,14 @@ void CloseLogFile(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(); diff --git a/Projects/TempDataLogger/TempDataLogger.h b/Projects/TempDataLogger/TempDataLogger.h index 21373f4a7e..86364f4e31 100644 --- a/Projects/TempDataLogger/TempDataLogger.h +++ b/Projects/TempDataLogger/TempDataLogger.h @@ -50,11 +50,12 @@ #include "Lib/FATFs/ff.h" #include "Lib/DS1307.h" #include "Config/AppConfig.h" - + #include #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Projects/USBtoSerial/USBtoSerial.c b/Projects/USBtoSerial/USBtoSerial.c index 76e3cb837b..6df9063403 100644 --- a/Projects/USBtoSerial/USBtoSerial.c +++ b/Projects/USBtoSerial/USBtoSerial.c @@ -145,12 +145,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ LEDs_Init(); diff --git a/Projects/USBtoSerial/USBtoSerial.h b/Projects/USBtoSerial/USBtoSerial.h index d37a5405c9..220500f911 100644 --- a/Projects/USBtoSerial/USBtoSerial.h +++ b/Projects/USBtoSerial/USBtoSerial.h @@ -48,6 +48,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Projects/Webserver/Webserver.c b/Projects/Webserver/Webserver.c index be53032d28..173b52e950 100644 --- a/Projects/Webserver/Webserver.c +++ b/Projects/Webserver/Webserver.c @@ -60,12 +60,14 @@ int main(void) /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { +#if (ARCH == ARCH_AVR8) /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); +#endif /* Hardware Initialization */ SPI_Init(SPI_SPEED_FCPU_DIV_2 | SPI_SCK_LEAD_FALLING | SPI_SAMPLE_TRAILING | SPI_MODE_MASTER); diff --git a/Projects/Webserver/Webserver.h b/Projects/Webserver/Webserver.h index 1dfa830366..a828e892eb 100644 --- a/Projects/Webserver/Webserver.h +++ b/Projects/Webserver/Webserver.h @@ -47,6 +47,7 @@ #include #include #include + #include #include "USBDeviceMode.h" #include "USBHostMode.h" diff --git a/Projects/XPLAINBridge/XPLAINBridge.c b/Projects/XPLAINBridge/XPLAINBridge.c index 79145a1386..2ef1d20ee2 100644 --- a/Projects/XPLAINBridge/XPLAINBridge.c +++ b/Projects/XPLAINBridge/XPLAINBridge.c @@ -169,12 +169,14 @@ void UARTBridge_Task(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 /* Disable JTAG debugging */ MCUCR |= (1 << JTD); @@ -197,8 +199,8 @@ void SetupHardware(void) #if defined(RESET_TOGGLES_LIBUSB_COMPAT) UpdateCurrentCompatibilityMode(); #endif - - /* USB Stack Initialization */ + + /* USB Stack Initialization */ USB_Init(); } diff --git a/Projects/XPLAINBridge/XPLAINBridge.h b/Projects/XPLAINBridge/XPLAINBridge.h index 1f08b2aba5..55921d8049 100644 --- a/Projects/XPLAINBridge/XPLAINBridge.h +++ b/Projects/XPLAINBridge/XPLAINBridge.h @@ -45,7 +45,7 @@ #include "USARTDescriptors.h" - #include "AVRISPDescriptors.h" + #include "AVRISPDescriptors.h" #include "Lib/V2Protocol.h" #include "Lib/SoftUART.h" #include "Config/AppConfig.h" @@ -53,6 +53,7 @@ #include #include #include + #include /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ @@ -97,7 +98,7 @@ 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