Move RGBLIGHT_LED_MAP
to data driven (#21095)
This commit is contained in:
@ -117,6 +117,7 @@
|
||||
"RGBLIGHT_LAYER_BLINK": {"info_key": "rgblight.layers.blink", "value_type": "bool"},
|
||||
"RGBLIGHT_LAYERS": {"info_key": "rgblight.layers.enabled", "value_type": "bool"},
|
||||
"RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF": {"info_key": "rgblight.layers.override_rgb", "value_type": "bool"},
|
||||
"RGBLIGHT_LED_MAP": {"info_key": "rgblight.led_map", "value_type": "array.int"},
|
||||
"RGBLIGHT_LIMIT_VAL": {"info_key": "rgblight.max_brightness", "value_type": "int"},
|
||||
"RGBLIGHT_MAX_LAYERS": {"info_key": "rgblight.layers.max", "value_type": "int"},
|
||||
"RGBLIGHT_SAT_STEP": {"info_key": "rgblight.saturation_steps", "value_type": "int"},
|
||||
|
@ -491,6 +491,11 @@
|
||||
}
|
||||
},
|
||||
"led_count": {"$ref": "qmk.definitions.v1#/unsigned_int"},
|
||||
"led_map": {
|
||||
"type": "array",
|
||||
"minItems": 2,
|
||||
"items": {"$ref": "qmk.definitions.v1#/unsigned_int"}
|
||||
},
|
||||
"max_brightness": {"$ref": "qmk.definitions.v1#/unsigned_int_8"},
|
||||
"pin": {
|
||||
"$ref": "qmk.definitions.v1#/mcu_pin",
|
||||
|
@ -524,37 +524,6 @@ By defining `RGBLIGHT_LED_MAP` as in the example below, you can specify the LED
|
||||
```
|
||||
<img src="https://user-images.githubusercontent.com/2170248/55743725-08ad7a80-5a6e-11e9-83ed-126a2b0209fc.JPG" alt="simple mapped" width="50%"/>
|
||||
|
||||
For keyboards that use the RGB LEDs as a backlight for each key, you can also define it as in the example below.
|
||||
|
||||
```c
|
||||
// config.h
|
||||
|
||||
#define RGBLED_NUM 30
|
||||
|
||||
/* RGB LED Conversion macro from physical array to electric array */
|
||||
#define LED_LAYOUT( \
|
||||
L00, L01, L02, L03, L04, L05, \
|
||||
L10, L11, L12, L13, L14, L15, \
|
||||
L20, L21, L22, L23, L24, L25, \
|
||||
L30, L31, L32, L33, L34, L35, \
|
||||
L40, L41, L42, L43, L44, L45 ) \
|
||||
{ \
|
||||
L05, L04, L03, L02, L01, L00, \
|
||||
L10, L11, L12, L13, L14, L15, \
|
||||
L25, L24, L23, L22, L21, L20, \
|
||||
L30, L31, L32, L33, L34, L35, \
|
||||
L46, L45, L44, L43, L42, L41 \
|
||||
}
|
||||
|
||||
/* RGB LED logical order map */
|
||||
/* Top->Bottom, Right->Left */
|
||||
#define RGBLIGHT_LED_MAP LED_LAYOUT( \
|
||||
25, 20, 15, 10, 5, 0, \
|
||||
26, 21, 16, 11, 6, 1, \
|
||||
27, 22, 17, 12, 7, 2, \
|
||||
28, 23, 18, 13, 8, 3, \
|
||||
29, 24, 19, 14, 9, 4 )
|
||||
|
||||
```
|
||||
## Clipping Range
|
||||
|
||||
|
@ -34,7 +34,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#ifdef RGBLED_CONT
|
||||
#define RGBLED_NUM 60
|
||||
#define RGBLED_SPLIT { 30, 30 }
|
||||
// #define RGBLIGHT_LED_MAP {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29}
|
||||
#else
|
||||
#define RGBLED_NUM 30
|
||||
#endif
|
||||
|
@ -34,7 +34,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#ifdef RGBLED_CONT
|
||||
#define RGBLED_NUM 60
|
||||
#define RGBLED_SPLIT { 30, 30 }
|
||||
// #define RGBLIGHT_LED_MAP {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29}
|
||||
#else
|
||||
#define RGBLED_NUM 30
|
||||
#endif
|
||||
|
@ -21,29 +21,6 @@
|
||||
# define RGBLIGHT_EFFECT_KNIGHT
|
||||
# define RGBLIGHT_EFFECT_SNAKE
|
||||
# define RGBLIGHT_EFFECT_CHRISTMAS
|
||||
|
||||
|
||||
// RGB LED Conversion macro from physical array to electric array. This results in better looking animated effects.
|
||||
# define LED_LAYOUT( \
|
||||
/* LED matrix */ \
|
||||
L01, L02, L03, L04, L05, L06, L011, L012, L013, L014, L015, L016, \
|
||||
L11, L12, L13, L14, L15, L16, L111, L112, L113, L114, L115, L116, \
|
||||
L20, L21, L22, L23, L24, L25, L26, L211, L212, L213, L214, L215, L216, L217, \
|
||||
L31, L32, L33, L34, L35, L36, L37, L38, L39, L310, L311, L312, L313, L314, L315, L316, \
|
||||
L44, L45, L46, L47, L48, L49, L410, L411, L412, L413 )\
|
||||
{ \
|
||||
/* left half - electrical wiring order */ \
|
||||
L47,L48,L38,L37,L36,L26,L16,L06,L05,L15,L25,L35,L46,L45,L34,L24,L14,L04,L03,L13,L23,L33,L44,L32,L22,L12,L02,L01,L11,L21,L31,L20, \
|
||||
/* right half - electrical wiring order */ \
|
||||
L410,L49,L39,L310,L311,L211,L111,L011,L012,L112,L212,L312,L411,L412,L313,L213,L113,L013,L014,L114,L214,L314,L413,L315,L215,L115,L015,L016,L116,L216,L316,L217 \
|
||||
}
|
||||
# define RGBLIGHT_LED_MAP LED_LAYOUT( \
|
||||
/* animation order. */ \
|
||||
4, 8, 12, 17, 22, 27, 40, 45, 50, 54, 58, 62, \
|
||||
3, 7, 11, 16, 21, 26, 39, 44, 49, 53, 57, 61, \
|
||||
0, 2, 6, 10, 15, 20, 25, 38, 43, 48, 52, 56, 60, 63, \
|
||||
1, 5, 9, 14, 19, 24, 29, 31, 33, 35, 37, 42, 47, 51, 55, 59, \
|
||||
13, 18, 23, 28, 30, 32, 34, 36, 41, 46 )
|
||||
#endif
|
||||
|
||||
#ifdef OLED_ENABLE
|
||||
|
@ -26,6 +26,7 @@
|
||||
},
|
||||
"rgblight": {
|
||||
"max_brightness": 100,
|
||||
"led_map": [28, 30, 31, 29, 24, 25, 26, 27, 22, 21, 20, 19, 23, 18, 14, 15, 16, 17, 12, 11, 10, 9, 13, 5, 6, 7, 8, 4, 3, 2, 1, 0, 34, 32, 33, 35, 37, 38, 39, 40, 45, 44, 43, 42, 36, 41, 47, 48, 49, 50, 54, 53, 52, 51, 46, 55, 56, 57, 58, 62, 61, 60, 59, 63],
|
||||
"split_count": [32, 32]
|
||||
},
|
||||
"processor": "atmega32u4",
|
||||
|
@ -49,7 +49,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define RGBLIGHT_EFFECT_RGB_TEST
|
||||
#define RGBLIGHT_EFFECT_ALTERNATING
|
||||
#define RGBLIGHT_EFFECT_TWINKLE
|
||||
#define RGBLIGHT_LED_MAP { 0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 5 }
|
||||
|
||||
/* COL2ROW, ROW2COL*/
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
@ -12,6 +12,9 @@
|
||||
"caps_lock": "B2",
|
||||
"num_lock": "B3"
|
||||
},
|
||||
"rgblight": {
|
||||
"led_map": [0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 5]
|
||||
},
|
||||
"ws2812": {
|
||||
"pin": "E6"
|
||||
},
|
||||
|
@ -29,7 +29,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# define RGBLIGHT_EFFECT_TWINKLE
|
||||
# define RGBLIGHT_DEFAULT_MODE RGBLIGHT_MODE_RAINBOW_SWIRL + 5
|
||||
# define RGBLED_NUM 12
|
||||
# define RGBLIGHT_LED_MAP { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }
|
||||
# define RGBLIGHT_HUE_STEP 8
|
||||
# define RGBLIGHT_SAT_STEP 8
|
||||
# define RGBLIGHT_VAL_STEP 8
|
||||
|
@ -18,14 +18,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#pragma once
|
||||
|
||||
#define RGBLED_NUM 33
|
||||
#define RGBLIGHT_LED_MAP { \
|
||||
0, 1, 2, 3, \
|
||||
7, 6, 5, 4, \
|
||||
8, 9, 10, 11, \
|
||||
15, 14, 13, 12, \
|
||||
16, 17, 18, 19, \
|
||||
22, 21, 20, \
|
||||
25, 24, 23, 26, 27, 28, 29, 30, 31, 32 }
|
||||
#define RGBLIGHT_HUE_STEP 8
|
||||
#define RGBLIGHT_SAT_STEP 8
|
||||
#define RGBLIGHT_VAL_STEP 8
|
||||
|
@ -12,7 +12,8 @@
|
||||
"pin": "C6"
|
||||
},
|
||||
"rgblight": {
|
||||
"max_brightness": 32
|
||||
"max_brightness": 32,
|
||||
"led_map": [0, 1, 2, 3, 7, 6, 5, 4, 8, 9, 10, 11, 15, 14, 13, 12, 16, 17, 18, 19, 22, 21, 20, 25, 24, 23, 26, 27, 28, 29, 30, 31, 32]
|
||||
},
|
||||
"matrix_pins": {
|
||||
"cols": ["C7", "D6", "B3", "B0", "B1"],
|
||||
|
@ -1,5 +0,0 @@
|
||||
// Copyright 2023 Massdrop, Inc.
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
#pragma once
|
||||
|
||||
#define RGBLIGHT_LED_MAP {4, 0, 1, 2, 3}
|
@ -25,6 +25,7 @@
|
||||
"diode_direction": "ROW2COL",
|
||||
"rgblight": {
|
||||
"led_count": 5,
|
||||
"led_map": [4, 0, 1, 2, 3],
|
||||
"sleep": true,
|
||||
"animations": {
|
||||
"alternating": true,
|
||||
|
@ -139,25 +139,3 @@ typedef union {
|
||||
} keyboard_config_t;
|
||||
|
||||
extern keyboard_config_t keyboard_config;
|
||||
|
||||
/* ---- LEFT HAND ---- ---- RIGHT HAND ---- */
|
||||
#define LED_LAYOUT_ergodox_pretty( \
|
||||
L01,L02,L03,L04,L05, R01,R02,R03,R04,R05, \
|
||||
L11,L12,L13,L14,L15, R11,R12,R13,R14,R15, \
|
||||
L21,L22,L23,L24,L25, R21,R22,R23,R24,R25, \
|
||||
L31,L32,L33,L34,L35, R31,R32,R33,R34,R35, \
|
||||
L41,L42,L43,L44, R42,R43,R44,R45 ) \
|
||||
\
|
||||
/* matrix positions */ \
|
||||
{ R01, R02, R03, R04, R05, \
|
||||
R11, R12, R13, R14, R15, \
|
||||
R21, R22, R23, R24, R25, \
|
||||
R31, R32, R33, R34, R35, \
|
||||
R42, R43, R44, R45, \
|
||||
\
|
||||
L05, L04, L03, L02, L01, \
|
||||
L15, L14, L13, L12, L11, \
|
||||
L25, L24, L23, L22, L21, \
|
||||
L35, L34, L33, L32, L31, \
|
||||
L44, L43, L42, L41 \
|
||||
}
|
||||
|
@ -30,7 +30,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/* ws2812 RGB LED */
|
||||
#define RGBLED_NUM 16
|
||||
#define RGBLIGHT_LED_MAP { 0, 1, 2, 3, 4, 5, 6, 7, 15, 14, 13, 12, 11, 10, 9, 8}
|
||||
#define RGBLIGHT_SPLIT
|
||||
#define RGBLIGHT_EFFECT_BREATHING
|
||||
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
|
||||
|
@ -19,6 +19,7 @@
|
||||
]
|
||||
},
|
||||
"rgblight": {
|
||||
"led_map": [0, 1, 2, 3, 4, 5, 6, 7, 15, 14, 13, 12, 11, 10, 9, 8],
|
||||
"split_count": [8, 8]
|
||||
},
|
||||
"ws2812": {
|
||||
|
@ -41,28 +41,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
// By default, LEDs of the buttons which are pressed turn on.
|
||||
// # define RGBLIGHT_EFFECT_TWINKLE
|
||||
// # define RGBLIGHT_EFFECT_KNIGHT
|
||||
|
||||
|
||||
// RGBLIGHT LED MAP
|
||||
// Right 1st row (12 LEDs)
|
||||
// ENCODER
|
||||
// Right 2nd .. 5th row(13, 12, 13, 12 LEDs)
|
||||
// Left 1st .. 5th row (12 LEDs x 5 rows)
|
||||
|
||||
# define RGBLIGHT_LED_MAP { \
|
||||
60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, \
|
||||
97, \
|
||||
84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, \
|
||||
85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, \
|
||||
110, 109, 108, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98, \
|
||||
111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, \
|
||||
\
|
||||
11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, \
|
||||
12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, \
|
||||
35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, \
|
||||
36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, \
|
||||
59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48 \
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
|
@ -12,7 +12,8 @@
|
||||
"driver": "WS2812"
|
||||
},
|
||||
"rgblight": {
|
||||
"max_brightness": 80
|
||||
"max_brightness": 80,
|
||||
"led_map": [60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 97, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 110, 109, 108, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48]
|
||||
},
|
||||
"matrix_pins": {
|
||||
"cols": ["B1", "F7", "F6", "F5", "F4", "B3", "B2", "B6", "D0", "D1"],
|
||||
|
@ -21,8 +21,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#if !defined(RGBLED_NUM)
|
||||
# define RGBLED_NUM 30
|
||||
# define RGBLIGHT_SPLIT
|
||||
// Switch RGB sides with LED MAP.
|
||||
# define RGBLIGHT_LED_MAP { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30}
|
||||
# define RGBLIGHT_LAYERS
|
||||
#endif
|
||||
#define RGBLIGHT_EFFECT_BREATHING
|
||||
|
@ -17,6 +17,7 @@
|
||||
"soft_serial_pin": "D0"
|
||||
},
|
||||
"rgblight": {
|
||||
"led_map": [15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30],
|
||||
"split_count": [16, 14]
|
||||
},
|
||||
"ws2812": {
|
||||
|
@ -23,7 +23,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define WS2812_DMA_STREAM STM32_DMA1_STREAM6 // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU.
|
||||
#define WS2812_DMA_CHANNEL 2 // DMA Channel for TIMx_UP, see the respective reference manual for the appropriate values for your MCU.
|
||||
#define WS2812_PWM_TARGET_PERIOD 800000
|
||||
#define RGBLIGHT_LED_MAP { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 23, 21, 19, 17, 15, 13, 11, 9, 7, 5, 3, 1 }
|
||||
|
||||
# define RGBLED_NUM 24
|
||||
# define RGBLIGHT_HUE_STEP 8
|
||||
|
@ -8,6 +8,9 @@
|
||||
"pid": "0x2137",
|
||||
"device_version": "0.0.1"
|
||||
},
|
||||
"rgblight": {
|
||||
"led_map": [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 23, 21, 19, 17, 15, 13, 11, 9, 7, 5, 3, 1]
|
||||
},
|
||||
"ws2812": {
|
||||
"pin": "B9"
|
||||
},
|
||||
|
@ -49,7 +49,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#endif
|
||||
|
||||
#define RGBLED_NUM 14 // Left(4) + Right(2) + Under(8)
|
||||
#define RGBLIGHT_LED_MAP {0,1,2,3,13,12,4,5,6,7,8,9,10,11} // Left --> Right --> Under
|
||||
#define RGBLIGHT_HUE_STEP 8
|
||||
#define RGBLIGHT_SAT_STEP 8
|
||||
#define RGBLIGHT_VAL_STEP 8
|
||||
|
@ -14,6 +14,9 @@
|
||||
{"pin_a": "B3", "pin_b": "B2"}
|
||||
]
|
||||
},
|
||||
"rgblight": {
|
||||
"led_map": [0, 1, 2, 3, 13, 12, 4, 5, 6, 7, 8, 9, 10, 11]
|
||||
},
|
||||
"ws2812": {
|
||||
"pin": "F0"
|
||||
},
|
||||
|
@ -35,5 +35,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define RGBLIGHT_EFFECT_ALTERNATING
|
||||
#define RGBLIGHT_EFFECT_TWINKLE
|
||||
#define RGBLED_NUM 16 // Number of LEDs
|
||||
#define RGBLIGHT_LED_MAP { 0, 1, 2, 3, 12, 13, 14, 15, 4, 5, 6, 7, 8, 9, 10, 11 }
|
||||
#define RGBLIGHT_DEFAULT_MODE (RGBLIGHT_MODE_RAINBOW_SWIRL + 2)
|
||||
|
@ -25,6 +25,7 @@
|
||||
"soft_serial_pin": "D0"
|
||||
},
|
||||
"rgblight": {
|
||||
"led_map": [0, 1, 2, 3, 12, 13, 14, 15, 4, 5, 6, 7, 8, 9, 10, 11],
|
||||
"split_count": [8, 8]
|
||||
},
|
||||
"ws2812": {
|
||||
|
@ -39,4 +39,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define RGBLIGHT_EFFECT_ALTERNATING
|
||||
#define RGBLIGHT_EFFECT_TWINKLE
|
||||
#define RGBLED_NUM 16 // Number of LEDs
|
||||
#define RGBLIGHT_LED_MAP { 1, 2, 3, 12, 13, 14, 15, 0, 7, 6, 5, 4, 11, 10, 9, 8 }
|
||||
|
@ -22,6 +22,7 @@
|
||||
"pin": "B5"
|
||||
},
|
||||
"rgblight": {
|
||||
"led_map": [1, 2, 3, 12, 13, 14, 15, 0, 7, 6, 5, 4, 11, 10, 9, 8],
|
||||
"split_count": [8, 8]
|
||||
},
|
||||
"ws2812": {
|
||||
|
@ -24,7 +24,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/* ws2812 RGB LED */
|
||||
#define RGBLED_NUM 16 // Number of LEDs
|
||||
#define RGBLIGHT_LED_MAP { 1, 2, 3, 12, 13, 14, 15, 0, 7, 6, 5, 4, 11, 10, 9, 8 }
|
||||
#define RGBLIGHT_EFFECT_BREATHING
|
||||
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
|
||||
#define RGBLIGHT_EFFECT_RAINBOW_SWIRL
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user