latinpad/latin60rgb: move RGB Matrix LED config to data driven (#24076)

This commit is contained in:
Ryan 2024-07-08 15:57:45 +10:00 committed by GitHub
parent 6eb6e3048a
commit a0bb7ff992
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 127 additions and 85 deletions

View file

@ -16,5 +16,3 @@
#pragma once #pragma once
#define IS31FL3733_I2C_ADDRESS_1 IS31FL3733_I2C_ADDRESS_GND_GND #define IS31FL3733_I2C_ADDRESS_1 IS31FL3733_I2C_ADDRESS_GND_GND
#define RGB_MATRIX_LED_COUNT 60

View file

@ -40,6 +40,72 @@
"solid_reactive": true "solid_reactive": true
}, },
"driver": "is31fl3733", "driver": "is31fl3733",
"layout": [
{"matrix": [0, 0], "x": 0, "y": 0, "flags": 1},
{"matrix": [0, 1], "x": 16, "y": 0, "flags": 4},
{"matrix": [0, 2], "x": 32, "y": 0, "flags": 4},
{"matrix": [0, 3], "x": 48, "y": 0, "flags": 4},
{"matrix": [0, 4], "x": 64, "y": 0, "flags": 4},
{"matrix": [0, 5], "x": 80, "y": 0, "flags": 4},
{"matrix": [0, 6], "x": 96, "y": 0, "flags": 4},
{"matrix": [0, 7], "x": 112, "y": 0, "flags": 4},
{"matrix": [0, 8], "x": 128, "y": 0, "flags": 4},
{"matrix": [0, 9], "x": 144, "y": 0, "flags": 4},
{"matrix": [0, 10], "x": 160, "y": 0, "flags": 4},
{"matrix": [0, 11], "x": 176, "y": 0, "flags": 4},
{"matrix": [0, 12], "x": 192, "y": 0, "flags": 4},
{"matrix": [0, 13], "x": 216, "y": 0, "flags": 1},
{"matrix": [1, 0], "x": 4, "y": 16, "flags": 1},
{"matrix": [1, 1], "x": 24, "y": 16, "flags": 4},
{"matrix": [1, 2], "x": 40, "y": 16, "flags": 4},
{"matrix": [1, 3], "x": 56, "y": 16, "flags": 4},
{"matrix": [1, 4], "x": 72, "y": 16, "flags": 4},
{"matrix": [1, 5], "x": 88, "y": 16, "flags": 4},
{"matrix": [1, 6], "x": 104, "y": 16, "flags": 4},
{"matrix": [1, 7], "x": 120, "y": 16, "flags": 4},
{"matrix": [1, 8], "x": 136, "y": 16, "flags": 4},
{"matrix": [1, 9], "x": 152, "y": 16, "flags": 4},
{"matrix": [1, 10], "x": 168, "y": 16, "flags": 4},
{"matrix": [1, 11], "x": 184, "y": 16, "flags": 4},
{"matrix": [1, 12], "x": 200, "y": 16, "flags": 4},
{"matrix": [1, 13], "x": 220, "y": 16, "flags": 1},
{"matrix": [2, 0], "x": 6, "y": 32, "flags": 1},
{"matrix": [2, 1], "x": 28, "y": 32, "flags": 4},
{"matrix": [2, 2], "x": 44, "y": 32, "flags": 4},
{"matrix": [2, 3], "x": 60, "y": 32, "flags": 4},
{"matrix": [2, 4], "x": 76, "y": 32, "flags": 4},
{"matrix": [2, 5], "x": 92, "y": 32, "flags": 4},
{"matrix": [2, 6], "x": 108, "y": 32, "flags": 4},
{"matrix": [2, 7], "x": 124, "y": 32, "flags": 4},
{"matrix": [2, 8], "x": 140, "y": 32, "flags": 4},
{"matrix": [2, 9], "x": 156, "y": 32, "flags": 4},
{"matrix": [2, 10], "x": 172, "y": 32, "flags": 4},
{"matrix": [2, 11], "x": 188, "y": 32, "flags": 4},
{"matrix": [2, 12], "x": 214, "y": 32, "flags": 1},
{"matrix": [3, 0], "x": 8, "y": 48, "flags": 1},
{"matrix": [3, 1], "x": 32, "y": 48, "flags": 4},
{"matrix": [3, 2], "x": 48, "y": 48, "flags": 4},
{"matrix": [3, 3], "x": 64, "y": 48, "flags": 4},
{"matrix": [3, 4], "x": 80, "y": 48, "flags": 4},
{"matrix": [3, 5], "x": 96, "y": 48, "flags": 4},
{"matrix": [3, 6], "x": 112, "y": 48, "flags": 4},
{"matrix": [3, 7], "x": 128, "y": 48, "flags": 4},
{"matrix": [3, 8], "x": 144, "y": 48, "flags": 4},
{"matrix": [3, 9], "x": 160, "y": 48, "flags": 4},
{"matrix": [3, 10], "x": 176, "y": 48, "flags": 4},
{"matrix": [3, 11], "x": 192, "y": 48, "flags": 4},
{"matrix": [3, 12], "x": 208, "y": 48, "flags": 4},
{"matrix": [3, 13], "x": 224, "y": 48, "flags": 4},
{"matrix": [4, 0], "x": 22, "y": 64, "flags": 1},
{"matrix": [4, 1], "x": 42, "y": 64, "flags": 1},
{"matrix": [4, 2], "x": 102, "y": 64, "flags": 4},
{"matrix": [4, 3], "x": 162, "y": 64, "flags": 1},
{"matrix": [4, 4], "x": 180, "y": 64, "flags": 1}
],
"sleep": true "sleep": true
}, },
"features": { "features": {

View file

@ -17,92 +17,70 @@
#ifdef RGB_MATRIX_ENABLE #ifdef RGB_MATRIX_ENABLE
const is31fl3733_led_t PROGMEM g_is31fl3733_leds[IS31FL3733_LED_COUNT] = { const is31fl3733_led_t PROGMEM g_is31fl3733_leds[IS31FL3733_LED_COUNT] = {
{ 0, SW11_CS13, SW10_CS13, SW12_CS13 }, { 0, SW2_CS1, SW1_CS1, SW3_CS1 },
{ 0, SW11_CS12, SW10_CS12, SW12_CS12 }, { 0, SW2_CS2, SW1_CS2, SW3_CS2 },
{ 0, SW11_CS11, SW10_CS11, SW12_CS11 }, { 0, SW2_CS3, SW1_CS3, SW3_CS3 },
{ 0, SW11_CS10, SW10_CS10, SW12_CS10 }, { 0, SW2_CS4, SW1_CS4, SW3_CS4 },
{ 0, SW11_CS9, SW10_CS9, SW12_CS9 }, { 0, SW2_CS5, SW1_CS5, SW3_CS5 },
{ 0, SW11_CS8, SW10_CS8, SW12_CS8 }, { 0, SW2_CS6, SW1_CS6, SW3_CS6 },
{ 0, SW11_CS7, SW10_CS7, SW12_CS7 }, { 0, SW2_CS7, SW1_CS7, SW3_CS7 },
{ 0, SW11_CS6, SW10_CS6, SW12_CS6 }, { 0, SW2_CS8, SW1_CS8, SW3_CS8 },
{ 0, SW11_CS5, SW10_CS5, SW12_CS5 }, { 0, SW2_CS9, SW1_CS9, SW3_CS9 },
{ 0, SW11_CS4, SW10_CS4, SW12_CS4 }, { 0, SW2_CS10, SW1_CS10, SW3_CS10 },
{ 0, SW11_CS3, SW10_CS3, SW12_CS3 }, { 0, SW2_CS11, SW1_CS11, SW3_CS11 },
{ 0, SW11_CS2, SW10_CS2, SW12_CS2 }, { 0, SW2_CS12, SW1_CS12, SW3_CS12 },
{ 0, SW11_CS1, SW10_CS1, SW12_CS1 }, { 0, SW2_CS13, SW1_CS13, SW3_CS13 },
{ 0, SW2_CS14, SW1_CS14, SW3_CS14 },
{ 0, SW8_CS16, SW7_CS16, SW9_CS16 },
{ 0, SW8_CS15, SW7_CS15, SW9_CS15 },
{ 0, SW8_CS14, SW7_CS14, SW9_CS14 },
{ 0, SW8_CS13, SW7_CS13, SW9_CS13 },
{ 0, SW8_CS12, SW7_CS12, SW9_CS12 },
{ 0, SW8_CS11, SW7_CS11, SW9_CS11 },
{ 0, SW8_CS10, SW7_CS10, SW9_CS10 },
{ 0, SW8_CS9, SW7_CS9, SW9_CS9 },
{ 0, SW8_CS8, SW7_CS8, SW9_CS8 },
{ 0, SW8_CS7, SW7_CS7, SW9_CS7 },
{ 0, SW8_CS6, SW7_CS6, SW9_CS6 },
{ 0, SW8_CS5, SW7_CS5, SW9_CS5 },
{ 0, SW8_CS4, SW7_CS4, SW9_CS4 },
{ 0, SW8_CS3, SW7_CS3, SW9_CS3 },
{ 0, SW8_CS2, SW7_CS2, SW9_CS2 },
{ 0, SW8_CS1, SW7_CS1, SW9_CS1 },
{ 0, SW5_CS16, SW4_CS16, SW6_CS16 },
{ 0, SW5_CS15, SW4_CS15, SW6_CS15 },
{ 0, SW5_CS14, SW4_CS14, SW6_CS14 },
{ 0, SW5_CS13, SW4_CS13, SW6_CS13 },
{ 0, SW5_CS12, SW4_CS12, SW6_CS12 },
{ 0, SW5_CS11, SW4_CS11, SW6_CS11 },
{ 0, SW5_CS10, SW4_CS10, SW6_CS10 },
{ 0, SW5_CS9, SW4_CS9, SW6_CS9 },
{ 0, SW5_CS8, SW4_CS8, SW6_CS8 },
{ 0, SW5_CS7, SW4_CS7, SW6_CS7 },
{ 0, SW5_CS6, SW4_CS6, SW6_CS6 },
{ 0, SW5_CS5, SW4_CS5, SW6_CS5 },
{ 0, SW5_CS4, SW4_CS4, SW6_CS4 },
{ 0, SW5_CS3, SW4_CS3, SW6_CS3 },
{ 0, SW5_CS2, SW4_CS2, SW6_CS2 },
{ 0, SW5_CS1, SW4_CS1, SW6_CS1 },
{ 0, SW2_CS16, SW1_CS16, SW3_CS16 }, { 0, SW2_CS16, SW1_CS16, SW3_CS16 },
{ 0, SW2_CS14, SW1_CS14, SW3_CS14 }, { 0, SW5_CS1, SW4_CS1, SW6_CS1 },
{ 0, SW2_CS13, SW1_CS13, SW3_CS13 }, { 0, SW5_CS2, SW4_CS2, SW6_CS2 },
{ 0, SW2_CS12, SW1_CS12, SW3_CS12 }, { 0, SW5_CS3, SW4_CS3, SW6_CS3 },
{ 0, SW2_CS11, SW1_CS11, SW3_CS11 }, { 0, SW5_CS4, SW4_CS4, SW6_CS4 },
{ 0, SW2_CS10, SW1_CS10, SW3_CS10 }, { 0, SW5_CS5, SW4_CS5, SW6_CS5 },
{ 0, SW2_CS9, SW1_CS9, SW3_CS9 }, { 0, SW5_CS6, SW4_CS6, SW6_CS6 },
{ 0, SW2_CS8, SW1_CS8, SW3_CS8 }, { 0, SW5_CS7, SW4_CS7, SW6_CS7 },
{ 0, SW2_CS7, SW1_CS7, SW3_CS7 }, { 0, SW5_CS8, SW4_CS8, SW6_CS8 },
{ 0, SW2_CS6, SW1_CS6, SW3_CS6 }, { 0, SW5_CS9, SW4_CS9, SW6_CS9 },
{ 0, SW2_CS5, SW1_CS5, SW3_CS5 }, { 0, SW5_CS10, SW4_CS10, SW6_CS10 },
{ 0, SW2_CS4, SW1_CS4, SW3_CS4 }, { 0, SW5_CS11, SW4_CS11, SW6_CS11 },
{ 0, SW2_CS3, SW1_CS3, SW3_CS3 }, { 0, SW5_CS12, SW4_CS12, SW6_CS12 },
{ 0, SW2_CS2, SW1_CS2, SW3_CS2 }, { 0, SW5_CS13, SW4_CS13, SW6_CS13 },
{ 0, SW2_CS1, SW1_CS1, SW3_CS1 }
}; { 0, SW5_CS14, SW4_CS14, SW6_CS14 },
{ 0, SW5_CS15, SW4_CS15, SW6_CS15 },
{ 0, SW5_CS16, SW4_CS16, SW6_CS16 },
{ 0, SW8_CS1, SW7_CS1, SW9_CS1 },
{ 0, SW8_CS2, SW7_CS2, SW9_CS2 },
{ 0, SW8_CS3, SW7_CS3, SW9_CS3 },
{ 0, SW8_CS4, SW7_CS4, SW9_CS4 },
{ 0, SW8_CS5, SW7_CS5, SW9_CS5 },
{ 0, SW8_CS6, SW7_CS6, SW9_CS6 },
{ 0, SW8_CS7, SW7_CS7, SW9_CS7 },
{ 0, SW8_CS8, SW7_CS8, SW9_CS8 },
{ 0, SW8_CS9, SW7_CS9, SW9_CS9 },
{ 0, SW8_CS10, SW7_CS10, SW9_CS10 },
led_config_t g_led_config = { { 0, SW8_CS11, SW7_CS11, SW9_CS11 },
{ { 0, SW8_CS12, SW7_CS12, SW9_CS12 },
{ 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46 }, { 0, SW8_CS13, SW7_CS13, SW9_CS13 },
{ 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32 }, { 0, SW8_CS14, SW7_CS14, SW9_CS14 },
{ 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19 }, { 0, SW8_CS15, SW7_CS15, SW9_CS15 },
{ 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5 }, { 0, SW8_CS16, SW7_CS16, SW9_CS16 },
{ 4, 3, 2, 1 ,0 } { 0, SW11_CS1, SW10_CS1, SW12_CS1 },
}, { { 0, SW11_CS2, SW10_CS2, SW12_CS2 },
{ 224, 0 }, { 208, 0 }, { 192, 0 }, { 176, 0 }, { 160, 0 }, { 144, 0 }, { 128, 0 }, { 112, 0 }, { 96, 0 }, { 80, 0 }, { 64, 0 }, { 48, 0 }, { 32, 0 }, { 16, 0 }, { 0, SW11_CS3, SW10_CS3, SW12_CS3 },
{ 220, 16 }, { 200, 16 }, { 184, 16 }, { 168, 16 }, { 152, 16 }, { 136, 16 }, { 120, 16 }, { 104, 16 }, { 88, 16 }, { 72, 16 }, { 56, 16 }, { 40, 16 }, { 24, 16 }, { 4, 16 }, { 0, SW11_CS4, SW10_CS4, SW12_CS4 },
{ 204, 32 }, { 188, 32 }, { 172, 32 }, { 156, 32 }, { 140, 32 }, { 124, 32 }, { 108, 32 }, { 92, 32 }, { 76, 32 }, { 60, 32 }, { 44, 32 }, { 28, 32 }, { 6, 32 }, { 0, SW11_CS5, SW10_CS5, SW12_CS5 },
{ 224, 48 }, { 198, 64 }, { 202, 48 }, { 180, 48 }, { 164, 48 }, { 148, 48 }, { 132, 48 }, { 116, 48 }, { 100, 48 }, { 84, 48 }, { 68, 48 }, { 52, 48 }, { 20, 48 }, { 10, 48 }, { 0, SW11_CS6, SW10_CS6, SW12_CS6 },
{ 218, 64 }, { 178, 64 }, { 112, 64 }, { 46, 64 }, { 26, 64 } { 0, SW11_CS7, SW10_CS7, SW12_CS7 },
}, { { 0, SW11_CS8, SW10_CS8, SW12_CS8 },
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, { 0, SW11_CS9, SW10_CS9, SW12_CS9 },
1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, { 0, SW11_CS10, SW10_CS10, SW12_CS10 },
1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, { 0, SW11_CS11, SW10_CS11, SW12_CS11 },
1, 1, 4, 1, 1 { 0, SW11_CS12, SW10_CS12, SW12_CS12 },
} { 0, SW11_CS13, SW10_CS13, SW12_CS13 }
}; };
void suspend_power_down_kb(void) { void suspend_power_down_kb(void) {
@ -120,7 +98,7 @@ bool rgb_matrix_indicators_kb(void) {
return false; return false;
} }
if (host_keyboard_led_state().caps_lock) { if (host_keyboard_led_state().caps_lock) {
rgb_matrix_set_color(41, 0xFF, 0xFF, 0xFF); rgb_matrix_set_color(28, 0xFF, 0xFF, 0xFF);
} }
return true; return true;
} }