mirror of
https://github.com/zmkfirmware/zmk.git
synced 2026-04-16 18:16:56 -05:00
This adds a new zmk,indicator-leds device, which maps HID indicator states onto any devices that implement the LED driver API. This adds support for things like a caps lock LED. The name was chosen so that more drivers could be added later as zmk,indicator-*, for example a version that uses the LED strip API.
19 lines
726 B
C
19 lines
726 B
C
/*
|
|
* Copyright (c) 2026 The ZMK Contributors
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <dt-bindings/zmk/hid_usage.h>
|
|
|
|
// hid.h defines HID_USAGE_LED_NUM_LOCK as the minimum value, so that is bit
|
|
// zero in the report, and all other indicators are relative to that.
|
|
|
|
#define HID_INDICATOR_NUM_LOCK (1 << (HID_USAGE_LED_NUM_LOCK - HID_USAGE_LED_NUM_LOCK))
|
|
#define HID_INDICATOR_CAPS_LOCK (1 << (HID_USAGE_LED_CAPS_LOCK - HID_USAGE_LED_NUM_LOCK))
|
|
#define HID_INDICATOR_SCROLL_LOCK (1 << (HID_USAGE_LED_SCROLL_LOCK - HID_USAGE_LED_NUM_LOCK))
|
|
#define HID_INDICATOR_COMPOSE (1 << (HID_USAGE_LED_COMPOSE - HID_USAGE_LED_NUM_LOCK))
|
|
#define HID_INDICATOR_KANA (1 << (HID_USAGE_LED_KANA - HID_USAGE_LED_NUM_LOCK))
|