@ -0,0 +1,43 @@
|
||||
#
|
||||
# LUFA Library
|
||||
# Copyright (C) Dean Camera, 2015.
|
||||
#
|
||||
# dean [at] fourwalledcubicle [dot] com
|
||||
# www.lufa-lib.org
|
||||
#
|
||||
|
||||
DMBS_BUILD_MODULES += LUFA_GCC
|
||||
DMBS_BUILD_TARGETS +=
|
||||
DMBS_BUILD_MANDATORY_VARS += LUFA_PATH ARCH F_USB
|
||||
DMBS_BUILD_OPTIONAL_VARS += BOARD
|
||||
DMBS_BUILD_PROVIDED_VARS +=
|
||||
DMBS_BUILD_PROVIDED_MACROS +=
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
ERROR_IF_UNSET ?= $(if $(filter undefined, $(origin $(strip $(1)))), $(error Makefile $(strip $(1)) value not set))
|
||||
ERROR_IF_EMPTY ?= $(if $(strip $($(strip $(1)))), , $(error Makefile $(strip $(1)) option cannot be blank))
|
||||
ERROR_IF_NONBOOL ?= $(if $(filter Y N, $($(strip $(1)))), , $(error Makefile $(strip $(1)) option must be Y or N))
|
||||
|
||||
# Sanity check user supplied values
|
||||
$(call ERROR_IF_EMPTY, LUFA_PATH)
|
||||
$(call ERROR_IF_EMPTY, ARCH)
|
||||
$(call ERROR_IF_EMPTY, F_USB)
|
||||
|
||||
# Default values of optionally user-supplied variables
|
||||
BOARD ?= NONE
|
||||
|
||||
# Determine the utility prefix to use for the selected architecture
|
||||
ifeq ($(ARCH), XMEGA)
|
||||
$(warning The XMEGA device support is currently EXPERIMENTAL (incomplete and/or non-functional), and is included for preview purposes only.)
|
||||
else ifeq ($(ARCH), UC3)
|
||||
$(warning The UC3 device support is currently EXPERIMENTAL (incomplete and/or non-functional), and is included for preview purposes only.)
|
||||
endif
|
||||
|
||||
# Common LUFA C/C++ includes/definitions
|
||||
LUFA_CXX_INCLUDES = -I. -I$(patsubst %/,%,$(LUFA_PATH))/..
|
||||
LUFA_CXX_DEFINES = -DARCH=ARCH_$(ARCH) -DBOARD=BOARD_$(BOARD) -DF_USB=$(F_USB)UL
|
||||
|
||||
# LUFA specific standard build options
|
||||
C_FLAGS += $(LUFA_CXX_INCLUDES) $(LUFA_CXX_DEFINES) $(LUFA_CXX_FLAGS)
|
||||
CPP_FLAGS += $(LUFA_CXX_INCLUDES) $(LUFA_CXX_DEFINES) $(LUFA_CXX_FLAGS)
|
@ -0,0 +1,95 @@
|
||||
#
|
||||
# LUFA Library
|
||||
# Copyright (C) Dean Camera, 2015.
|
||||
#
|
||||
# dean [at] fourwalledcubicle [dot] com
|
||||
# www.lufa-lib.org
|
||||
#
|
||||
|
||||
DMBS_BUILD_MODULES += LUFA_SOURCES
|
||||
DMBS_BUILD_TARGETS +=
|
||||
DMBS_BUILD_MANDATORY_VARS += LUFA_PATH ARCH
|
||||
DMBS_BUILD_OPTIONAL_VARS +=
|
||||
DMBS_BUILD_PROVIDED_VARS += LUFA_SRC_USB_DEVICE LUFA_SRC_USB_HOST \
|
||||
LUFA_SRC_USB LUFA_SRC_USBCLASS_DEVICE \
|
||||
LUFA_SRC_USBCLASS_HOST LUFA_SRC_USBCLASS \
|
||||
LUFA_SRC_TEMPERATURE LUFA_SRC_SERIAL \
|
||||
LUFA_SRC_TWI LUFA_SRC_PLATFORM
|
||||
DMBS_BUILD_PROVIDED_MACROS +=
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
ERROR_IF_UNSET ?= $(if $(filter undefined, $(origin $(strip $(1)))), $(error Makefile $(strip $(1)) value not set))
|
||||
ERROR_IF_EMPTY ?= $(if $(strip $($(strip $(1)))), , $(error Makefile $(strip $(1)) option cannot be blank))
|
||||
ERROR_IF_NONBOOL ?= $(if $(filter Y N, $($(strip $(1)))), , $(error Makefile $(strip $(1)) option must be Y or N))
|
||||
|
||||
# Sanity check user supplied values
|
||||
$(foreach MANDATORY_VAR, $(LUFA_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR)))
|
||||
$(call ERROR_IF_EMPTY, LUFA_PATH)
|
||||
$(call ERROR_IF_EMPTY, ARCH)
|
||||
|
||||
# Allow LUFA_ROOT_PATH to be overridden elsewhere to support legacy LUFA makefiles
|
||||
LUFA_ROOT_PATH ?= $(patsubst %/,%,$(LUFA_PATH))
|
||||
|
||||
# Construct LUFA module source variables
|
||||
LUFA_SRC_USB_COMMON := $(LUFA_ROOT_PATH)/Drivers/USB/Core/$(ARCH)/USBController_$(ARCH).c \
|
||||
$(LUFA_ROOT_PATH)/Drivers/USB/Core/$(ARCH)/USBInterrupt_$(ARCH).c \
|
||||
$(LUFA_ROOT_PATH)/Drivers/USB/Core/ConfigDescriptors.c \
|
||||
$(LUFA_ROOT_PATH)/Drivers/USB/Core/Events.c \
|
||||
$(LUFA_ROOT_PATH)/Drivers/USB/Core/USBTask.c \
|
||||
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Common/HIDParser.c \
|
||||
|
||||
LUFA_SRC_USB_HOST := $(LUFA_ROOT_PATH)/Drivers/USB/Core/$(ARCH)/Host_$(ARCH).c \
|
||||
$(LUFA_ROOT_PATH)/Drivers/USB/Core/$(ARCH)/Pipe_$(ARCH).c \
|
||||
$(LUFA_ROOT_PATH)/Drivers/USB/Core/$(ARCH)/PipeStream_$(ARCH).c \
|
||||
$(LUFA_ROOT_PATH)/Drivers/USB/Core/HostStandardReq.c \
|
||||
$(LUFA_SRC_USB_COMMON)
|
||||
|
||||
LUFA_SRC_USB_DEVICE := $(LUFA_ROOT_PATH)/Drivers/USB/Core/$(ARCH)/Device_$(ARCH).c \
|
||||
$(LUFA_ROOT_PATH)/Drivers/USB/Core/$(ARCH)/Endpoint_$(ARCH).c \
|
||||
$(LUFA_ROOT_PATH)/Drivers/USB/Core/$(ARCH)/EndpointStream_$(ARCH).c \
|
||||
$(LUFA_ROOT_PATH)/Drivers/USB/Core/DeviceStandardReq.c \
|
||||
$(LUFA_SRC_USB_COMMON)
|
||||
|
||||
LUFA_SRC_USBCLASS_DEVICE := $(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/AudioClassDevice.c \
|
||||
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/CDCClassDevice.c \
|
||||
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/HIDClassDevice.c \
|
||||
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/MassStorageClassDevice.c \
|
||||
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/MIDIClassDevice.c \
|
||||
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/PrinterClassDevice.c \
|
||||
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Device/RNDISClassDevice.c \
|
||||
|
||||
LUFA_SRC_USBCLASS_HOST := $(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/AndroidAccessoryClassHost.c \
|
||||
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/AudioClassHost.c \
|
||||
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/CDCClassHost.c \
|
||||
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/HIDClassHost.c \
|
||||
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/MassStorageClassHost.c \
|
||||
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/MIDIClassHost.c \
|
||||
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/PrinterClassHost.c \
|
||||
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/RNDISClassHost.c \
|
||||
$(LUFA_ROOT_PATH)/Drivers/USB/Class/Host/StillImageClassHost.c
|
||||
|
||||
LUFA_SRC_USB := $(sort $(LUFA_SRC_USB_COMMON) $(LUFA_SRC_USB_HOST) $(LUFA_SRC_USB_DEVICE))
|
||||
|
||||
LUFA_SRC_USBCLASS := $(LUFA_SRC_USBCLASS_DEVICE) $(LUFA_SRC_USBCLASS_HOST)
|
||||
|
||||
LUFA_SRC_TEMPERATURE := $(LUFA_ROOT_PATH)/Drivers/Board/Temperature.c
|
||||
|
||||
LUFA_SRC_SERIAL := $(LUFA_ROOT_PATH)/Drivers/Peripheral/$(ARCH)/Serial_$(ARCH).c
|
||||
|
||||
LUFA_SRC_TWI := $(LUFA_ROOT_PATH)/Drivers/Peripheral/$(ARCH)/TWI_$(ARCH).c
|
||||
|
||||
ifeq ($(ARCH), UC3)
|
||||
LUFA_SRC_PLATFORM := $(LUFA_ROOT_PATH)/Platform/UC3/Exception.S \
|
||||
$(LUFA_ROOT_PATH)/Platform/UC3/InterruptManagement.c
|
||||
else
|
||||
LUFA_SRC_PLATFORM :=
|
||||
endif
|
||||
|
||||
# Build a list of all available module sources
|
||||
LUFA_SRC_ALL_FILES := $(LUFA_SRC_USB) \
|
||||
$(LUFA_SRC_USBCLASS) \
|
||||
$(LUFA_SRC_TEMPERATURE) \
|
||||
$(LUFA_SRC_SERIAL) \
|
||||
$(LUFA_SRC_TWI) \
|
||||
$(LUFA_SRC_PLATFORM)
|
@ -1,112 +0,0 @@
|
||||
/** \file
|
||||
*
|
||||
* This file contains special DoxyGen information for the generation of the main page and other special
|
||||
* documentation pages. It is not a project source file.
|
||||
*/
|
||||
|
||||
/** \page Page_ExportingLibrary Exporting the Library for IDE Use
|
||||
*
|
||||
* While LUFA was designed to allow for easy compilation in a makefile driven environment,
|
||||
* it is possible to export the library into a form suitable for drop-in use inside of an
|
||||
* IDE.
|
||||
*
|
||||
* \note <b>LUFA is also available as a native Atmel Studio 6.1 extension</b>, which integrates LUFA into
|
||||
* Atmel Studio including all demos and projects. If you are running Atmel Studio 6.1 or later, the
|
||||
* below instructions are not required; download and install the native LUFA extension from the
|
||||
* <a href="http://gallery.atmel.com">Atmel Gallery</a> instead.
|
||||
*
|
||||
* \section Sec_LibraryExport Exporting the Library
|
||||
* An export of the library is at its most basic, a direct copy of the main "LUFA" source folder from the
|
||||
* root download folder; this contains the library core which can be re-used within external projects.
|
||||
* However, as many IDEs attempt to automatically compile all included source files, it is necessary to
|
||||
* exclude some directories and files from the library core export to allow for easier integration into
|
||||
* an IDE project.
|
||||
*
|
||||
* \subsection SSec_ManualExport Manual Export
|
||||
* To manually export the library core, copy over the main LUFA library folder from the LUFA root directory,
|
||||
* renaming as desired. Within the library core folder, the following directories should be removed or
|
||||
* excluded from your IDE import:
|
||||
* - Documentation/
|
||||
* - DoxygenPages/
|
||||
* - CodeTemplates/
|
||||
* - StudioIntegration/
|
||||
*
|
||||
* If required, files from the CodeTemplates/ subdirectory may be copied to your IDE project as needed.
|
||||
*
|
||||
* The resulting copy of the library may then be imported into your chosen IDE according to the instructions
|
||||
* shown in \ref Sec_LibraryImport.
|
||||
*
|
||||
* \subsection SSec_AutomaticExport Automatic Export
|
||||
* If desired, the steps indicated in \ref SSec_ManualExport may be automatically performed, by running the
|
||||
* command <b><code>make export_tar</code></b> from the command line. This will generate two .tar files in the
|
||||
* current directory, named <code>LUFA_YYMMDD.tar</code> and <code>LUFA_YYMMDD_Code_Templates.tar</code> (where
|
||||
* "YYMMDD" is the version of the library being exported). The first archive contains the exported LUFA core
|
||||
* with the non-required files removed, while the second contains an archived copy of the code template files
|
||||
* for the current LUFA version.
|
||||
*
|
||||
* The resulting archived copy of the library may then be extracted to your chosen IDE project source directory
|
||||
* and imported according to the instructions shown in \ref Sec_LibraryImport.
|
||||
*
|
||||
* \section Sec_LibraryImport Importing the Library
|
||||
* An exported copy of the library may be imported wholesale into an IDE project, if the instructions detailed
|
||||
* in \ref Sec_LibraryExport are followed.
|
||||
*
|
||||
* Specific instructions for importing an exported version of LUFA into various IDEs are listed below.
|
||||
*
|
||||
* \subsection SSec_AS56_Import Importing into AVRStudio 5.x/Atmel Studio 6.0
|
||||
* To import LUFA into a new or existing project, the following steps must be followed.
|
||||
*
|
||||
* \subsubsection SSSec_AS56_Import_Step1 Copy over the exported library
|
||||
* Copy over the exported library archive created via the steps listed in \ref Sec_LibraryExport to your AS5/AS6
|
||||
* project directory.
|
||||
*
|
||||
* \image html Images/AS5_AS6_Import/AS5_AS6_Import_Step1.png
|
||||
*
|
||||
* \subsubsection SSSec_AS56_Import_Step2 Extract exported library
|
||||
* Extract out the contents of the archive to a new folder. This may be any name you wish, however keep in mind
|
||||
* that this name will need to be referenced within your user application under most circumstances. It is
|
||||
* suggested that this folder be named "LUFA", or "LUFA" followed by the version string for easy reference.
|
||||
*
|
||||
* \image html Images/AS5_AS6_Import/AS5_AS6_Import_Step2.png
|
||||
*
|
||||
* \subsubsection SSSec_AS56_Import_Step3 Add the library files
|
||||
* Open your AVRStudio 5/Atmel Studio 6 project. From the "Solution Explorer" pane, click the "Show All Files"
|
||||
* button on the toolbar to display ghosted icons of files and folders located in the project source directory
|
||||
* that are not currently added to the project.
|
||||
*
|
||||
* \image html Images/AS5_AS6_Import/AS5_AS6_Import_Step3.png
|
||||
*
|
||||
* Right-click the ghosted version of the extracted LUFA export folder in the Solution Explorer pane, and
|
||||
* choose the "Add to Project" option from the context menu. This will add the entire LUFA source tree to the
|
||||
* current project.
|
||||
*
|
||||
* \subsubsection SSSec_AS56_Import_Step4 Open Project Toolchain Properties
|
||||
* In the Solution Explorer pane, click the project node, and press the "Properties" button in the toolbar to
|
||||
* open the Project Properties window. This window allows you to configure the various project global compiler,
|
||||
* assembler and linker options.
|
||||
*
|
||||
* \image html Images/AS5_AS6_Import/AS5_AS6_Import_Step4.png
|
||||
*
|
||||
* Click the "Toolchain" tab on the left side of the Project Properties window.
|
||||
*
|
||||
* \subsubsection SSSec_AS56_Import_Step5 Configure Project Toolchain Properties
|
||||
*
|
||||
* In the GNU C Compiler section, open the "Symbols" page. Click the "Add Item" button to the top-right of the
|
||||
* "Defined Symbols" section to add new symbols.
|
||||
*
|
||||
* At a minimum, you will need to define the following symbols (for more information on these symbols, see
|
||||
* \ref Page_ConfiguringApps):
|
||||
* - ARCH
|
||||
* - F_CPU
|
||||
* - F_USB
|
||||
* - BOARD
|
||||
* \image html Images/AS5_AS6_Import/AS5_AS6_Import_Step5_1.png
|
||||
*
|
||||
* Next, open the GNU C Compiler section's "Optimization" page. Ensure that the option to prepare functions for
|
||||
* garbage collection is enabled.
|
||||
* \image html Images/AS5_AS6_Import/AS5_AS6_Import_Step5_2.png
|
||||
*
|
||||
* Finally, in the GNU C Linker section, open the "Optimization" page. Ensure that the option to garbage collect
|
||||
* unused sections is selected.
|
||||
* \image html Images/AS5_AS6_Import/AS5_AS6_Import_Step5_3.png
|
||||
*/
|
Before Width: | Height: | Size: 96 KiB |
Before Width: | Height: | Size: 98 KiB |
Before Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 158 KiB |
Before Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 23 KiB |