From d968e533d1fb369b90feb78d49518ee028430212 Mon Sep 17 00:00:00 2001 From: nuphy-src Date: Mon, 22 Jul 2024 15:34:25 +0800 Subject: [PATCH] Commit Halo96 V2, add IS31FL3763 driver file, and make format adjustments for other projects. --- builddefs/common_features.mk | 10 +- data/schemas/keyboard.jsonschema | 2 + drivers/led/issi/is31fl3763.c | 295 +++++++++++++++++ drivers/led/issi/is31fl3763.h | 305 ++++++++++++++++++ .../nuphy/halo96_v2/ansi/keymaps/via/keymap.c | 2 +- keyboards/nuphy/halo96_v2/ansi/side.c | 1 - quantum/rgb_matrix/rgb_matrix_drivers.c | 8 + quantum/rgb_matrix/rgb_matrix_drivers.h | 2 + 8 files changed, 621 insertions(+), 4 deletions(-) create mode 100644 drivers/led/issi/is31fl3763.c create mode 100644 drivers/led/issi/is31fl3763.h diff --git a/builddefs/common_features.mk b/builddefs/common_features.mk index 68f9a1dd08a8..3a6f6f6579e1 100644 --- a/builddefs/common_features.mk +++ b/builddefs/common_features.mk @@ -340,7 +340,7 @@ LED_MATRIX_DRIVER := snled27351 endif LED_MATRIX_ENABLE ?= no -VALID_LED_MATRIX_TYPES := is31fl3218 is31fl3236 is31fl3729 is31fl3731 is31fl3733 is31fl3736 is31fl3737 is31fl3741 is31fl3742a is31fl3743a is31fl3745 is31fl3746a snled27351 custom +VALID_LED_MATRIX_TYPES := is31fl3218 is31fl3236 is31fl3729 is31fl3731 is31fl3733 is31fl3763 is31fl3736 is31fl3737 is31fl3741 is31fl3742a is31fl3743a is31fl3745 is31fl3746a snled27351 custom ifeq ($(strip $(LED_MATRIX_ENABLE)), yes) ifeq ($(filter $(LED_MATRIX_DRIVER),$(VALID_LED_MATRIX_TYPES)),) @@ -449,7 +449,7 @@ endif RGB_MATRIX_ENABLE ?= no -VALID_RGB_MATRIX_TYPES := aw20216s is31fl3218 is31fl3236 is31fl3729 is31fl3731 is31fl3733 is31fl3736 is31fl3737 is31fl3741 is31fl3742a is31fl3743a is31fl3745 is31fl3746a snled27351 ws2812 custom +VALID_RGB_MATRIX_TYPES := aw20216s is31fl3218 is31fl3236 is31fl3729 is31fl3731 is31fl3733 is31fl3763 is31fl3736 is31fl3737 is31fl3741 is31fl3742a is31fl3743a is31fl3745 is31fl3746a snled27351 ws2812 custom ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) ifeq ($(filter $(RGB_MATRIX_DRIVER),$(VALID_RGB_MATRIX_TYPES)),) $(call CATASTROPHIC_ERROR,Invalid RGB_MATRIX_DRIVER,RGB_MATRIX_DRIVER="$(RGB_MATRIX_DRIVER)" is not a valid matrix type) @@ -498,6 +498,12 @@ ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) SRC += is31fl3731.c endif + ifeq ($(strip $(RGB_MATRIX_DRIVER)), is31fl3763) + I2C_DRIVER_REQUIRED = yes + COMMON_VPATH += $(DRIVER_PATH)/led/issi + SRC += is31fl3763.c + endif + ifeq ($(strip $(RGB_MATRIX_DRIVER)), is31fl3733) I2C_DRIVER_REQUIRED = yes COMMON_VPATH += $(DRIVER_PATH)/led/issi diff --git a/data/schemas/keyboard.jsonschema b/data/schemas/keyboard.jsonschema index b699f862770b..9222cde0d16a 100644 --- a/data/schemas/keyboard.jsonschema +++ b/data/schemas/keyboard.jsonschema @@ -470,6 +470,7 @@ "is31fl3729", "is31fl3731", "is31fl3733", + "is31fl3763", "is31fl3736", "is31fl3737", "is31fl3741", @@ -553,6 +554,7 @@ "is31fl3729", "is31fl3731", "is31fl3733", + "is31fl3763", "is31fl3736", "is31fl3737", "is31fl3741", diff --git a/drivers/led/issi/is31fl3763.c b/drivers/led/issi/is31fl3763.c new file mode 100644 index 000000000000..11060b7e2686 --- /dev/null +++ b/drivers/led/issi/is31fl3763.c @@ -0,0 +1,295 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * Copyright 2021 Doni Crosby + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "is31fl3763.h" +#include "i2c_master.h" +#include "gpio.h" +#include "wait.h" + + +#define ISSI_ADDR_DEFAULT 0x6C + +#define ISSI_COMMANDREGISTER 0xFE +#define ISSI_COMMANDREGISTER_WRITELOCK 0xFF +#define ISSI_INTERRUPTMASKREGISTER 0xF0 +#define ISSI_INTERRUPTSTATUSREGISTER 0xF1 + + +#define ISSI_PAGE_PWM 0x00 // PG0 +#define ISSI_PAGE_PWM_CONTROL 0x01 // PG1 + +#define ISSI_PAGE_AUTOBREATH 0x02 // PG2 +#define ISSI_PAGE_FUNCTION 0x03 // PG3 + +#define ISSI_REG_CONFIGURATION 0x00 // PG3 +#define ISSI_REG_GLOBALCURRENT 0x01 // PG3 +#define ISSI_REG_RESET 0x11 // PG3 +#define ISSI_REG_SWPULLUP 0x0F // PG3 +#define ISSI_REG_CSPULLUP 0x10 // PG3 + +#ifndef ISSI_TIMEOUT +# define ISSI_TIMEOUT 100 +#endif + +#ifndef ISSI_PERSISTENCE +# define ISSI_PERSISTENCE 0 +#endif + +#ifndef ISSI_PWM_FREQUENCY +# define ISSI_PWM_FREQUENCY 0b000 +#endif + +#ifndef ISSI_SWPULLUP +# define ISSI_SWPULLUP PUR_0R +#endif + +#ifndef ISSI_CSPULLUP +# define ISSI_CSPULLUP PUR_0R +#endif + +#ifndef ISSI_GLOBALCURRENT +# define ISSI_GLOBALCURRENT 0x80 +#endif + +const uint8_t i2c_addresses[DRIVER_COUNT] = { + DRIVER_ADDR_1,DRIVER_ADDR_2, +}; + +// Transfer buffer for TWITransmitData() +uint8_t g_twi_transfer_buffer[20]; + +// These buffers match the IS31FL3733 PWM registers. +// The control buffers match the PG0 LED On/Off registers. +// Storing them like this is optimal for I2C transfers to the registers. +// We could optimize this and take out the unused registers from these +// buffers and the transfers in is31fl3733_write_pwm_buffer() but it's +// probably not worth the extra complexity. +uint8_t g_pwm_buffer[DRIVER_COUNT][328]; +bool g_pwm_buffer_update_required[DRIVER_COUNT] = {false}; + +uint8_t g_led_control_registers[DRIVER_COUNT][24] = {0}; +bool g_led_control_registers_update_required[DRIVER_COUNT] = {false}; + + +// I2C +void is31fl3763_write_register(uint8_t index, uint8_t reg, uint8_t data) { + // If the transaction fails function returns false. +#if ISSI_PERSISTENCE > 0 + for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { + if (i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, ISSI_TIMEOUT) != 0) { + return false; + } + } +#else + i2c_write_register(i2c_addresses[index] << 1, reg, &data, 1, ISSI_TIMEOUT); +#endif +} + +uint8_t PWM_H_Tab[14][12] = +{ +//sw 1 2 3 4 5 6 7 8 9 10 11 12 + {0x01,0x02,0x04,0x05,0x07,0x08,0x0A,0x0B,0X0D,0X0E,0X10,0X11}, //CS01 | CS15 + {0X13,0X14,0X16,0X17,0X19,0X1A,0X1C,0X1D,0X1F,0X20,0X22,0X23}, //CS02 | CS16 + {0X25,0X26,0X28,0X29,0X2B,0X2C,0X2E,0X2F,0X31,0X32,0X34,0X35}, //CS03 | CS17 + {0X37,0X38,0X3A,0X3B,0X3D,0X3E,0X40,0X41,0X43,0X44,0X46,0X47}, //CS04 | CS18 + {0X49,0X4A,0X4C,0X4D,0X4F,0X50,0X52,0X53,0X55,0X56,0X58,0X59}, //CS05 + {0X5B,0X5C,0X5E,0X5F,0X61,0X62,0X64,0X65,0X67,0X68,0X6A,0X6B}, //CS06 + {0X6D,0X6E,0X70,0X71,0X73,0X74,0X76,0X77,0X79,0X7A,0X7C,0X7D}, //CS07 + {0X7F,0X80,0X82,0X83,0X85,0X86,0X88,0X89,0X8B,0X8C,0X8E,0X8F}, //CS08 + {0x91,0x92,0x94,0x95,0x97,0x98,0x9A,0x9B,0X9D,0X9E,0XA0,0XA1}, //CS09 + {0XA3,0XA4,0XA6,0XA7,0XA9,0XAA,0XAC,0XAD,0XAF,0XB0,0XB2,0XB3}, //CS10 + {0XB5,0XB6,0XB8,0XB9,0XBB,0XBC,0XBE,0XBF,0XC1,0XC2,0XC4,0XC5}, //CS11 + {0XC7,0XC8,0XCA,0XCB,0XCD,0XCE,0XD0,0XD1,0XD3,0XD4,0XD6,0XD7}, //CS12 + {0XD9,0XDA,0XDC,0XDD,0XDF,0XE0,0XE2,0XE3,0XE5,0XE6,0XE8,0XE9}, //CS13 + {0XEB,0XEC,0XEE,0XEF,0XF1,0XF2,0XF4,0XF5,0XF7,0XF8,0XFA,0XFB} //CS14 +}; + + +void is31fl3763_write_pwm_buffer(uint8_t index) { + + uint16_t addr_sart = 0; + + for (int i = 0; i < 18; i += 1) { + + if(i >= 14) { + is31fl3763_write_register(index, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); + is31fl3763_write_register(index, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM_CONTROL); + + addr_sart = ((i-14)*18); + + i2c_write_register(i2c_addresses[index] << 1, addr_sart, &g_pwm_buffer[index][(addr_sart | 0X100)], 18, ISSI_TIMEOUT); + + } else { + is31fl3763_write_register(index, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); + is31fl3763_write_register(index, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM); + + addr_sart = (i*18); + + i2c_write_register(i2c_addresses[index] << 1, addr_sart, &g_pwm_buffer[index][(addr_sart)], 18, ISSI_TIMEOUT); + } + } + + is31fl3763_write_register(index, 0xFD, 0x00); +} + + + +void is31fl3763_init_drivers(void) { + i2c_init(); + + for (uint8_t i = 0; i < DRIVER_COUNT; i++) { + is31fl3763_init(i); + } + + for (int i = 0; i < DRIVER_COUNT; i++) { + is31fl3763_set_led_control_register(i, true, true, true); + } + + for (uint8_t i = 0; i < DRIVER_COUNT; i++) { + is31fl3763_update_led_control_registers(i); + } +} + +void is31fl3763_init(uint8_t index) { + + uint8_t i, j; + + // Unlock the command register. + is31fl3763_write_register(index, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); + is31fl3763_write_register(index, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM); + + // Turn off all LEDs. + for(i = 0;i < 14;i++) { + for(j = 0;j < 12; j++) { + is31fl3763_write_register(index, PWM_H_Tab[i][j], 0X00); + } + } + + // Unlock the command register. + is31fl3763_write_register(index, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); + is31fl3763_write_register(index, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM_CONTROL); + + // Turn off all LEDs. + for(i = 0;i < 4;i++) { + for(j = 0;j < 12; j++) { + is31fl3763_write_register(index, PWM_H_Tab[i][j], 0X00); + } + } + + // Unlock the command register. + is31fl3763_write_register(index, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); + // Select PG1 + is31fl3763_write_register(index, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM_CONTROL); + // Set de-ghost pull-up resistors (SWx)(CSx) + is31fl3763_write_register(index, 0x62, 0x66); // + // Set global current to maximum. + is31fl3763_write_register(index, 0x61, ISSI_GLOBALCURRENT); + // Disable software shutdown. + is31fl3763_write_register(index, 0x60,0x09); + + is31fl3763_write_register(index, 0x63, 0x00); + + uint8_t SL_Set; + for(SL_Set = 0x49;SL_Set <= 0x5A;SL_Set++) { + is31fl3763_write_register(index, SL_Set, 0x80); + } + is31fl3763_write_register(index, 0xFD, 0x00); //update + + // Wait 10ms to ensure the device has woken up. + wait_ms(10); +} + +void is31fl3763_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { + is31_led led; + if (index >= 0 && index < RGB_MATRIX_LED_COUNT) { + memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); + + g_pwm_buffer[led.driver][led.r] = red; + g_pwm_buffer[led.driver][led.g] = green; + g_pwm_buffer[led.driver][led.b] = blue; + g_pwm_buffer_update_required[led.driver] = true; + } +} + +void is31fl3763_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { + for (int i = 0; i < RGB_MATRIX_LED_COUNT; i++) { + is31fl3763_set_color(i, red, green, blue); + } +} + +void is31fl3763_set_led_control_register(uint8_t index, bool red, bool green, bool blue) { + is31_led led; + memcpy_P(&led, (&g_is31_leds[index]), sizeof(led)); + + uint8_t control_register_r = led.r / 8; + uint8_t control_register_g = led.g / 8; + uint8_t control_register_b = led.b / 8; + uint8_t bit_r = led.r % 8; + uint8_t bit_g = led.g % 8; + uint8_t bit_b = led.b % 8; + + if (red) { + g_led_control_registers[led.driver][control_register_r] |= (1 << bit_r); + } else { + g_led_control_registers[led.driver][control_register_r] &= ~(1 << bit_r); + } + if (green) { + g_led_control_registers[led.driver][control_register_g] |= (1 << bit_g); + } else { + g_led_control_registers[led.driver][control_register_g] &= ~(1 << bit_g); + } + if (blue) { + g_led_control_registers[led.driver][control_register_b] |= (1 << bit_b); + } else { + g_led_control_registers[led.driver][control_register_b] &= ~(1 << bit_b); + } + + g_led_control_registers_update_required[led.driver] = true; +} + +void is31fl3763_update_pwm_buffers(uint8_t index) { + if (g_pwm_buffer_update_required[index]) { + // Firstly we need to unlock the command register and select PG1. + is31fl3763_write_register(index, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); + is31fl3763_write_register(index, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM); + + is31fl3763_write_pwm_buffer(index); + + g_pwm_buffer_update_required[index] = false; + } +} + + +void is31fl3763_update_led_control_registers(uint8_t index) { + if (g_led_control_registers_update_required[index]) { + // Firstly we need to unlock the command register and select PG0 + is31fl3763_write_register(index, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5); + is31fl3763_write_register(index, ISSI_COMMANDREGISTER, 0x01); + for (int i = 0; i < 24; i++) { + is31fl3763_write_register(index, i, g_led_control_registers[index][i]); + } + } + g_led_control_registers_update_required[index] = false; +} + +void is31fl3763_flush(void) { + for (uint8_t i = 0; i < DRIVER_COUNT; i++) { + is31fl3763_update_pwm_buffers(i); + } +} diff --git a/drivers/led/issi/is31fl3763.h b/drivers/led/issi/is31fl3763.h new file mode 100644 index 000000000000..5c7a3c1c8898 --- /dev/null +++ b/drivers/led/issi/is31fl3763.h @@ -0,0 +1,305 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * Copyright 2021 Doni Crosby + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include +#include +#include "progmem.h" +#include "util.h" + +typedef struct is31_led { + uint8_t driver; + uint16_t r; + uint16_t g; + uint16_t b; +} __attribute__((packed)) is31_led; + +extern const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT]; + +void is31fl3763_init_drivers(void); +void is31fl3763_init(uint8_t index); +void is31fl3763_write_register(uint8_t index, uint8_t reg, uint8_t data); +void is31fl3763_select_page(uint8_t index, uint8_t page); + +void is31fl3763_set_color(int index, uint8_t red, uint8_t green, uint8_t blue); +void is31fl3763_set_color_all(uint8_t red, uint8_t green, uint8_t blue); + +void is31fl3763_set_led_control_register(uint8_t index, bool red, bool green, bool blue); + +// This should not be called from an interrupt +// (eg. from a timer interrupt). +// Call this while idle (in between matrix scans). +// If the buffer is dirty, it will update the driver with the buffer. +void is31fl3763_update_pwm_buffers(uint8_t index); +void is31fl3763_update_led_control_registers(uint8_t index); + +void is31fl3763_flush(void); + + +#define PUR_0R 0x00 // No PUR resistor +#define PUR_05KR 0x02 // 0.5k Ohm resistor in t_NOL +#define PUR_3KR 0x03 // 3.0k Ohm resistor on all the time +#define PUR_4KR 0x04 // 4.0k Ohm resistor on all the time +#define PUR_8KR 0x05 // 8.0k Ohm resistor on all the time +#define PUR_16KR 0x06 // 16k Ohm resistor on all the time +#define PUR_32KR 0x07 // 32k Ohm resistor in t_NOL + +//SW1 +#define A_1 0x01 +#define B_1 0x13 +#define C_1 0x25 +#define D_1 0x37 +#define E_1 0x49 +#define F_1 0x5B +#define G_1 0x6D +#define H_1 0x7F +#define I_1 0x91 +#define J_1 0xA3 +#define K_1 0xB5 +#define L_1 0xC7 +#define M_1 0xD9 +#define N_1 0xEB +#define O_1 0x101 +#define P_1 0x113 +#define Q_1 0x125 +#define R_1 0x137 + +//SW2 +#define A_2 0x02 +#define C_2 0x26 +#define F_2 0x5C +#define I_2 0x92 +#define L_2 0xC8 +#define B_2 0x14 +#define E_2 0x4A +#define H_2 0x80 +#define K_2 0xB6 +#define N_2 0xEC +#define D_2 0x38 +#define G_2 0x6E +#define J_2 0xA4 +#define M_2 0xDA +#define O_2 0x102 +#define P_2 0x114 +#define Q_2 0x126 +#define R_2 0x138 + +//SW3 +#define C_3 0x28 +#define F_3 0x5E +#define I_3 0x94 +#define L_3 0xCA +#define B_3 0x16 +#define E_3 0x4C +#define H_3 0x82 +#define K_3 0xB8 +#define N_3 0xEE +#define A_3 0x04 +#define D_3 0x3A +#define G_3 0x70 +#define J_3 0xA6 +#define M_3 0xDC +#define O_3 0x104 +#define P_3 0x116 +#define Q_3 0x128 +#define R_3 0x13A + +//SW4 +#define C_4 0x29 +#define F_4 0x5F +#define I_4 0x95 +#define L_4 0xCB +#define B_4 0x17 +#define E_4 0x4D +#define H_4 0x83 +#define K_4 0xB9 +#define N_4 0xEF +#define A_4 0x05 +#define D_4 0x3B +#define G_4 0x71 +#define J_4 0xA7 +#define M_4 0xDD +#define O_4 0x105 +#define P_4 0x117 +#define Q_4 0x129 +#define R_4 0x13B + +//SW5 +#define C_5 0x2B +#define F_5 0x61 +#define I_5 0x97 +#define L_5 0xCD +#define B_5 0x19 +#define E_5 0x4F +#define H_5 0x85 +#define K_5 0xBB +#define N_5 0xF1 +#define A_5 0x07 +#define D_5 0x3D +#define G_5 0x73 +#define J_5 0xA9 +#define M_5 0xDF +#define O_5 0x107 +#define P_5 0x119 +#define Q_5 0x12B +#define R_5 0x13D + +//SW6 +#define C_6 0x2C +#define F_6 0x62 +#define I_6 0x98 +#define L_6 0xCE +#define B_6 0x1A +#define E_6 0x50 +#define H_6 0x86 +#define K_6 0xBC +#define N_6 0xF2 +#define A_6 0x08 +#define D_6 0x3E +#define G_6 0x74 +#define J_6 0xAA +#define M_6 0xE0 +#define O_6 0x108 +#define P_6 0x11A +#define Q_6 0x12C +#define R_6 0x13E + +//SW7 +#define C_7 0x2E +#define F_7 0x64 +#define I_7 0x9A +#define L_7 0xD0 +#define B_7 0x1C +#define E_7 0x52 +#define H_7 0x88 +#define K_7 0xBE +#define N_7 0xF4 +#define A_7 0x0A +#define D_7 0x40 +#define G_7 0x76 +#define J_7 0xAC +#define M_7 0xE2 +#define O_7 0x10A +#define P_7 0x11C +#define Q_7 0x12E +#define R_7 0x140 + +//SW8 +#define C_8 0x2F +#define F_8 0x65 +#define I_8 0x9B +#define L_8 0xD1 +#define B_8 0x1D +#define E_8 0x53 +#define H_8 0x89 +#define K_8 0xBF +#define N_8 0xF5 +#define A_8 0x0B +#define D_8 0x41 +#define G_8 0x77 +#define J_8 0xAD +#define M_8 0xE3 +#define O_8 0x10B +#define P_8 0x11D +#define Q_8 0x12F +#define R_8 0x141 + +//SW9 +#define C_9 0x31 +#define F_9 0x67 +#define I_9 0x9D +#define L_9 0xD3 +#define B_9 0x1F +#define E_9 0x55 +#define H_9 0x8B +#define K_9 0xC1 +#define N_9 0xF7 +#define A_9 0x0D +#define D_9 0x43 +#define G_9 0x79 +#define J_9 0xAF +#define M_9 0xE5 +#define O_9 0x10D +#define P_9 0x11F +#define Q_9 0x131 +#define R_9 0x143 + +//SW10 +#define C_10 0x32 +#define F_10 0x68 +#define I_10 0x9E +#define L_10 0xD4 +#define B_10 0x20 +#define E_10 0x56 +#define H_10 0x8C +#define K_10 0xC2 +#define N_10 0xF8 +#define A_10 0x0E +#define D_10 0x44 +#define G_10 0x7A +#define J_10 0xB0 +#define M_10 0xE6 +#define O_10 0x10E +#define P_10 0x120 +#define Q_10 0x132 +#define R_10 0x144 + +//SW11 +#define C_11 0x34 +#define F_11 0x6A +#define I_11 0xA0 +#define L_11 0xD6 +#define B_11 0x22 +#define E_11 0x58 +#define H_11 0x8E +#define K_11 0xC4 +#define N_11 0xFA +#define A_11 0x10 +#define D_11 0x46 +#define G_11 0x7C +#define J_11 0xB2 +#define M_11 0xE8 +#define O_11 0x110 +#define P_11 0x122 +#define Q_11 0x134 +#define R_11 0x146 + +//SW12 +#define C_12 0x35 +#define F_12 0x6B +#define I_12 0xA1 +#define L_12 0xD7 +#define B_12 0x23 +#define E_12 0x59 +#define H_12 0x8F +#define K_12 0xC5 +#define N_12 0xFB +#define A_12 0x11 +#define D_12 0x47 +#define G_12 0x7D +#define J_12 0xB3 +#define M_12 0xE9 +#define O_12 0x111 +#define P_12 0x123 +#define Q_12 0x135 +#define R_12 0x147 + + + diff --git a/keyboards/nuphy/halo96_v2/ansi/keymaps/via/keymap.c b/keyboards/nuphy/halo96_v2/ansi/keymaps/via/keymap.c index 7291dcafcc28..33502f08d8e9 100644 --- a/keyboards/nuphy/halo96_v2/ansi/keymaps/via/keymap.c +++ b/keyboards/nuphy/halo96_v2/ansi/keymaps/via/keymap.c @@ -178,7 +178,7 @@ const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { {0, G_3, H_3, I_3}, // 2 {0, D_3, E_3, F_3}, // 2 {0, D_2, E_2, F_2}, // 2 -= + {0, D_1, E_1, F_1}, // 3 123 {0, A_1, B_1, C_1}, // 3 {0, A_2, B_2, C_2}, // 3 diff --git a/keyboards/nuphy/halo96_v2/ansi/side.c b/keyboards/nuphy/halo96_v2/ansi/side.c index f4172cfe330d..e4f42b572b4b 100644 --- a/keyboards/nuphy/halo96_v2/ansi/side.c +++ b/keyboards/nuphy/halo96_v2/ansi/side.c @@ -993,7 +993,6 @@ void bat_percent_led(uint8_t bat_percent) } } -bool low_bat_flag = 0; /** * @brief battery state indicate */ diff --git a/quantum/rgb_matrix/rgb_matrix_drivers.c b/quantum/rgb_matrix/rgb_matrix_drivers.c index bf5209a9d322..0c13bc36a215 100644 --- a/quantum/rgb_matrix/rgb_matrix_drivers.c +++ b/quantum/rgb_matrix/rgb_matrix_drivers.c @@ -60,6 +60,14 @@ const rgb_matrix_driver_t rgb_matrix_driver = { .set_color_all = is31fl3731_set_color_all, }; +#elif defined(RGB_MATRIX_IS31FL3763) +const rgb_matrix_driver_t rgb_matrix_driver = { + .init = is31fl3763_init_drivers, + .flush = is31fl3763_flush, + .set_color = is31fl3763_set_color, + .set_color_all = is31fl3763_set_color_all, +}; + #elif defined(RGB_MATRIX_IS31FL3733) const rgb_matrix_driver_t rgb_matrix_driver = { .init = is31fl3733_init_drivers, diff --git a/quantum/rgb_matrix/rgb_matrix_drivers.h b/quantum/rgb_matrix/rgb_matrix_drivers.h index 1ea5f0817d31..7248655507e6 100644 --- a/quantum/rgb_matrix/rgb_matrix_drivers.h +++ b/quantum/rgb_matrix/rgb_matrix_drivers.h @@ -17,6 +17,8 @@ # include "is31fl3731.h" #elif defined(RGB_MATRIX_IS31FL3733) # include "is31fl3733.h" +#elif defined(RGB_MATRIX_IS31FL3763) +# include "is31fl3763.h" #elif defined(RGB_MATRIX_IS31FL3736) # include "is31fl3736.h" #elif defined(RGB_MATRIX_IS31FL3737)