underglow-layer: use behaviors to control RGBs

This commit is contained in:
darknao 2025-01-04 20:01:15 +01:00 committed by afiqzudinhadi
parent aa151f7473
commit f178f86a54
20 changed files with 352 additions and 26 deletions

View file

@ -19,6 +19,14 @@
zmk,battery = &vbatt;
};
underglow-layer {
compatible = "zmk,underglow-layer";
pixel-lookup = <52>, <53>, <54>, <69>, <70>, <71>, <15>, <27>, <39>, <51>, <4>, <14>, <26>, <38>,
<50>, <68>, <3>, <13>, <25>, <37>, <49>, <67>, <2>, <12>, <24>, <36>, <48>, <66>,
<1>, <11>, <23>, <35>, <47>, <65>, <0>, <10>, <22>, <34>, <46>, <64>;
};
back_led_backlight: pwmleds {
compatible = "pwm-leds";
pwm_led_0 {

View file

@ -16,16 +16,32 @@ CONFIG_USB_DEVICE_VID=0x16c0
CONFIG_USB_DEVICE_MANUFACTURER="MoErgo"
CONFIG_USB_DEVICE_SN="moergo.com:GLV80-0123456789ABCDEF"
CONFIG_BT_DEVICE_NAME="Glove80"
CONFIG_BT_DIS_PNP_PID=0x27db
CONFIG_BT_DIS_PNP_VID=0x16c0
CONFIG_BT_DIS_MANUF="MoErgo"
CONFIG_BT_DIS_MODEL="Glove80"
### Bluetooth configuration workarounds
# Use higher radio transmit power
CONFIG_BT_CTLR_TX_PWR_PLUS_8=y
# Work-around for Windows bug with battery notifications
CONFIG_BT_GATT_ENFORCE_SUBSCRIPTION=n
# Allow unauthenticated re-pairing for already paired hosts. This would permit
# an attacker that can spoof the host's peer address to "steal" the keyboard
# pairing by overwriting it, but without access to the previous keys it can't
# establish a MITM, and the sudden loss of the keyboard would be very obvious to
# the previously-connected host.
CONFIG_BT_SMP_ALLOW_UNAUTH_OVERWRITE=y
CONFIG_ZMK_BLE_PASSKEY_ENTRY=n
# Fetch peripheral battery level for status display reporting
CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_FETCHING=y
# Enable MPU
CONFIG_ARM_MPU=y
@ -51,6 +67,9 @@ CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=y
# Enable RGB underglow
CONFIG_ZMK_RGB_UNDERGLOW=y
# disable EXT_POWER until underglow gets turned on
CONFIG_ZMK_EXT_POWER_START=n
CONFIG_ZMK_RGB_UNDERGLOW_EXT_POWER=y
CONFIG_ZMK_RGB_UNDERGLOW_ON_START=n
CONFIG_ZMK_RGB_UNDERGLOW_BRT_STEP=4
@ -79,6 +98,13 @@ CONFIG_ZMK_BACKLIGHT_AUTO_OFF_USB=y
# space.
CONFIG_ZMK_HID_CONSUMER_REPORT_USAGES_BASIC=y
# Enable USB boot protocol support
CONFIG_ZMK_USB_BOOT=y
CONFIG_ZMK_HID_INDICATORS=y
# Send HID indicator to peripherals
CONFIG_ZMK_SPLIT_PERIPHERAL_HID_INDICATORS=y
# Turn on debugging to disable optimization. Debug messages can result in larger
# stacks, so enable stack protection and particularly a larger BLE peripheral stack.
# CONFIG_DEBUG=y

View file

@ -20,6 +20,14 @@
zmk,battery = &vbatt;
};
underglow-layer {
compatible = "zmk,underglow-layer";
pixel-lookup = <57>, <56>, <55>, <74>, <73>, <72>, <16>, <28>, <40>, <58>, <5>, <17>, <29>, <41>,
<59>, <75>, <6>, <18>, <30>, <42>, <60>, <76>, <7>, <19>, <31>, <43>, <61>, <77>,
<8>, <20>, <32>, <44>, <62>, <78>, <9>, <21>, <33>, <45>, <63>, <79>;
};
back_led_backlight: pwmleds {
compatible = "pwm-leds";
pwm_led_0 {

View file

@ -63,6 +63,10 @@ CONFIG_ZMK_RGB_UNDERGLOW_HUE_START=285
CONFIG_ZMK_RGB_UNDERGLOW_SAT_START=75
CONFIG_ZMK_RGB_UNDERGLOW_BRT_START=16
# Enable HID indicators on peripheral
CONFIG_ZMK_HID_INDICATORS=y
CONFIG_ZMK_SPLIT_PERIPHERAL_HID_INDICATORS=y
# The power LED is implemented as a backlight
# For now, the power LED is acting as a "USB connected" indicator
CONFIG_ZMK_BACKLIGHT=y