Statistics
| Branch: | Tag: | Revision:

root / LUFA / ManPages / ConfiguringApps.txt @ 978b99e5

History | View | Annotate | Download (6.67 KB)

1
/** \file
2
 *
3
 *  This file contains special DoxyGen information for the generation of the main page and other special
4
 *  documentation pages. It is not a project source file.
5
 */
6

    
7
/** \page Page_ConfiguringApps Configuring the Demos, Bootloaders and Projects
8
 *
9
 *  If the target microcontroller model, architecture, clock speed, board or other settings are different from the current
10
 *  settings, they must be changed and the project recompiled from the source code before being programmed into the microcontroller.
11
 *  Most project configuration options are located in the "makefile" build script inside each LUFA application's folder, however
12
 *  some demo or application-specific configuration settings (such as the output format in the AudioOut demo) are located in one or
13
 *  more of the source files of the project. See each project's individual documentation for application-specific configuration
14
 *  values.
15
 *
16
 *  Each project "makefile" contains all the script and configuration data required to compile each project. When opened with
17
 *  any regular basic text editor such as Notepad or WordPad (ensure that the save format is a pure ASCII text format) the
18
 *  build configuration settings may be altered.
19
 *
20
 *  Inside each makefile, a number of configuration variables are located, with the format "<VARIABLE NAME> = <VALUE>". For
21
 *  each application, the important variables which should be altered are:
22
 *
23
 *    - <b>MCU</b>, the target processor model
24
 *    - <b>ARCH</b>, the target microcontroller architecture
25
 *    - <b>BOARD</b>, the target board hardware
26
 *    - <b>F_CPU</b>, the target CPU master clock frequency, after any prescaling
27
 *    - <b>F_USB</b>, the target raw input clock to the USB module of the processor
28
 *    - <b>CDEFS</b>, the C preprocessor defines which configure options the source code
29
 *    - <b>LUFA_PATH</b>, the path to the LUFA library source code
30
 *    - <b>LUFA_OPTS</b>, the compile time LUFA options which configure the library features
31
 *
32
 *  These values should be changed to reflect the build hardware.
33
 *
34
 *  \section Sec_MCU The MCU Parameter
35
 *  This parameter indicates the target microcontroller model for the compiled application. This should be set to the model of the target
36
 *  microcontroller (such as the AT90USB1287, or the ATMEGA32U4), in all lower-case (e.g. "at90usb1287"). Note that not all demos support all the
37
 *  microcontroller models and architectures, as they may make use of peripherals or modes only present in some devices.
38
 *
39
 *  For supported processor models, see \ref Page_DeviceSupport.
40
 *
41
 *  \section Sec_ARCH The ARCH Parameter
42
 *  This parameter indicates the target microcontroller architecture the library is to be compiled for. Different microcontroller
43
 *  architectures require different source files to be compiled into the final binary, and so this option must be set to the correct
44
 *  architecture for the selected platform.
45
 *
46
 *  For supported processor architectures, see \ref Page_DeviceSupport.
47
 *
48
 *  \section Sec_BOARD The BOARD Parameter
49
 *  This parameter indicates the target board hardware for the compiled application. Some LUFA library drivers are board-specific,
50
 *  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
51
 *  on the main library page, change this parameter to the board name in all UPPER-case.
52
 *
53
 *  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
54
 *  "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
55
 *  board-specific hardware drivers inside the LUFA library, then the appropriate stub drives files should be copied from the /BoardStubs/
56
 *  directory into a /Board/ folder inside the application directory, and the stub driver completed with the appropriate code to drive the
57
 *  custom board's hardware.
58
 *
59
 *  For boards with built in hardware driver support within the LUFA library, see \ref Page_DeviceSupport.
60
 *
61
 *  \section Sec_F_CPU The F_CPU Parameter
62
 *  This parameter indicates the target microcontroller's main CPU clock frequency, in Hz. This is used by many libraries (and applications) for
63
 *  timing related purposes, and should reflect the actual CPU speed after any prescaling or adjustments are performed.
64
 *
65
 *  \section Sec_F_USB The F_USB Parameter
66
 *  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
67
 *  to the main CPU clock or other peripheral/bus clocks.
68
 *
69
 *  \section Sec_CDEFS The CDEFS Parameter
70
 *  Many applications have features which can be controlled by the defining of specially named preprocessor tokens at the point of compilation - for example,
71
 *  an application might use a compile time token to turn on or off optional or mutually exclusive portions of code. Preprocessor tokens can be
72
 *  defined here by listing each one with the -D command line switch, and each token can optionally be defined to a specific value. When defined in the
73
 *  project makefile, these behave as if they were defined in every source file via a normal preprocessor define statement.
74
 *
75
 *  Most applications will actually have multiple CDEF lines, which are concatenated together with the "+=" operator. This ensures that large
76
 *  numbers of configuration options remain readable by splitting up groups of options into separate lines.
77
 *
78
 *  \section Sec_LUFA_PATH The LUFA_PATH Parameter
79
 *  As each LUFA program requires the LUFA library source code to compile correctly, the application must know where the LUFA library is located. This
80
 *  value specifies the path to the LUFA library base relative to the path of the project makefile.
81
 *
82
 *  \section Sec_LUFA_OPTS The LUFA_OPTS Parameter
83
 *  This value is similar to the CDEFS parameter listed elsewhere -- indeed, it is simply a convenient place to group LUFA related tokens away from the
84
 *  application's compile time tokens. Normally, these options do not need to be altered to allow an application to compile and run correctly on a
85
 *  different board or microcontroller to the current configuration - if the options are incorrect, then the demo is most likely incompatible with the chosen
86
 *  microcontroller model and cannot be made to function through the altering of the makefile settings alone (or at all). Settings such as the USB mode
87
 *  (device, host or both), the USB interface speed and other LUFA configuration options can be set here - see \ref Page_TokenSummary documentation for details
88
 *  on the available LUFA compile time configuration options.
89
 */