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.

pull/1469/head
Dean Camera 14 years ago
parent 100a197d0e
commit 3d4d8e7f62

@ -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)

@ -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)

@ -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)

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

File diff suppressed because one or more lines are too long

@ -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.

@ -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
/** @} */

@ -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

@ -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

@ -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 <stdint.h>
#include <stdbool.h>
#include "Architectures.h"
#include "Attributes.h"
#include "BoardTypes.h"
/* Architecture specific utility includes: */
#if (ARCH == ARCH_AVR8)
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include <avr/eeprom.h>
#include <util/atomic.h>
#include <util/delay.h>
#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

@ -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).
*

@ -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.
*

@ -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.
*

@ -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).
*

@ -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).
*

@ -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/.
*

@ -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).
*

@ -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

@ -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

@ -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

@ -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: */

@ -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).
*

@ -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).
*

@ -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: */

@ -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.
*

@ -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.
*

@ -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.
*

@ -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.
*

@ -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.
*

@ -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).
*

@ -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).
*

@ -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: */

@ -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

@ -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/).
*

@ -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/).
*

@ -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/).
*

@ -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.
*

@ -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/).
*

@ -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).
*

@ -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).
*

@ -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.
*

@ -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).
*

@ -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.
*

@ -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.
*

@ -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.
*

@ -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.
*

@ -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.
*

@ -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.
*

@ -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.
*

@ -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.
*

@ -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.
*

@ -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.
*

@ -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).
*

@ -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 <avr/pgmspace.h>
#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: */

@ -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/).
*

@ -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/).
*

@ -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).
*

@ -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).
*

@ -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).
*

@ -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.
*

@ -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.
*

@ -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.
*

@ -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.
*

@ -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.
*

@ -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/).
*

@ -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/).
*

@ -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.
*

@ -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.
*

@ -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.
*

@ -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:

@ -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:

@ -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

@ -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 <avr/io.h>
#include <stdbool.h>
/* 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: */

@ -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
/** @} */

@ -28,6 +28,7 @@
this software.
*/
#define __INCLUDE_FROM_SERIAL_C
#include "Serial.h"
FILE USARTSerialStream;

@ -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 <stdio.h>
/* 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 <stdio.h> 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
/** @} */

@ -5,6 +5,7 @@
www.lufa-lib.org
*/
#define __INCLUDE_FROM_TWI_C
#include "TWI.h"
uint8_t TWI_StartTransmission(const uint8_t SlaveAddress,

@ -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 <avr/io.h>
#include <stdbool.h>
#include <stdio.h>
#include <util/twi.h>
#include <util/delay.h>
/* 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

@ -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 <stdbool.h>
/* 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
/** @} */

@ -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 <i>(Makefile source module name: LUFA_SRC_SERIAL)</i>
* - LUFA/Drivers/Peripheral/$(ARCH)/Serial.c <i>(Makefile source module name: LUFA_SRC_SERIAL)</i>
*
* \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 <avr/io.h>
#include <avr/pgmspace.h>
#include <stdbool.h>
#include <stdio.h>
#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 <stdio.h> 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
/** @} */

@ -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 <i>(Makefile source module name: LUFA_SRC_TWI)</i>
*
* - LUFA/Drivers/Peripheral/$(ARCH)TWI.c <i>(Makefile source module name: LUFA_SRC_TWI)</i>
*
* \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

@ -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:

@ -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:

@ -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

@ -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

@ -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

@ -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:

@ -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.
*

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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:

@ -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:

@ -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:

@ -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:

@ -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:

@ -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:

@ -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:

@ -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:

@ -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:

@ -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:

@ -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:

@ -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:

@ -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:

@ -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:

@ -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:

@ -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:

@ -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:

@ -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:

@ -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:

@ -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.
*

@ -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.

@ -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

@ -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.

@ -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.

@ -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.

@ -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

@ -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.

@ -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

@ -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.

@ -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

@ -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

@ -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.
*

@ -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

@ -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

@ -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 <b>not</b> 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 <b>not</b> 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.

@ -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];

@ -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 <stdint.h>
#include <stdbool.h>
#include <util/atomic.h>
#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);

@ -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

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

Loading…
Cancel
Save