]> git.gir.st - tmk_keyboard.git/blob - protocol/lufa/LUFA-git/LUFA/DoxygenPages/WritingBoardDrivers.txt
Squashed 'tmk_core/' changes from caca2c0..dc0e46e
[tmk_keyboard.git] / protocol / lufa / LUFA-git / LUFA / DoxygenPages / WritingBoardDrivers.txt
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_WritingBoardDrivers Writing LUFA Board Drivers
8 *
9 * LUFA ships with several basic pre-made board drivers, to control hardware present on the supported board
10 * hardware - such as Dataflash ICs, LEDs, Joysticks, or other hardware peripherals. When compiling an application
11 * which makes use of one or more board drivers located in <i>LUFA/Drivers/Board</i>, you must also indicate which
12 * board hardware you are using in your project makefile. This is done by defining the <tt>BOARD</tt> macro using
13 * the <tt>-D</tt> switch passed to the compiler, with a constant of <tt>BOARD_{Name}</tt>. For example,
14 * <tt>-DBOARD=BOARD_USBKEY</tt> instructs the compiler to use the USBKEY board hardware drivers.
15 *
16 * If your application does not use <i>any</i> board level drivers, you can omit the definition of the <tt>BOARD</tt>
17 * macro. However, some users may wish to write their own custom board hardware drivers which are to remain compatible
18 * with the LUFA hardware API. To do this, the <tt>BOARD</tt> macro should be defined to the value <tt>BOARD_USER</tt>.
19 * This indicates that the board level drivers should be located in a folder named "Board" located inside the
20 * application's folder.
21 *
22 * When used, the driver stub files located in the <tt>LUFA/CodeTemplates/DriverStubs</tt> folder should be copied to
23 * the user application's <tt>Board/</tt> directory, and filled out to include the values and code needed to control
24 * the custom board hardware. Once done, the existing LUFA board level APIs (accessed in the regular
25 * <tt>LUFA/Drivers/Board/</tt> folder) will redirect to the user board drivers, maintaining code compatibility and
26 * allowing for a different board to be selected through the project makefile with no code changes.
27 *
28 * \section Sec_BoardTemplates Board Driver Templates
29 *
30 * The templates for each board driver are reproduced below.
31 *
32 * \subsection SSec_BoardTemplates_Board Template for USER <Board/Board.h>
33 * \include "DriverStubs/Board.h"
34 *
35 * \subsection SSec_BoardTemplates_Buttons Template for USER <Board/Buttons.h>
36 * \include "DriverStubs/Buttons.h"
37 *
38 * \subsection SSec_BoardTemplates_Dataflash Template for USER <Board/Dataflash.h>
39 * \include "DriverStubs/Dataflash.h"
40 *
41 * \subsection SSec_BoardTemplates_Joystick Template for USER <Board/Joystick.h>
42 * \include "DriverStubs/Joystick.h"
43 *
44 * \subsection SSec_BoardTemplates_LEDs Template for USER <Board/LEDs.h>
45 * \include "DriverStubs/LEDs.h"
46 */
47
Imprint / Impressum