1
0
Fork 0

Add VIA support for QMK backlight, QMK RGBLight (#7911)

* Add VIA support for QMK backlight, QMK RGBLight

* clang-format changes
This commit is contained in:
Wilba 2020-01-21 05:18:25 +11:00 committed by MechMerlin
parent ce81c4f89b
commit 484a9b12bc
37 changed files with 500 additions and 35 deletions

View file

@ -121,4 +121,7 @@
// Backlight config starts after VIA's EEPROM usage,
// dynamic keymaps start after this.
#define VIA_EEPROM_CUSTOM_CONFIG_SIZE 31
#define VIA_EEPROM_CUSTOM_CONFIG_SIZE 31
// VIA lighting is handled by the keyboard-level code
#define VIA_CUSTOM_LIGHTING_ENABLE

View file

@ -119,3 +119,6 @@
// 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

View file

@ -109,3 +109,6 @@
// Backlight config starts after VIA's EEPROM usage,
// dynamic keymaps start after this.
#define VIA_EEPROM_CUSTOM_CONFIG_SIZE 43
// VIA lighting is handled by the keyboard-level code
#define VIA_CUSTOM_LIGHTING_ENABLE

View file

@ -152,3 +152,6 @@
// Backlight config starts after VIA's EEPROM usage,
// dynamic keymaps start after this.
#define VIA_EEPROM_CUSTOM_CONFIG_SIZE 43
// VIA lighting is handled by the keyboard-level code
#define VIA_CUSTOM_LIGHTING_ENABLE

View file

@ -235,3 +235,6 @@
// 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

View file

@ -204,3 +204,5 @@
// dynamic keymaps start after this.
#define VIA_EEPROM_CUSTOM_CONFIG_SIZE 7
// VIA lighting is handled by the keyboard-level code
#define VIA_CUSTOM_LIGHTING_ENABLE

View file

@ -201,3 +201,5 @@
// dynamic keymaps start after this.
#define VIA_EEPROM_CUSTOM_CONFIG_SIZE 7
// VIA lighting is handled by the keyboard-level code
#define VIA_CUSTOM_LIGHTING_ENABLE

View file

@ -201,3 +201,5 @@
// dynamic keymaps start after this.
#define VIA_EEPROM_CUSTOM_CONFIG_SIZE 7
// VIA lighting is handled by the keyboard-level code
#define VIA_CUSTOM_LIGHTING_ENABLE

View file

@ -204,3 +204,5 @@
// dynamic keymaps start after this.
#define VIA_EEPROM_CUSTOM_CONFIG_SIZE 7
// VIA lighting is handled by the keyboard-level code
#define VIA_CUSTOM_LIGHTING_ENABLE

View file

@ -204,3 +204,5 @@
// dynamic keymaps start after this.
#define VIA_EEPROM_CUSTOM_CONFIG_SIZE 7
// VIA lighting is handled by the keyboard-level code
#define VIA_CUSTOM_LIGHTING_ENABLE

View file

@ -204,3 +204,5 @@
// dynamic keymaps start after this.
#define VIA_EEPROM_CUSTOM_CONFIG_SIZE 7
// VIA lighting is handled by the keyboard-level code
#define VIA_CUSTOM_LIGHTING_ENABLE

View file

@ -200,3 +200,6 @@
// Backlight config starts after VIA's EEPROM usage,
// dynamic keymaps start after this.
#define VIA_EEPROM_CUSTOM_CONFIG_SIZE 7
// VIA lighting is handled by the keyboard-level code
#define VIA_CUSTOM_LIGHTING_ENABLE

View file

@ -123,17 +123,17 @@ void raw_hid_receive_kb(uint8_t *data, uint8_t length) {
switch ( *command_id )
{
#if RGB_BACKLIGHT_ENABLED || MONO_BACKLIGHT_ENABLED
case id_backlight_config_set_value:
case id_lighting_set_value:
{
backlight_config_set_value(command_data);
break;
}
case id_backlight_config_get_value:
case id_lighting_get_value:
{
backlight_config_get_value(command_data);
break;
}
case id_backlight_config_save:
case id_lighting_save:
{
backlight_config_save();
break;

View file

@ -26,9 +26,13 @@
#include "quantum/color.h"
#include "tmk_core/common/eeprom.h"
#include "via.h" // uses only the EEPROM address
#include "via.h" // uses EEPROM address, lighting value IDs
#define MONO_BACKLIGHT_CONFIG_EEPROM_ADDR (VIA_EEPROM_CUSTOM_CONFIG_ADDR)
#if VIA_EEPROM_CUSTOM_CONFIG_SIZE == 0
#error VIA_EEPROM_CUSTOM_CONFIG_SIZE was not defined to store backlight_config struct
#endif
#include "drivers/issi/is31fl3736.h"
#define ISSI_ADDR_DEFAULT 0x50

View file

@ -50,9 +50,13 @@ LED_TYPE g_ws2812_leds[WS2812_LED_TOTAL];
#include "quantum/color.h"
#include "tmk_core/common/eeprom.h"
#include "via.h" // uses only the EEPROM address
#include "via.h" // uses EEPROM address, lighting value IDs
#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR (VIA_EEPROM_CUSTOM_CONFIG_ADDR)
#if VIA_EEPROM_CUSTOM_CONFIG_SIZE == 0
#error VIA_EEPROM_CUSTOM_CONFIG_SIZE was not defined to store backlight_config struct
#endif
#if defined(RGB_BACKLIGHT_M6_B)
#include "drivers/issi/is31fl3218.h"
#define BACKLIGHT_LED_COUNT 6

View file

@ -117,4 +117,7 @@
// Backlight config starts after VIA's EEPROM usage,
// dynamic keymaps start after this.
#define VIA_EEPROM_CUSTOM_CONFIG_SIZE 31
#define VIA_EEPROM_CUSTOM_CONFIG_SIZE 31
// VIA lighting is handled by the keyboard-level code
#define VIA_CUSTOM_LIGHTING_ENABLE

View file

@ -118,3 +118,6 @@
// 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