diff options
-rw-r--r-- | keyboards/tkc/portico/config.h | 60 | ||||
-rw-r--r-- | keyboards/tkc/portico/keymaps/default/keymap.c | 20 | ||||
-rw-r--r-- | keyboards/tkc/portico/keymaps/via/keymap.c | 20 | ||||
-rw-r--r-- | keyboards/tkc/portico/portico.c | 2 | ||||
-rw-r--r-- | keyboards/tkc/portico/portico.h | 4 | ||||
-rw-r--r-- | keyboards/tkc/portico/rules.mk | 11 | ||||
-rw-r--r-- | keyboards/wilba_tech/wt_rgb_backlight.c | 129 |
7 files changed, 237 insertions, 9 deletions
diff --git a/keyboards/tkc/portico/config.h b/keyboards/tkc/portico/config.h index ef6e46658a..ba4f11a41e 100644 --- a/keyboards/tkc/portico/config.h +++ b/keyboards/tkc/portico/config.h @@ -70,4 +70,62 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. # define DRIVER_1_LED_TOTAL 36 # define DRIVER_2_LED_TOTAL 31 # define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) -#endif + +#else +// IS31FL3731 driver +#define DRIVER_COUNT 2 +#define DRIVER_LED_TOTAL 67 + +#define RGB_BACKLIGHT_ENABLED 1 + +// This conditionally compiles the backlight code for Dawn60 specifics +#define RGB_BACKLIGHT_PORTICO + +// disable backlight when USB suspended (PC sleep/hibernate/shutdown) +#define RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 1 + +// disable backlight after timeout in minutes, 0 = no timeout +#define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0 + +// the default brightness +#define RGB_BACKLIGHT_BRIGHTNESS 255 + +// the default effect (RGB test) +#define RGB_BACKLIGHT_EFFECT 255 + +// the default effect speed (0-3) +#define RGB_BACKLIGHT_EFFECT_SPEED 0 + +// the default color1 and color2 +#define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 } +#define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 } + +#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 0 +#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0 +#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 0 +#define RGB_BACKLIGHT_USE_7U_SPACEBAR 0 +#define RGB_BACKLIGHT_USE_ISO_ENTER 0 +#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 0 +#define RGB_BACKLIGHT_CAPS_LOCK_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_1_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_2_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } +#define RGB_BACKLIGHT_LAYER_3_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 } + +// These define which keys in the matrix are alphas/mods +// Used for backlight effects so colors are different for +// alphas vs. mods +// Each value is for a row, bit 0 is column 0 +// Alpha=0 Mod=1 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 0b0110000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0b0110000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0b0111000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0111000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b1111111111111111 + +// Backlight config starts after VIA's EEPROM usage, +// dynamic keymaps start after this. +#define VIA_EEPROM_CUSTOM_CONFIG_SIZE 31 + +// VIA lighting is handled by the keyboard-level code +#define VIA_CUSTOM_LIGHTING_ENABLE +#endif
\ No newline at end of file diff --git a/keyboards/tkc/portico/keymaps/default/keymap.c b/keyboards/tkc/portico/keymaps/default/keymap.c index bbc68c3b93..3442067011 100644 --- a/keyboards/tkc/portico/keymaps/default/keymap.c +++ b/keyboards/tkc/portico/keymaps/default/keymap.c @@ -17,6 +17,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include QMK_KEYBOARD_H +// RGB-specific keys: +// EF_INC, EF_DEC, // next/previous backlight effect +// H1_INC, H1_DEC, // Color 1 hue increase/decrease +// S1_INC, S1_DEC, // Color 1 saturation increase/decrease +// H2_INC, H2_DEC, // Color 2 hue increase/decrease +// S2_INC, S2_DEC, // Color 2 saturation increase/decrease +// BR_INC, BR_DEC, // backlight brightness increase/decrease + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT_65_ansi_blocker( KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, @@ -25,13 +33,23 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ), +#ifdef RGB_BACKLIGHT_PORTICO + [1] = LAYOUT_65_ansi_blocker( + KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_HOME, + _______, EF_INC, EF_DEC, BR_INC, BR_DEC, H1_INC, H1_DEC, S1_INC, S1_DEC, _______, KC_PSCR, KC_SLCK, KC_PAUS, RESET, KC_PGUP, + KC_CAPS, _______, _______, _______, _______, H2_INC, H2_DEC, S2_INC, S2_DEC, _______, _______, _______, _______, KC_PGDN, + KC_LSFT, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, KC_VOLU, KC_MUTE, + _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT + ), +#else [1] = LAYOUT_65_ansi_blocker( KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_HOME, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, KC_PSCR, KC_SLCK, KC_PAUS, RESET, KC_PGUP, - KC_CAPS, RGB_SPI, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, EEP_RST, KC_PGDN, + KC_CAPS, RGB_SPI, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGDN, KC_LSFT, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, KC_VOLU, KC_MUTE, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT ), +#endif [2] = LAYOUT_65_ansi_blocker( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, diff --git a/keyboards/tkc/portico/keymaps/via/keymap.c b/keyboards/tkc/portico/keymaps/via/keymap.c index bbc68c3b93..3442067011 100644 --- a/keyboards/tkc/portico/keymaps/via/keymap.c +++ b/keyboards/tkc/portico/keymaps/via/keymap.c @@ -17,6 +17,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include QMK_KEYBOARD_H +// RGB-specific keys: +// EF_INC, EF_DEC, // next/previous backlight effect +// H1_INC, H1_DEC, // Color 1 hue increase/decrease +// S1_INC, S1_DEC, // Color 1 saturation increase/decrease +// H2_INC, H2_DEC, // Color 2 hue increase/decrease +// S2_INC, S2_DEC, // Color 2 saturation increase/decrease +// BR_INC, BR_DEC, // backlight brightness increase/decrease + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT_65_ansi_blocker( KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, @@ -25,13 +33,23 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ), +#ifdef RGB_BACKLIGHT_PORTICO + [1] = LAYOUT_65_ansi_blocker( + KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_HOME, + _______, EF_INC, EF_DEC, BR_INC, BR_DEC, H1_INC, H1_DEC, S1_INC, S1_DEC, _______, KC_PSCR, KC_SLCK, KC_PAUS, RESET, KC_PGUP, + KC_CAPS, _______, _______, _______, _______, H2_INC, H2_DEC, S2_INC, S2_DEC, _______, _______, _______, _______, KC_PGDN, + KC_LSFT, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, KC_VOLU, KC_MUTE, + _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT + ), +#else [1] = LAYOUT_65_ansi_blocker( KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_HOME, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, KC_PSCR, KC_SLCK, KC_PAUS, RESET, KC_PGUP, - KC_CAPS, RGB_SPI, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, EEP_RST, KC_PGDN, + KC_CAPS, RGB_SPI, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGDN, KC_LSFT, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, KC_VOLU, KC_MUTE, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT ), +#endif [2] = LAYOUT_65_ansi_blocker( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, diff --git a/keyboards/tkc/portico/portico.c b/keyboards/tkc/portico/portico.c index e4fd741078..a65a85d242 100644 --- a/keyboards/tkc/portico/portico.c +++ b/keyboards/tkc/portico/portico.c @@ -136,4 +136,4 @@ void rgb_matrix_indicators_kb(void) { rgb_matrix_driver.flush(); } } -#endif +#endif
\ No newline at end of file diff --git a/keyboards/tkc/portico/portico.h b/keyboards/tkc/portico/portico.h index 7add429432..71b28074dd 100644 --- a/keyboards/tkc/portico/portico.h +++ b/keyboards/tkc/portico/portico.h @@ -18,6 +18,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #pragma once #include "quantum.h" +#ifdef RGB_BACKLIGHT_PORTICO +#include "keyboards/wilba_tech/wt_rgb_backlight_keycodes.h" +#include "via.h" +#endif #define XXX KC_NO diff --git a/keyboards/tkc/portico/rules.mk b/keyboards/tkc/portico/rules.mk index 1cbcd95d6a..84a65370e3 100644 --- a/keyboards/tkc/portico/rules.mk +++ b/keyboards/tkc/portico/rules.mk @@ -20,7 +20,16 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow BLUETOOTH_ENABLE = no # Enable Bluetooth AUDIO_ENABLE = no # Audio output -RGB_MATRIX_ENABLE = yes # Use RGB matrix +RGB_MATRIX_ENABLE = no RGB_MATRIX_DRIVER = IS31FL3731 +CIE1931_CURVE = yes + +# project specific files +SRC += keyboards/wilba_tech/wt_main.c \ + keyboards/wilba_tech/wt_rgb_backlight.c \ + quantum/color.c \ + drivers/issi/is31fl3731.c + +QUANTUM_LIB_SRC += i2c_master.c LAYOUTS = 65_ansi_blocker diff --git a/keyboards/wilba_tech/wt_rgb_backlight.c b/keyboards/wilba_tech/wt_rgb_backlight.c index 306f8186e0..e57d061b20 100644 --- a/keyboards/wilba_tech/wt_rgb_backlight.c +++ b/keyboards/wilba_tech/wt_rgb_backlight.c @@ -30,6 +30,7 @@ defined(RGB_BACKLIGHT_NEBULA68) || \ defined(RGB_BACKLIGHT_U80_A) || \ defined(RGB_BACKLIGHT_DAWN60) || \ + defined(RGB_BACKLIGHT_PORTICO) || \ defined(RGB_BACKLIGHT_WT60_B) || \ defined(RGB_BACKLIGHT_WT60_BX) || \ defined(RGB_BACKLIGHT_WT60_C) || \ @@ -94,6 +95,8 @@ LED_TYPE g_ws2812_leds[WS2812_LED_TOTAL]; #define BACKLIGHT_LED_COUNT 108 #elif defined(RGB_BACKLIGHT_DAWN60) #define BACKLIGHT_LED_COUNT 84 //64 + 20 +#elif defined(RGB_BACKLIGHT_PORTICO) +#define BACKLIGHT_LED_COUNT 67 //36 + 31 #elif defined(RGB_BACKLIGHT_NEBULA12) #define BACKLIGHT_LED_COUNT 16 #elif defined(RGB_BACKLIGHT_M10_C) @@ -613,6 +616,91 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {1, C9_15, C8_15, C6_14}, //D15 {1, C9_16, C7_15, C6_15} //D16 }; +#elif defined(RGB_BACKLIGHT_PORTICO) +// This is a 7-bit address, that gets left-shifted and bit 0 +// set to 0 for write, 1 for read (as per I2C protocol) +#define ISSI_ADDR_1 0x74 +#define ISSI_ADDR_2 0x77 + +const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { +/* Refer to IS31 manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + { 0, C2_1, C3_1, C4_1 }, + { 0, C1_1, C3_2, C4_2 }, + { 0, C1_2, C2_2, C4_3 }, + { 0, C1_3, C2_3, C3_3 }, + { 0, C1_4, C2_4, C3_4 }, + { 0, C1_5, C2_5, C3_5 }, + { 0, C1_6, C2_6, C3_6 }, + { 0, C1_7, C2_7, C3_7 }, + { 0, C1_8, C2_8, C3_8 }, + { 1, C2_1, C3_1, C4_1 }, + { 1, C1_1, C3_2, C4_2 }, + { 1, C1_2, C2_2, C4_3 }, + { 1, C1_3, C2_3, C3_3 }, + { 1, C1_4, C2_4, C3_4 }, + { 1, C1_5, C2_5, C3_5 }, + + { 0, C9_1, C8_1, C7_1 }, + { 0, C9_2, C8_2, C7_2 }, + { 0, C9_3, C8_3, C7_3 }, + { 0, C9_4, C8_4, C7_4 }, + { 0, C9_5, C8_5, C7_5 }, + { 0, C9_6, C8_6, C7_6 }, + { 0, C9_7, C8_7, C6_6 }, + { 0, C9_8, C7_7, C6_7 }, + { 0, C8_8, C7_8, C6_8 }, + { 1, C9_1, C8_1, C7_1 }, + { 1, C9_2, C8_2, C7_2 }, + { 1, C9_3, C8_3, C7_3 }, + { 1, C9_4, C8_4, C7_4 }, + { 1, C9_5, C8_5, C7_5 }, + { 1, C9_6, C8_6, C7_6 }, + + { 0, C1_9, C3_10, C4_10 }, + { 0, C1_10, C2_10, C4_11 }, + { 0, C1_11, C2_11, C3_11 }, + { 0, C1_12, C2_12, C3_12 }, + { 0, C1_13, C2_13, C3_13 }, + { 0, C1_14, C2_14, C3_14 }, + { 0, C1_15, C2_15, C3_15 }, + { 0, C1_16, C2_16, C3_16 }, + { 1, C1_10, C2_10, C4_11 }, + { 1, C1_11, C2_11, C3_11 }, + { 1, C1_12, C2_12, C3_12 }, + { 1, C1_13, C2_13, C3_13 }, + { 1, C1_14, C2_14, C3_14 }, + { 1, C9_7, C8_7, C6_6 }, + + { 0, C2_9, C3_9, C4_9 }, + { 0, C9_12, C8_12, C7_12 }, + { 0, C9_13, C8_13, C7_13 }, + { 0, C9_14, C8_14, C7_14 }, + { 0, C9_15, C8_15, C6_14 }, + { 0, C9_16, C7_15, C6_15 }, + { 1, C2_9, C3_9, C4_9 }, + { 1, C1_9, C3_10, C4_10 }, + { 1, C9_9, C8_9, C7_9 }, + { 1, C9_10, C8_10, C7_10 }, + { 1, C9_11, C8_11, C7_11 }, + { 1, C9_14, C8_14, C7_14 }, + { 1, C1_15, C2_15, C3_15 }, + { 1, C1_16, C2_16, C3_16 }, + + { 0, C9_9, C8_9, C7_9 }, + { 0, C9_10, C8_10, C7_10 }, + { 0, C9_11, C8_11, C7_11 }, + { 0, C8_16, C7_16, C6_16 }, + { 1, C9_12, C8_12, C7_12 }, + { 1, C9_13, C8_13, C7_13 }, + { 1, C9_15, C8_15, C6_14 }, + { 1, C9_16, C7_15, C6_15 }, + { 1, C8_16, C7_16, C6_16 } +}; #elif defined(RGB_BACKLIGHT_M6_B) // Driver has fixed mapping of index to the red, green and blue LEDs #elif defined(RGB_BACKLIGHT_M10_C) @@ -776,7 +864,8 @@ const Point g_map_led_to_point[BACKLIGHT_LED_COUNT] PROGMEM = { // LC0..LC17 {112,64}, {100,48}, {84,48}, {68,48}, {52,48}, {36,48}, {64,60}, {44,60}, {24,64}, {108,32}, {92,32}, {76,32}, {60,32}, {44,32}, {28,32}, {255,255}, {10,48}, {4,64}, - // LD0..LD17 + // LD0..LD1762 + {124,32}, {140,32}, {156,32}, {172,32}, {188,32}, {214,32}, {180,48}, {202,48}, {224,48}, {116,48}, {132,48}, {148,48}, {164,48}, {255,255}, {160,60}, {180,64}, {208,64}, {255,255} }; @@ -1156,6 +1245,21 @@ const Point g_map_led_to_point_polar[BACKLIGHT_LED_COUNT] PROGMEM = { //11 - 20 {234,255}, {222,255}, {213,255}, {197,255}, {180,255}, {167,255}, {152,255}, {147,255}, {128,255}, {101,255} }; +#elif defined(RGB_BACKLIGHT_PORTICO) +const Point g_map_led_to_point[BACKLIGHT_LED_COUNT] PROGMEM = { + { 0, 0 }, { 15, 0 }, { 30, 0 }, { 45, 0 }, { 60, 0 }, { 75, 0 }, { 90, 0 }, { 105, 0 }, { 120, 0 }, { 135, 0 }, { 150, 0 }, { 165, 0 }, { 180, 0 }, { 203, 0 }, { 224, 0 }, + { 4, 16 }, { 23, 16 }, { 38, 16 }, { 53, 16 }, { 68, 16 }, { 83, 16 }, { 98, 16 }, { 113, 16 }, { 128, 16 }, { 143, 16 }, { 158, 16 }, { 173, 16 }, { 188, 16 }, { 206, 16 }, { 224, 16 }, + { 6, 32 }, { 26, 32 }, { 41, 32 }, { 56, 32 }, { 71, 32 }, { 86, 32 }, { 101, 32 }, { 116, 32 }, { 131, 32 }, { 146, 32 }, { 161, 32 }, { 176, 32 }, { 201, 32 }, { 224, 32 }, + { 9, 48 }, { 34, 48 }, { 49, 48 }, { 64, 48 }, { 79, 48 }, { 94, 48 }, { 109, 48 }, { 124, 48 }, { 139, 48 }, { 154, 48 }, { 169, 48 }, { 189, 48 }, { 210, 48 }, { 224, 48 }, + { 2, 64 }, { 21, 64 }, { 39, 64 }, { 96, 64 }, { 152, 64 }, { 171, 64 }, { 195, 64 }, { 210, 64 }, { 224, 64 }, +}; +const Point g_map_led_to_point_polar[BACKLIGHT_LED_COUNT] PROGMEM = { + { 138, 240 }, { 140, 210 }, { 142, 181 }, { 145, 153 }, { 149, 126 }, { 156, 101 }, { 166, 80 }, { 182, 67 }, { 200, 68 }, { 216, 81 }, { 226, 102 }, { 232, 128 }, { 236, 155 }, { 240, 199 }, { 243, 240 }, //Done through here TM 052421 143PM + { 133, 225 }, { 134, 186 }, { 136, 156 }, { 138, 126 }, { 141, 96 }, { 147, 68 }, { 161, 44 }, { 193, 33 }, { 222, 47 }, { 235, 72 }, { 240, 100 }, { 244, 130 }, { 246, 160 }, { 247, 196 }, { 248, 233 }, //Done through here TM 052421 235PM + { 127, 218 }, { 127, 177 }, { 127, 146 }, { 127, 115 }, { 127, 84 }, { 127, 54 }, { 127, 23 }, { 0, 8 }, { 0, 39 }, { 0, 70 }, { 0, 101 }, { 0, 132 }, { 0, 183 }, { 0, 231 }, + { 121, 215 }, { 119, 164 }, { 117, 134 }, { 114, 104 }, { 109, 76 }, { 98, 50 }, { 71, 34 }, { 37, 41 }, { 22, 65 }, { 15, 93 }, { 11, 122 }, { 8, 162 }, { 7, 205 }, { 6, 233 }, + { 116, 236 }, { 113, 199 }, { 110, 164 }, { 82, 74 }, { 27, 106 }, { 20, 138 }, { 15, 183 }, { 13, 212 }, { 11, 240 } +}; #elif defined(RGB_BACKLIGHT_M50_A) const Point g_map_led_to_point[BACKLIGHT_LED_COUNT] PROGMEM = { // LA0..LA17 @@ -1198,7 +1302,7 @@ void map_led_to_point( uint8_t index, Point *point ) point->x = pgm_read_byte(addr); point->y = pgm_read_byte(addr+1); -#if defined(RGB_BACKLIGHT_M6_B) || defined(RGB_BACKLIGHT_M10_C) || defined(RGB_BACKLIGHT_HS60) || defined(RGB_BACKLIGHT_NK65) || \ +#if defined(RGB_BACKLIGHT_M6_B) || defined(RGB_BACKLIGHT_M10_C) || defined(RGB_BACKLIGHT_HS60) || defined(RGB_BACKLIGHT_NK65) || defined(RGB_BACKLIGHT_PORTICO) || \ defined(RGB_BACKLIGHT_NK87) || defined(RGB_BACKLIGHT_NEBULA68) || defined(RGB_BACKLIGHT_NEBULA12) || defined(RGB_BACKLIGHT_KW_MEGA) return; #endif @@ -1474,6 +1578,14 @@ const uint8_t g_map_row_column_to_led[MATRIX_ROWS][MATRIX_COLS] PROGMEM = { { 31+15, 31+5 , 31+4 , 31+3 , 31+2 , 31+1 , 47+9 , 47+10, 47+11, 47+12, 255 ,47+6 , 47+7 , 15+16}, { 31+16, 31+8 , 31+7 , 255 , 255 , 31+6 , 255 , 255 , 255 , 47+13, 47+14, 47+15, 47+16, 47+8 } }; +#elif defined(RGB_BACKLIGHT_PORTICO) +const uint8_t g_map_row_column_to_led[MATRIX_ROWS][MATRIX_COLS] PROGMEM = { + { 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 }, + { 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 255, 43 }, + { 44, 255, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57 }, + { 58, 59, 60, 255, 255, 255, 61, 255, 255, 255, 62, 63, 64, 65, 66 } +}; #elif defined(RGB_BACKLIGHT_M50_A) // LA15, LA14, LA13, LA12, LA11, LA10, LA9, LB1, LB2, LB3, LB4, LB5, LB6 // LA16, LA6, LA5, LA4, LA3, LA2, LA1, LB9, LB10, LB11, LB12, LB13, LB14 @@ -1546,6 +1658,8 @@ void backlight_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ) IS31FL3218_set_color( index, red, green, blue ); #elif defined(RGB_BACKLIGHT_HS60) || defined(RGB_BACKLIGHT_NK65) || defined(RGB_BACKLIGHT_NEBULA68) || defined(RGB_BACKLIGHT_KW_MEGA) IS31FL3733_set_color( index, red, green, blue ); +#elif defined (RGB_BACKLIGHT_PORTICO) + IS31FL3731_set_color( index, red, green, blue ); #elif defined(RGB_BACKLIGHT_NK87) // This is done to avoid indicator LEDs being set if (( index != 63+64-1 ) && ( index != 48+64-1 )) { @@ -1574,6 +1688,11 @@ void backlight_set_color_all( uint8_t red, uint8_t green, uint8_t blue ) for (int i = 0; i < BACKLIGHT_LED_COUNT; i++) { IS31FL3733_set_color(i, red, green, blue); } +#elif defined (RGB_BACKLIGHT_PORTICO) + // This is done to avoid indicator LEDs being set + for (int i = 0; i < BACKLIGHT_LED_COUNT; i++) { + IS31FL3731_set_color(i, red, green, blue); + } #elif defined(RGB_BACKLIGHT_NK87) // This is done to avoid indicator LEDs being set for (int i = 0; i < BACKLIGHT_LED_COUNT; i++) { @@ -1639,6 +1758,7 @@ void backlight_timer_disable(void) { TIMSK3 &= ~_BV(OCIE3A); } + #elif defined(RGB_BACKLIGHT_NEBULA12) //STM32, use GPT with TIM3. Enable in halconf.h static void gpt_backlight_timer_task(GPTDriver *gptp); // Timer setup at 200Khz, callback at 10k ticks = 20Hz @@ -1661,6 +1781,7 @@ void backlight_timer_disable(void) { gptStopTimer(&GPTD3); } + #else //STM32, use GPT with TIM4. Enable in halconf.h static void gpt_backlight_timer_task(GPTDriver *gptp); // Timer setup at 200Khz, callback at 10k ticks = 20Hz @@ -2851,6 +2972,8 @@ void backlight_init_drivers(void) ( index == 54+17 ) ); #elif defined(RGB_BACKLIGHT_M10_C) bool enabled = true; +#elif defined(RGB_BACKLIGHT_PORTICO) + bool enabled = true; #endif // This only caches it for later IS31FL3731_set_led_control_register( index, enabled, enabled, enabled ); @@ -3121,5 +3244,3 @@ void backlight_debug_led( bool state ) } } #endif // defined(RGB_DEBUGGING_ONLY) - - |