summaryrefslogtreecommitdiffstats
path: root/tmk_core/common/led.h
diff options
context:
space:
mode:
authorWilliam Chang <william@factual.com>2019-11-20 22:17:07 -0800
committerWilliam Chang <william@factual.com>2019-11-20 22:17:07 -0800
commite7f4d56592b3975c38af329e77b4efd9108495e8 (patch)
tree0a416bccbf70bfdbdb9ffcdb3bf136b47378c014 /tmk_core/common/led.h
parent71493b2f9bbd5f3d18373c518fa14ccafcbf48fc (diff)
parent8416a94ad27b3ff058576f09f35f0704a8b39ff3 (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'tmk_core/common/led.h')
-rw-r--r--tmk_core/common/led.h24
1 files changed, 18 insertions, 6 deletions
diff --git a/tmk_core/common/led.h b/tmk_core/common/led.h
index c16305129b..990282862b 100644
--- a/tmk_core/common/led.h
+++ b/tmk_core/common/led.h
@@ -18,21 +18,33 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef LED_H
#define LED_H
#include "stdint.h"
+#include "stdbool.h"
/* FIXME: Add doxygen comments here. */
/* keyboard LEDs */
-#define USB_LED_NUM_LOCK 0
-#define USB_LED_CAPS_LOCK 1
-#define USB_LED_SCROLL_LOCK 2
-#define USB_LED_COMPOSE 3
-#define USB_LED_KANA 4
-
+#define USB_LED_NUM_LOCK 0
+#define USB_LED_CAPS_LOCK 1
+#define USB_LED_SCROLL_LOCK 2
+#define USB_LED_COMPOSE 3
+#define USB_LED_KANA 4
#ifdef __cplusplus
extern "C" {
#endif
+typedef union {
+ uint8_t raw;
+ struct {
+ bool num_lock : 1;
+ bool caps_lock : 1;
+ bool scroll_lock : 1;
+ bool compose : 1;
+ bool kana : 1;
+ uint8_t reserved : 3;
+ };
+} led_t;
+
void led_set(uint8_t usb_led);
void led_init_ports(void);