]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - keyboards/hs60/v2/config.h
[Keyboard] Added configurable defaults for RGB backlight parameters. (#5549)
[qmk_firmware.git] / keyboards / hs60 / v2 / config.h
index 192f7d6f25db29ecbad106e187dc6949e565e7f1..05255d13310466b82305693ca1ea31f4358d69fc 100644 (file)
@@ -20,9 +20,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "config_common.h"
 
 /* USB Device descriptor parameter */
-#define VENDOR_ID       0xFEED
-#define PRODUCT_ID      0x0258
-#define DEVICE_VER      0x0001
+#define VENDOR_ID       0x8968
+#define PRODUCT_ID      0x4853
+#define DEVICE_VER      0x0002
 #define MANUFACTURER    Yiancar-Designs
 #define PRODUCT         HS60 V2
 #define DESCRIPTION     GH60 compatible, tool free RGB keyboard
@@ -35,11 +35,11 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define MATRIX_COL_PINS { A13, A10, A9, A14, A15, B8, B9, C13, C14, C15, A0, A1, A2, A3 }
 // To enable debugger set A13 A14 -> A5 A6
 
-/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */
+/* COL2ROW, ROW2COL*/
 #define DIODE_DIRECTION COL2ROW
 
 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
-#define DEBOUNCE 0
+#define DEBOUNCING_DELAY 5
 
 /* define if matrix has ghost (lacks anti-ghosting diodes) */
 //#define MATRIX_HAS_GHOST
@@ -82,36 +82,73 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  */
 
-/* key combination for magic key command */
-#define IS_COMMAND() ( \
-    keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
-)
+/* Backlight options */
 
-/*
- * Feature disable options
- *  These options are also useful to firmware size reduction.
- */
+#define RGB_BACKLIGHT_ENABLED 1
 
-/* disable debug print */
-//#define NO_DEBUG
+#define RGB_BACKLIGHT_HS60
 
-/* disable print */
-//#define NO_PRINT
+// they aren't really used if RGB_BACKLIGHT_HS60 defined
+#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
 
-/* Backlight options */
+// disable backlight when USB suspended (PC sleep/hibernate/shutdown)
+#define RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0
 
-#define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
-#define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended
-#define RGB_MATRIX_SKIP_FRAMES 3
+// disable backlight after timeout in minutes, 0 = no timeout
+#define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0
 
-#define DRIVER_ADDR_1 0b1010000
-#define DRIVER_ADDR_2 0b1010000 // this is here for compliancy reasons.
+// the default brightness
+#define RGB_BACKLIGHT_BRIGHTNESS 255
 
-#define DRIVER_COUNT 2
-#ifdef HS60_ANSI
-#define DRIVER_1_LED_TOTAL 61
-#else
-#define DRIVER_1_LED_TOTAL 62
-#endif
+// the default effect (RGB test)
+#define RGB_BACKLIGHT_EFFECT 255
+
+// the default effect speed (0-3)
+#define RGB_BACKLIGHT_EFFECT_SPEED 0
 
-#define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL
+// the default color1 and color2
+#define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 }
+#define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 }
+
+#define DRIVER_COUNT 2
+#define DRIVER_LED_TOTAL 64
+
+// 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 0b0010000000000001
+#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0b0000000000000001
+#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0b0010000000000001
+#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0010000000000001
+#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0011110000000111
+
+#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 }
+
+// TODO: refactor with new user EEPROM code (coming soon)
+#define EEPROM_MAGIC 0x451F
+#define EEPROM_MAGIC_ADDR 32
+// Bump this every time we change what we store
+// This will automatically reset the EEPROM with defaults
+// and avoid loading invalid data from the EEPROM
+#define EEPROM_VERSION 0x08
+#define EEPROM_VERSION_ADDR 34
+
+// Backlight config starts after EEPROM version
+#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35
+// Dynamic keymap starts after backlight config (35+32)
+#define DYNAMIC_KEYMAP_EEPROM_ADDR 67
+#define DYNAMIC_KEYMAP_LAYER_COUNT 4
+// Dynamic macro starts after dynamic keymaps (67+(4*5*14*2)) = (67+560)
+#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 627
+#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 398
+#define DYNAMIC_KEYMAP_MACRO_COUNT 16