]> git.donarmstrong.com Git - qmk_firmware.git/blob - protocol/lufa/LUFA-120730/LUFA/DoxygenPages/ConfiguringApps.txt
Change TOP_DIR to TMK_DIR in makefiles
[qmk_firmware.git] / protocol / lufa / LUFA-120730 / LUFA / DoxygenPages / ConfiguringApps.txt
1 /** \file\r
2  *\r
3  *  This file contains special DoxyGen information for the generation of the main page and other special\r
4  *  documentation pages. It is not a project source file.\r
5  */\r
6 \r
7 /** \page Page_ConfiguringApps Configuring the Demos, Bootloaders and Projects\r
8  *\r
9  *  If the target microcontroller model, architecture, clock speed, board or other settings are different from the current\r
10  *  settings, they must be changed and the project recompiled from the source code before being programmed into the microcontroller.\r
11  *  Most project configuration options are located in the <tt>makefile</tt> build script inside each LUFA application's folder,\r
12  *  however some demo or application-specific configuration settings are located in one or more of the source files of the project.\r
13  *  See each project's individual documentation for application-specific configuration values.\r
14  *\r
15  *  Each project "makefile" contains all the script and configuration data required to compile each project. When opened with\r
16  *  any regular basic text editor such as Notepad or WordPad (ensure that the save format is a pure ASCII text format) the\r
17  *  build configuration settings may be altered.\r
18  *\r
19  *  \see \ref Page_BuildSystem for information on the LUFA build system.\r
20  *\r
21  *  \section Sec_AppConfigParams The Default Application Template\r
22  *\r
23  *  Below is a copy of the default LUFA application makefile, which can be used as a template for each application.\r
24  *\r
25  *  \verbinclude makefile_template\r
26  *\r
27  *  Inside each makefile, a number of configuration variables are listed with the syntax "<VARIABLE NAME> = <VALUE>". For\r
28  *  each application, the important standard variables which should be altered are:\r
29  *\r
30  *    - <b>MCU</b>, the target processor model\r
31  *    - <b>ARCH</b>, the target microcontroller architecture\r
32  *    - <b>BOARD</b>, the target board hardware\r
33  *    - <b>F_CPU</b>, the target CPU master clock frequency, after any prescaling\r
34  *    - <b>F_USB</b>, the target raw input clock to the USB module of the processor\r
35  *    - <b>OPTIMIZATION</b>, the level of optimization to compile with\r
36  *    - <b>TARGET</b>, the name of the target output binary and other files\r
37  *    - <b>SRC</b>, the list of source files to compile/assemble/link\r
38  *    - <b>LUFA_PATH</b>, the path to the LUFA library core source code\r
39  *    - <b>CC_FLAGS</b>, the common command line flags to pass to the C/C++ compiler, assembler and linker\r
40  *    - <b>LD_FLAGS</b>, the command line flags to pass to the linker\r
41  *\r
42  *  These values should be changed to reflect the build hardware.\r
43  *\r
44  *  \subsection SSec_MCU The MCU Parameter\r
45  *  This parameter indicates the target microcontroller model for the compiled application. This should be set to the model of the target\r
46  *  microcontroller (such as the AT90USB1287, or the ATMEGA32U4), in all lower-case (e.g. "at90usb1287"). Note that not all demos support all the\r
47  *  microcontroller models and architectures, as they may make use of peripherals or modes only present in some devices.\r
48  *\r
49  *  For supported processor models, see \ref Page_DeviceSupport.\r
50  *\r
51  *  \subsection SSec_ARCH The ARCH Parameter\r
52  *  This parameter indicates the target microcontroller architecture the library is to be compiled for. Different microcontroller\r
53  *  architectures require different source files to be compiled into the final binary, and so this option must be set to the correct\r
54  *  architecture for the selected platform.\r
55  *\r
56  *  For supported processor architectures, see \ref Page_DeviceSupport.\r
57  *\r
58  *  \subsection SSec_BOARD The BOARD Parameter\r
59  *  This parameter indicates the target board hardware for the compiled application. Some LUFA library drivers are board-specific,\r
60  *  such as the LED driver, and the library needs to know the layout of the target board. If you are using one of the board models listed\r
61  *  on the main library page, change this parameter to the board name in all UPPER-case.\r
62  *\r
63  *  If you are not using any board-specific drivers in the LUFA library, or you are using a custom board layout, change this to read\r
64  *  "USER" (no quotes) instead of a standard board name. If the USER board type is selected and the application makes use of one or more\r
65  *  board-specific hardware drivers inside the LUFA library, then the appropriate stub drives files should be copied from the \c /CodeTemplates/DriverStubs/\r
66  *  directory into a /Board/ folder inside the application directory, and the stub driver completed with the appropriate code to drive the\r
67  *  custom board's hardware.\r
68  *\r
69  *  For boards with built in hardware driver support within the LUFA library, see \ref Page_DeviceSupport.\r
70  *\r
71  *  \subsection SSec_F_CPU The F_CPU Parameter\r
72  *  This parameter indicates the target microcontroller's main CPU clock frequency, in Hz. This is used by many libraries (and applications) for\r
73  *  timing related purposes, and should reflect the actual CPU speed after any prescaling or adjustments are performed.\r
74  *\r
75  *  \subsection SSec_F_USB The F_USB Parameter\r
76  *  This parameter indicates the raw input clock frequency to the USB module within the microcontroller in Hz. This may be very different on some platforms\r
77  *  to the main CPU clock or other peripheral/bus clocks.\r
78  *\r
79  *  \subsection SSec_OPTIMIZATION The OPTIMIZATION Parameter\r
80  *  This parameter indicates the level of optimization to use when compiling the application. This will allow you to compile with an optimization level\r
81  *  supported by GCC, from <tt>0</tt> (no optimization) to <tt>3</tt> (fastest runtime optimization) or <tt>s</tt> (smallest size).\r
82  *\r
83  *  \subsection SSec_TARGET The TARGET Parameter\r
84  *  This parameter indicates the application target name, which is used as the base filename for the build binary and debugging files. This will be the\r
85  *  name of the output files once linked together into the final application, ready to load into the target.\r
86  *\r
87  *  \subsection SSec_SRC The SRC Parameter\r
88  *  This parameter indicates the source files used to compile the application, as a list of C (<tt>*.c</tt>), C++ (<tt>*.cpp</tt>) and Assembly (<tt>*.S</tt>) files. Note that\r
89  *  all assembly files must end in a <b>capital</b> .S extension, as lowercase .s files are reserved for GCC intermediate files.\r
90  *\r
91  *  \subsection SSec_LUFA_PATH The LUFA_PATH Parameter\r
92  *  As each LUFA program requires the LUFA library source code to compile correctly, the application must know where the LUFA library is located. This\r
93  *  value specifies the path to the LUFA library core. This path may be relative or absolute, however note than even under Windows based systems the\r
94  *  forward-slash (/) path seperator must be used.\r
95  *\r
96  *  \subsection SSec_CC_FLAGS The CC_FLAGS Parameter\r
97  *  This parameter lists the compiler flags passed to the C/C++ compiler, the assembler and the linker. These are used as-is directly to GCC and thus\r
98  *  must match GCC's command line options as given in the GCC manual. This variable may be used to define tokens directly on the command line, enable or\r
99  *  disable warnings, adjust the target-specific tuning parameters or other options.\r
100  *\r
101  *  \subsection SSec_LD_FLAGS The LD_FLAGS Parameter\r
102  *  This parameter lists the linker flags passed exclusively to the linker. These are used as-is directly to GCC and thus must match GCC's command line\r
103  *  linker options as given in the GCC manual. This variable may be used to create or relocate custom data sections, or enable linker specific behaviors.\r
104  */\r