config.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. /*
  2. Copyright 2018 Yiancar
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. #pragma once
  15. #include "config_common.h"
  16. /* USB Device descriptor parameter */
  17. #define VENDOR_ID 0x8968
  18. #define PRODUCT_ID 0x4853
  19. #define DEVICE_VER 0x0002
  20. #define MANUFACTURER Yiancar-Designs
  21. #define PRODUCT HS60 V2
  22. #define DESCRIPTION GH60 compatible, tool free RGB keyboard
  23. /* key matrix size */
  24. #define MATRIX_ROWS 5
  25. #define MATRIX_COLS 14
  26. #define MATRIX_ROW_PINS { B3, B4, B5, A8, A4 }
  27. #define MATRIX_COL_PINS { A13, A10, A9, A14, A15, B8, B9, C13, C14, C15, A0, A1, A2, A3 }
  28. // To enable debugger set A13 A14 -> A5 A6
  29. /* COL2ROW, ROW2COL, or CUSTOM_MATRIX */
  30. #define DIODE_DIRECTION COL2ROW
  31. /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
  32. #define DEBOUNCING_DELAY 5
  33. /* define if matrix has ghost (lacks anti-ghosting diodes) */
  34. //#define MATRIX_HAS_GHOST
  35. /* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
  36. * This is userful for the Windows task manager shortcut (ctrl+shift+esc).
  37. */
  38. // #define GRAVE_ESC_CTRL_OVERRIDE
  39. /*
  40. * Force NKRO
  41. *
  42. * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
  43. * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
  44. * makefile for this to work.)
  45. *
  46. * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
  47. * until the next keyboard reset.
  48. *
  49. * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
  50. * fully operational during normal computer usage.
  51. *
  52. * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
  53. * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
  54. * bootmagic, NKRO mode will always be enabled until it is toggled again during a
  55. * power-up.
  56. *
  57. */
  58. //#define FORCE_NKRO
  59. /* key combination for magic key command */
  60. #define IS_COMMAND() ( \
  61. keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
  62. )
  63. /* Backlight options */
  64. #define RGB_BACKLIGHT_ENABLED 1
  65. #define RGB_BACKLIGHT_HS60
  66. // they aren't really used if RGB_BACKLIGHT_HS60 defined
  67. #define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 0
  68. #define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0
  69. #define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 0
  70. #define RGB_BACKLIGHT_USE_7U_SPACEBAR 0
  71. #define RGB_BACKLIGHT_USE_ISO_ENTER 0
  72. #define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 0
  73. // disable backlight when USB suspended (PC sleep/hibernate/shutdown)
  74. #define RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0
  75. // disable backlight after timeout in minutes, 0 = no timeout
  76. #define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0
  77. // the default effect (RGB test)
  78. #define RGB_BACKLIGHT_EFFECT 255
  79. #define DRIVER_COUNT 2
  80. #define DRIVER_LED_TOTAL 64
  81. // These define which keys in the matrix are alphas/mods
  82. // Used for backlight effects so colors are different for
  83. // alphas vs. mods
  84. // Each value is for a row, bit 0 is column 0
  85. // Alpha=0 Mod=1
  86. #define RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 0b0010000000000001
  87. #define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0b0000000000000001
  88. #define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0b0010000000000001
  89. #define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0010000000000001
  90. #define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0011110000000111
  91. // TODO: refactor with new user EEPROM code (coming soon)
  92. #define EEPROM_MAGIC 0x451F
  93. #define EEPROM_MAGIC_ADDR 32
  94. // Bump this every time we change what we store
  95. // This will automatically reset the EEPROM with defaults
  96. // and avoid loading invalid data from the EEPROM
  97. #define EEPROM_VERSION 0x08
  98. #define EEPROM_VERSION_ADDR 34
  99. // Backlight config starts after EEPROM version
  100. #define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35
  101. // Dynamic keymap starts after backlight config (35+31)
  102. #define DYNAMIC_KEYMAP_EEPROM_ADDR 66
  103. #define DYNAMIC_KEYMAP_LAYER_COUNT 4
  104. // Dynamic macro starts after dynamic keymaps (66+(4*5*14*2)) = (66+560)
  105. #define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 626
  106. #define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 398
  107. #define DYNAMIC_KEYMAP_MACRO_COUNT 16