config.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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. /*
  60. * Magic Key Options
  61. *
  62. * Magic keys are hotkey commands that allow control over firmware functions of
  63. * the keyboard. They are best used in combination with the HID Listen program,
  64. * found here: https://www.pjrc.com/teensy/hid_listen.html
  65. *
  66. * The options below allow the magic key functionality to be changed. This is
  67. * useful if your keyboard/keypad is missing keys and you want magic key support.
  68. *
  69. */
  70. /* Backlight options */
  71. #define RGB_BACKLIGHT_ENABLED 1
  72. #define RGB_BACKLIGHT_HS60
  73. // they aren't really used if RGB_BACKLIGHT_HS60 defined
  74. #define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 0
  75. #define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0
  76. #define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 0
  77. #define RGB_BACKLIGHT_USE_7U_SPACEBAR 0
  78. #define RGB_BACKLIGHT_USE_ISO_ENTER 0
  79. #define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 0
  80. // disable backlight when USB suspended (PC sleep/hibernate/shutdown)
  81. #define RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0
  82. // disable backlight after timeout in minutes, 0 = no timeout
  83. #define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0
  84. // the default effect (RGB test)
  85. #define RGB_BACKLIGHT_EFFECT 255
  86. #define DRIVER_COUNT 2
  87. #define DRIVER_LED_TOTAL 64
  88. // These define which keys in the matrix are alphas/mods
  89. // Used for backlight effects so colors are different for
  90. // alphas vs. mods
  91. // Each value is for a row, bit 0 is column 0
  92. // Alpha=0 Mod=1
  93. #define RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 0b0010000000000001
  94. #define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0b0000000000000001
  95. #define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0b0010000000000001
  96. #define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0010000000000001
  97. #define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0011110000000111
  98. // TODO: refactor with new user EEPROM code (coming soon)
  99. #define EEPROM_MAGIC 0x451F
  100. #define EEPROM_MAGIC_ADDR 32
  101. // Bump this every time we change what we store
  102. // This will automatically reset the EEPROM with defaults
  103. // and avoid loading invalid data from the EEPROM
  104. #define EEPROM_VERSION 0x08
  105. #define EEPROM_VERSION_ADDR 34
  106. // Backlight config starts after EEPROM version
  107. #define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35
  108. // Dynamic keymap starts after backlight config (35+31)
  109. #define DYNAMIC_KEYMAP_EEPROM_ADDR 66
  110. #define DYNAMIC_KEYMAP_LAYER_COUNT 4
  111. // Dynamic macro starts after dynamic keymaps (66+(4*5*14*2)) = (66+560)
  112. #define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 626
  113. #define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 398
  114. #define DYNAMIC_KEYMAP_MACRO_COUNT 16