diff options
Diffstat (limited to 'quantum/led.h')
-rw-r--r-- | quantum/led.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/quantum/led.h b/quantum/led.h new file mode 100644 index 000000000..0fe38ea03 --- /dev/null +++ b/quantum/led.h | |||
@@ -0,0 +1,54 @@ | |||
1 | /* | ||
2 | Copyright 2011 Jun Wako <wakojun@gmail.com> | ||
3 | |||
4 | This program is free software: you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Public License as published by | ||
6 | the Free Software Foundation, either version 2 of the License, or | ||
7 | (at your option) any later version. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU General Public License | ||
15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | ||
17 | |||
18 | #pragma once | ||
19 | |||
20 | #include <stdint.h> | ||
21 | #include <stdbool.h> | ||
22 | |||
23 | /* FIXME: Add doxygen comments here. */ | ||
24 | |||
25 | /* keyboard LEDs */ | ||
26 | #define USB_LED_NUM_LOCK 0 | ||
27 | #define USB_LED_CAPS_LOCK 1 | ||
28 | #define USB_LED_SCROLL_LOCK 2 | ||
29 | #define USB_LED_COMPOSE 3 | ||
30 | #define USB_LED_KANA 4 | ||
31 | |||
32 | #ifdef __cplusplus | ||
33 | extern "C" { | ||
34 | #endif | ||
35 | |||
36 | typedef union { | ||
37 | uint8_t raw; | ||
38 | struct { | ||
39 | bool num_lock : 1; | ||
40 | bool caps_lock : 1; | ||
41 | bool scroll_lock : 1; | ||
42 | bool compose : 1; | ||
43 | bool kana : 1; | ||
44 | uint8_t reserved : 3; | ||
45 | }; | ||
46 | } led_t; | ||
47 | |||
48 | void led_set(uint8_t usb_led); | ||
49 | |||
50 | void led_init_ports(void); | ||
51 | |||
52 | #ifdef __cplusplus | ||
53 | } | ||
54 | #endif | ||