From 3d4d8e7f628f9dc9981242f69b097333faa9940d Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sat, 19 Feb 2011 18:37:22 +0000 Subject: [PATCH] Add new ARCH option to the makefiles to (eventually) specify the target device architecture. Update non-usb peripheral drivers to reflect future multiple architecture support. --- Bootloaders/CDC/makefile | 6 +- Bootloaders/DFU/makefile | 6 +- Bootloaders/HID/makefile | 6 +- Demos/Device/ClassDriver/AudioInput/makefile | 10 +- Demos/Device/ClassDriver/AudioOutput/makefile | 10 +- .../ClassDriver/DualVirtualSerial/makefile | 10 +- Demos/Device/ClassDriver/GenericHID/makefile | 10 +- Demos/Device/ClassDriver/Joystick/makefile | 10 +- Demos/Device/ClassDriver/Keyboard/makefile | 10 +- .../Device/ClassDriver/KeyboardMouse/makefile | 10 +- .../KeyboardMouseMultiReport/makefile | 10 +- Demos/Device/ClassDriver/MIDI/makefile | 10 +- Demos/Device/ClassDriver/MassStorage/makefile | 10 +- .../ClassDriver/MassStorageKeyboard/makefile | 10 +- Demos/Device/ClassDriver/Mouse/makefile | 6 +- .../Device/ClassDriver/RNDISEthernet/makefile | 6 +- .../Device/ClassDriver/VirtualSerial/makefile | 6 +- .../ClassDriver/VirtualSerialMouse/makefile | 6 +- Demos/Device/Incomplete/Sideshow/makefile | 6 +- .../Incomplete/TestAndMeasurement/makefile | 6 +- Demos/Device/LowLevel/AudioInput/makefile | 6 +- Demos/Device/LowLevel/AudioOutput/makefile | 6 +- .../LowLevel/DualVirtualSerial/makefile | 6 +- Demos/Device/LowLevel/GenericHID/makefile | 6 +- Demos/Device/LowLevel/Joystick/makefile | 6 +- Demos/Device/LowLevel/Keyboard/makefile | 6 +- Demos/Device/LowLevel/KeyboardMouse/makefile | 6 +- Demos/Device/LowLevel/MIDI/makefile | 6 +- Demos/Device/LowLevel/MassStorage/makefile | 6 +- Demos/Device/LowLevel/Mouse/makefile | 6 +- Demos/Device/LowLevel/RNDISEthernet/makefile | 6 +- Demos/Device/LowLevel/VirtualSerial/makefile | 6 +- .../ClassDriver/MouseHostDevice/makefile | 6 +- .../JoystickHostWithParser/makefile | 6 +- Demos/Host/ClassDriver/KeyboardHost/makefile | 6 +- .../KeyboardHostWithParser/makefile | 6 +- Demos/Host/ClassDriver/MIDIHost/makefile | 6 +- .../Host/ClassDriver/MassStorageHost/makefile | 6 +- Demos/Host/ClassDriver/MouseHost/makefile | 6 +- .../ClassDriver/MouseHostWithParser/makefile | 6 +- Demos/Host/ClassDriver/PrinterHost/makefile | 6 +- .../ClassDriver/RNDISEthernetHost/makefile | 6 +- .../Host/ClassDriver/StillImageHost/makefile | 6 +- .../ClassDriver/VirtualSerialHost/makefile | 6 +- Demos/Host/Incomplete/BluetoothHost/makefile | 6 +- Demos/Host/LowLevel/GenericHIDHost/makefile | 6 +- .../LowLevel/JoystickHostWithParser/makefile | 6 +- Demos/Host/LowLevel/KeyboardHost/makefile | 6 +- .../LowLevel/KeyboardHostWithParser/makefile | 6 +- Demos/Host/LowLevel/MIDIHost/makefile | 6 +- Demos/Host/LowLevel/MassStorageHost/makefile | 6 +- Demos/Host/LowLevel/MouseHost/makefile | 6 +- .../LowLevel/MouseHostWithParser/makefile | 6 +- Demos/Host/LowLevel/PrinterHost/makefile | 6 +- .../Host/LowLevel/RNDISEthernetHost/makefile | 6 +- Demos/Host/LowLevel/StillImageHost/makefile | 6 +- .../Host/LowLevel/VirtualSerialHost/makefile | 6 +- LUFA.pnproj | 2 +- LUFA/CodeTemplates/makefile_template | 4 + LUFA/Common/Architectures.h | 74 ++++++ LUFA/Common/Attributes.h | 8 +- LUFA/Common/BoardTypes.h | 8 +- LUFA/Common/Common.h | 130 +++++---- LUFA/Drivers/Board/ADAFRUITU4/LEDs.h | 2 +- LUFA/Drivers/Board/ATAVRUSBRF01/Buttons.h | 2 +- LUFA/Drivers/Board/ATAVRUSBRF01/LEDs.h | 2 +- LUFA/Drivers/Board/BENITO/Buttons.h | 2 +- LUFA/Drivers/Board/BENITO/LEDs.h | 2 +- LUFA/Drivers/Board/BLACKCAT/LEDs.h | 2 +- LUFA/Drivers/Board/BUI/LEDs.h | 2 +- LUFA/Drivers/Board/BUMBLEB/Buttons.h | 2 +- LUFA/Drivers/Board/BUMBLEB/Joystick.h | 2 +- LUFA/Drivers/Board/BUMBLEB/LEDs.h | 2 +- LUFA/Drivers/Board/Buttons.h | 6 +- LUFA/Drivers/Board/CULV3/Buttons.h | 2 +- LUFA/Drivers/Board/CULV3/LEDs.h | 2 +- LUFA/Drivers/Board/Dataflash.h | 8 +- LUFA/Drivers/Board/EVK527/AT45DB321C.h | 2 +- LUFA/Drivers/Board/EVK527/Buttons.h | 2 +- LUFA/Drivers/Board/EVK527/Dataflash.h | 2 +- LUFA/Drivers/Board/EVK527/Joystick.h | 2 +- LUFA/Drivers/Board/EVK527/LEDs.h | 2 +- LUFA/Drivers/Board/JMDBU2/Buttons.h | 2 +- LUFA/Drivers/Board/JMDBU2/LEDs.h | 2 +- LUFA/Drivers/Board/Joystick.h | 6 +- LUFA/Drivers/Board/LEDs.h | 4 +- LUFA/Drivers/Board/MAXIMUS/LEDs.h | 2 +- LUFA/Drivers/Board/MICROSIN162/Buttons.h | 2 +- LUFA/Drivers/Board/MICROSIN162/LEDs.h | 2 +- LUFA/Drivers/Board/MINIMUS/Buttons.h | 2 +- LUFA/Drivers/Board/MINIMUS/LEDs.h | 2 +- LUFA/Drivers/Board/OLIMEX162/Buttons.h | 2 +- LUFA/Drivers/Board/OLIMEX162/LEDs.h | 2 +- LUFA/Drivers/Board/RZUSBSTICK/LEDs.h | 2 +- LUFA/Drivers/Board/SPARKFUN8U2/LEDs.h | 2 +- LUFA/Drivers/Board/STK525/AT45DB321C.h | 2 +- LUFA/Drivers/Board/STK525/Buttons.h | 2 +- LUFA/Drivers/Board/STK525/Dataflash.h | 2 +- LUFA/Drivers/Board/STK525/Joystick.h | 2 +- LUFA/Drivers/Board/STK525/LEDs.h | 2 +- LUFA/Drivers/Board/STK526/AT45DB642D.h | 2 +- LUFA/Drivers/Board/STK526/Buttons.h | 2 +- LUFA/Drivers/Board/STK526/Dataflash.h | 2 +- LUFA/Drivers/Board/STK526/Joystick.h | 2 +- LUFA/Drivers/Board/STK526/LEDs.h | 2 +- LUFA/Drivers/Board/TEENSY/LEDs.h | 2 +- LUFA/Drivers/Board/Temperature.h | 6 +- LUFA/Drivers/Board/UDIP/Buttons.h | 2 +- LUFA/Drivers/Board/UDIP/LEDs.h | 2 +- LUFA/Drivers/Board/UNO/LEDs.h | 2 +- LUFA/Drivers/Board/USBFOO/Buttons.h | 2 +- LUFA/Drivers/Board/USBFOO/LEDS.h | 2 +- LUFA/Drivers/Board/USBKEY/AT45DB642D.h | 2 +- LUFA/Drivers/Board/USBKEY/Buttons.h | 2 +- LUFA/Drivers/Board/USBKEY/Dataflash.h | 2 +- LUFA/Drivers/Board/USBKEY/Joystick.h | 2 +- LUFA/Drivers/Board/USBKEY/LEDs.h | 2 +- LUFA/Drivers/Board/USBTINYMKII/Buttons.h | 2 +- LUFA/Drivers/Board/USBTINYMKII/LEDs.h | 2 +- LUFA/Drivers/Board/XPLAIN/AT45DB642D.h | 2 +- LUFA/Drivers/Board/XPLAIN/Dataflash.h | 2 +- LUFA/Drivers/Board/XPLAIN/LEDs.h | 2 +- LUFA/Drivers/Misc/RingBuffer.h | 2 +- LUFA/Drivers/Misc/TerminalCodes.h | 2 +- LUFA/Drivers/Peripheral/ADC.h | 29 +- .../Peripheral/{AVRU4U6U7 => AVR8}/ADC.h | 19 +- LUFA/Drivers/Peripheral/AVR8/SPI.h | 239 +++++++++++++++++ LUFA/Drivers/Peripheral/{ => AVR8}/Serial.c | 1 + LUFA/Drivers/Peripheral/AVR8/Serial.h | 251 ++++++++++++++++++ LUFA/Drivers/Peripheral/{ => AVR8}/TWI.c | 1 + .../Peripheral/{AVRU4U6U7 => AVR8}/TWI.h | 25 +- LUFA/Drivers/Peripheral/SPI.h | 197 ++------------ LUFA/Drivers/Peripheral/Serial.h | 216 ++------------- LUFA/Drivers/Peripheral/TWI.h | 34 +-- LUFA/Drivers/USB/Class/Audio.h | 2 +- LUFA/Drivers/USB/Class/CDC.h | 2 +- LUFA/Drivers/USB/Class/Common/Audio.h | 2 +- LUFA/Drivers/USB/Class/Common/CDC.h | 2 +- LUFA/Drivers/USB/Class/Common/HID.h | 2 +- LUFA/Drivers/USB/Class/Common/HIDParser.h | 2 +- LUFA/Drivers/USB/Class/Common/HIDReportData.h | 2 +- LUFA/Drivers/USB/Class/Common/MIDI.h | 2 +- LUFA/Drivers/USB/Class/Common/MassStorage.h | 2 +- LUFA/Drivers/USB/Class/Common/Printer.h | 2 +- LUFA/Drivers/USB/Class/Common/RNDIS.h | 2 +- LUFA/Drivers/USB/Class/Common/StillImage.h | 2 +- LUFA/Drivers/USB/Class/Device/Audio.h | 2 +- LUFA/Drivers/USB/Class/Device/CDC.h | 2 +- LUFA/Drivers/USB/Class/Device/HID.h | 2 +- LUFA/Drivers/USB/Class/Device/MIDI.h | 2 +- LUFA/Drivers/USB/Class/Device/MassStorage.h | 2 +- LUFA/Drivers/USB/Class/Device/RNDIS.h | 2 +- LUFA/Drivers/USB/Class/HID.h | 2 +- LUFA/Drivers/USB/Class/Host/CDC.h | 2 +- LUFA/Drivers/USB/Class/Host/HID.h | 2 +- LUFA/Drivers/USB/Class/Host/MIDI.h | 2 +- LUFA/Drivers/USB/Class/Host/MassStorage.h | 2 +- LUFA/Drivers/USB/Class/Host/Printer.h | 2 +- LUFA/Drivers/USB/Class/Host/RNDIS.h | 2 +- LUFA/Drivers/USB/Class/Host/StillImage.h | 2 +- LUFA/Drivers/USB/Class/MIDI.h | 2 +- LUFA/Drivers/USB/Class/MassStorage.h | 2 +- LUFA/Drivers/USB/Class/Printer.h | 2 +- LUFA/Drivers/USB/Class/RNDIS.h | 2 +- LUFA/Drivers/USB/Class/StillImage.h | 2 +- LUFA/Drivers/USB/HighLevel/ConfigDescriptor.h | 2 +- LUFA/Drivers/USB/HighLevel/EndpointStream.h | 2 +- LUFA/Drivers/USB/HighLevel/Events.h | 2 +- LUFA/Drivers/USB/HighLevel/PipeStream.h | 2 +- LUFA/Drivers/USB/HighLevel/StdDescriptors.h | 2 +- LUFA/Drivers/USB/HighLevel/StdRequestType.h | 2 +- LUFA/Drivers/USB/HighLevel/USBMode.h | 2 +- LUFA/Drivers/USB/LowLevel/Device.h | 2 +- LUFA/Drivers/USB/LowLevel/Endpoint.h | 8 +- LUFA/Drivers/USB/LowLevel/Host.h | 2 +- LUFA/Drivers/USB/LowLevel/OTG.h | 2 +- LUFA/Drivers/USB/LowLevel/Pipe.h | 10 +- LUFA/Drivers/USB/LowLevel/USBController.h | 2 +- LUFA/Drivers/USB/USB.h | 4 +- LUFA/ManPages/ChangeLog.txt | 1 + LUFA/ManPages/DirectorySummaries.txt | 9 +- LUFA/Scheduler/Scheduler.c | 6 +- LUFA/Scheduler/Scheduler.h | 34 ++- LUFA/makefile | 9 +- Projects/AVRISP-MKII/makefile | 6 +- Projects/Benito/makefile | 6 +- .../Incomplete/StandaloneProgrammer/makefile | 6 +- Projects/LEDNotifier/makefile | 6 +- Projects/MIDIToneGenerator/makefile | 6 +- Projects/Magstripe/makefile | 6 +- Projects/MissileLauncher/makefile | 6 +- Projects/RelayBoard/makefile | 6 +- Projects/TempDataLogger/makefile | 6 +- Projects/USBtoSerial/makefile | 6 +- Projects/Webserver/makefile | 6 +- Projects/XPLAINBridge/makefile | 6 +- 196 files changed, 1272 insertions(+), 731 deletions(-) create mode 100644 LUFA/Common/Architectures.h rename LUFA/Drivers/Peripheral/{AVRU4U6U7 => AVR8}/ADC.h (96%) create mode 100644 LUFA/Drivers/Peripheral/AVR8/SPI.h rename LUFA/Drivers/Peripheral/{ => AVR8}/Serial.c (98%) create mode 100644 LUFA/Drivers/Peripheral/AVR8/Serial.h rename LUFA/Drivers/Peripheral/{ => AVR8}/TWI.c (99%) rename LUFA/Drivers/Peripheral/{AVRU4U6U7 => AVR8}/TWI.h (93%) diff --git a/Bootloaders/CDC/makefile b/Bootloaders/CDC/makefile index 8fa7cb2298..92b63dad3c 100644 --- a/Bootloaders/CDC/makefile +++ b/Bootloaders/CDC/makefile @@ -51,6 +51,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -187,7 +191,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += -DBOOT_START_ADDR=$(BOOT_START)UL CDEFS += $(LUFA_OPTS) diff --git a/Bootloaders/DFU/makefile b/Bootloaders/DFU/makefile index ce97b58d12..d77933b6bb 100644 --- a/Bootloaders/DFU/makefile +++ b/Bootloaders/DFU/makefile @@ -51,6 +51,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -182,7 +186,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += -DBOOT_START_ADDR=$(BOOT_START)UL CDEFS += $(LUFA_OPTS) diff --git a/Bootloaders/HID/makefile b/Bootloaders/HID/makefile index 338bafa015..6d8fbf560b 100644 --- a/Bootloaders/HID/makefile +++ b/Bootloaders/HID/makefile @@ -51,6 +51,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -182,7 +186,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += -DBOOT_START_ADDR=$(BOOT_START)UL CDEFS += $(LUFA_OPTS) diff --git a/Demos/Device/ClassDriver/AudioInput/makefile b/Demos/Device/ClassDriver/AudioInput/makefile index 3c26c97ed9..371375567b 100644 --- a/Demos/Device/ClassDriver/AudioInput/makefile +++ b/Demos/Device/ClassDriver/AudioInput/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -182,20 +186,20 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) # Place -D or -U options here for ASM sources ADEFS = -DF_CPU=$(F_CPU) ADEFS += -DF_CLOCK=$(F_CLOCK)UL -ADEFS += -DBOARD=BOARD_$(BOARD) +ADEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) ADEFS += $(LUFA_OPTS) # Place -D or -U options here for C++ sources CPPDEFS = -DF_CPU=$(F_CPU)UL CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL -CPPDEFS += -DBOARD=BOARD_$(BOARD) +CPPDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CPPDEFS += $(LUFA_OPTS) #CPPDEFS += -D__STDC_LIMIT_MACROS #CPPDEFS += -D__STDC_CONSTANT_MACROS diff --git a/Demos/Device/ClassDriver/AudioOutput/makefile b/Demos/Device/ClassDriver/AudioOutput/makefile index 9ff71b2e16..2f23514eae 100644 --- a/Demos/Device/ClassDriver/AudioOutput/makefile +++ b/Demos/Device/ClassDriver/AudioOutput/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -183,20 +187,20 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) # Place -D or -U options here for ASM sources ADEFS = -DF_CPU=$(F_CPU) ADEFS += -DF_CLOCK=$(F_CLOCK)UL -ADEFS += -DBOARD=BOARD_$(BOARD) +ADEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) ADEFS += $(LUFA_OPTS) # Place -D or -U options here for C++ sources CPPDEFS = -DF_CPU=$(F_CPU)UL CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL -CPPDEFS += -DBOARD=BOARD_$(BOARD) +CPPDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CPPDEFS += $(LUFA_OPTS) #CPPDEFS += -D__STDC_LIMIT_MACROS #CPPDEFS += -D__STDC_CONSTANT_MACROS diff --git a/Demos/Device/ClassDriver/DualVirtualSerial/makefile b/Demos/Device/ClassDriver/DualVirtualSerial/makefile index c9c0349246..9234fe9e6e 100644 --- a/Demos/Device/ClassDriver/DualVirtualSerial/makefile +++ b/Demos/Device/ClassDriver/DualVirtualSerial/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -179,20 +183,20 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) # Place -D or -U options here for ASM sources ADEFS = -DF_CPU=$(F_CPU) ADEFS += -DF_CLOCK=$(F_CLOCK)UL -ADEFS += -DBOARD=BOARD_$(BOARD) +ADEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) ADEFS += $(LUFA_OPTS) # Place -D or -U options here for C++ sources CPPDEFS = -DF_CPU=$(F_CPU)UL CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL -CPPDEFS += -DBOARD=BOARD_$(BOARD) +CPPDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CPPDEFS += $(LUFA_OPTS) #CPPDEFS += -D__STDC_LIMIT_MACROS #CPPDEFS += -D__STDC_CONSTANT_MACROS diff --git a/Demos/Device/ClassDriver/GenericHID/makefile b/Demos/Device/ClassDriver/GenericHID/makefile index 5c7e78ee74..b20d045d9d 100644 --- a/Demos/Device/ClassDriver/GenericHID/makefile +++ b/Demos/Device/ClassDriver/GenericHID/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -179,20 +183,20 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) # Place -D or -U options here for ASM sources ADEFS = -DF_CPU=$(F_CPU) ADEFS += -DF_CLOCK=$(F_CLOCK)UL -ADEFS += -DBOARD=BOARD_$(BOARD) +ADEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) ADEFS += $(LUFA_OPTS) # Place -D or -U options here for C++ sources CPPDEFS = -DF_CPU=$(F_CPU)UL CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL -CPPDEFS += -DBOARD=BOARD_$(BOARD) +CPPDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CPPDEFS += $(LUFA_OPTS) #CPPDEFS += -D__STDC_LIMIT_MACROS #CPPDEFS += -D__STDC_CONSTANT_MACROS diff --git a/Demos/Device/ClassDriver/Joystick/makefile b/Demos/Device/ClassDriver/Joystick/makefile index ff8ffea13e..23845f4b52 100644 --- a/Demos/Device/ClassDriver/Joystick/makefile +++ b/Demos/Device/ClassDriver/Joystick/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -179,20 +183,20 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) # Place -D or -U options here for ASM sources ADEFS = -DF_CPU=$(F_CPU) ADEFS += -DF_CLOCK=$(F_CLOCK)UL -ADEFS += -DBOARD=BOARD_$(BOARD) +ADEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) ADEFS += $(LUFA_OPTS) # Place -D or -U options here for C++ sources CPPDEFS = -DF_CPU=$(F_CPU)UL CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL -CPPDEFS += -DBOARD=BOARD_$(BOARD) +CPPDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CPPDEFS += $(LUFA_OPTS) #CPPDEFS += -D__STDC_LIMIT_MACROS #CPPDEFS += -D__STDC_CONSTANT_MACROS diff --git a/Demos/Device/ClassDriver/Keyboard/makefile b/Demos/Device/ClassDriver/Keyboard/makefile index d31b068dde..7981b5d034 100644 --- a/Demos/Device/ClassDriver/Keyboard/makefile +++ b/Demos/Device/ClassDriver/Keyboard/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -179,20 +183,20 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) # Place -D or -U options here for ASM sources ADEFS = -DF_CPU=$(F_CPU) ADEFS += -DF_CLOCK=$(F_CLOCK)UL -ADEFS += -DBOARD=BOARD_$(BOARD) +ADEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) ADEFS += $(LUFA_OPTS) # Place -D or -U options here for C++ sources CPPDEFS = -DF_CPU=$(F_CPU)UL CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL -CPPDEFS += -DBOARD=BOARD_$(BOARD) +CPPDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CPPDEFS += $(LUFA_OPTS) #CPPDEFS += -D__STDC_LIMIT_MACROS #CPPDEFS += -D__STDC_CONSTANT_MACROS diff --git a/Demos/Device/ClassDriver/KeyboardMouse/makefile b/Demos/Device/ClassDriver/KeyboardMouse/makefile index 8ef9319624..c4477dc00f 100644 --- a/Demos/Device/ClassDriver/KeyboardMouse/makefile +++ b/Demos/Device/ClassDriver/KeyboardMouse/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -179,20 +183,20 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) # Place -D or -U options here for ASM sources ADEFS = -DF_CPU=$(F_CPU) ADEFS += -DF_CLOCK=$(F_CLOCK)UL -ADEFS += -DBOARD=BOARD_$(BOARD) +ADEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) ADEFS += $(LUFA_OPTS) # Place -D or -U options here for C++ sources CPPDEFS = -DF_CPU=$(F_CPU)UL CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL -CPPDEFS += -DBOARD=BOARD_$(BOARD) +CPPDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CPPDEFS += $(LUFA_OPTS) #CPPDEFS += -D__STDC_LIMIT_MACROS #CPPDEFS += -D__STDC_CONSTANT_MACROS diff --git a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/makefile b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/makefile index 8ccd785cf2..9fcd9aeae3 100644 --- a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/makefile +++ b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -179,20 +183,20 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) # Place -D or -U options here for ASM sources ADEFS = -DF_CPU=$(F_CPU) ADEFS += -DF_CLOCK=$(F_CLOCK)UL -ADEFS += -DBOARD=BOARD_$(BOARD) +ADEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) ADEFS += $(LUFA_OPTS) # Place -D or -U options here for C++ sources CPPDEFS = -DF_CPU=$(F_CPU)UL CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL -CPPDEFS += -DBOARD=BOARD_$(BOARD) +CPPDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CPPDEFS += $(LUFA_OPTS) #CPPDEFS += -D__STDC_LIMIT_MACROS #CPPDEFS += -D__STDC_CONSTANT_MACROS diff --git a/Demos/Device/ClassDriver/MIDI/makefile b/Demos/Device/ClassDriver/MIDI/makefile index c60aff97d9..11b76deb4a 100644 --- a/Demos/Device/ClassDriver/MIDI/makefile +++ b/Demos/Device/ClassDriver/MIDI/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -179,20 +183,20 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) # Place -D or -U options here for ASM sources ADEFS = -DF_CPU=$(F_CPU) ADEFS += -DF_CLOCK=$(F_CLOCK)UL -ADEFS += -DBOARD=BOARD_$(BOARD) +ADEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) ADEFS += $(LUFA_OPTS) # Place -D or -U options here for C++ sources CPPDEFS = -DF_CPU=$(F_CPU)UL CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL -CPPDEFS += -DBOARD=BOARD_$(BOARD) +CPPDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CPPDEFS += $(LUFA_OPTS) #CPPDEFS += -D__STDC_LIMIT_MACROS #CPPDEFS += -D__STDC_CONSTANT_MACROS diff --git a/Demos/Device/ClassDriver/MassStorage/makefile b/Demos/Device/ClassDriver/MassStorage/makefile index 54b4b7f179..bd548f8763 100644 --- a/Demos/Device/ClassDriver/MassStorage/makefile +++ b/Demos/Device/ClassDriver/MassStorage/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -182,20 +186,20 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) # Place -D or -U options here for ASM sources ADEFS = -DF_CPU=$(F_CPU) ADEFS += -DF_CLOCK=$(F_CLOCK)UL -ADEFS += -DBOARD=BOARD_$(BOARD) +ADEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) ADEFS += $(LUFA_OPTS) # Place -D or -U options here for C++ sources CPPDEFS = -DF_CPU=$(F_CPU)UL CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL -CPPDEFS += -DBOARD=BOARD_$(BOARD) +CPPDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CPPDEFS += $(LUFA_OPTS) #CPPDEFS += -D__STDC_LIMIT_MACROS #CPPDEFS += -D__STDC_CONSTANT_MACROS diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/makefile b/Demos/Device/ClassDriver/MassStorageKeyboard/makefile index bdc0a9b644..1d7eaca538 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/makefile +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -182,20 +186,20 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) # Place -D or -U options here for ASM sources ADEFS = -DF_CPU=$(F_CPU) ADEFS += -DF_CLOCK=$(F_CLOCK)UL -ADEFS += -DBOARD=BOARD_$(BOARD) +ADEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) ADEFS += $(LUFA_OPTS) # Place -D or -U options here for C++ sources CPPDEFS = -DF_CPU=$(F_CPU)UL CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL -CPPDEFS += -DBOARD=BOARD_$(BOARD) +CPPDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CPPDEFS += $(LUFA_OPTS) #CPPDEFS += -D__STDC_LIMIT_MACROS #CPPDEFS += -D__STDC_CONSTANT_MACROS diff --git a/Demos/Device/ClassDriver/Mouse/makefile b/Demos/Device/ClassDriver/Mouse/makefile index 76e6d7dfce..317005f3ae 100644 --- a/Demos/Device/ClassDriver/Mouse/makefile +++ b/Demos/Device/ClassDriver/Mouse/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -179,7 +183,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Device/ClassDriver/RNDISEthernet/makefile b/Demos/Device/ClassDriver/RNDISEthernet/makefile index e4e2274531..910452b7da 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/makefile +++ b/Demos/Device/ClassDriver/RNDISEthernet/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -197,7 +201,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Device/ClassDriver/VirtualSerial/makefile b/Demos/Device/ClassDriver/VirtualSerial/makefile index 1f43438ab0..fb7dd779fa 100644 --- a/Demos/Device/ClassDriver/VirtualSerial/makefile +++ b/Demos/Device/ClassDriver/VirtualSerial/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -179,7 +183,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Device/ClassDriver/VirtualSerialMouse/makefile b/Demos/Device/ClassDriver/VirtualSerialMouse/makefile index 3aa0b487f9..2ed7afddf6 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMouse/makefile +++ b/Demos/Device/ClassDriver/VirtualSerialMouse/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -179,7 +183,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Device/Incomplete/Sideshow/makefile b/Demos/Device/Incomplete/Sideshow/makefile index 2060175492..9439e1d9ef 100644 --- a/Demos/Device/Incomplete/Sideshow/makefile +++ b/Demos/Device/Incomplete/Sideshow/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -183,7 +187,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Device/Incomplete/TestAndMeasurement/makefile b/Demos/Device/Incomplete/TestAndMeasurement/makefile index 7e282ed57b..298cd2281c 100644 --- a/Demos/Device/Incomplete/TestAndMeasurement/makefile +++ b/Demos/Device/Incomplete/TestAndMeasurement/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -179,7 +183,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Device/LowLevel/AudioInput/makefile b/Demos/Device/LowLevel/AudioInput/makefile index 15ceba7a42..40746f8f93 100644 --- a/Demos/Device/LowLevel/AudioInput/makefile +++ b/Demos/Device/LowLevel/AudioInput/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -181,7 +185,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Device/LowLevel/AudioOutput/makefile b/Demos/Device/LowLevel/AudioOutput/makefile index 1f526006cf..28bc1c286a 100644 --- a/Demos/Device/LowLevel/AudioOutput/makefile +++ b/Demos/Device/LowLevel/AudioOutput/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -182,7 +186,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Device/LowLevel/DualVirtualSerial/makefile b/Demos/Device/LowLevel/DualVirtualSerial/makefile index 4daadb2a3a..6808429211 100644 --- a/Demos/Device/LowLevel/DualVirtualSerial/makefile +++ b/Demos/Device/LowLevel/DualVirtualSerial/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -178,7 +182,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Device/LowLevel/GenericHID/makefile b/Demos/Device/LowLevel/GenericHID/makefile index ae6c300ca7..d87f6dc69e 100644 --- a/Demos/Device/LowLevel/GenericHID/makefile +++ b/Demos/Device/LowLevel/GenericHID/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -178,7 +182,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Device/LowLevel/Joystick/makefile b/Demos/Device/LowLevel/Joystick/makefile index e22d511e9b..ba9c158990 100644 --- a/Demos/Device/LowLevel/Joystick/makefile +++ b/Demos/Device/LowLevel/Joystick/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -178,7 +182,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Device/LowLevel/Keyboard/makefile b/Demos/Device/LowLevel/Keyboard/makefile index 2c1e31fca1..3e764d9d72 100644 --- a/Demos/Device/LowLevel/Keyboard/makefile +++ b/Demos/Device/LowLevel/Keyboard/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -178,7 +182,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Device/LowLevel/KeyboardMouse/makefile b/Demos/Device/LowLevel/KeyboardMouse/makefile index f1a16e1e1e..12490fc614 100644 --- a/Demos/Device/LowLevel/KeyboardMouse/makefile +++ b/Demos/Device/LowLevel/KeyboardMouse/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -178,7 +182,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Device/LowLevel/MIDI/makefile b/Demos/Device/LowLevel/MIDI/makefile index 40c028328e..7b8a242c49 100644 --- a/Demos/Device/LowLevel/MIDI/makefile +++ b/Demos/Device/LowLevel/MIDI/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -178,7 +182,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Device/LowLevel/MassStorage/makefile b/Demos/Device/LowLevel/MassStorage/makefile index d1c0d8198f..becdfab0f5 100644 --- a/Demos/Device/LowLevel/MassStorage/makefile +++ b/Demos/Device/LowLevel/MassStorage/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -181,7 +185,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Device/LowLevel/Mouse/makefile b/Demos/Device/LowLevel/Mouse/makefile index 9041e5cf6d..7b8d8eea21 100644 --- a/Demos/Device/LowLevel/Mouse/makefile +++ b/Demos/Device/LowLevel/Mouse/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -178,7 +182,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Device/LowLevel/RNDISEthernet/makefile b/Demos/Device/LowLevel/RNDISEthernet/makefile index 09213a98e3..66528646dd 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/makefile +++ b/Demos/Device/LowLevel/RNDISEthernet/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -197,7 +201,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Device/LowLevel/VirtualSerial/makefile b/Demos/Device/LowLevel/VirtualSerial/makefile index 0488b71d50..fd13fc64e6 100644 --- a/Demos/Device/LowLevel/VirtualSerial/makefile +++ b/Demos/Device/LowLevel/VirtualSerial/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -178,7 +182,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/DualRole/ClassDriver/MouseHostDevice/makefile b/Demos/DualRole/ClassDriver/MouseHostDevice/makefile index 8aca25a0e7..c9b74eb2bf 100644 --- a/Demos/DualRole/ClassDriver/MouseHostDevice/makefile +++ b/Demos/DualRole/ClassDriver/MouseHostDevice/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -181,7 +185,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Host/ClassDriver/JoystickHostWithParser/makefile b/Demos/Host/ClassDriver/JoystickHostWithParser/makefile index 4133b2b080..f72c1e3006 100644 --- a/Demos/Host/ClassDriver/JoystickHostWithParser/makefile +++ b/Demos/Host/ClassDriver/JoystickHostWithParser/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -176,7 +180,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Host/ClassDriver/KeyboardHost/makefile b/Demos/Host/ClassDriver/KeyboardHost/makefile index 30946c5bf5..ba0e92fe03 100644 --- a/Demos/Host/ClassDriver/KeyboardHost/makefile +++ b/Demos/Host/ClassDriver/KeyboardHost/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -176,7 +180,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Host/ClassDriver/KeyboardHostWithParser/makefile b/Demos/Host/ClassDriver/KeyboardHostWithParser/makefile index 4e07a6883a..b1070f9c82 100644 --- a/Demos/Host/ClassDriver/KeyboardHostWithParser/makefile +++ b/Demos/Host/ClassDriver/KeyboardHostWithParser/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -176,7 +180,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Host/ClassDriver/MIDIHost/makefile b/Demos/Host/ClassDriver/MIDIHost/makefile index fe203868f6..99e529f4dd 100644 --- a/Demos/Host/ClassDriver/MIDIHost/makefile +++ b/Demos/Host/ClassDriver/MIDIHost/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -176,7 +180,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Host/ClassDriver/MassStorageHost/makefile b/Demos/Host/ClassDriver/MassStorageHost/makefile index 8124af8126..22b9b14caf 100644 --- a/Demos/Host/ClassDriver/MassStorageHost/makefile +++ b/Demos/Host/ClassDriver/MassStorageHost/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -177,7 +181,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Host/ClassDriver/MouseHost/makefile b/Demos/Host/ClassDriver/MouseHost/makefile index 77c47237e9..748213a1a2 100644 --- a/Demos/Host/ClassDriver/MouseHost/makefile +++ b/Demos/Host/ClassDriver/MouseHost/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -176,7 +180,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Host/ClassDriver/MouseHostWithParser/makefile b/Demos/Host/ClassDriver/MouseHostWithParser/makefile index 37424e8269..040f2697eb 100644 --- a/Demos/Host/ClassDriver/MouseHostWithParser/makefile +++ b/Demos/Host/ClassDriver/MouseHostWithParser/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -176,7 +180,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Host/ClassDriver/PrinterHost/makefile b/Demos/Host/ClassDriver/PrinterHost/makefile index a5df91fce1..85638aec5d 100644 --- a/Demos/Host/ClassDriver/PrinterHost/makefile +++ b/Demos/Host/ClassDriver/PrinterHost/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -176,7 +180,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Host/ClassDriver/RNDISEthernetHost/makefile b/Demos/Host/ClassDriver/RNDISEthernetHost/makefile index 942544718c..9ed8fb08e5 100644 --- a/Demos/Host/ClassDriver/RNDISEthernetHost/makefile +++ b/Demos/Host/ClassDriver/RNDISEthernetHost/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -176,7 +180,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Host/ClassDriver/StillImageHost/makefile b/Demos/Host/ClassDriver/StillImageHost/makefile index e4ded2cc15..1c8a2c38be 100644 --- a/Demos/Host/ClassDriver/StillImageHost/makefile +++ b/Demos/Host/ClassDriver/StillImageHost/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -176,7 +180,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Host/ClassDriver/VirtualSerialHost/makefile b/Demos/Host/ClassDriver/VirtualSerialHost/makefile index c957f831f7..176e1fabf9 100644 --- a/Demos/Host/ClassDriver/VirtualSerialHost/makefile +++ b/Demos/Host/ClassDriver/VirtualSerialHost/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -176,7 +180,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Host/Incomplete/BluetoothHost/makefile b/Demos/Host/Incomplete/BluetoothHost/makefile index de80a0e5b0..1c6dc0d874 100644 --- a/Demos/Host/Incomplete/BluetoothHost/makefile +++ b/Demos/Host/Incomplete/BluetoothHost/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -185,7 +189,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Host/LowLevel/GenericHIDHost/makefile b/Demos/Host/LowLevel/GenericHIDHost/makefile index 4db0c93a27..936538496f 100644 --- a/Demos/Host/LowLevel/GenericHIDHost/makefile +++ b/Demos/Host/LowLevel/GenericHIDHost/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -176,7 +180,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Host/LowLevel/JoystickHostWithParser/makefile b/Demos/Host/LowLevel/JoystickHostWithParser/makefile index 93d0522709..09f87d9802 100644 --- a/Demos/Host/LowLevel/JoystickHostWithParser/makefile +++ b/Demos/Host/LowLevel/JoystickHostWithParser/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -177,7 +181,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Host/LowLevel/KeyboardHost/makefile b/Demos/Host/LowLevel/KeyboardHost/makefile index 1c733784ad..a4b16f1dba 100644 --- a/Demos/Host/LowLevel/KeyboardHost/makefile +++ b/Demos/Host/LowLevel/KeyboardHost/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -176,7 +180,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Host/LowLevel/KeyboardHostWithParser/makefile b/Demos/Host/LowLevel/KeyboardHostWithParser/makefile index a0ff248ffa..9ddad4e9b8 100644 --- a/Demos/Host/LowLevel/KeyboardHostWithParser/makefile +++ b/Demos/Host/LowLevel/KeyboardHostWithParser/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -177,7 +181,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Host/LowLevel/MIDIHost/makefile b/Demos/Host/LowLevel/MIDIHost/makefile index 146ca54774..2f304753a7 100644 --- a/Demos/Host/LowLevel/MIDIHost/makefile +++ b/Demos/Host/LowLevel/MIDIHost/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -176,7 +180,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Host/LowLevel/MassStorageHost/makefile b/Demos/Host/LowLevel/MassStorageHost/makefile index ce38971dda..756204ae9e 100644 --- a/Demos/Host/LowLevel/MassStorageHost/makefile +++ b/Demos/Host/LowLevel/MassStorageHost/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -178,7 +182,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Host/LowLevel/MouseHost/makefile b/Demos/Host/LowLevel/MouseHost/makefile index f64af3b3f4..e0abc3fde1 100644 --- a/Demos/Host/LowLevel/MouseHost/makefile +++ b/Demos/Host/LowLevel/MouseHost/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -176,7 +180,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Host/LowLevel/MouseHostWithParser/makefile b/Demos/Host/LowLevel/MouseHostWithParser/makefile index 79d8ec2735..40648eecec 100644 --- a/Demos/Host/LowLevel/MouseHostWithParser/makefile +++ b/Demos/Host/LowLevel/MouseHostWithParser/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -177,7 +181,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Host/LowLevel/PrinterHost/makefile b/Demos/Host/LowLevel/PrinterHost/makefile index f4946c490c..374159062b 100644 --- a/Demos/Host/LowLevel/PrinterHost/makefile +++ b/Demos/Host/LowLevel/PrinterHost/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -177,7 +181,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Host/LowLevel/RNDISEthernetHost/makefile b/Demos/Host/LowLevel/RNDISEthernetHost/makefile index dce4aadd16..5f0e12b73f 100644 --- a/Demos/Host/LowLevel/RNDISEthernetHost/makefile +++ b/Demos/Host/LowLevel/RNDISEthernetHost/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -177,7 +181,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Host/LowLevel/StillImageHost/makefile b/Demos/Host/LowLevel/StillImageHost/makefile index ebf57ca839..5878b586ae 100644 --- a/Demos/Host/LowLevel/StillImageHost/makefile +++ b/Demos/Host/LowLevel/StillImageHost/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -177,7 +181,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Demos/Host/LowLevel/VirtualSerialHost/makefile b/Demos/Host/LowLevel/VirtualSerialHost/makefile index 298c029330..c5e03c8508 100644 --- a/Demos/Host/LowLevel/VirtualSerialHost/makefile +++ b/Demos/Host/LowLevel/VirtualSerialHost/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -176,7 +180,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/LUFA.pnproj b/LUFA.pnproj index 3fc4290f52..ca95f21f6f 100644 --- a/LUFA.pnproj +++ b/LUFA.pnproj @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/LUFA/CodeTemplates/makefile_template b/LUFA/CodeTemplates/makefile_template index 33b47e0bbf..adf5e54dd2 100644 --- a/LUFA/CodeTemplates/makefile_template +++ b/LUFA/CodeTemplates/makefile_template @@ -63,6 +63,10 @@ MCU = ### INSERT NAME OF MICROCONTROLLER MODEL HERE ### +# Target architecture (see library "Board Types" documentation). +ARCH = ## INSERT NAME OF ARCHITECTURE HERE ## + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. diff --git a/LUFA/Common/Architectures.h b/LUFA/Common/Architectures.h new file mode 100644 index 0000000000..8bf9c7cac4 --- /dev/null +++ b/LUFA/Common/Architectures.h @@ -0,0 +1,74 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2011. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + 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 + 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 + software without specific, written prior permission. + + The author disclaim all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * \brief Supported architecture defines. + * + * This file contains constants which can be passed to the compiler (via setting the macro ARCH) in the + * user project makefile using the -D option to configure the library drivers. + * + * \note Do not include this file directly, rather include the Common.h header file instead to gain this file's + * functionality. + */ + +/** \ingroup Group_Common + * \defgroup Group_Architectures Hardware Architectures + * + * Macros for indicating the chosen hardware architecture to the library. These macros should be used when + * defining the ARCH token to the chosen hardware via the -D switch in the project makefile. + * + * @{ + */ + +#ifndef __LUFA_ARCHITECTURES_H__ +#define __LUFA_ARCHITECTURES_H__ + + /* Preprocessor Checks: */ + #if !defined(__INCLUDE_FROM_COMMON_H) + #error Do not include this file directly. Include LUFA/Common/Common.h instead to gain this functionality. + #endif + + /* Public Interface - May be used in end-application: */ + /* Macros: */ + /** Selects the Atmel 8-bit AVR (AT90USB* and ATMEGA*U* chips) architecture. */ + #define ARCH_AVR8 1 + + #if !defined(__DOXYGEN__) + #define ARCH_ ARCH_AVR8 + + #if !defined(ARCH) + #define ARCH ARCH_AVR8 + #endif + #endif + +#endif + +/** @} */ + diff --git a/LUFA/Common/Attributes.h b/LUFA/Common/Attributes.h index 67a3166b21..ff4058cf11 100644 --- a/LUFA/Common/Attributes.h +++ b/LUFA/Common/Attributes.h @@ -44,7 +44,7 @@ */ /** \ingroup Group_Common - * @defgroup Group_GCCAttr Function/Variable Attributes + * \defgroup Group_GCCAttr Function/Variable Attributes * * Macros for easy access GCC function and variable attributes, which can be applied to function prototypes or * variable attributes. @@ -52,11 +52,11 @@ * @{ */ -#ifndef __FUNCATTR_H__ -#define __FUNCATTR_H__ +#ifndef __LUFA_FUNCATTR_H__ +#define __LUFA_FUNCATTR_H__ /* Preprocessor Checks: */ - #if !defined(__COMMON_H__) + #if !defined(__INCLUDE_FROM_COMMON_H) #error Do not include this file directly. Include LUFA/Common/Common.h instead to gain this functionality. #endif diff --git a/LUFA/Common/BoardTypes.h b/LUFA/Common/BoardTypes.h index 264908fe2c..7d91622622 100644 --- a/LUFA/Common/BoardTypes.h +++ b/LUFA/Common/BoardTypes.h @@ -39,7 +39,7 @@ */ /** \ingroup Group_Common - * @defgroup Group_BoardTypes Board Types + * \defgroup Group_BoardTypes Board Types * * Macros for indicating the chosen physical board hardware to the library. These macros should be used when * defining the BOARD token to the chosen hardware via the -D switch in the project makefile. @@ -47,11 +47,11 @@ * @{ */ -#ifndef __BOARDTYPES_H__ -#define __BOARDTYPES_H__ +#ifndef __LUFA_BOARDTYPES_H__ +#define __LUFA_BOARDTYPES_H__ /* Preprocessor Checks: */ - #if !defined(__COMMON_H__) + #if !defined(__INCLUDE_FROM_COMMON_H) #error Do not include this file directly. Include LUFA/Common/Common.h instead to gain this functionality. #endif diff --git a/LUFA/Common/Common.h b/LUFA/Common/Common.h index c1aa27a5f4..3afb60d008 100644 --- a/LUFA/Common/Common.h +++ b/LUFA/Common/Common.h @@ -35,7 +35,7 @@ * also includes other common code headers. */ -/** @defgroup Group_Common Common Utility Headers - LUFA/Drivers/Common/Common.h +/** \defgroup Group_Common Common Utility Headers - LUFA/Drivers/Common/Common.h * * Common utility headers containing macros, functions, enums and types which are common to all * aspects of the library. @@ -43,25 +43,41 @@ * @{ */ -/** @defgroup Group_Debugging Debugging Macros +/** \defgroup Group_Debugging Debugging Macros * * Macros for debugging use. */ -/** @defgroup Group_BitManip Endian and Bit Macros +/** \defgroup Group_BitManip Endian and Bit Macros * * Functions for swapping endianness and reversing bit orders. */ -#ifndef __COMMON_H__ -#define __COMMON_H__ +#ifndef __LUFA_COMMON_H__ +#define __LUFA_COMMON_H__ + /* Macros: */ + #if !defined(__DOXYGEN__) + #define __INCLUDE_FROM_COMMON_H + #endif + /* Includes: */ #include #include + #include "Architectures.h" #include "Attributes.h" #include "BoardTypes.h" + + /* Architecture specific utility includes: */ + #if (ARCH == ARCH_AVR8) + #include + #include + #include + #include + #include + #include + #endif /* Public Interface - May be used in end-application: */ /* Macros: */ @@ -89,7 +105,9 @@ * * \return The larger of the two input parameters */ - #define MAX(x, y) ((x > y) ? x : y) + #if !defined(MAX) || defined(__DOXYGEN__) + #define MAX(x, y) ((x > y) ? x : y) + #endif /** Convenience macro to determine the smaller of two values. * @@ -101,44 +119,61 @@ * * \return The smaller of the two input parameters */ - #define MIN(x, y) ((x < y) ? x : y) - - /** Defines a volatile \c NOP statement which cannot be optimized out by the compiler, and thus can always - * be set as a breakpoint in the resulting code. Useful for debugging purposes, where the optimiser - * removes/reorders code to the point where break points cannot reliably be set. - * - * \ingroup Group_Debugging - */ - #define JTAG_DEBUG_POINT() __asm__ __volatile__ ("NOP" ::) + #if !defined(MIN) || defined(__DOXYGEN__) + #define MIN(x, y) ((x < y) ? x : y) + #endif - /** Defines an explicit JTAG break point in the resulting binary via the assembly \c BREAK statement. When - * a JTAG is used, this causes the program execution to halt when reached until manually resumed. - * - * \ingroup Group_Debugging - */ - #define JTAG_DEBUG_BREAK() __asm__ __volatile__ ("BREAK" ::) + #if (ARCH == ARCH_AVR8) + /** Defines a volatile \c NOP statement which cannot be optimized out by the compiler, and thus can always + * be set as a breakpoint in the resulting code. Useful for debugging purposes, where the optimiser + * removes/reorders code to the point where break points cannot reliably be set. + * + * \ingroup Group_Debugging + */ + #define JTAG_DEBUG_POINT() __asm__ __volatile__ ("NOP" ::) - /** Macro for testing condition "x" and breaking via \ref JTAG_DEBUG_BREAK() if the condition is false. - * - * \param[in] Condition Condition that will be evaluated, - * - * \ingroup Group_Debugging - */ - #define JTAG_DEBUG_ASSERT(Condition) MACROS{ if (!(Condition)) { JTAG_DEBUG_BREAK(); } }MACROE + /** Defines an explicit JTAG break point in the resulting binary via the assembly \c BREAK statement. When + * a JTAG is used, this causes the program execution to halt when reached until manually resumed. + * + * \ingroup Group_Debugging + */ + #define JTAG_DEBUG_BREAK() __asm__ __volatile__ ("BREAK" ::) + + #if !defined(pgm_read_ptr) || defined(__DOXYGEN__) + /** Reads a pointer out of PROGMEM space. This is currently a wrapper for the avr-libc \c pgm_read_ptr() + * macro with a \c void* cast, so that its value can be assigned directly to a pointer variable or used + * in pointer arithmetic without further casting in C. In a future avr-libc distribution this will be + * part of the standard API and will be implemented in a more formal manner. + * + * \param[in] Addr Address of the pointer to read. + * + * \return Pointer retrieved from PROGMEM space. + */ + #define pgm_read_ptr(Addr) (void*)pgm_read_word(Addr) + #endif + + /** Macro for testing condition "x" and breaking via \ref JTAG_DEBUG_BREAK() if the condition is false. + * + * \param[in] Condition Condition that will be evaluated, + * + * \ingroup Group_Debugging + */ + #define JTAG_DEBUG_ASSERT(Condition) MACROS{ if (!(Condition)) { JTAG_DEBUG_BREAK(); } }MACROE - /** Macro for testing condition "x" and writing debug data to the stdout stream if \c false. The stdout stream - * must be pre-initialized before this macro is run and linked to an output device, such as the AVR's USART - * peripheral. - * - * The output takes the form "{FILENAME}: Function {FUNCTION NAME}, Line {LINE NUMBER}: Assertion {Condition} failed." - * - * \param[in] Condition Condition that will be evaluated, - * - * \ingroup Group_Debugging - */ - #define STDOUT_ASSERT(Condition) MACROS{ if (!(x)) { printf_P(PSTR("%s: Function \"%s\", Line %d: " \ - "Assertion \"%s\" failed.\r\n"), \ - __FILE__, __func__, __LINE__, #Condition); } }MACROE + /** Macro for testing condition "x" and writing debug data to the stdout stream if \c false. The stdout stream + * must be pre-initialized before this macro is run and linked to an output device, such as the AVR's USART + * peripheral. + * + * The output takes the form "{FILENAME}: Function {FUNCTION NAME}, Line {LINE NUMBER}: Assertion {Condition} failed." + * + * \param[in] Condition Condition that will be evaluated, + * + * \ingroup Group_Debugging + */ + #define STDOUT_ASSERT(Condition) MACROS{ if (!(x)) { printf_P(PSTR("%s: Function \"%s\", Line %d: " \ + "Assertion \"%s\" failed.\r\n"), \ + __FILE__, __func__, __LINE__, #Condition); } }MACROE + #endif /** Forces GCC to use pointer indirection (via the AVR's pointer register pairs) when accessing the given * struct pointer. In some cases GCC will emit non-optimal assembly code when accessing a structure through @@ -150,19 +185,6 @@ */ #define GCC_FORCE_POINTER_ACCESS(StructPtr) __asm__ __volatile__("" : "=b" (StructPtr) : "0" (StructPtr)) - #if !defined(pgm_read_ptr) || defined(__DOXYGEN__) - /** Reads a pointer out of PROGMEM space. This is currently a wrapper for the avr-libc \c pgm_read_ptr() - * macro with a \c void* cast, so that its value can be assigned directly to a pointer variable or used - * in pointer arithmetic without further casting in C. In a future avr-libc distribution this will be - * part of the standard API and will be implemented in a more formal manner. - * - * \param[in] Addr Address of the pointer to read. - * - * \return Pointer retrieved from PROGMEM space. - */ - #define pgm_read_ptr(Addr) (void*)pgm_read_word(Addr) - #endif - /** Swaps the byte ordering of a 16-bit value at compile time. Do not use this macro for swapping byte orderings * of dynamic values computed at runtime, use \ref SwapEndian_16() instead. The result of this macro can be used * inside struct or other variable initializers outside of a function, something that is not possible with the diff --git a/LUFA/Drivers/Board/ADAFRUITU4/LEDs.h b/LUFA/Drivers/Board/ADAFRUITU4/LEDs.h index 4d38817d8c..3f6a6cca45 100644 --- a/LUFA/Drivers/Board/ADAFRUITU4/LEDs.h +++ b/LUFA/Drivers/Board/ADAFRUITU4/LEDs.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_LEDs - * @defgroup Group_LEDs_ADAFRUITU4 ADAFRUITU4 + * \defgroup Group_LEDs_ADAFRUITU4 ADAFRUITU4 * * Board specific LED driver header for the Adafruit U4 Breakout board (http://ladyada.net/products/atmega32u4breakout). * diff --git a/LUFA/Drivers/Board/ATAVRUSBRF01/Buttons.h b/LUFA/Drivers/Board/ATAVRUSBRF01/Buttons.h index 28ea057926..568c0cb7da 100644 --- a/LUFA/Drivers/Board/ATAVRUSBRF01/Buttons.h +++ b/LUFA/Drivers/Board/ATAVRUSBRF01/Buttons.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_Buttons - * @defgroup Group_Buttons_ATAVRUSBRF01 ATAVRUSBRF01 + * \defgroup Group_Buttons_ATAVRUSBRF01 ATAVRUSBRF01 * * Board specific Buttons driver header for the Atmel ATAVRUSBRF01. * diff --git a/LUFA/Drivers/Board/ATAVRUSBRF01/LEDs.h b/LUFA/Drivers/Board/ATAVRUSBRF01/LEDs.h index d6dde92da1..044042f091 100644 --- a/LUFA/Drivers/Board/ATAVRUSBRF01/LEDs.h +++ b/LUFA/Drivers/Board/ATAVRUSBRF01/LEDs.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_LEDs - * @defgroup Group_LEDs_ATAVRUSBRF01 ATAVRUSBRF01 + * \defgroup Group_LEDs_ATAVRUSBRF01 ATAVRUSBRF01 * * Board specific LED driver header for the Atmel ATAVRUSBRF01. * diff --git a/LUFA/Drivers/Board/BENITO/Buttons.h b/LUFA/Drivers/Board/BENITO/Buttons.h index cf2a477caf..4e3d088204 100644 --- a/LUFA/Drivers/Board/BENITO/Buttons.h +++ b/LUFA/Drivers/Board/BENITO/Buttons.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_Buttons - * @defgroup Group_Buttons_BENITO BENITO + * \defgroup Group_Buttons_BENITO BENITO * * Board specific Buttons driver header for the Tempusdictum Benito (http://dorkbotpdx.org/wiki/benito). * diff --git a/LUFA/Drivers/Board/BENITO/LEDs.h b/LUFA/Drivers/Board/BENITO/LEDs.h index 855ca01a36..51593ec9ef 100644 --- a/LUFA/Drivers/Board/BENITO/LEDs.h +++ b/LUFA/Drivers/Board/BENITO/LEDs.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_LEDs - * @defgroup Group_LEDs_BENITO BENITO + * \defgroup Group_LEDs_BENITO BENITO * * Board specific LED driver header for the Tempusdictum Benito (http://dorkbotpdx.org/wiki/benito). * diff --git a/LUFA/Drivers/Board/BLACKCAT/LEDs.h b/LUFA/Drivers/Board/BLACKCAT/LEDs.h index 40c847333c..e5c250cc4f 100644 --- a/LUFA/Drivers/Board/BLACKCAT/LEDs.h +++ b/LUFA/Drivers/Board/BLACKCAT/LEDs.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_LEDs - * @defgroup Group_LEDs_BLACKCAT BLACKCAT + * \defgroup Group_LEDs_BLACKCAT BLACKCAT * * Board specific LED driver header for the TCNISO Blackcat USB JTAG (http://www.embeddedcomputers.net/products/BlackcatUSB/. * diff --git a/LUFA/Drivers/Board/BUI/LEDs.h b/LUFA/Drivers/Board/BUI/LEDs.h index 6c2a36132f..fa1a8b0c45 100644 --- a/LUFA/Drivers/Board/BUI/LEDs.h +++ b/LUFA/Drivers/Board/BUI/LEDs.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_LEDs - * @defgroup Group_LEDs_BUI BUI + * \defgroup Group_LEDs_BUI BUI * * Board specific LED driver header for the Busware BUI (http://www.busware.de/tiki-index.php?page=BUI). * diff --git a/LUFA/Drivers/Board/BUMBLEB/Buttons.h b/LUFA/Drivers/Board/BUMBLEB/Buttons.h index 8b54f113be..015ecf6d5c 100644 --- a/LUFA/Drivers/Board/BUMBLEB/Buttons.h +++ b/LUFA/Drivers/Board/BUMBLEB/Buttons.h @@ -41,7 +41,7 @@ */ /** \ingroup Group_Buttons - * @defgroup Group_Buttons_BUMBLEB BUMBLEB + * \defgroup Group_Buttons_BUMBLEB BUMBLEB * * Board specific buttons driver header for the Fletchtronics BUMBLEB (http://fletchtronics.net/bumble-b). The BUMBLEB * third-party board does not include any on-board peripherals, but does have an officially recommended external peripheral diff --git a/LUFA/Drivers/Board/BUMBLEB/Joystick.h b/LUFA/Drivers/Board/BUMBLEB/Joystick.h index 4516bdb614..336863c387 100644 --- a/LUFA/Drivers/Board/BUMBLEB/Joystick.h +++ b/LUFA/Drivers/Board/BUMBLEB/Joystick.h @@ -41,7 +41,7 @@ */ /** \ingroup Group_Joystick - * @defgroup Group_Joystick_BUMBLEB BUMBLEB + * \defgroup Group_Joystick_BUMBLEB BUMBLEB * * Board specific joystick driver header for the Fletchtronics BUMBLEB (http://fletchtronics.net/bumble-b). The BUMBLEB * third-party board does not include any on-board peripherals, but does have an officially recommended external peripheral diff --git a/LUFA/Drivers/Board/BUMBLEB/LEDs.h b/LUFA/Drivers/Board/BUMBLEB/LEDs.h index b985340d00..349ef38c6a 100644 --- a/LUFA/Drivers/Board/BUMBLEB/LEDs.h +++ b/LUFA/Drivers/Board/BUMBLEB/LEDs.h @@ -41,7 +41,7 @@ */ /** \ingroup Group_LEDs - * @defgroup Group_LEDs_BUMBLEB BUMBLEB + * \defgroup Group_LEDs_BUMBLEB BUMBLEB * * Board specific LED driver header for the Fletchtronics BUMBLEB (http://fletchtronics.net/bumble-b). The BUMBLEB * third-party board does not include any on-board peripherals, but does have an officially recommended external diff --git a/LUFA/Drivers/Board/Buttons.h b/LUFA/Drivers/Board/Buttons.h index 1e31059d42..686fe5ad99 100644 --- a/LUFA/Drivers/Board/Buttons.h +++ b/LUFA/Drivers/Board/Buttons.h @@ -44,7 +44,7 @@ */ /** \ingroup Group_BoardDrivers - * @defgroup Group_Buttons Buttons Driver - LUFA/Drivers/Board/Buttons.h + * \defgroup Group_Buttons Buttons Driver - LUFA/Drivers/Board/Buttons.h * * \section Sec_Dependencies Module Source Dependencies * The following files must be built with any user project that uses this module: @@ -125,10 +125,8 @@ #include "MINIMUS/Buttons.h" #elif (BOARD == BOARD_MICROSIN162) #include "MICROSIN162/Buttons.h" - #elif (BOARD == BOARD_USER) - #include "Board/Buttons.h" #else - #error The selected board does not contain any GPIO buttons. + #include "Board/Buttons.h" #endif /* Pseudo-Functions for Doxygen: */ diff --git a/LUFA/Drivers/Board/CULV3/Buttons.h b/LUFA/Drivers/Board/CULV3/Buttons.h index 5ed6817d10..fd98c775f7 100644 --- a/LUFA/Drivers/Board/CULV3/Buttons.h +++ b/LUFA/Drivers/Board/CULV3/Buttons.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_LEDs - * @defgroup Group_LEDs_CULV3 CULV3 + * \defgroup Group_LEDs_CULV3 CULV3 * * Board specific LED driver header for the Busware CUL V3 (http://busware.de/tiki-index.php?page=CUL). * diff --git a/LUFA/Drivers/Board/CULV3/LEDs.h b/LUFA/Drivers/Board/CULV3/LEDs.h index 3a2469d5ca..c9d20b692d 100644 --- a/LUFA/Drivers/Board/CULV3/LEDs.h +++ b/LUFA/Drivers/Board/CULV3/LEDs.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_LEDs - * @defgroup Group_LEDs_CULV3 CULV3 + * \defgroup Group_LEDs_CULV3 CULV3 * * Board specific LED driver header for the Busware CUL V3 (http://busware.de/tiki-index.php?page=CUL). * diff --git a/LUFA/Drivers/Board/Dataflash.h b/LUFA/Drivers/Board/Dataflash.h index 852d81977d..06c1e62ac7 100644 --- a/LUFA/Drivers/Board/Dataflash.h +++ b/LUFA/Drivers/Board/Dataflash.h @@ -44,7 +44,7 @@ */ /** \ingroup Group_BoardDrivers - * @defgroup Group_Dataflash Dataflash Driver - LUFA/Drivers/Board/Dataflash.h + * \defgroup Group_Dataflash Dataflash Driver - LUFA/Drivers/Board/Dataflash.h * * \section Sec_Dependencies Module Source Dependencies * The following files must be built with any user project that uses this module: @@ -123,8 +123,8 @@ #endif /* Includes: */ - #include "../Peripheral/SPI.h" #include "../../Common/Common.h" + #include "../Peripheral/SPI.h" /* Enable C linkage for C++ Compilers: */ #if defined(__cplusplus) @@ -247,10 +247,8 @@ #include "XPLAIN/Dataflash.h" #elif (BOARD == BOARD_EVK527) #include "EVK527/Dataflash.h" - #elif (BOARD == BOARD_USER) - #include "Board/Dataflash.h" #else - #error The selected board does not contain a dataflash IC. + #include "Board/Dataflash.h" #endif /* Disable C linkage for C++ Compilers: */ diff --git a/LUFA/Drivers/Board/EVK527/AT45DB321C.h b/LUFA/Drivers/Board/EVK527/AT45DB321C.h index c0d3589a56..8d36ae3f42 100644 --- a/LUFA/Drivers/Board/EVK527/AT45DB321C.h +++ b/LUFA/Drivers/Board/EVK527/AT45DB321C.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_Dataflash_EVK527 - * @defgroup Group_Dataflash_EVK527_AT45DB321C AT45DB321C + * \defgroup Group_Dataflash_EVK527_AT45DB321C AT45DB321C * * Board specific Dataflash commands header for the AT45DB321C as mounted on the Atmel EVK527. * diff --git a/LUFA/Drivers/Board/EVK527/Buttons.h b/LUFA/Drivers/Board/EVK527/Buttons.h index eff2f51792..f9b3da12e1 100644 --- a/LUFA/Drivers/Board/EVK527/Buttons.h +++ b/LUFA/Drivers/Board/EVK527/Buttons.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_Buttons - * @defgroup Group_Buttons_EVK527 EVK527 + * \defgroup Group_Buttons_EVK527 EVK527 * * Board specific Buttons driver header for the Atmel EVK527. * diff --git a/LUFA/Drivers/Board/EVK527/Dataflash.h b/LUFA/Drivers/Board/EVK527/Dataflash.h index fdf49c1e81..e9629e06df 100644 --- a/LUFA/Drivers/Board/EVK527/Dataflash.h +++ b/LUFA/Drivers/Board/EVK527/Dataflash.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_Dataflash - * @defgroup Group_Dataflash_EVK527 EVK527 + * \defgroup Group_Dataflash_EVK527 EVK527 * * Board specific Dataflash driver header for the Atmel EVK527. * diff --git a/LUFA/Drivers/Board/EVK527/Joystick.h b/LUFA/Drivers/Board/EVK527/Joystick.h index ec08b7a8b8..c0255f4595 100644 --- a/LUFA/Drivers/Board/EVK527/Joystick.h +++ b/LUFA/Drivers/Board/EVK527/Joystick.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_Joystick - * @defgroup Group_Joystick_EVK527 EVK527 + * \defgroup Group_Joystick_EVK527 EVK527 * * Board specific joystick driver header for the Atmel EVK527. * diff --git a/LUFA/Drivers/Board/EVK527/LEDs.h b/LUFA/Drivers/Board/EVK527/LEDs.h index f5c78fdd70..5f4670fa75 100644 --- a/LUFA/Drivers/Board/EVK527/LEDs.h +++ b/LUFA/Drivers/Board/EVK527/LEDs.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_LEDs - * @defgroup Group_LEDs_EVK527 EVK527 + * \defgroup Group_LEDs_EVK527 EVK527 * * Board specific LED driver header for the Atmel EVK527. * diff --git a/LUFA/Drivers/Board/JMDBU2/Buttons.h b/LUFA/Drivers/Board/JMDBU2/Buttons.h index 958664cae8..b5272ae75c 100644 --- a/LUFA/Drivers/Board/JMDBU2/Buttons.h +++ b/LUFA/Drivers/Board/JMDBU2/Buttons.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_Buttons - * @defgroup Group_Buttons_JMDBU2 JMDBU2 + * \defgroup Group_Buttons_JMDBU2 JMDBU2 * * Board specific Buttons driver header for the Mattairtech JM-DB-U2 (http://u2.mattair.net/index.html). * diff --git a/LUFA/Drivers/Board/JMDBU2/LEDs.h b/LUFA/Drivers/Board/JMDBU2/LEDs.h index 4c62a45f23..a15e9f35ce 100644 --- a/LUFA/Drivers/Board/JMDBU2/LEDs.h +++ b/LUFA/Drivers/Board/JMDBU2/LEDs.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_LEDs - * @defgroup Group_LEDs_JMDBU2 JMDBU2 + * \defgroup Group_LEDs_JMDBU2 JMDBU2 * * Board specific LED driver header for the Mattairtech JM-DB-U2 (http://u2.mattair.net/index.html). * diff --git a/LUFA/Drivers/Board/Joystick.h b/LUFA/Drivers/Board/Joystick.h index f2298e9bd1..a9448ffb7c 100644 --- a/LUFA/Drivers/Board/Joystick.h +++ b/LUFA/Drivers/Board/Joystick.h @@ -44,7 +44,7 @@ */ /** \ingroup Group_BoardDrivers - * @defgroup Group_Joystick Joystick Driver - LUFA/Drivers/Board/Joystick.h + * \defgroup Group_Joystick Joystick Driver - LUFA/Drivers/Board/Joystick.h * * \section Sec_Dependencies Module Source Dependencies * The following files must be built with any user project that uses this module: @@ -113,10 +113,8 @@ #include "BUMBLEB/Joystick.h" #elif (BOARD == BOARD_EVK527) #include "EVK527/Joystick.h" - #elif (BOARD == BOARD_USER) - #include "Board/Joystick.h" #else - #error The selected board does not contain a joystick. + #include "Board/Joystick.h" #endif /* Pseudo-Functions for Doxygen: */ diff --git a/LUFA/Drivers/Board/LEDs.h b/LUFA/Drivers/Board/LEDs.h index 58cdffe510..9ef2ea1958 100644 --- a/LUFA/Drivers/Board/LEDs.h +++ b/LUFA/Drivers/Board/LEDs.h @@ -44,7 +44,7 @@ */ /** \ingroup Group_BoardDrivers - * @defgroup Group_LEDs LEDs Driver - LUFA/Drivers/Board/LEDs.h + * \defgroup Group_LEDs LEDs Driver - LUFA/Drivers/Board/LEDs.h * * \section Sec_Dependencies Module Source Dependencies * The following files must be built with any user project that uses this module: @@ -165,7 +165,7 @@ #include "MICROSIN162/LEDs.h" #elif (BOARD == BOARD_SPARKFUN8U2) #include "SPARKFUN8U2/LEDs.h" - #elif (BOARD == BOARD_USER) + #else #include "Board/LEDs.h" #endif diff --git a/LUFA/Drivers/Board/MAXIMUS/LEDs.h b/LUFA/Drivers/Board/MAXIMUS/LEDs.h index b6ec75089b..c3ead686b9 100644 --- a/LUFA/Drivers/Board/MAXIMUS/LEDs.h +++ b/LUFA/Drivers/Board/MAXIMUS/LEDs.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_LEDs - * @defgroup Group_LEDs_MAXIMUS MAXIMUS + * \defgroup Group_LEDs_MAXIMUS MAXIMUS * * Board specific LED driver header for the Maximus (http://www.avrusb.com/). * diff --git a/LUFA/Drivers/Board/MICROSIN162/Buttons.h b/LUFA/Drivers/Board/MICROSIN162/Buttons.h index a8cff7e6b2..a4d1637e54 100644 --- a/LUFA/Drivers/Board/MICROSIN162/Buttons.h +++ b/LUFA/Drivers/Board/MICROSIN162/Buttons.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_Buttons - * @defgroup Group_Buttons_MICROSIN162 MICROSIN162 + * \defgroup Group_Buttons_MICROSIN162 MICROSIN162 * * Board specific Buttons driver header for the Microsin AVR-USB162 board (http://microsin.ru/content/view/685/44/). * diff --git a/LUFA/Drivers/Board/MICROSIN162/LEDs.h b/LUFA/Drivers/Board/MICROSIN162/LEDs.h index f988d7cce2..8926e33fc6 100644 --- a/LUFA/Drivers/Board/MICROSIN162/LEDs.h +++ b/LUFA/Drivers/Board/MICROSIN162/LEDs.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_LEDs - * @defgroup Group_LEDs_MICROSIN162 MICROSIN162 + * \defgroup Group_LEDs_MICROSIN162 MICROSIN162 * * Board specific LED driver header for the Microsin AVR-USB162 board (http://microsin.ru/content/view/685/44/). * diff --git a/LUFA/Drivers/Board/MINIMUS/Buttons.h b/LUFA/Drivers/Board/MINIMUS/Buttons.h index f421f73ffe..9b3016fa3f 100644 --- a/LUFA/Drivers/Board/MINIMUS/Buttons.h +++ b/LUFA/Drivers/Board/MINIMUS/Buttons.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_Buttons - * @defgroup Group_Buttons_MINIMUS MINIMUS + * \defgroup Group_Buttons_MINIMUS MINIMUS * * Board specific Buttons driver header for the MINIMUS. * diff --git a/LUFA/Drivers/Board/MINIMUS/LEDs.h b/LUFA/Drivers/Board/MINIMUS/LEDs.h index 83338576a5..524e628536 100644 --- a/LUFA/Drivers/Board/MINIMUS/LEDs.h +++ b/LUFA/Drivers/Board/MINIMUS/LEDs.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_LEDs - * @defgroup Group_LEDs_MINIMUS MINIMUS + * \defgroup Group_LEDs_MINIMUS MINIMUS * * Board specific LED driver header for the Minimus USB (http://www.minimususb.com/). * diff --git a/LUFA/Drivers/Board/OLIMEX162/Buttons.h b/LUFA/Drivers/Board/OLIMEX162/Buttons.h index 322eaa37b2..e52dadf141 100644 --- a/LUFA/Drivers/Board/OLIMEX162/Buttons.h +++ b/LUFA/Drivers/Board/OLIMEX162/Buttons.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_Buttons - * @defgroup Group_Buttons_OLIMEX162 OLIMEX162 + * \defgroup Group_Buttons_OLIMEX162 OLIMEX162 * * Board specific Buttons driver header for the Olimex AVR-USB-162 Development Board (http://www.olimex.com/dev/avr-usb-162.html). * diff --git a/LUFA/Drivers/Board/OLIMEX162/LEDs.h b/LUFA/Drivers/Board/OLIMEX162/LEDs.h index 5605096f7b..d13418a3cf 100644 --- a/LUFA/Drivers/Board/OLIMEX162/LEDs.h +++ b/LUFA/Drivers/Board/OLIMEX162/LEDs.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_LEDs - * @defgroup Group_LEDs_OLIMEX162 OLIMEX162 + * \defgroup Group_LEDs_OLIMEX162 OLIMEX162 * * Board specific LED driver header for the Olimex AVR-USB-162 (http://www.olimex.com/dev/avr-usb-162.html). * diff --git a/LUFA/Drivers/Board/RZUSBSTICK/LEDs.h b/LUFA/Drivers/Board/RZUSBSTICK/LEDs.h index 4012e5b68a..adaa9cd9a3 100644 --- a/LUFA/Drivers/Board/RZUSBSTICK/LEDs.h +++ b/LUFA/Drivers/Board/RZUSBSTICK/LEDs.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_LEDs - * @defgroup Group_LEDs_RZUSBSTICK RZUSBSTICK + * \defgroup Group_LEDs_RZUSBSTICK RZUSBSTICK * * Board specific LED driver header for the Atmel RZUSBSTICK. * diff --git a/LUFA/Drivers/Board/SPARKFUN8U2/LEDs.h b/LUFA/Drivers/Board/SPARKFUN8U2/LEDs.h index e3682c7607..2a3961edb2 100644 --- a/LUFA/Drivers/Board/SPARKFUN8U2/LEDs.h +++ b/LUFA/Drivers/Board/SPARKFUN8U2/LEDs.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_LEDs - * @defgroup Group_LEDs_SPARKFUN8U2 SPARKFUN8U2 + * \defgroup Group_LEDs_SPARKFUN8U2 SPARKFUN8U2 * * Board specific LED driver header for the Sparkfun ATMEGA8U2 breakout board (http://www.sparkfun.com/products/10277). * diff --git a/LUFA/Drivers/Board/STK525/AT45DB321C.h b/LUFA/Drivers/Board/STK525/AT45DB321C.h index ea5c8d2544..074fc37dfa 100644 --- a/LUFA/Drivers/Board/STK525/AT45DB321C.h +++ b/LUFA/Drivers/Board/STK525/AT45DB321C.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_Dataflash_STK525 - * @defgroup Group_Dataflash_STK525_AT45DB321C AT45DB321C + * \defgroup Group_Dataflash_STK525_AT45DB321C AT45DB321C * * Board specific Dataflash commands header for the AT45DB321C as mounted on the Atmel STK525. * diff --git a/LUFA/Drivers/Board/STK525/Buttons.h b/LUFA/Drivers/Board/STK525/Buttons.h index dd9caee396..f18c2a1a8e 100644 --- a/LUFA/Drivers/Board/STK525/Buttons.h +++ b/LUFA/Drivers/Board/STK525/Buttons.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_Buttons - * @defgroup Group_Buttons_STK525 STK525 + * \defgroup Group_Buttons_STK525 STK525 * * Board specific Buttons driver header for the Atmel STK525. * diff --git a/LUFA/Drivers/Board/STK525/Dataflash.h b/LUFA/Drivers/Board/STK525/Dataflash.h index 54cdcbde8f..ec3246c5e2 100644 --- a/LUFA/Drivers/Board/STK525/Dataflash.h +++ b/LUFA/Drivers/Board/STK525/Dataflash.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_Dataflash - * @defgroup Group_Dataflash_STK525 STK525 + * \defgroup Group_Dataflash_STK525 STK525 * * Board specific Dataflash driver header for the Atmel STK525. * diff --git a/LUFA/Drivers/Board/STK525/Joystick.h b/LUFA/Drivers/Board/STK525/Joystick.h index d42fd0493f..2baedb0b95 100644 --- a/LUFA/Drivers/Board/STK525/Joystick.h +++ b/LUFA/Drivers/Board/STK525/Joystick.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_Joystick - * @defgroup Group_Joystick_STK525 STK525 + * \defgroup Group_Joystick_STK525 STK525 * * Board specific joystick driver header for the Atmel STK525. * diff --git a/LUFA/Drivers/Board/STK525/LEDs.h b/LUFA/Drivers/Board/STK525/LEDs.h index 3aa62100b6..cacd3195f8 100644 --- a/LUFA/Drivers/Board/STK525/LEDs.h +++ b/LUFA/Drivers/Board/STK525/LEDs.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_LEDs - * @defgroup Group_LEDs_STK525 STK525 + * \defgroup Group_LEDs_STK525 STK525 * * Board specific LED driver header for the Atmel STK525. * diff --git a/LUFA/Drivers/Board/STK526/AT45DB642D.h b/LUFA/Drivers/Board/STK526/AT45DB642D.h index 589613c05e..10344d4e96 100644 --- a/LUFA/Drivers/Board/STK526/AT45DB642D.h +++ b/LUFA/Drivers/Board/STK526/AT45DB642D.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_Dataflash_STK526 - * @defgroup Group_Dataflash_STK526_AT45DB642D AT45DB642D + * \defgroup Group_Dataflash_STK526_AT45DB642D AT45DB642D * * Board specific Dataflash commands header for the AT45DB642D as mounted on the Atmel STK526. * diff --git a/LUFA/Drivers/Board/STK526/Buttons.h b/LUFA/Drivers/Board/STK526/Buttons.h index 274869a75d..afbb3fab53 100644 --- a/LUFA/Drivers/Board/STK526/Buttons.h +++ b/LUFA/Drivers/Board/STK526/Buttons.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_Buttons - * @defgroup Group_Buttons_STK526 STK526 + * \defgroup Group_Buttons_STK526 STK526 * * Board specific Buttons driver header for the Atmel STK526. * diff --git a/LUFA/Drivers/Board/STK526/Dataflash.h b/LUFA/Drivers/Board/STK526/Dataflash.h index f51073511c..b0ceecd64e 100644 --- a/LUFA/Drivers/Board/STK526/Dataflash.h +++ b/LUFA/Drivers/Board/STK526/Dataflash.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_Dataflash - * @defgroup Group_Dataflash_STK526 STK526 + * \defgroup Group_Dataflash_STK526 STK526 * * Board specific Dataflash driver header for the Atmel STK525. * diff --git a/LUFA/Drivers/Board/STK526/Joystick.h b/LUFA/Drivers/Board/STK526/Joystick.h index 7605a8f20f..6d54545e8b 100644 --- a/LUFA/Drivers/Board/STK526/Joystick.h +++ b/LUFA/Drivers/Board/STK526/Joystick.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_Joystick - * @defgroup Group_Joystick_STK526 STK526 + * \defgroup Group_Joystick_STK526 STK526 * * Board specific joystick driver header for the Atmel STK526. * diff --git a/LUFA/Drivers/Board/STK526/LEDs.h b/LUFA/Drivers/Board/STK526/LEDs.h index e4b0fca842..3ec9bd394c 100644 --- a/LUFA/Drivers/Board/STK526/LEDs.h +++ b/LUFA/Drivers/Board/STK526/LEDs.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_LEDs - * @defgroup Group_LEDs_STK526 STK526 + * \defgroup Group_LEDs_STK526 STK526 * * Board specific LED driver header for the Atmel STK526. * diff --git a/LUFA/Drivers/Board/TEENSY/LEDs.h b/LUFA/Drivers/Board/TEENSY/LEDs.h index 93b56ef528..551cdc2c65 100644 --- a/LUFA/Drivers/Board/TEENSY/LEDs.h +++ b/LUFA/Drivers/Board/TEENSY/LEDs.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_LEDs - * @defgroup Group_LEDs_TEENSY TEENSY + * \defgroup Group_LEDs_TEENSY TEENSY * * Board specific LED driver header for the PJRC Teensy boards (http://www.pjrc.com/teensy/index.html). * diff --git a/LUFA/Drivers/Board/Temperature.h b/LUFA/Drivers/Board/Temperature.h index a87327571f..f7a2b6d879 100644 --- a/LUFA/Drivers/Board/Temperature.h +++ b/LUFA/Drivers/Board/Temperature.h @@ -35,7 +35,7 @@ */ /** \ingroup Group_BoardDrivers - * @defgroup Group_Temperature Temperature Sensor Driver - LUFA/Drivers/Board/Temperature.h + * \defgroup Group_Temperature Temperature Sensor Driver - LUFA/Drivers/Board/Temperature.h * * \section Sec_Dependencies Module Source Dependencies * The following files must be built with any user project that uses this module: @@ -67,8 +67,6 @@ #define __TEMPERATURE_H__ /* Includes: */ - #include - #include "../../Common/Common.h" #include "../Peripheral/ADC.h" @@ -77,7 +75,7 @@ #elif ((BOARD != BOARD_USBKEY) && (BOARD != BOARD_STK525) && \ (BOARD != BOARD_STK526) && (BOARD != BOARD_USER) && \ (BOARD != BOARD_EVK527)) - #error The selected board does not contain a temperature sensor. + #error The selected board does not contain a compatible temperature sensor. #endif /* Enable C linkage for C++ Compilers: */ diff --git a/LUFA/Drivers/Board/UDIP/Buttons.h b/LUFA/Drivers/Board/UDIP/Buttons.h index 782235e6ca..6a232bd1b8 100644 --- a/LUFA/Drivers/Board/UDIP/Buttons.h +++ b/LUFA/Drivers/Board/UDIP/Buttons.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_Buttons - * @defgroup Group_Buttons_UDIP UDIP + * \defgroup Group_Buttons_UDIP UDIP * * Board specific Buttons driver header for the Linnix UDIP (http://linnix.com/udip/). * diff --git a/LUFA/Drivers/Board/UDIP/LEDs.h b/LUFA/Drivers/Board/UDIP/LEDs.h index 0001940a6e..6f0e56971d 100644 --- a/LUFA/Drivers/Board/UDIP/LEDs.h +++ b/LUFA/Drivers/Board/UDIP/LEDs.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_LEDs - * @defgroup Group_LEDs_UDIP UDIP + * \defgroup Group_LEDs_UDIP UDIP * * Board specific LED driver header for the Linnix UDIP (http://linnix.com/udip/). * diff --git a/LUFA/Drivers/Board/UNO/LEDs.h b/LUFA/Drivers/Board/UNO/LEDs.h index f21abfc4ba..0b5413d905 100644 --- a/LUFA/Drivers/Board/UNO/LEDs.h +++ b/LUFA/Drivers/Board/UNO/LEDs.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_LEDs - * @defgroup Group_LEDs_UNO UNO + * \defgroup Group_LEDs_UNO UNO * * Board specific LED driver header for the Arduino Uno (http://arduino.cc/en/Main/ArduinoBoardUno). * diff --git a/LUFA/Drivers/Board/USBFOO/Buttons.h b/LUFA/Drivers/Board/USBFOO/Buttons.h index 87fdd7b886..8f79a92e99 100644 --- a/LUFA/Drivers/Board/USBFOO/Buttons.h +++ b/LUFA/Drivers/Board/USBFOO/Buttons.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_Buttons - * @defgroup Group_Buttons_USBFOO USBFOO + * \defgroup Group_Buttons_USBFOO USBFOO * * Board specific Buttons driver header for the Kernel Concepts USBFOO (http://shop.kernelconcepts.de/product_info.php?products_id=102). * diff --git a/LUFA/Drivers/Board/USBFOO/LEDS.h b/LUFA/Drivers/Board/USBFOO/LEDS.h index 585bcef31a..07346e498c 100644 --- a/LUFA/Drivers/Board/USBFOO/LEDS.h +++ b/LUFA/Drivers/Board/USBFOO/LEDS.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_LEDs - * @defgroup Group_LEDs_USBFOO USBFOO + * \defgroup Group_LEDs_USBFOO USBFOO * * Board specific LED driver header for the Kernel Concepts USBFOO (http://shop.kernelconcepts.de/product_info.php?products_id=102). * diff --git a/LUFA/Drivers/Board/USBKEY/AT45DB642D.h b/LUFA/Drivers/Board/USBKEY/AT45DB642D.h index e603654809..f09a7b533f 100644 --- a/LUFA/Drivers/Board/USBKEY/AT45DB642D.h +++ b/LUFA/Drivers/Board/USBKEY/AT45DB642D.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_Dataflash_USBKEY - * @defgroup Group_Dataflash_USBKEY_AT45DB642D AT45DB642D + * \defgroup Group_Dataflash_USBKEY_AT45DB642D AT45DB642D * * Board specific Dataflash commands header for the AT45DB642D as mounted on the Atmel USBKEY. * diff --git a/LUFA/Drivers/Board/USBKEY/Buttons.h b/LUFA/Drivers/Board/USBKEY/Buttons.h index d9dfd6281e..2018cb0c38 100644 --- a/LUFA/Drivers/Board/USBKEY/Buttons.h +++ b/LUFA/Drivers/Board/USBKEY/Buttons.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_Buttons - * @defgroup Group_Buttons_USBKEY USBKEY + * \defgroup Group_Buttons_USBKEY USBKEY * * Board specific Buttons driver header for the Atmel USBKEY. * diff --git a/LUFA/Drivers/Board/USBKEY/Dataflash.h b/LUFA/Drivers/Board/USBKEY/Dataflash.h index 69ac90d8c6..892cfcfe3a 100644 --- a/LUFA/Drivers/Board/USBKEY/Dataflash.h +++ b/LUFA/Drivers/Board/USBKEY/Dataflash.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_Dataflash - * @defgroup Group_Dataflash_USBKEY USBKEY + * \defgroup Group_Dataflash_USBKEY USBKEY * * Board specific Dataflash driver header for the Atmel USBKEY board. * diff --git a/LUFA/Drivers/Board/USBKEY/Joystick.h b/LUFA/Drivers/Board/USBKEY/Joystick.h index 8c47db9650..90cbf7f69f 100644 --- a/LUFA/Drivers/Board/USBKEY/Joystick.h +++ b/LUFA/Drivers/Board/USBKEY/Joystick.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_Joystick - * @defgroup Group_Joystick_USBKEY USBKEY + * \defgroup Group_Joystick_USBKEY USBKEY * * Board specific joystick driver header for the Atmel USBKEY. * diff --git a/LUFA/Drivers/Board/USBKEY/LEDs.h b/LUFA/Drivers/Board/USBKEY/LEDs.h index 588511bf10..31722319ee 100644 --- a/LUFA/Drivers/Board/USBKEY/LEDs.h +++ b/LUFA/Drivers/Board/USBKEY/LEDs.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_LEDs - * @defgroup Group_LEDs_USBKEY USBKEY + * \defgroup Group_LEDs_USBKEY USBKEY * * Board specific LED driver header for the Atmel USBKEY. * diff --git a/LUFA/Drivers/Board/USBTINYMKII/Buttons.h b/LUFA/Drivers/Board/USBTINYMKII/Buttons.h index dc2e9a2568..b5493ab2d2 100644 --- a/LUFA/Drivers/Board/USBTINYMKII/Buttons.h +++ b/LUFA/Drivers/Board/USBTINYMKII/Buttons.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_Buttons - * @defgroup Group_Buttons_USBTINYMKII USBTINYMKII + * \defgroup Group_Buttons_USBTINYMKII USBTINYMKII * * Board specific Buttons driver header for Tom's USBTINY MKII (http://tom-itx.dyndns.org:81/~webpage/). * diff --git a/LUFA/Drivers/Board/USBTINYMKII/LEDs.h b/LUFA/Drivers/Board/USBTINYMKII/LEDs.h index c836bd0ffc..65f1117e29 100644 --- a/LUFA/Drivers/Board/USBTINYMKII/LEDs.h +++ b/LUFA/Drivers/Board/USBTINYMKII/LEDs.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_LEDs - * @defgroup Group_LEDs_USBTINYMKII USBTINYMKII + * \defgroup Group_LEDs_USBTINYMKII USBTINYMKII * * Board specific LED driver header for Tom's USBTINY MKII (http://tom-itx.dyndns.org:81/~webpage/). * diff --git a/LUFA/Drivers/Board/XPLAIN/AT45DB642D.h b/LUFA/Drivers/Board/XPLAIN/AT45DB642D.h index 7aa1157940..0fbb380a2c 100644 --- a/LUFA/Drivers/Board/XPLAIN/AT45DB642D.h +++ b/LUFA/Drivers/Board/XPLAIN/AT45DB642D.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_Dataflash_XPLAIN - * @defgroup Group_Dataflash_XPLAIN_AT45DB642D AT45DB642D + * \defgroup Group_Dataflash_XPLAIN_AT45DB642D AT45DB642D * * Board specific Dataflash commands header for the AT45DB642D as mounted on the Atmel XPLAIN. * diff --git a/LUFA/Drivers/Board/XPLAIN/Dataflash.h b/LUFA/Drivers/Board/XPLAIN/Dataflash.h index 6ea43fd32f..065145280c 100644 --- a/LUFA/Drivers/Board/XPLAIN/Dataflash.h +++ b/LUFA/Drivers/Board/XPLAIN/Dataflash.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_Dataflash - * @defgroup Group_Dataflash_XPLAIN XPLAIN + * \defgroup Group_Dataflash_XPLAIN XPLAIN * * Board specific Dataflash driver header for the Atmel XPLAIN. * diff --git a/LUFA/Drivers/Board/XPLAIN/LEDs.h b/LUFA/Drivers/Board/XPLAIN/LEDs.h index 4be19ef6fd..953c77e1a8 100644 --- a/LUFA/Drivers/Board/XPLAIN/LEDs.h +++ b/LUFA/Drivers/Board/XPLAIN/LEDs.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_LEDs - * @defgroup Group_LEDs_XPLAIN XPLAIN + * \defgroup Group_LEDs_XPLAIN XPLAIN * * Board specific LED driver header for the Atmel XPLAIN. * diff --git a/LUFA/Drivers/Misc/RingBuffer.h b/LUFA/Drivers/Misc/RingBuffer.h index dd34e99ca7..8ca5d2a0a5 100644 --- a/LUFA/Drivers/Misc/RingBuffer.h +++ b/LUFA/Drivers/Misc/RingBuffer.h @@ -41,7 +41,7 @@ */ /** \ingroup Group_MiscDrivers - * @defgroup Group_RingBuff Generic Byte Ring Buffer - LUFA/Drivers/Misc/RingBuffer.h + * \defgroup Group_RingBuff Generic Byte Ring Buffer - LUFA/Drivers/Misc/RingBuffer.h * * \section Sec_Dependencies Module Source Dependencies * The following files must be built with any user project that uses this module: diff --git a/LUFA/Drivers/Misc/TerminalCodes.h b/LUFA/Drivers/Misc/TerminalCodes.h index 6b9d3fbb8f..2ab0058115 100644 --- a/LUFA/Drivers/Misc/TerminalCodes.h +++ b/LUFA/Drivers/Misc/TerminalCodes.h @@ -36,7 +36,7 @@ */ /** \ingroup Group_MiscDrivers - * @defgroup Group_Terminal ANSI Terminal Escape Codes - LUFA/Drivers/Misc/TerminalCodes.h + * \defgroup Group_Terminal ANSI Terminal Escape Codes - LUFA/Drivers/Misc/TerminalCodes.h * * \section Sec_Dependencies Module Source Dependencies * The following files must be built with any user project that uses this module: diff --git a/LUFA/Drivers/Peripheral/ADC.h b/LUFA/Drivers/Peripheral/ADC.h index ec58e52da4..29e32a83cb 100644 --- a/LUFA/Drivers/Peripheral/ADC.h +++ b/LUFA/Drivers/Peripheral/ADC.h @@ -31,22 +31,23 @@ /** \file * \brief Master include file for the ADC peripheral driver. * - * This file is the master dispatch header file for the device-specific ADC driver, for AVRs containing an ADC. + * This file is the master dispatch header file for the device-specific ADC driver, for microcontrollers + * containing an ADC. * * User code should include this file, which will in turn include the correct ADC driver header file for the - * currently selected AVR model. + * currently selected architecture and microcontroller model. */ /** \ingroup Group_PeripheralDrivers - * @defgroup Group_ADC ADC Driver - LUFA/Drivers/Peripheral/ADC.h + * \defgroup Group_ADC ADC Driver - LUFA/Drivers/Peripheral/ADC.h * * \section Sec_Dependencies Module Source Dependencies * The following files must be built with any user project that uses this module: * - None * * \section Sec_ModDescription Module Description - * Hardware ADC driver. This module provides an easy to use driver for the hardware - * ADC present on many AVR models, for the conversion of analogue signals into the + * Hardware ADC driver. This module provides an easy to use driver for the hardware ADC + * present on many microcontrollers, for the conversion of analogue signals into the * digital domain. * * \note The exact API for this driver may vary depending on the target used - see @@ -57,18 +58,18 @@ #define __ADC_H__ /* Macros: */ - #if !defined(__DOXYGEN__) - #define __INCLUDE_FROM_ADC_H - #endif + #if !defined(__DOXYGEN__) + #define __INCLUDE_FROM_ADC_H + #endif + + /* Includes: */ + #include "../../Common/Common.h" /* Includes: */ - #if (defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || \ - defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB647__) || \ - defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__) || \ - defined(__AVR_ATmega32U6__)) - #include "AVRU4U6U7/ADC.h" + #if (ARCH == ARCH_AVR8) + #include "AVR8/ADC.h" #else - #error "ADC is not available for the currently selected AVR model." + #error The ADC peripheral driver is not currently available for your selected architecture. #endif #endif diff --git a/LUFA/Drivers/Peripheral/AVRU4U6U7/ADC.h b/LUFA/Drivers/Peripheral/AVR8/ADC.h similarity index 96% rename from LUFA/Drivers/Peripheral/AVRU4U6U7/ADC.h rename to LUFA/Drivers/Peripheral/AVR8/ADC.h index ddeb53aa3a..99f70d14bb 100644 --- a/LUFA/Drivers/Peripheral/AVRU4U6U7/ADC.h +++ b/LUFA/Drivers/Peripheral/AVR8/ADC.h @@ -29,7 +29,7 @@ */ /** \file - * \brief ADC peripheral driver for the U7, U6 and U4 USB AVRs. + * \brief ADC Peripheral Driver (AVR8) * * On-chip Analogue-to-Digital converter (ADC) driver for supported U4, U6 and U7 model AVRs that contain an ADC * peripheral internally. @@ -39,8 +39,9 @@ */ /** \ingroup Group_ADC - * @defgroup Group_ADC_AVRU4U6U7 Series U4, U6 and U7 Model ADC Driver + * \defgroup Group_ADC_AVR8 ADC Peripheral Driver (AVR8) * + * \section Sec_ModDescription Module Description * On-chip Analogue-to-Digital converter (ADC) driver for supported U4, U6 and U7 model AVRs that contain an ADC * peripheral internally. * @@ -71,15 +72,12 @@ * @{ */ -#ifndef __ADC_AVRU4U6U7_H__ -#define __ADC_AVRU4U6U7_H__ +#ifndef __ADC_AVR8_H__ +#define __ADC_AVR8_H__ /* Includes: */ #include "../../../Common/Common.h" - #include - #include - /* Enable C linkage for C++ Compilers: */ #if defined(__cplusplus) extern "C" { @@ -90,6 +88,13 @@ #error Do not include this file directly. Include LUFA/Drivers/Peripheral/ADC.h instead. #endif + #if !(defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || \ + defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB647__) || \ + defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__) || \ + defined(__AVR_ATmega32U6__)) + #error The ADC peripheral driver is not currently available for your selected microcontroller model. + #endif + /* Private Interface - For use in library only: */ #if !defined(__DOXYGEN__) /* Macros: */ diff --git a/LUFA/Drivers/Peripheral/AVR8/SPI.h b/LUFA/Drivers/Peripheral/AVR8/SPI.h new file mode 100644 index 0000000000..d800fca1a2 --- /dev/null +++ b/LUFA/Drivers/Peripheral/AVR8/SPI.h @@ -0,0 +1,239 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2011. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + 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 + 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 + software without specific, written prior permission. + + The author disclaim all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * \brief SPI Peripheral Driver (AVR8) + * + * On-chip SPI driver for the 8-bit AVR microcontrollers. + * + * \note This file should not be included directly. It is automatically included as needed by the SPI driver + * dispatch header located in LUFA/Drivers/Peripheral/SPI.h. + */ + +/** \ingroup Group_SPI + * \defgroup Group_SPI_AVR8 SPI Peripheral Driver (AVR8) + * + * \section Sec_ModDescription Module Description + * Driver for the hardware SPI port available on most 8-bit AVR microcontroller models. This + * module provides an easy to use driver for the setup and transfer of data over the + * AVR's SPI port. + * + * \note This file should not be included directly. It is automatically included as needed by the SPI driver + * dispatch header located in LUFA/Drivers/Peripheral/SPI.h. + * + * \section Sec_ExampleUsage Example Usage + * The following snippet is an example of how this module may be used within a typical + * application. + * + * \code + * // Initialise the SPI driver before first use + * SPI_Init(SPI_SPEED_FCPU_DIV_2 | SPI_ORDER_MSB_FIRST | SPI_SCK_LEAD_FALLING | + * SPI_SAMPLE_TRAILING | SPI_MODE_MASTER); + * + * // Send several bytes, ignoring the returned data + * SPI_SendByte(0x01); + * SPI_SendByte(0x02); + * SPI_SendByte(0x03); + * + * // Receive several bytes, sending a dummy 0x00 byte each time + * uint8_t Byte1 = SPI_ReceiveByte(); + * uint8_t Byte2 = SPI_ReceiveByte(); + * uint8_t Byte3 = SPI_ReceiveByte(); + * + * // Send a byte, and store the received byte from the same transaction + * uint8_t ResponseByte = SPI_TransferByte(0xDC); + * \endcode + * + * @{ + */ + +#ifndef __SPI_AVR8_H__ +#define __SPI_AVR8_H__ + + /* Includes: */ + #include "../../../Common/Common.h" + + /* Enable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + extern "C" { + #endif + + /* Preprocessor Checks: */ + #if !defined(__INCLUDE_FROM_SPI_H) + #error Do not include this file directly. Include LUFA/Drivers/Peripheral/SPI.h instead. + #endif + + /* Private Interface - For use in library only: */ + #if !defined(__DOXYGEN__) + /* Macros: */ + #define SPI_USE_DOUBLESPEED (1 << SPE) + #endif + + /* Public Interface - May be used in end-application: */ + /* Macros: */ + /** \name SPI Prescaler Configuration Masks */ + //@{ + /** SPI prescaler mask for \c SPI_Init(). Divides the system clock by a factor of 2. */ + #define SPI_SPEED_FCPU_DIV_2 SPI_USE_DOUBLESPEED + + /** SPI prescaler mask for \c SPI_Init(). Divides the system clock by a factor of 4. */ + #define SPI_SPEED_FCPU_DIV_4 0 + + /** SPI prescaler mask for \c SPI_Init(). Divides the system clock by a factor of 8. */ + #define SPI_SPEED_FCPU_DIV_8 (SPI_USE_DOUBLESPEED | (1 << SPR0)) + + /** SPI prescaler mask for \c SPI_Init(). Divides the system clock by a factor of 16. */ + #define SPI_SPEED_FCPU_DIV_16 (1 << SPR0) + + /** SPI prescaler mask for \c SPI_Init(). Divides the system clock by a factor of 32. */ + #define SPI_SPEED_FCPU_DIV_32 (SPI_USE_DOUBLESPEED | (1 << SPR1)) + + /** SPI prescaler mask for \c SPI_Init(). Divides the system clock by a factor of 64. */ + #define SPI_SPEED_FCPU_DIV_64 (SPI_USE_DOUBLESPEED | (1 << SPR1) | (1 << SPR0)) + + /** SPI prescaler mask for \c SPI_Init(). Divides the system clock by a factor of 128. */ + #define SPI_SPEED_FCPU_DIV_128 ((1 << SPR1) | (1 << SPR0)) + //@} + + /** \name SPI SCK Polarity Configuration Masks */ + //@{ + /** SPI clock polarity mask for \c SPI_Init(). Indicates that the SCK should lead on the rising edge. */ + #define SPI_SCK_LEAD_RISING (0 << CPOL) + + /** SPI clock polarity mask for \c SPI_Init(). Indicates that the SCK should lead on the falling edge. */ + #define SPI_SCK_LEAD_FALLING (1 << CPOL) + //@} + + /** \name SPI Sample Edge Configuration Masks */ + //@{ + /** SPI data sample mode mask for \c SPI_Init(). Indicates that the data should sampled on the leading edge. */ + #define SPI_SAMPLE_LEADING (0 << CPHA) + + /** SPI data sample mode mask for \c SPI_Init(). Indicates that the data should be sampled on the trailing edge. */ + #define SPI_SAMPLE_TRAILING (1 << CPHA) + //@} + + /** \name SPI Data Ordering Configuration Masks */ + //@{ + /** SPI data order mask for \c SPI_Init(). Indicates that data should be shifted out MSB first. */ + #define SPI_ORDER_MSB_FIRST (0 << DORD) + + /** SPI data order mask for \c SPI_Init(). Indicates that data should be shifted out MSB first. */ + #define SPI_ORDER_LSB_FIRST (1 << DORD) + //@} + + /** \name SPI Mode Configuration Masks */ + //@{ + /** SPI mode mask for \c SPI_Init(). Indicates that the SPI interface should be initialized into slave mode. */ + #define SPI_MODE_SLAVE (0 << MSTR) + + /** SPI mode mask for \c SPI_Init(). Indicates that the SPI interface should be initialized into master mode. */ + #define SPI_MODE_MASTER (1 << MSTR) + //@} + + /* Inline Functions: */ + /** Initialises the SPI subsystem, ready for transfers. Must be called before calling any other + * SPI routines. + * + * \param[in] SPIOptions SPI Options, a mask consisting of one of each of the \c SPI_SPEED_*, + * \c SPI_SCK_*, \c SPI_SAMPLE_*, \c SPI_ORDER_* and \c SPI_MODE_* masks. + */ + static inline void SPI_Init(const uint8_t SPIOptions) + { + DDRB |= ((1 << 1) | (1 << 2)); + DDRB &= ~((1 << 0) | (1 << 3)); + PORTB |= ((1 << 0) | (1 << 3)); + + SPCR = ((1 << SPE) | SPIOptions); + + if (SPIOptions & SPI_USE_DOUBLESPEED) + SPSR |= (1 << SPI2X); + else + SPSR &= ~(1 << SPI2X); + } + + /** Turns off the SPI driver, disabling and returning used hardware to their default configuration. */ + static inline void SPI_Disable(void) + { + DDRB &= ~((1 << 1) | (1 << 2)); + PORTB &= ~((1 << 0) | (1 << 3)); + + SPCR = 0; + SPSR = 0; + } + + /** Sends and receives a byte through the SPI interface, blocking until the transfer is complete. + * + * \param[in] Byte Byte to send through the SPI interface. + * + * \return Response byte from the attached SPI device. + */ + static inline uint8_t SPI_TransferByte(const uint8_t Byte) ATTR_ALWAYS_INLINE; + static inline uint8_t SPI_TransferByte(const uint8_t Byte) + { + SPDR = Byte; + while (!(SPSR & (1 << SPIF))); + return SPDR; + } + + /** Sends a byte through the SPI interface, blocking until the transfer is complete. The response + * byte sent to from the attached SPI device is ignored. + * + * \param[in] Byte Byte to send through the SPI interface. + */ + static inline void SPI_SendByte(const uint8_t Byte) ATTR_ALWAYS_INLINE; + static inline void SPI_SendByte(const uint8_t Byte) + { + SPDR = Byte; + while (!(SPSR & (1 << SPIF))); + } + + /** Sends a dummy byte through the SPI interface, blocking until the transfer is complete. The response + * byte from the attached SPI device is returned. + * + * \return The response byte from the attached SPI device. + */ + static inline uint8_t SPI_ReceiveByte(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT; + static inline uint8_t SPI_ReceiveByte(void) + { + SPDR = 0x00; + while (!(SPSR & (1 << SPIF))); + return SPDR; + } + + /* Disable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + } + #endif + +#endif + +/** @} */ + diff --git a/LUFA/Drivers/Peripheral/Serial.c b/LUFA/Drivers/Peripheral/AVR8/Serial.c similarity index 98% rename from LUFA/Drivers/Peripheral/Serial.c rename to LUFA/Drivers/Peripheral/AVR8/Serial.c index 99af2000c4..3a8312d853 100644 --- a/LUFA/Drivers/Peripheral/Serial.c +++ b/LUFA/Drivers/Peripheral/AVR8/Serial.c @@ -28,6 +28,7 @@ this software. */ +#define __INCLUDE_FROM_SERIAL_C #include "Serial.h" FILE USARTSerialStream; diff --git a/LUFA/Drivers/Peripheral/AVR8/Serial.h b/LUFA/Drivers/Peripheral/AVR8/Serial.h new file mode 100644 index 0000000000..bb9ba856e8 --- /dev/null +++ b/LUFA/Drivers/Peripheral/AVR8/Serial.h @@ -0,0 +1,251 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2011. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + 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 + 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 + software without specific, written prior permission. + + The author disclaim all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * \brief Serial USART Peripheral Driver (AVR8) + * + * On-chip serial USART driver for the 8-bit AVR microcontrollers. + * + * \note This file should not be included directly. It is automatically included as needed by the USART driver + * dispatch header located in LUFA/Drivers/Peripheral/Serial.h. + */ + +/** \ingroup Group_Serial + * \defgroup Group_Serial_AVR8 Serial USART Peripheral Driver (AVR8) + * + * \section Sec_ModDescription Module Description + * On-chip serial USART driver for the 8-bit AVR microcontrollers. + * + * \note This file should not be included directly. It is automatically included as needed by the ADC driver + * dispatch header located in LUFA/Drivers/Peripheral/Serial.h. + * + * \section Sec_ExampleUsage Example Usage + * The following snippet is an example of how this module may be used within a typical + * application. + * + * \code + * // Initialise the serial USART driver before first use, with 9600 baud (and no double-speed mode) + * Serial_Init(9600, false); + * + * // Send a string through the USART + * Serial_TxString("Test String\r\n"); + * + * // Receive a byte through the USART + * uint8_t DataByte = Serial_RxByte(); + * \endcode + * + * @{ + */ + +#ifndef __SERIAL_AVR8_H__ +#define __SERIAL_AVR8_H__ + + /* Includes: */ + #include "../../../Common/Common.h" + #include "../../Misc/TerminalCodes.h" + + #include + + /* Enable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + extern "C" { + #endif + + /* Preprocessor Checks: */ + #if !defined(__INCLUDE_FROM_SERIAL_H) && !defined(__INCLUDE_FROM_SERIAL_C) + #error Do not include this file directly. Include LUFA/Drivers/Peripheral/Serial.h instead. + #endif + + /* Private Interface - For use in library only: */ + #if !defined(__DOXYGEN__) + /* External Variables: */ + extern FILE USARTSerialStream; + + /* Function Prototypes: */ + int Serial_putchar(char DataByte, + FILE *Stream); + int Serial_getchar(FILE *Stream); + int Serial_getchar_Blocking(FILE *Stream); + #endif + + /* Public Interface - May be used in end-application: */ + /* Macros: */ + /** Macro for calculating the baud value from a given baud rate when the U2X (double speed) bit is + * not set. + */ + #define SERIAL_UBBRVAL(baud) ((((F_CPU / 16) + (baud / 2)) / (baud)) - 1) + + /** Macro for calculating the baud value from a given baud rate when the U2X (double speed) bit is + * set. + */ + #define SERIAL_2X_UBBRVAL(baud) ((((F_CPU / 8) + (baud / 2)) / (baud)) - 1) + + /* Function Prototypes: */ + /** Transmits a given string located in program space (FLASH) through the USART. + * + * \param[in] FlashStringPtr Pointer to a string located in program space. + */ + void Serial_SendString_P(const char* FlashStringPtr) ATTR_NON_NULL_PTR_ARG(1); + + /** Transmits a given string located in SRAM memory through the USART. + * + * \param[in] StringPtr Pointer to a string located in SRAM space. + */ + void Serial_SendString(const char* StringPtr) ATTR_NON_NULL_PTR_ARG(1); + + /** Transmits a given buffer located in SRAM memory through the USART. + * + * \param[in] Buffer Pointer to a buffer containing the data to send. + * \param[in] Length Length of the data to send, in bytes. + */ + void Serial_SendData(const uint8_t* Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1); + + /* Inline Functions: */ + /** Initializes the USART, ready for serial data transmission and reception. This initializes the interface to + * standard 8-bit, no parity, 1 stop bit settings suitable for most applications. + * + * \param[in] BaudRate Serial baud rate, in bits per second. + * \param[in] DoubleSpeed Enables double speed mode when set, halving the sample time to double the baud rate. + */ + static inline void Serial_Init(const uint32_t BaudRate, + const bool DoubleSpeed) + { + UBRR1 = (DoubleSpeed ? SERIAL_2X_UBBRVAL(BaudRate) : SERIAL_UBBRVAL(BaudRate)); + + UCSR1C = ((1 << UCSZ11) | (1 << UCSZ10)); + UCSR1A = (DoubleSpeed ? (1 << U2X1) : 0); + UCSR1B = ((1 << TXEN1) | (1 << RXEN1)); + + DDRD |= (1 << 3); + PORTD |= (1 << 2); + } + + /** Turns off the USART driver, disabling and returning used hardware to their default configuration. */ + static inline void Serial_Disable(void) + { + UCSR1B = 0; + UCSR1A = 0; + UCSR1C = 0; + + UBRR1 = 0; + + DDRD &= ~(1 << 3); + PORTD &= ~(1 << 2); + } + + /** Creates a standard character stream from the USART so that it can be used with all the regular functions + * in the avr-libc \c library that accept a \c FILE stream as a destination (e.g. \c fprintf). The created + * stream is bidirectional and can be used for both input and output functions. + * + * Reading data from this stream is non-blocking, i.e. in most instances, complete strings cannot be read in by a single + * fetch, as the endpoint will not be ready at some point in the transmission, aborting the transfer. However, this may + * be used when the read data is processed byte-per-bye (via \c getc()) or when the user application will implement its own + * line buffering. + * + * \param[in,out] Stream Pointer to a FILE structure where the created stream should be placed, if \c NULL stdio + * and stdin will be configured to use the USART. + * + * \pre The USART must first be configured via a call to \ref Serial_Init() before the stream is used. + */ + static inline void Serial_CreateStream(FILE* Stream) + { + if (!(Stream)) + { + Stream = &USARTSerialStream; + stdin = Stream; + stdout = Stream; + } + + *Stream = (FILE)FDEV_SETUP_STREAM(Serial_putchar, Serial_getchar, _FDEV_SETUP_RW); + } + + /** Identical to \ref Serial_CreateStream(), except that reads are blocking until the calling stream function terminates + * the transfer. + * + * \param[in,out] Stream Pointer to a FILE structure where the created stream should be placed, if \c NULL stdio + * and stdin will be configured to use the USART. + * + * \pre The USART must first be configured via a call to \ref Serial_Init() before the stream is used. + */ + static inline void Serial_CreateBlockingStream(FILE* Stream) + { + if (!(Stream)) + { + Stream = &USARTSerialStream; + stdin = Stream; + stdout = Stream; + } + + *Stream = (FILE)FDEV_SETUP_STREAM(Serial_putchar, Serial_getchar_Blocking, _FDEV_SETUP_RW); + } + + /** Indicates whether a character has been received through the USART. + * + * \return Boolean \c true if a character has been received, \c false otherwise. + */ + static inline bool Serial_IsCharReceived(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; + static inline bool Serial_IsCharReceived(void) + { + return ((UCSR1A & (1 << RXC1)) ? true : false); + } + + /** Transmits a given byte through the USART. + * + * \param[in] DataByte Byte to transmit through the USART. + */ + static inline void Serial_SendByte(const char DataByte) ATTR_ALWAYS_INLINE; + static inline void Serial_SendByte(const char DataByte) + { + while (!(UCSR1A & (1 << UDRE1))); + UDR1 = DataByte; + } + + /** Receives the next byte from the USART. + * + * \return Next byte received from the USART, or a negative value if no byte has been received. + */ + static inline int16_t Serial_ReceiveByte(void) ATTR_ALWAYS_INLINE; + static inline int16_t Serial_ReceiveByte(void) + { + if (!(Serial_IsCharReceived())) + return -1; + + return UDR1; + } + + /* Disable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + } + #endif + +#endif + +/** @} */ + diff --git a/LUFA/Drivers/Peripheral/TWI.c b/LUFA/Drivers/Peripheral/AVR8/TWI.c similarity index 99% rename from LUFA/Drivers/Peripheral/TWI.c rename to LUFA/Drivers/Peripheral/AVR8/TWI.c index 2f4e4ed424..b5f258dd3c 100644 --- a/LUFA/Drivers/Peripheral/TWI.c +++ b/LUFA/Drivers/Peripheral/AVR8/TWI.c @@ -5,6 +5,7 @@ www.lufa-lib.org */ +#define __INCLUDE_FROM_TWI_C #include "TWI.h" uint8_t TWI_StartTransmission(const uint8_t SlaveAddress, diff --git a/LUFA/Drivers/Peripheral/AVRU4U6U7/TWI.h b/LUFA/Drivers/Peripheral/AVR8/TWI.h similarity index 93% rename from LUFA/Drivers/Peripheral/AVRU4U6U7/TWI.h rename to LUFA/Drivers/Peripheral/AVR8/TWI.h index c8293f5ac2..e034233852 100644 --- a/LUFA/Drivers/Peripheral/AVRU4U6U7/TWI.h +++ b/LUFA/Drivers/Peripheral/AVR8/TWI.h @@ -29,18 +29,19 @@ */ /** \file - * \brief TWI peripheral driver for the U7, U6 and U4 USB AVRs. + * \brief TWI Peripheral Driver (AVR8) * - * Master mode TWI driver for the AT90USB1287, AT90USB1286, AT90USB647, AT90USB646, ATMEGA16U4 and ATMEGA32U4 AVRs. + * On-chip TWI driver for the 8-bit AVR microcontrollers. * * \note This file should not be included directly. It is automatically included as needed by the TWI driver * dispatch header located in LUFA/Drivers/Peripheral/TWI.h. */ /** \ingroup Group_TWI - * @defgroup Group_TWI_AVRU4U6U7 Series U4, U6 and U7 Model TWI Driver + * \defgroup Group_TWI_AVR8 TWI Peripheral Driver (AVR8) * - * Master mode TWI driver for the AT90USB1287, AT90USB1286, AT90USB647, AT90USB646, ATMEGA16U4 and ATMEGA32U4 AVRs. + * \section Sec_ModDescription Module Description + * Master mode TWI driver for the 8-bit AVR microcontrollers which contain a hardware TWI module. * * \note This file should not be included directly. It is automatically included as needed by the TWI driver * dispatch header located in LUFA/Drivers/Peripheral/TWI.h. @@ -111,17 +112,14 @@ * @{ */ -#ifndef __TWI_AVRU4U6U7_H__ -#define __TWI_AVRU4U6U7_H__ +#ifndef __TWI_AVR8_H__ +#define __TWI_AVR8_H__ /* Includes: */ #include "../../../Common/Common.h" - #include - #include #include #include - #include /* Enable C linkage for C++ Compilers: */ #if defined(__cplusplus) @@ -129,10 +127,17 @@ #endif /* Preprocessor Checks: */ - #if !defined(__INCLUDE_FROM_TWI_H) + #if !defined(__INCLUDE_FROM_TWI_H) && !defined(__INCLUDE_FROM_TWI_C) #error Do not include this file directly. Include LUFA/Drivers/Peripheral/TWI.h instead. #endif + #if !(defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || \ + defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB647__) || \ + defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__) || \ + defined(__AVR_ATmega32U6__)) + #error The TWI peripheral driver is not currently available for your selected microcontroller model. + #endif + /* Public Interface - May be used in end-application: */ /* Macros: */ /** TWI slave device address mask for a read session. Mask with a slave device base address to obtain diff --git a/LUFA/Drivers/Peripheral/SPI.h b/LUFA/Drivers/Peripheral/SPI.h index 0b8b17e1d7..9b967e0cdd 100644 --- a/LUFA/Drivers/Peripheral/SPI.h +++ b/LUFA/Drivers/Peripheral/SPI.h @@ -31,201 +31,44 @@ /** \file * \brief Master include file for the SPI peripheral driver. * - * Hardware SPI subsystem driver for the supported USB AVRs models. + * This file is the master dispatch header file for the device-specific SPI driver, for microcontrollers + * containing a hardware SPI. + * + * User code should include this file, which will in turn include the correct SPI driver header file for the + * currently selected architecture and microcontroller model. */ /** \ingroup Group_PeripheralDrivers - * @defgroup Group_SPI SPI Driver - LUFA/Drivers/Peripheral/SPI.h + * \defgroup Group_SPI SPI Driver - LUFA/Drivers/Peripheral/SPI.h * * \section Sec_Dependencies Module Source Dependencies * The following files must be built with any user project that uses this module: * - None * * \section Sec_ModDescription Module Description - * Driver for the hardware SPI port available on most AVR models. This module provides - * an easy to use driver for the setup of and transfer of data over the AVR's SPI port. - * - * \section Sec_ExampleUsage Example Usage - * The following snippet is an example of how this module may be used within a typical - * application. - * - * \code - * // Initialise the SPI driver before first use - * SPI_Init(SPI_SPEED_FCPU_DIV_2 | SPI_ORDER_MSB_FIRST | SPI_SCK_LEAD_FALLING | - * SPI_SAMPLE_TRAILING | SPI_MODE_MASTER); - * - * // Send several bytes, ignoring the returned data - * SPI_SendByte(0x01); - * SPI_SendByte(0x02); - * SPI_SendByte(0x03); + * Hardware SPI driver. This module provides an easy to use driver for the setup and transfer of data over + * the selected architecture and microcontroller model's SPI port. * - * // Receive several bytes, sending a dummy 0x00 byte each time - * uint8_t Byte1 = SPI_ReceiveByte(); - * uint8_t Byte2 = SPI_ReceiveByte(); - * uint8_t Byte3 = SPI_ReceiveByte(); - * - * // Send a byte, and store the received byte from the same transaction - * uint8_t ResponseByte = SPI_TransferByte(0xDC); - * \endcode - * - * @{ + * \note The exact API for this driver may vary depending on the target used - see + * individual target module documentation for the API specific to your target processor. */ #ifndef __SPI_H__ #define __SPI_H__ - /* Includes: */ - #include - - /* Enable C linkage for C++ Compilers: */ - #if defined(__cplusplus) - extern "C" { + /* Macros: */ + #if !defined(__DOXYGEN__) + #define __INCLUDE_FROM_SPI_H #endif - /* Private Interface - For use in library only: */ - #if !defined(__DOXYGEN__) - /* Macros: */ - #define SPI_USE_DOUBLESPEED (1 << SPE) - #endif - - /* Public Interface - May be used in end-application: */ - /* Macros: */ - /** \name SPI Prescaler Configuration Masks */ - //@{ - /** SPI prescaler mask for \c SPI_Init(). Divides the system clock by a factor of 2. */ - #define SPI_SPEED_FCPU_DIV_2 SPI_USE_DOUBLESPEED - - /** SPI prescaler mask for \c SPI_Init(). Divides the system clock by a factor of 4. */ - #define SPI_SPEED_FCPU_DIV_4 0 - - /** SPI prescaler mask for \c SPI_Init(). Divides the system clock by a factor of 8. */ - #define SPI_SPEED_FCPU_DIV_8 (SPI_USE_DOUBLESPEED | (1 << SPR0)) - - /** SPI prescaler mask for \c SPI_Init(). Divides the system clock by a factor of 16. */ - #define SPI_SPEED_FCPU_DIV_16 (1 << SPR0) - - /** SPI prescaler mask for \c SPI_Init(). Divides the system clock by a factor of 32. */ - #define SPI_SPEED_FCPU_DIV_32 (SPI_USE_DOUBLESPEED | (1 << SPR1)) - - /** SPI prescaler mask for \c SPI_Init(). Divides the system clock by a factor of 64. */ - #define SPI_SPEED_FCPU_DIV_64 (SPI_USE_DOUBLESPEED | (1 << SPR1) | (1 << SPR0)) - - /** SPI prescaler mask for \c SPI_Init(). Divides the system clock by a factor of 128. */ - #define SPI_SPEED_FCPU_DIV_128 ((1 << SPR1) | (1 << SPR0)) - //@} - - /** \name SPI SCK Polarity Configuration Masks */ - //@{ - /** SPI clock polarity mask for \c SPI_Init(). Indicates that the SCK should lead on the rising edge. */ - #define SPI_SCK_LEAD_RISING (0 << CPOL) - - /** SPI clock polarity mask for \c SPI_Init(). Indicates that the SCK should lead on the falling edge. */ - #define SPI_SCK_LEAD_FALLING (1 << CPOL) - //@} - - /** \name SPI Sample Edge Configuration Masks */ - //@{ - /** SPI data sample mode mask for \c SPI_Init(). Indicates that the data should sampled on the leading edge. */ - #define SPI_SAMPLE_LEADING (0 << CPHA) - - /** SPI data sample mode mask for \c SPI_Init(). Indicates that the data should be sampled on the trailing edge. */ - #define SPI_SAMPLE_TRAILING (1 << CPHA) - //@} - - /** \name SPI Data Ordering Configuration Masks */ - //@{ - /** SPI data order mask for \c SPI_Init(). Indicates that data should be shifted out MSB first. */ - #define SPI_ORDER_MSB_FIRST (0 << DORD) - - /** SPI data order mask for \c SPI_Init(). Indicates that data should be shifted out MSB first. */ - #define SPI_ORDER_LSB_FIRST (1 << DORD) - //@} - - /** \name SPI Mode Configuration Masks */ - //@{ - /** SPI mode mask for \c SPI_Init(). Indicates that the SPI interface should be initialized into slave mode. */ - #define SPI_MODE_SLAVE (0 << MSTR) - - /** SPI mode mask for \c SPI_Init(). Indicates that the SPI interface should be initialized into master mode. */ - #define SPI_MODE_MASTER (1 << MSTR) - //@} - - /* Inline Functions: */ - /** Initialises the SPI subsystem, ready for transfers. Must be called before calling any other - * SPI routines. - * - * \param[in] SPIOptions SPI Options, a mask consisting of one of each of the \c SPI_SPEED_*, - * \c SPI_SCK_*, \c SPI_SAMPLE_*, \c SPI_ORDER_* and \c SPI_MODE_* masks. - */ - static inline void SPI_Init(const uint8_t SPIOptions) - { - DDRB |= ((1 << 1) | (1 << 2)); - DDRB &= ~((1 << 0) | (1 << 3)); - PORTB |= ((1 << 0) | (1 << 3)); - - SPCR = ((1 << SPE) | SPIOptions); - - if (SPIOptions & SPI_USE_DOUBLESPEED) - SPSR |= (1 << SPI2X); - else - SPSR &= ~(1 << SPI2X); - } - - /** Turns off the SPI driver, disabling and returning used hardware to their default configuration. */ - static inline void SPI_Disable(void) - { - DDRB &= ~((1 << 1) | (1 << 2)); - PORTB &= ~((1 << 0) | (1 << 3)); - - SPCR = 0; - SPSR = 0; - } - - /** Sends and receives a byte through the SPI interface, blocking until the transfer is complete. - * - * \param[in] Byte Byte to send through the SPI interface. - * - * \return Response byte from the attached SPI device. - */ - static inline uint8_t SPI_TransferByte(const uint8_t Byte) ATTR_ALWAYS_INLINE; - static inline uint8_t SPI_TransferByte(const uint8_t Byte) - { - SPDR = Byte; - while (!(SPSR & (1 << SPIF))); - return SPDR; - } - - /** Sends a byte through the SPI interface, blocking until the transfer is complete. The response - * byte sent to from the attached SPI device is ignored. - * - * \param[in] Byte Byte to send through the SPI interface. - */ - static inline void SPI_SendByte(const uint8_t Byte) ATTR_ALWAYS_INLINE; - static inline void SPI_SendByte(const uint8_t Byte) - { - SPDR = Byte; - while (!(SPSR & (1 << SPIF))); - } - - /** Sends a dummy byte through the SPI interface, blocking until the transfer is complete. The response - * byte from the attached SPI device is returned. - * - * \return The response byte from the attached SPI device. - */ - static inline uint8_t SPI_ReceiveByte(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT; - static inline uint8_t SPI_ReceiveByte(void) - { - SPDR = 0x00; - while (!(SPSR & (1 << SPIF))); - return SPDR; - } + /* Includes: */ + #include "../../Common/Common.h" - /* Disable C linkage for C++ Compilers: */ - #if defined(__cplusplus) - } + /* Includes: */ + #if (ARCH == ARCH_AVR8) + #include "AVR8/SPI.h" + #else + #error The SPI peripheral driver is not currently available for your selected architecture. #endif #endif - -/** @} */ - diff --git a/LUFA/Drivers/Peripheral/Serial.h b/LUFA/Drivers/Peripheral/Serial.h index e7c2fa065f..0c6cd86bf3 100644 --- a/LUFA/Drivers/Peripheral/Serial.h +++ b/LUFA/Drivers/Peripheral/Serial.h @@ -31,218 +31,44 @@ /** \file * \brief Master include file for the USART peripheral driver. * - * Driver for the USART subsystem on supported USB AVRs. + * This file is the master dispatch header file for the device-specific USART driver, for microcontrollers + * containing a hardware USART. + * + * User code should include this file, which will in turn include the correct ADC driver header file for the + * currently selected architecture and microcontroller model. */ /** \ingroup Group_PeripheralDrivers - * @defgroup Group_Serial Serial USART Driver - LUFA/Drivers/Peripheral/Serial.h + * \defgroup Group_Serial Serial USART Driver - LUFA/Drivers/Peripheral/Serial.h * * \section Sec_Dependencies Module Source Dependencies * The following files must be built with any user project that uses this module: - * - LUFA/Drivers/Peripheral/Serial.c (Makefile source module name: LUFA_SRC_SERIAL) + * - LUFA/Drivers/Peripheral/$(ARCH)/Serial.c (Makefile source module name: LUFA_SRC_SERIAL) * * \section Sec_ModDescription Module Description - * Hardware serial USART driver. This module provides an easy to use driver for - * the setup of and transfer of data over the AVR's USART port. - * - * \section Sec_ExampleUsage Example Usage - * The following snippet is an example of how this module may be used within a typical - * application. - * - * \code - * // Initialise the serial USART driver before first use, with 9600 baud (and no double-speed mode) - * Serial_Init(9600, false); - * - * // Send a string through the USART - * Serial_TxString("Test String\r\n"); + * Hardware serial USART driver. This module provides an easy to use driver for the setup and transfer + * of data over the selected architecture and microcontroller model's USART port. * - * // Receive a byte through the USART - * uint8_t DataByte = Serial_RxByte(); - * \endcode - * - * @{ + * \note The exact API for this driver may vary depending on the target used - see + * individual target module documentation for the API specific to your target processor. */ #ifndef __SERIAL_H__ #define __SERIAL_H__ - /* Includes: */ - #include - #include - #include - #include - - #include "../../Common/Common.h" - #include "../Misc/TerminalCodes.h" - - /* Enable C linkage for C++ Compilers: */ - #if defined(__cplusplus) - extern "C" { + /* Macros: */ + #if !defined(__DOXYGEN__) + #define __INCLUDE_FROM_SERIAL_H #endif - /* Private Interface - For use in library only: */ - #if !defined(__DOXYGEN__) - /* External Variables: */ - extern FILE USARTSerialStream; - - /* Function Prototypes: */ - int Serial_putchar(char DataByte, - FILE *Stream); - int Serial_getchar(FILE *Stream); - int Serial_getchar_Blocking(FILE *Stream); - #endif - - /* Public Interface - May be used in end-application: */ - /* Macros: */ - /** Macro for calculating the baud value from a given baud rate when the U2X (double speed) bit is - * not set. - */ - #define SERIAL_UBBRVAL(baud) ((((F_CPU / 16) + (baud / 2)) / (baud)) - 1) - - /** Macro for calculating the baud value from a given baud rate when the U2X (double speed) bit is - * set. - */ - #define SERIAL_2X_UBBRVAL(baud) ((((F_CPU / 8) + (baud / 2)) / (baud)) - 1) - - /* Function Prototypes: */ - /** Transmits a given string located in program space (FLASH) through the USART. - * - * \param[in] FlashStringPtr Pointer to a string located in program space. - */ - void Serial_SendString_P(const char* FlashStringPtr) ATTR_NON_NULL_PTR_ARG(1); - - /** Transmits a given string located in SRAM memory through the USART. - * - * \param[in] StringPtr Pointer to a string located in SRAM space. - */ - void Serial_SendString(const char* StringPtr) ATTR_NON_NULL_PTR_ARG(1); - - /** Transmits a given buffer located in SRAM memory through the USART. - * - * \param[in] Buffer Pointer to a buffer containing the data to send. - * \param[in] Length Length of the data to send, in bytes. - */ - void Serial_SendData(const uint8_t* Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1); - - /* Inline Functions: */ - /** Initializes the USART, ready for serial data transmission and reception. This initializes the interface to - * standard 8-bit, no parity, 1 stop bit settings suitable for most applications. - * - * \param[in] BaudRate Serial baud rate, in bits per second. - * \param[in] DoubleSpeed Enables double speed mode when set, halving the sample time to double the baud rate. - */ - static inline void Serial_Init(const uint32_t BaudRate, - const bool DoubleSpeed) - { - UBRR1 = (DoubleSpeed ? SERIAL_2X_UBBRVAL(BaudRate) : SERIAL_UBBRVAL(BaudRate)); - - UCSR1C = ((1 << UCSZ11) | (1 << UCSZ10)); - UCSR1A = (DoubleSpeed ? (1 << U2X1) : 0); - UCSR1B = ((1 << TXEN1) | (1 << RXEN1)); - - DDRD |= (1 << 3); - PORTD |= (1 << 2); - } - - /** Turns off the USART driver, disabling and returning used hardware to their default configuration. */ - static inline void Serial_Disable(void) - { - UCSR1B = 0; - UCSR1A = 0; - UCSR1C = 0; - - UBRR1 = 0; - - DDRD &= ~(1 << 3); - PORTD &= ~(1 << 2); - } - - /** Creates a standard character stream from the USART so that it can be used with all the regular functions - * in the avr-libc \c library that accept a \c FILE stream as a destination (e.g. \c fprintf). The created - * stream is bidirectional and can be used for both input and output functions. - * - * Reading data from this stream is non-blocking, i.e. in most instances, complete strings cannot be read in by a single - * fetch, as the endpoint will not be ready at some point in the transmission, aborting the transfer. However, this may - * be used when the read data is processed byte-per-bye (via \c getc()) or when the user application will implement its own - * line buffering. - * - * \param[in,out] Stream Pointer to a FILE structure where the created stream should be placed, if \c NULL stdio - * and stdin will be configured to use the USART. - * - * \pre The USART must first be configured via a call to \ref Serial_Init() before the stream is used. - */ - static inline void Serial_CreateStream(FILE* Stream) - { - if (!(Stream)) - { - Stream = &USARTSerialStream; - stdin = Stream; - stdout = Stream; - } - - *Stream = (FILE)FDEV_SETUP_STREAM(Serial_putchar, Serial_getchar, _FDEV_SETUP_RW); - } - - /** Identical to \ref Serial_CreateStream(), except that reads are blocking until the calling stream function terminates - * the transfer. - * - * \param[in,out] Stream Pointer to a FILE structure where the created stream should be placed, if \c NULL stdio - * and stdin will be configured to use the USART. - * - * \pre The USART must first be configured via a call to \ref Serial_Init() before the stream is used. - */ - static inline void Serial_CreateBlockingStream(FILE* Stream) - { - if (!(Stream)) - { - Stream = &USARTSerialStream; - stdin = Stream; - stdout = Stream; - } - - *Stream = (FILE)FDEV_SETUP_STREAM(Serial_putchar, Serial_getchar_Blocking, _FDEV_SETUP_RW); - } - - /** Indicates whether a character has been received through the USART. - * - * \return Boolean \c true if a character has been received, \c false otherwise. - */ - static inline bool Serial_IsCharReceived(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; - static inline bool Serial_IsCharReceived(void) - { - return ((UCSR1A & (1 << RXC1)) ? true : false); - } - - /** Transmits a given byte through the USART. - * - * \param[in] DataByte Byte to transmit through the USART. - */ - static inline void Serial_SendByte(const char DataByte) ATTR_ALWAYS_INLINE; - static inline void Serial_SendByte(const char DataByte) - { - while (!(UCSR1A & (1 << UDRE1))); - UDR1 = DataByte; - } - - /** Receives the next byte from the USART. - * - * \return Next byte received from the USART, or a negative value if no byte has been received. - */ - static inline int16_t Serial_ReceiveByte(void) ATTR_ALWAYS_INLINE; - static inline int16_t Serial_ReceiveByte(void) - { - if (!(Serial_IsCharReceived())) - return -1; - - return UDR1; - } + /* Includes: */ + #include "../../Common/Common.h" - /* Disable C linkage for C++ Compilers: */ - #if defined(__cplusplus) - } + /* Includes: */ + #if (ARCH == ARCH_AVR8) + #include "AVR8/Serial.h" + #else + #error The Serial peripheral driver is not currently available for your selected architecture. #endif #endif - -/** @} */ - diff --git a/LUFA/Drivers/Peripheral/TWI.h b/LUFA/Drivers/Peripheral/TWI.h index 6e68bde0e4..e7eb850e35 100644 --- a/LUFA/Drivers/Peripheral/TWI.h +++ b/LUFA/Drivers/Peripheral/TWI.h @@ -31,23 +31,23 @@ /** \file * \brief Master include file for the TWI peripheral driver. * - * This file is the master dispatch header file for the device-specific ADC driver, for AVRs containing an ADC. + * This file is the master dispatch header file for the device-specific SPI driver, for microcontrollers + * containing a hardware TWI. * - * User code should include this file, which will in turn include the correct ADC driver header file for the - * currently selected AVR model. + * User code should include this file, which will in turn include the correct TWI driver header file for the + * currently selected architecture and microcontroller model. */ /** \ingroup Group_PeripheralDrivers - * @defgroup Group_TWI TWI Driver - LUFA/Drivers/Peripheral/TWI.h + * \defgroup Group_TWI TWI Driver - LUFA/Drivers/Peripheral/TWI.h * * \section Sec_Dependencies Module Source Dependencies * The following files must be built with any user project that uses this module: - * - LUFA/Drivers/Peripheral/TWI.c (Makefile source module name: LUFA_SRC_TWI) - * + * - LUFA/Drivers/Peripheral/$(ARCH)TWI.c (Makefile source module name: LUFA_SRC_TWI) * * \section Sec_ModDescription Module Description - * Master Mode Hardware TWI driver. This module provides an easy to use driver for the hardware - * TWI present on many AVR models, for the transmission and reception of data on a TWI bus. + * Hardware TWI driver. This module provides an easy to use driver for the setup and transfer of data over + * the selected architecture and microcontroller model's TWI bus port. * * \note The exact API for this driver may vary depending on the target used - see * individual target module documentation for the API specific to your target processor. @@ -57,18 +57,18 @@ #define __TWI_H__ /* Macros: */ - #if !defined(__DOXYGEN__) - #define __INCLUDE_FROM_TWI_H - #endif + #if !defined(__DOXYGEN__) + #define __INCLUDE_FROM_TWI_H + #endif + + /* Includes: */ + #include "../../Common/Common.h" /* Includes: */ - #if (defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || \ - defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB647__) || \ - defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__) || \ - defined(__AVR_ATmega32U6__)) - #include "AVRU4U6U7/TWI.h" + #if (ARCH == ARCH_AVR8) + #include "AVR8/TWI.h" #else - #error "TWI is not available for the currently selected AVR model." + #error The TWI peripheral driver is not currently available for your selected architecture. #endif #endif diff --git a/LUFA/Drivers/USB/Class/Audio.h b/LUFA/Drivers/USB/Class/Audio.h index 8fc70fe5bf..9a13eb128a 100644 --- a/LUFA/Drivers/USB/Class/Audio.h +++ b/LUFA/Drivers/USB/Class/Audio.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_USBClassDrivers - * @defgroup Group_USBClassAudio Audio Class Driver + * \defgroup Group_USBClassAudio Audio Class Driver * * \section Sec_Dependencies Module Source Dependencies * The following files must be built with any user project that uses this module: diff --git a/LUFA/Drivers/USB/Class/CDC.h b/LUFA/Drivers/USB/Class/CDC.h index 7b302fa2c1..a5dc373701 100644 --- a/LUFA/Drivers/USB/Class/CDC.h +++ b/LUFA/Drivers/USB/Class/CDC.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_USBClassDrivers - * @defgroup Group_USBClassCDC CDC-ACM (Virtual Serial) Class Driver + * \defgroup Group_USBClassCDC CDC-ACM (Virtual Serial) Class Driver * * \section Sec_Dependencies Module Source Dependencies * The following files must be built with any user project that uses this module: diff --git a/LUFA/Drivers/USB/Class/Common/Audio.h b/LUFA/Drivers/USB/Class/Common/Audio.h index 70a8016c13..8ddb52da00 100644 --- a/LUFA/Drivers/USB/Class/Common/Audio.h +++ b/LUFA/Drivers/USB/Class/Common/Audio.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_USBClassAudio - * @defgroup Group_USBClassAudioCommon Common Class Definitions + * \defgroup Group_USBClassAudioCommon Common Class Definitions * * \section Sec_ModDescription Module Description * Constants, Types and Enum definitions that are common to both Device and Host modes for the USB diff --git a/LUFA/Drivers/USB/Class/Common/CDC.h b/LUFA/Drivers/USB/Class/Common/CDC.h index 52107d6a8a..c63c0b537c 100644 --- a/LUFA/Drivers/USB/Class/Common/CDC.h +++ b/LUFA/Drivers/USB/Class/Common/CDC.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_USBClassCDC - * @defgroup Group_USBClassCDCCommon Common Class Definitions + * \defgroup Group_USBClassCDCCommon Common Class Definitions * * \section Sec_ModDescription Module Description * Constants, Types and Enum definitions that are common to both Device and Host modes for the USB diff --git a/LUFA/Drivers/USB/Class/Common/HID.h b/LUFA/Drivers/USB/Class/Common/HID.h index 485b9dbb08..fd35905e61 100644 --- a/LUFA/Drivers/USB/Class/Common/HID.h +++ b/LUFA/Drivers/USB/Class/Common/HID.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_USBClassHID - * @defgroup Group_USBClassHIDCommon Common Class Definitions + * \defgroup Group_USBClassHIDCommon Common Class Definitions * * \section Sec_ModDescription Module Description * Constants, Types and Enum definitions that are common to both Device and Host modes for the USB diff --git a/LUFA/Drivers/USB/Class/Common/HIDParser.h b/LUFA/Drivers/USB/Class/Common/HIDParser.h index c1689fad83..cd32093cab 100644 --- a/LUFA/Drivers/USB/Class/Common/HIDParser.h +++ b/LUFA/Drivers/USB/Class/Common/HIDParser.h @@ -37,7 +37,7 @@ */ /** \ingroup Group_USB - * @defgroup Group_HIDParser HID Report Parser + * \defgroup Group_HIDParser HID Report Parser * * \section Sec_Dependencies Module Source Dependencies * The following files must be built with any user project that uses this module: diff --git a/LUFA/Drivers/USB/Class/Common/HIDReportData.h b/LUFA/Drivers/USB/Class/Common/HIDReportData.h index d9de5df627..952f393323 100644 --- a/LUFA/Drivers/USB/Class/Common/HIDReportData.h +++ b/LUFA/Drivers/USB/Class/Common/HIDReportData.h @@ -36,7 +36,7 @@ */ /** \ingroup Group_HIDParser - * @defgroup Group_HIDReportItemConst HID Report Descriptor Item Constants + * \defgroup Group_HIDReportItemConst HID Report Descriptor Item Constants * * General HID constant definitions for HID Report Descriptor elements. * diff --git a/LUFA/Drivers/USB/Class/Common/MIDI.h b/LUFA/Drivers/USB/Class/Common/MIDI.h index 3aea6376e0..8d56f1eba0 100644 --- a/LUFA/Drivers/USB/Class/Common/MIDI.h +++ b/LUFA/Drivers/USB/Class/Common/MIDI.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_USBClassMIDI - * @defgroup Group_USBClassMIDICommon Common Class Definitions + * \defgroup Group_USBClassMIDICommon Common Class Definitions * * \section Sec_ModDescription Module Description * Constants, Types and Enum definitions that are common to both Device and Host modes for the USB diff --git a/LUFA/Drivers/USB/Class/Common/MassStorage.h b/LUFA/Drivers/USB/Class/Common/MassStorage.h index 761141b63d..f4274cab8a 100644 --- a/LUFA/Drivers/USB/Class/Common/MassStorage.h +++ b/LUFA/Drivers/USB/Class/Common/MassStorage.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_USBClassMS - * @defgroup Group_USBClassMSCommon Common Class Definitions + * \defgroup Group_USBClassMSCommon Common Class Definitions * * \section Sec_ModDescription Module Description * Constants, Types and Enum definitions that are common to both Device and Host modes for the USB diff --git a/LUFA/Drivers/USB/Class/Common/Printer.h b/LUFA/Drivers/USB/Class/Common/Printer.h index 7fbdf8534b..23bc6a461d 100644 --- a/LUFA/Drivers/USB/Class/Common/Printer.h +++ b/LUFA/Drivers/USB/Class/Common/Printer.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_USBClassPrinter - * @defgroup Group_USBClassPrinterCommon Common Class Definitions + * \defgroup Group_USBClassPrinterCommon Common Class Definitions * * \section Sec_ModDescription Module Description * Constants, Types and Enum definitions that are common to both Device and Host modes for the USB diff --git a/LUFA/Drivers/USB/Class/Common/RNDIS.h b/LUFA/Drivers/USB/Class/Common/RNDIS.h index edcf9e7bfb..6b67b97d19 100644 --- a/LUFA/Drivers/USB/Class/Common/RNDIS.h +++ b/LUFA/Drivers/USB/Class/Common/RNDIS.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_USBClassRNDIS - * @defgroup Group_USBClassRNDISCommon Common Class Definitions + * \defgroup Group_USBClassRNDISCommon Common Class Definitions * * \section Sec_ModDescription Module Description * Constants, Types and Enum definitions that are common to both Device and Host modes for the USB diff --git a/LUFA/Drivers/USB/Class/Common/StillImage.h b/LUFA/Drivers/USB/Class/Common/StillImage.h index 132e2aa938..06299bf77b 100644 --- a/LUFA/Drivers/USB/Class/Common/StillImage.h +++ b/LUFA/Drivers/USB/Class/Common/StillImage.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_USBClassSI - * @defgroup Group_USBClassSICommon Common Class Definitions + * \defgroup Group_USBClassSICommon Common Class Definitions * * \section Sec_ModDescription Module Description * Constants, Types and Enum definitions that are common to both Device and Host modes for the USB diff --git a/LUFA/Drivers/USB/Class/Device/Audio.h b/LUFA/Drivers/USB/Class/Device/Audio.h index c674b6d94d..d82beabc69 100644 --- a/LUFA/Drivers/USB/Class/Device/Audio.h +++ b/LUFA/Drivers/USB/Class/Device/Audio.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_USBClassAudio - * @defgroup Group_USBClassAudioDevice Audio Class Device Mode Driver + * \defgroup Group_USBClassAudioDevice Audio Class Device Mode Driver * * \section Sec_Dependencies Module Source Dependencies * The following files must be built with any user project that uses this module: diff --git a/LUFA/Drivers/USB/Class/Device/CDC.h b/LUFA/Drivers/USB/Class/Device/CDC.h index 4a7dc6725f..bf388819f6 100644 --- a/LUFA/Drivers/USB/Class/Device/CDC.h +++ b/LUFA/Drivers/USB/Class/Device/CDC.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_USBClassCDC - * @defgroup Group_USBClassCDCDevice CDC Class Device Mode Driver + * \defgroup Group_USBClassCDCDevice CDC Class Device Mode Driver * * \section Sec_Dependencies Module Source Dependencies * The following files must be built with any user project that uses this module: diff --git a/LUFA/Drivers/USB/Class/Device/HID.h b/LUFA/Drivers/USB/Class/Device/HID.h index 631b191b59..545baddf3b 100644 --- a/LUFA/Drivers/USB/Class/Device/HID.h +++ b/LUFA/Drivers/USB/Class/Device/HID.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_USBClassHID - * @defgroup Group_USBClassHIDDevice HID Class Device Mode Driver + * \defgroup Group_USBClassHIDDevice HID Class Device Mode Driver * * \section Sec_Dependencies Module Source Dependencies * The following files must be built with any user project that uses this module: diff --git a/LUFA/Drivers/USB/Class/Device/MIDI.h b/LUFA/Drivers/USB/Class/Device/MIDI.h index 3ea45d1275..4016d8a9a3 100644 --- a/LUFA/Drivers/USB/Class/Device/MIDI.h +++ b/LUFA/Drivers/USB/Class/Device/MIDI.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_USBClassMIDI - * @defgroup Group_USBClassMIDIDevice MIDI Class Device Mode Driver + * \defgroup Group_USBClassMIDIDevice MIDI Class Device Mode Driver * * \section Sec_Dependencies Module Source Dependencies * The following files must be built with any user project that uses this module: diff --git a/LUFA/Drivers/USB/Class/Device/MassStorage.h b/LUFA/Drivers/USB/Class/Device/MassStorage.h index 6ca0a76330..aceeb6261c 100644 --- a/LUFA/Drivers/USB/Class/Device/MassStorage.h +++ b/LUFA/Drivers/USB/Class/Device/MassStorage.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_USBClassMS - * @defgroup Group_USBClassMSDevice Mass Storage Class Device Mode Driver + * \defgroup Group_USBClassMSDevice Mass Storage Class Device Mode Driver * * \section Sec_Dependencies Module Source Dependencies * The following files must be built with any user project that uses this module: diff --git a/LUFA/Drivers/USB/Class/Device/RNDIS.h b/LUFA/Drivers/USB/Class/Device/RNDIS.h index 40d15ef237..cdc6fbad0a 100644 --- a/LUFA/Drivers/USB/Class/Device/RNDIS.h +++ b/LUFA/Drivers/USB/Class/Device/RNDIS.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_USBClassRNDIS - * @defgroup Group_USBClassRNDISDevice RNDIS Class Device Mode Driver + * \defgroup Group_USBClassRNDISDevice RNDIS Class Device Mode Driver * * \section Sec_Dependencies Module Source Dependencies * The following files must be built with any user project that uses this module: diff --git a/LUFA/Drivers/USB/Class/HID.h b/LUFA/Drivers/USB/Class/HID.h index 39cef953b8..4eafa752a2 100644 --- a/LUFA/Drivers/USB/Class/HID.h +++ b/LUFA/Drivers/USB/Class/HID.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_USBClassDrivers - * @defgroup Group_USBClassHID HID Class Driver + * \defgroup Group_USBClassHID HID Class Driver * * \section Sec_Dependencies Module Source Dependencies * The following files must be built with any user project that uses this module: diff --git a/LUFA/Drivers/USB/Class/Host/CDC.h b/LUFA/Drivers/USB/Class/Host/CDC.h index 5f59e0c3a3..bba94fe81c 100644 --- a/LUFA/Drivers/USB/Class/Host/CDC.h +++ b/LUFA/Drivers/USB/Class/Host/CDC.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_USBClassCDC - * @defgroup Group_USBClassCDCHost CDC Class Host Mode Driver + * \defgroup Group_USBClassCDCHost CDC Class Host Mode Driver * * \section Sec_Dependencies Module Source Dependencies * The following files must be built with any user project that uses this module: diff --git a/LUFA/Drivers/USB/Class/Host/HID.h b/LUFA/Drivers/USB/Class/Host/HID.h index 9057845f77..bd67f8f186 100644 --- a/LUFA/Drivers/USB/Class/Host/HID.h +++ b/LUFA/Drivers/USB/Class/Host/HID.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_USBClassHID - * @defgroup Group_USBClassHIDHost HID Class Host Mode Driver + * \defgroup Group_USBClassHIDHost HID Class Host Mode Driver * * \section Sec_Dependencies Module Source Dependencies * The following files must be built with any user project that uses this module: diff --git a/LUFA/Drivers/USB/Class/Host/MIDI.h b/LUFA/Drivers/USB/Class/Host/MIDI.h index 13a1e77ce4..fc31d401d8 100644 --- a/LUFA/Drivers/USB/Class/Host/MIDI.h +++ b/LUFA/Drivers/USB/Class/Host/MIDI.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_USBClassMIDI - * @defgroup Group_USBClassMIDIHost MIDI Class Host Mode Driver + * \defgroup Group_USBClassMIDIHost MIDI Class Host Mode Driver * * \section Sec_Dependencies Module Source Dependencies * The following files must be built with any user project that uses this module: diff --git a/LUFA/Drivers/USB/Class/Host/MassStorage.h b/LUFA/Drivers/USB/Class/Host/MassStorage.h index 93034c3bc1..cd2ea45315 100644 --- a/LUFA/Drivers/USB/Class/Host/MassStorage.h +++ b/LUFA/Drivers/USB/Class/Host/MassStorage.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_USBClassMS - * @defgroup Group_USBClassMassStorageHost Mass Storage Class Host Mode Driver + * \defgroup Group_USBClassMassStorageHost Mass Storage Class Host Mode Driver * * \section Sec_Dependencies Module Source Dependencies * The following files must be built with any user project that uses this module: diff --git a/LUFA/Drivers/USB/Class/Host/Printer.h b/LUFA/Drivers/USB/Class/Host/Printer.h index 91c13195b5..096cc592c8 100644 --- a/LUFA/Drivers/USB/Class/Host/Printer.h +++ b/LUFA/Drivers/USB/Class/Host/Printer.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_USBClassPrinter - * @defgroup Group_USBClassPrinterHost Printer Class Host Mode Driver + * \defgroup Group_USBClassPrinterHost Printer Class Host Mode Driver * * \section Sec_Dependencies Module Source Dependencies * The following files must be built with any user project that uses this module: diff --git a/LUFA/Drivers/USB/Class/Host/RNDIS.h b/LUFA/Drivers/USB/Class/Host/RNDIS.h index 71ae317e9a..68aa347ec1 100644 --- a/LUFA/Drivers/USB/Class/Host/RNDIS.h +++ b/LUFA/Drivers/USB/Class/Host/RNDIS.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_USBClassRNDIS - * @defgroup Group_USBClassRNDISHost RNDIS Class Host Mode Driver + * \defgroup Group_USBClassRNDISHost RNDIS Class Host Mode Driver * * \section Sec_Dependencies Module Source Dependencies * The following files must be built with any user project that uses this module: diff --git a/LUFA/Drivers/USB/Class/Host/StillImage.h b/LUFA/Drivers/USB/Class/Host/StillImage.h index 24deb5a7fc..51dc1e99de 100644 --- a/LUFA/Drivers/USB/Class/Host/StillImage.h +++ b/LUFA/Drivers/USB/Class/Host/StillImage.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_USBClassSI - * @defgroup Group_USBClassStillImageHost Still Image Class Host Mode Driver + * \defgroup Group_USBClassStillImageHost Still Image Class Host Mode Driver * * \section Sec_Dependencies Module Source Dependencies * The following files must be built with any user project that uses this module: diff --git a/LUFA/Drivers/USB/Class/MIDI.h b/LUFA/Drivers/USB/Class/MIDI.h index 5b291896f3..431df22f0a 100644 --- a/LUFA/Drivers/USB/Class/MIDI.h +++ b/LUFA/Drivers/USB/Class/MIDI.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_USBClassDrivers - * @defgroup Group_USBClassMIDI MIDI Class Driver + * \defgroup Group_USBClassMIDI MIDI Class Driver * * \section Sec_Dependencies Module Source Dependencies * The following files must be built with any user project that uses this module: diff --git a/LUFA/Drivers/USB/Class/MassStorage.h b/LUFA/Drivers/USB/Class/MassStorage.h index 7dd96c96e4..8267c1696f 100644 --- a/LUFA/Drivers/USB/Class/MassStorage.h +++ b/LUFA/Drivers/USB/Class/MassStorage.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_USBClassDrivers - * @defgroup Group_USBClassMS Mass Storage Class Driver + * \defgroup Group_USBClassMS Mass Storage Class Driver * * \section Sec_Dependencies Module Source Dependencies * The following files must be built with any user project that uses this module: diff --git a/LUFA/Drivers/USB/Class/Printer.h b/LUFA/Drivers/USB/Class/Printer.h index e53fc717d4..e624128b49 100644 --- a/LUFA/Drivers/USB/Class/Printer.h +++ b/LUFA/Drivers/USB/Class/Printer.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_USBClassDrivers - * @defgroup Group_USBClassPrinter Printer Class Driver + * \defgroup Group_USBClassPrinter Printer Class Driver * * \section Sec_Dependencies Module Source Dependencies * The following files must be built with any user project that uses this module: diff --git a/LUFA/Drivers/USB/Class/RNDIS.h b/LUFA/Drivers/USB/Class/RNDIS.h index ebcadfdf25..5725bea628 100644 --- a/LUFA/Drivers/USB/Class/RNDIS.h +++ b/LUFA/Drivers/USB/Class/RNDIS.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_USBClassDrivers - * @defgroup Group_USBClassRNDIS RNDIS (Networking) Class Driver + * \defgroup Group_USBClassRNDIS RNDIS (Networking) Class Driver * * \section Sec_Dependencies Module Source Dependencies * The following files must be built with any user project that uses this module: diff --git a/LUFA/Drivers/USB/Class/StillImage.h b/LUFA/Drivers/USB/Class/StillImage.h index 35936a60ab..dadb98de59 100644 --- a/LUFA/Drivers/USB/Class/StillImage.h +++ b/LUFA/Drivers/USB/Class/StillImage.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_USBClassDrivers - * @defgroup Group_USBClassSI Still Image Class Driver + * \defgroup Group_USBClassSI Still Image Class Driver * * \section Sec_Dependencies Module Source Dependencies * The following files must be built with any user project that uses this module: diff --git a/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.h b/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.h index 3ef95a4066..d51eb3d93d 100644 --- a/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.h +++ b/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.h @@ -40,7 +40,7 @@ */ /** \ingroup Group_Descriptors - * @defgroup Group_ConfigDescriptorParser Configuration Descriptor Parser + * \defgroup Group_ConfigDescriptorParser Configuration Descriptor Parser * * Functions, macros, variables, enums and types related to the parsing of Configuration Descriptors. * diff --git a/LUFA/Drivers/USB/HighLevel/EndpointStream.h b/LUFA/Drivers/USB/HighLevel/EndpointStream.h index a6e7200e31..726378bfb5 100644 --- a/LUFA/Drivers/USB/HighLevel/EndpointStream.h +++ b/LUFA/Drivers/USB/HighLevel/EndpointStream.h @@ -39,7 +39,7 @@ */ /** \ingroup Group_EndpointRW - * @defgroup Group_EndpointStreamRW Read/Write of Multi-Byte Streams + * \defgroup Group_EndpointStreamRW Read/Write of Multi-Byte Streams * * Functions, macros, variables, enums and types related to data reading and writing of data streams from * and to endpoints. diff --git a/LUFA/Drivers/USB/HighLevel/Events.h b/LUFA/Drivers/USB/HighLevel/Events.h index 53e31f6c1e..368774bdd1 100644 --- a/LUFA/Drivers/USB/HighLevel/Events.h +++ b/LUFA/Drivers/USB/HighLevel/Events.h @@ -48,7 +48,7 @@ */ /** \ingroup Group_USB - * @defgroup Group_Events USB Events + * \defgroup Group_Events USB Events * * This module contains macros and functions relating to the management of library events, which are small * pieces of code similar to ISRs which are run when a given condition is met. Each event can be fired from diff --git a/LUFA/Drivers/USB/HighLevel/PipeStream.h b/LUFA/Drivers/USB/HighLevel/PipeStream.h index b2d392af0b..38ab09f0be 100644 --- a/LUFA/Drivers/USB/HighLevel/PipeStream.h +++ b/LUFA/Drivers/USB/HighLevel/PipeStream.h @@ -39,7 +39,7 @@ */ /** \ingroup Group_PipeRW - * @defgroup Group_PipeStreamRW Read/Write of Multi-Byte Streams + * \defgroup Group_PipeStreamRW Read/Write of Multi-Byte Streams * * Functions, macros, variables, enums and types related to data reading and writing of data streams from * and to pipes. diff --git a/LUFA/Drivers/USB/HighLevel/StdDescriptors.h b/LUFA/Drivers/USB/HighLevel/StdDescriptors.h index a6c5231830..7b8f4d7dc6 100644 --- a/LUFA/Drivers/USB/HighLevel/StdDescriptors.h +++ b/LUFA/Drivers/USB/HighLevel/StdDescriptors.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_USB - * @defgroup Group_Descriptors USB Descriptors + * \defgroup Group_Descriptors USB Descriptors * * Standard USB device descriptor defines and retrieval routines, for USB devices. This module contains * structures and macros for the easy creation of standard USB descriptors in USB device projects. diff --git a/LUFA/Drivers/USB/HighLevel/StdRequestType.h b/LUFA/Drivers/USB/HighLevel/StdRequestType.h index f8e951eb13..c62aa502dd 100644 --- a/LUFA/Drivers/USB/HighLevel/StdRequestType.h +++ b/LUFA/Drivers/USB/HighLevel/StdRequestType.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_USB - * @defgroup Group_StdRequest Standard USB Requests + * \defgroup Group_StdRequest Standard USB Requests * * This module contains definitions for the various control request parameters, so that the request * details (such as data direction, request recipient, etc.) can be extracted via masking. diff --git a/LUFA/Drivers/USB/HighLevel/USBMode.h b/LUFA/Drivers/USB/HighLevel/USBMode.h index 91b2697f76..58f9927dc9 100644 --- a/LUFA/Drivers/USB/HighLevel/USBMode.h +++ b/LUFA/Drivers/USB/HighLevel/USBMode.h @@ -40,7 +40,7 @@ */ /** \ingroup Group_USB - * @defgroup Group_USBMode USB Mode Tokens + * \defgroup Group_USBMode USB Mode Tokens * * After the inclusion of the master USB driver header, one or more of the following * tokens may be defined, to allow the user code to conditionally enable or disable diff --git a/LUFA/Drivers/USB/LowLevel/Device.h b/LUFA/Drivers/USB/LowLevel/Device.h index 55f4346a17..ae3df4111b 100644 --- a/LUFA/Drivers/USB/LowLevel/Device.h +++ b/LUFA/Drivers/USB/LowLevel/Device.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_USB - * @defgroup Group_Device Device Management + * \defgroup Group_Device Device Management * * USB Device mode related macros and enums. This module contains macros and enums which are used when * the USB controller is initialized in device mode. diff --git a/LUFA/Drivers/USB/LowLevel/Endpoint.h b/LUFA/Drivers/USB/LowLevel/Endpoint.h index 9ce1380b41..455577c5a9 100644 --- a/LUFA/Drivers/USB/LowLevel/Endpoint.h +++ b/LUFA/Drivers/USB/LowLevel/Endpoint.h @@ -39,26 +39,26 @@ */ /** \ingroup Group_EndpointManagement - * @defgroup Group_EndpointRW Endpoint Data Reading and Writing + * \defgroup Group_EndpointRW Endpoint Data Reading and Writing * * Functions, macros, variables, enums and types related to data reading and writing from and to endpoints. */ /** \ingroup Group_EndpointRW - * @defgroup Group_EndpointPrimitiveRW Read/Write of Primitive Data Types + * \defgroup Group_EndpointPrimitiveRW Read/Write of Primitive Data Types * * Functions, macros, variables, enums and types related to data reading and writing of primitive data types * from and to endpoints. */ /** \ingroup Group_EndpointManagement - * @defgroup Group_EndpointPacketManagement Endpoint Packet Management + * \defgroup Group_EndpointPacketManagement Endpoint Packet Management * * Functions, macros, variables, enums and types related to packet management of endpoints. */ /** \ingroup Group_USB - * @defgroup Group_EndpointManagement Endpoint Management + * \defgroup Group_EndpointManagement Endpoint Management * * Functions, macros and enums related to endpoint management when in USB Device mode. This * module contains the endpoint management macros, as well as endpoint interrupt and data diff --git a/LUFA/Drivers/USB/LowLevel/Host.h b/LUFA/Drivers/USB/LowLevel/Host.h index 92a4cb9c57..651daf28bf 100644 --- a/LUFA/Drivers/USB/LowLevel/Host.h +++ b/LUFA/Drivers/USB/LowLevel/Host.h @@ -38,7 +38,7 @@ */ /** \ingroup Group_USB - * @defgroup Group_Host Host Management + * \defgroup Group_Host Host Management * * USB Host mode related macros and enums. This module contains macros and enums which are used when * the USB controller is initialized in host mode. diff --git a/LUFA/Drivers/USB/LowLevel/OTG.h b/LUFA/Drivers/USB/LowLevel/OTG.h index 5e096ca7a3..2cb751dad3 100644 --- a/LUFA/Drivers/USB/LowLevel/OTG.h +++ b/LUFA/Drivers/USB/LowLevel/OTG.h @@ -39,7 +39,7 @@ */ /** \ingroup Group_USB - * @defgroup Group_OTG USB On The Go (OTG) Management + * \defgroup Group_OTG USB On The Go (OTG) Management * * This module contains macros for embedded USB hosts with dual role On The Go capabilities, for managing role * exchange. OTG is a way for two USB dual role devices to talk to one another directly without fixed device/host diff --git a/LUFA/Drivers/USB/LowLevel/Pipe.h b/LUFA/Drivers/USB/LowLevel/Pipe.h index 75cdf7a7df..34a64a7c50 100644 --- a/LUFA/Drivers/USB/LowLevel/Pipe.h +++ b/LUFA/Drivers/USB/LowLevel/Pipe.h @@ -39,26 +39,26 @@ */ /** \ingroup Group_PipeManagement - * @defgroup Group_PipeRW Pipe Data Reading and Writing + * \defgroup Group_PipeRW Pipe Data Reading and Writing * * Functions, macros, variables, enums and types related to data reading and writing from and to pipes. */ /** \ingroup Group_PipeRW - * @defgroup Group_PipePrimitiveRW Read/Write of Primitive Data Types + * \defgroup Group_PipePrimitiveRW Read/Write of Primitive Data Types * * Functions, macros, variables, enums and types related to data reading and writing of primitive data types * from and to pipes. */ /** \ingroup Group_PipeManagement - * @defgroup Group_PipePacketManagement Pipe Packet Management + * \defgroup Group_PipePacketManagement Pipe Packet Management * * Functions, macros, variables, enums and types related to packet management of pipes. */ /** \ingroup Group_PipeManagement - * @defgroup Group_PipeControlReq Pipe Control Request Management + * \defgroup Group_PipeControlReq Pipe Control Request Management * * Module for host mode request processing. This module allows for the transmission of standard, class and * vendor control requests to the default control endpoint of an attached device while in host mode. @@ -67,7 +67,7 @@ */ /** \ingroup Group_USB - * @defgroup Group_PipeManagement Pipe Management + * \defgroup Group_PipeManagement Pipe Management * * This module contains functions, macros and enums related to pipe management when in USB Host mode. This * module contains the pipe management macros, as well as pipe interrupt and data send/receive functions diff --git a/LUFA/Drivers/USB/LowLevel/USBController.h b/LUFA/Drivers/USB/LowLevel/USBController.h index f35c52da94..b85539d3e3 100644 --- a/LUFA/Drivers/USB/LowLevel/USBController.h +++ b/LUFA/Drivers/USB/LowLevel/USBController.h @@ -39,7 +39,7 @@ */ /** \ingroup Group_USB - * @defgroup Group_USBManagement USB Interface Management + * \defgroup Group_USBManagement USB Interface Management * * Functions, macros, variables, enums and types related to the setup and management of the USB interface. * diff --git a/LUFA/Drivers/USB/USB.h b/LUFA/Drivers/USB/USB.h index ff72a08f3c..70dc97e105 100644 --- a/LUFA/Drivers/USB/USB.h +++ b/LUFA/Drivers/USB/USB.h @@ -37,7 +37,7 @@ * including any headers in the USB/LowLevel/ or USB/HighLevel/ subdirectories. */ -/** @defgroup Group_USB USB Core - LUFA/Drivers/USB/USB.h +/** \defgroup Group_USB USB Core - LUFA/Drivers/USB/USB.h * * \section Sec_Dependencies Module Source Dependencies * The following files must be built with any user project that uses this module: @@ -71,7 +71,7 @@ * of USB management functions found \ref Group_USBManagement. */ -/** @defgroup Group_USBClassDrivers USB Class Drivers +/** \defgroup Group_USBClassDrivers USB Class Drivers * * Drivers for both host and device mode of the standard USB classes, for rapid application development. * Class drivers give a framework which sits on top of the low level library API, allowing for standard diff --git a/LUFA/ManPages/ChangeLog.txt b/LUFA/ManPages/ChangeLog.txt index 915b83a4db..26700f6c3b 100644 --- a/LUFA/ManPages/ChangeLog.txt +++ b/LUFA/ManPages/ChangeLog.txt @@ -22,6 +22,7 @@ * - Added new MAX() and MIN() convenience macros * - Added new Serial_SendData() function to the Serial driver * - Added board driver support for the Sparkfun ATMEGA8U2 breakout board + * - Started internal restructuring for eventual multiple architecture ports * - Library Applications: * - Added ability to write protect Mass Storage disk write operations from the host OS * - Added new MIDIToneGenerator project diff --git a/LUFA/ManPages/DirectorySummaries.txt b/LUFA/ManPages/DirectorySummaries.txt index 36ba26d656..a02d4076b6 100644 --- a/LUFA/ManPages/DirectorySummaries.txt +++ b/LUFA/ManPages/DirectorySummaries.txt @@ -27,13 +27,12 @@ * This folder contains drivers for several of the AVR internal peripherals such as the USART, compatible with * all USB AVR models. * - * \dir LUFA/Drivers/Peripheral/AVRU4U6U7 - * \brief AT90USBXXX6, AT90USBXXX7 and ATMEGAXXU4 AVR model peripheral driver files. + * \dir LUFA/Drivers/Peripheral/AVR8 + * \brief AVR8 AVR microcontroller model specific peripheral driver files. * * This folder contains drivers for several of the AVR internal peripherals such as the USART, compatible only with - * the AT90USBXXX6, AT90USBXXX7 and ATMEGAXXU4 USB AVR models, such as the AT90USB1287. Its contents should not be - * included by the user application - the dispatch header file located in the parent directory should be used - * instead. + * the 8-bit AVR microcontroller models, such as the AT90USB1287. Its contents should not be included by the + * user application - the dispatch header file located in the parent directory should be used instead. * * \dir LUFA/Drivers/USB * \brief USB controller peripheral driver files. diff --git a/LUFA/Scheduler/Scheduler.c b/LUFA/Scheduler/Scheduler.c index 857e9dd2d6..4e71d4d874 100644 --- a/LUFA/Scheduler/Scheduler.c +++ b/LUFA/Scheduler/Scheduler.c @@ -31,9 +31,9 @@ #include "Scheduler.h" volatile SchedulerDelayCounter_t Scheduler_TickCounter; -volatile uint8_t Scheduler_TotalTasks; +volatile uint_least8_t Scheduler_TotalTasks; -bool Scheduler_HasDelayElapsed(const uint16_t Delay, +bool Scheduler_HasDelayElapsed(const uint_least16_t Delay, SchedulerDelayCounter_t* const DelayCounter) { SchedulerDelayCounter_t CurrentTickValue_LCL; @@ -83,7 +83,7 @@ void Scheduler_SetTaskMode(const TaskPtr_t Task, } } -void Scheduler_SetGroupTaskMode(const uint8_t GroupID, +void Scheduler_SetGroupTaskMode(const uint_least8_t GroupID, const bool TaskStatus) { TaskEntry_t* CurrTask = &Scheduler_TaskList[0]; diff --git a/LUFA/Scheduler/Scheduler.h b/LUFA/Scheduler/Scheduler.h index 72b8773647..35f165fb40 100644 --- a/LUFA/Scheduler/Scheduler.h +++ b/LUFA/Scheduler/Scheduler.h @@ -37,7 +37,7 @@ * \deprecated This module is deprecated and will be removed in a future library release. */ -/** @defgroup Group_Scheduler Simple Task Scheduler - LUFA/Scheduler/Scheduler.h +/** \defgroup Group_Scheduler Simple Task Scheduler - LUFA/Scheduler/Scheduler.h * * \deprecated This module is deprecated and will be removed in a future library release. * @@ -105,11 +105,6 @@ #define __SCHEDULER_H__ /* Includes: */ - #include - #include - - #include - #include "../Common/Common.h" /* Enable C linkage for C++ Compilers: */ @@ -180,7 +175,7 @@ /** Type define for a variable which can hold a tick delay value for the scheduler up to the maximum delay * possible. */ - typedef uint16_t SchedulerDelayCounter_t; + typedef uint_least16_t SchedulerDelayCounter_t; /** \brief Scheduler Task List Entry Structure. * @@ -188,9 +183,9 @@ */ typedef struct { - TaskPtr_t Task; /**< Pointer to the task to execute. */ - bool TaskStatus; /**< Status of the task (either TASK_RUN or TASK_STOP). */ - uint8_t GroupID; /**< Group ID of the task so that its status can be changed as a group. */ + TaskPtr_t Task; /**< Pointer to the task to execute. */ + bool TaskStatus; /**< Status of the task (either TASK_RUN or TASK_STOP). */ + uint_least8_t GroupID; /**< Group ID of the task so that its status can be changed as a group. */ } TaskEntry_t; /* Global Variables: */ @@ -198,14 +193,14 @@ * \ref TaskEntry_t and can be manipulated as desired, although it is preferred that the proper Scheduler * functions should be used instead of direct manipulation. */ - exter TaskEntry_t Scheduler_TaskList[]; + extern TaskEntry_t Scheduler_TaskList[]; /** Contains the total number of tasks in the task list, irrespective of if the task's status is set to * \ref TASK_RUN or \ref TASK_STOP. * * \note This value should be treated as read-only, and never altered in user-code. */ - extern volatile uint8_t Scheduler_TotalTasks; + extern volatile uint_least8_t Scheduler_TotalTasks; /** Contains the current scheduler tick count, for use with the delay functions. If the delay functions * are used in the user code, this should be incremented each tick period so that the delays can be @@ -248,7 +243,7 @@ * } * \endcode */ - bool Scheduler_HasDelayElapsed(const uint16_t Delay, + bool Scheduler_HasDelayElapsed(const uint_least16_t Delay, SchedulerDelayCounter_t* const DelayCounter) ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(2); @@ -266,24 +261,25 @@ * \param[in] GroupID Value of the task group ID whose status is to be changed. * \param[in] TaskStatus New task status for tasks in the specified group (\ref TASK_RUN or \ref TASK_STOP). */ - void Scheduler_SetGroupTaskMode(const uint8_t GroupID, + void Scheduler_SetGroupTaskMode(const uint_least8_t GroupID, const bool TaskStatus); /* Private Interface - For use in library only: */ #if !defined(__DOXYGEN__) /* Macros: */ #define TOTAL_TASKS (sizeof(Scheduler_TaskList) / sizeof(TaskEntry_t)) - #define MAX_DELAYCTR_COUNT 0xFFFF + #define MAX_DELAYCTR_COUNT UINT_LEAST16_MAX /* Inline Functions: */ - static inline void Scheduler_InitScheduler(const uint8_t TotalTasks) ATTR_ALWAYS_INLINE; - static inline void Scheduler_InitScheduler(const uint8_t TotalTasks) + static inline void Scheduler_InitScheduler(const uint_least8_t TotalTasks) ATTR_ALWAYS_INLINE; + static inline void Scheduler_InitScheduler(const uint_least8_t TotalTasks) { Scheduler_TotalTasks = TotalTasks; } - static inline void Scheduler_GoSchedule(const uint8_t TotalTasks) ATTR_NO_RETURN ATTR_ALWAYS_INLINE ATTR_DEPRECATED; - static inline void Scheduler_GoSchedule(const uint8_t TotalTasks) + static inline void Scheduler_GoSchedule(const uint_least8_t TotalTasks) + ATTR_NO_RETURN ATTR_ALWAYS_INLINE ATTR_DEPRECATED; + static inline void Scheduler_GoSchedule(const uint_least8_t TotalTasks) { Scheduler_InitScheduler(TotalTasks); diff --git a/LUFA/makefile b/LUFA/makefile index d1710ef808..ccc2afd8c4 100644 --- a/LUFA/makefile +++ b/LUFA/makefile @@ -16,6 +16,11 @@ else LUFA_ROOT_PATH = $(LUFA_PATH)/LUFA endif +# Check to see if the chip architecture has not been defined in the user makefile, set a default architecture if not +ifeq ($(origin ARCH), undefined) + ARCH = AVR8 +endif + # Define module source file lists LUFA_SRC_USB = $(LUFA_ROOT_PATH)/Drivers/USB/LowLevel/Device.c \ $(LUFA_ROOT_PATH)/Drivers/USB/LowLevel/Endpoint.c \ @@ -45,8 +50,8 @@ LUFA_SRC_USBCLASS = $(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/Audio.c $(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/RNDIS.c \ $(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/StillImage.c LUFA_SRC_TEMPERATURE = $(LUFA_ROOT_PATH)/Drivers/Board/Temperature.c -LUFA_SRC_SERIAL = $(LUFA_ROOT_PATH)/Drivers/Peripheral/Serial.c -LUFA_SRC_TWI = $(LUFA_ROOT_PATH)/Drivers/Peripheral/TWI.c +LUFA_SRC_SERIAL = $(LUFA_ROOT_PATH)/Drivers/Peripheral/$(ARCH)/Serial.c +LUFA_SRC_TWI = $(LUFA_ROOT_PATH)/Drivers/Peripheral/$(ARCH)/TWI.c LUFA_SRC_SCHEDULER = $(LUFA_ROOT_PATH)/Scheduler/Scheduler.c diff --git a/Projects/AVRISP-MKII/makefile b/Projects/AVRISP-MKII/makefile index 944054efbf..ecfa0a1288 100644 --- a/Projects/AVRISP-MKII/makefile +++ b/Projects/AVRISP-MKII/makefile @@ -63,6 +63,10 @@ MCU = at90usb162 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -204,7 +208,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Projects/Benito/makefile b/Projects/Benito/makefile index 1d306803d5..9b19f0da2e 100644 --- a/Projects/Benito/makefile +++ b/Projects/Benito/makefile @@ -63,6 +63,10 @@ MCU = atmega32u2 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -190,7 +194,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Projects/Incomplete/StandaloneProgrammer/makefile b/Projects/Incomplete/StandaloneProgrammer/makefile index 6656d9270e..8d6fcedca3 100644 --- a/Projects/Incomplete/StandaloneProgrammer/makefile +++ b/Projects/Incomplete/StandaloneProgrammer/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -190,7 +194,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Projects/LEDNotifier/makefile b/Projects/LEDNotifier/makefile index 017a3fa4c7..a29ff5404e 100644 --- a/Projects/LEDNotifier/makefile +++ b/Projects/LEDNotifier/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -181,7 +185,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Projects/MIDIToneGenerator/makefile b/Projects/MIDIToneGenerator/makefile index 7aee785d8f..6e1a2a32b4 100644 --- a/Projects/MIDIToneGenerator/makefile +++ b/Projects/MIDIToneGenerator/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -181,7 +185,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Projects/Magstripe/makefile b/Projects/Magstripe/makefile index 597736dce6..9e6674f362 100644 --- a/Projects/Magstripe/makefile +++ b/Projects/Magstripe/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -193,7 +197,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Projects/MissileLauncher/makefile b/Projects/MissileLauncher/makefile index d7b35c95d0..e3e550e64a 100644 --- a/Projects/MissileLauncher/makefile +++ b/Projects/MissileLauncher/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -177,7 +181,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Projects/RelayBoard/makefile b/Projects/RelayBoard/makefile index baad4a74b3..d548ff4835 100644 --- a/Projects/RelayBoard/makefile +++ b/Projects/RelayBoard/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -181,7 +185,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Projects/TempDataLogger/makefile b/Projects/TempDataLogger/makefile index f6d43621a3..66648165e3 100644 --- a/Projects/TempDataLogger/makefile +++ b/Projects/TempDataLogger/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -190,7 +194,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Projects/USBtoSerial/makefile b/Projects/USBtoSerial/makefile index f495af6899..01141fd1d6 100644 --- a/Projects/USBtoSerial/makefile +++ b/Projects/USBtoSerial/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -182,7 +186,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Projects/Webserver/makefile b/Projects/Webserver/makefile index acc371ad5b..2091f8d805 100644 --- a/Projects/Webserver/makefile +++ b/Projects/Webserver/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -214,7 +218,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS) diff --git a/Projects/XPLAINBridge/makefile b/Projects/XPLAINBridge/makefile index ee466dde3a..437d70ad93 100644 --- a/Projects/XPLAINBridge/makefile +++ b/Projects/XPLAINBridge/makefile @@ -63,6 +63,10 @@ MCU = at90usb1287 +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + + # Target board (see library "Board Types" documentation, NONE for projects not requiring # LUFA board drivers). If USER is selected, put custom board drivers in a directory called # "Board" inside the application directory. @@ -206,7 +210,7 @@ CSTANDARD = -std=c99 # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL CDEFS += -DF_CLOCK=$(F_CLOCK)UL -CDEFS += -DBOARD=BOARD_$(BOARD) +CDEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH) CDEFS += $(LUFA_OPTS)