]> git.gir.st - tmk_keyboard.git/blob - protocol/lufa/LUFA-120730/LUFA/CodeTemplates/DriverStubs/LEDs.h
Squashed 'tmk_core/' content from commit 05caacc
[tmk_keyboard.git] / protocol / lufa / LUFA-120730 / LUFA / CodeTemplates / DriverStubs / LEDs.h
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2012.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaim all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
31 /** \file
32 * \brief LUFA Custom Board LED Hardware Driver (Template)
33 *
34 * This is a stub driver header file, for implementing custom board
35 * layout hardware with compatible LUFA board specific drivers. If
36 * the library is configured to use the BOARD_USER board mode, this
37 * driver file should be completed and copied into the "/Board/" folder
38 * inside the application's folder.
39 *
40 * This stub is for the board-specific component of the LUFA LEDs driver,
41 * for the LEDs (up to four) mounted on most development boards.
42 */
43
44 #ifndef __LEDS_USER_H__
45 #define __LEDS_USER_H__
46
47 /* Includes: */
48 // TODO: Add any required includes here
49
50 /* Enable C linkage for C++ Compilers: */
51 #if defined(__cplusplus)
52 extern "C" {
53 #endif
54
55 /* Preprocessor Checks: */
56 #if !defined(__INCLUDE_FROM_LEDS_H)
57 #error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead.
58 #endif
59
60 /* Public Interface - May be used in end-application: */
61 /* Macros: */
62 /** LED mask for the first LED on the board. */
63 #define LEDS_LED1 // TODO: Add mask for first board LED here
64
65 /** LED mask for the second LED on the board. */
66 #define LEDS_LED2 // TODO: Add mask for second board LED here
67
68 /** LED mask for the third LED on the board. */
69 #define LEDS_LED3 // TODO: Add mask for third board LED here
70
71 /** LED mask for the fourth LED on the board. */
72 #define LEDS_LED4 // TODO: Add mask for fourth board LED here
73
74 /** LED mask for all the LEDs on the board. */
75 #define LEDS_ALL_LEDS (LEDS_LED1 | LEDS_LED2 | LEDS_LED3 | LEDS_LED4)
76
77 /** LED mask for none of the board LEDs. */
78 #define LEDS_NO_LEDS 0
79
80 /* Inline Functions: */
81 #if !defined(__DOXYGEN__)
82 static inline void LEDs_Init(void)
83 {
84 // TODO: Add code to initialize LED port pins as outputs here
85 }
86
87 static inline void LEDs_Disable(void)
88 {
89 // TODO: Clear the LED port pins as high impedance inputs here
90 }
91
92 static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)
93 {
94 // TODO: Add code to turn on LEDs given in the LEDMask mask here, leave others as-is
95 }
96
97 static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask)
98 {
99 // TODO: Add code to turn off LEDs given in the LEDMask mask here, leave others as-is
100 }
101
102 static inline void LEDs_SetAllLEDs(const uint8_t LEDMask)
103 {
104 // TODO: Add code to turn on only LEDs given in the LEDMask mask here, all others off
105 }
106
107 static inline void LEDs_ChangeLEDs(const uint8_t LEDMask, const uint8_t ActiveMask)
108 {
109 // TODO: Add code to set the Leds in the given LEDMask to the status given in ActiveMask here
110 }
111
112 static inline void LEDs_ToggleLEDs(const uint8_t LEDMask)
113 {
114 // TODO: Add code to toggle the Leds in the given LEDMask, ignoring all others
115 }
116
117 static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
118 static inline uint8_t LEDs_GetLEDs(void)
119 {
120 // TODO: Add code to return the current LEDs status' here which can be masked against LED_LED* macros
121 }
122 #endif
123
124 /* Disable C linkage for C++ Compilers: */
125 #if defined(__cplusplus)
126 }
127 #endif
128
129 #endif
130
Imprint / Impressum