config.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. /*
  2. Copyright 2015 Jun Wako <wakojun@gmail.com>
  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 0x04D8
  18. #define PRODUCT_ID 0xEED2
  19. #define DEVICE_VER 0x0101
  20. #define MANUFACTURER "Massdrop Inc."
  21. #define PRODUCT "CTRL Keyboard"
  22. #define SERIAL_NUM "Unavailable"
  23. /* key matrix size */
  24. #define MATRIX_ROWS 11
  25. #define MATRIX_COLS 8
  26. #define MATRIX_ROW_PINS { B04, B05, B06, B07, B08, B09, A10, A11, B10, B11, B12 }
  27. #define MATRIX_COL_PINS { A00, A01, A02, A03, A04, A05, A06, A07 }
  28. #define UNUSED_PINS
  29. /* COL2ROW, ROW2COL */
  30. #define DIODE_DIRECTION COL2ROW
  31. /* Temporary solution for matrix delay */
  32. #define IGNORE_ATOMIC_BLOCK
  33. /* Avoid out-of-bounds errors when SmartEEPROM is not enabled */
  34. #define EEPROM_SIZE 1024
  35. /* MCU Port name definitions */
  36. #define PA 0
  37. #define PB 1
  38. /* This Shift Register expands available hardware output lines to control additional peripherals */
  39. /* It uses four lines from the MCU to provide 16 output lines */
  40. /* Shift Register Clock configuration (MCU to ShiftRegister.RCLK) */
  41. #define SR_EXP_RCLK_PIN B14
  42. /* Shift Register Output Enable configuration (MCU to ShiftRegister.OE_N) */
  43. #define SR_EXP_OE_PIN B15
  44. /* SERCOM port to use for Shift Register SPI */
  45. /* DATAOUT and SCLK must be configured to use hardware pins of this port */
  46. #define SPI_SERCOM SERCOM2
  47. /* Shift Register SPI Data Out configuration (MCU.SERCOMx.PAD[0] to ShiftRegister.SER) */
  48. #define SPI_DATAOUT_PIN A12
  49. #define SPI_DATAOUT_MUX 2
  50. /* Shift Register SPI Serial Clock configuration (MCU.SERCOMx.PAD[1] to ShiftRegister.SRCLK) */
  51. #define SPI_SCLK_PIN A13
  52. #define SPI_SCLK_MUX 2
  53. /* Debug LED (Small LED Located near MCU) */
  54. #define DEBUG_LED_ENABLE 1
  55. #define DEBUG_LED_PORT PA
  56. #define DEBUG_LED_PIN 27
  57. /* Additional debugging ports */
  58. /* PCB M21 */
  59. #define DEBUG_PORT1_ENABLE 1
  60. #define DEBUG_PORT1_PORT PB
  61. #define DEBUG_PORT1_PIN 3
  62. /* PCB M23 */
  63. #define DEBUG_PORT2_ENABLE 1
  64. #define DEBUG_PORT2_PORT PB
  65. #define DEBUG_PORT2_PIN 17
  66. /* PCB M25 */
  67. #define DEBUG_PORT3_ENABLE 1
  68. #define DEBUG_PORT3_PORT PA
  69. #define DEBUG_PORT3_PIN 20
  70. /* Debug Boot Tracing - During boot sequence, ground this pin to halt and display debug code using Debug LED */
  71. /* This is useful in determining which hardware device may have malfunctioned or is improperly configured */
  72. /* Feature is automatically disabled after successful boot */
  73. /* PCB M27 */
  74. #define DEBUG_BOOT_TRACING_ENABLE 1
  75. #define DEBUG_BOOT_TRACING_PORT PB
  76. #define DEBUG_BOOT_TRACING_PIN 23
  77. /* USB2422 config */
  78. #define USB2422_ADDRESS 0x58
  79. #define USB2422_VENDOR_ID 0x04D8
  80. #define USB2422_PRODUCT_ID 0xEEC5
  81. #define USB2422_DEVICE_VER 0x0101
  82. #define USB2422_MANUFACTURER "Massdrop Inc."
  83. #define USB2422_PRODUCT "Massdrop Hub"
  84. #define USB2422_ACTIVE_PIN A18
  85. /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
  86. #define DEBOUNCE 5
  87. /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
  88. //#define LOCKING_SUPPORT_ENABLE
  89. /* Locking resynchronize hack */
  90. //#define LOCKING_RESYNC_ENABLE
  91. /* Force boot in NKRO mode */
  92. //#define FORCE_NKRO
  93. /*
  94. * Feature disable options
  95. * These options are also useful to firmware size reduction.
  96. */
  97. /* disable debug print */
  98. //#define NO_DEBUG
  99. /* disable print */
  100. //#define NO_PRINT
  101. /* disable action features */
  102. //#define NO_ACTION_LAYER
  103. //#define NO_ACTION_TAPPING
  104. //#define NO_ACTION_ONESHOT
  105. #define RGB_MATRIX_KEYPRESSES
  106. #define RGB_MATRIX_LED_PROCESS_LIMIT 15
  107. #define RGB_MATRIX_LED_FLUSH_LIMIT 10
  108. // RGB Matrix Animation modes. Explicitly enabled
  109. // For full list of effects, see:
  110. // https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects
  111. # define ENABLE_RGB_MATRIX_ALPHAS_MODS
  112. # define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN
  113. # define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT
  114. # define ENABLE_RGB_MATRIX_BREATHING
  115. # define ENABLE_RGB_MATRIX_BAND_SAT
  116. # define ENABLE_RGB_MATRIX_BAND_VAL
  117. # define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT
  118. # define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL
  119. # define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT
  120. # define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL
  121. # define ENABLE_RGB_MATRIX_CYCLE_ALL
  122. # define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
  123. # define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN
  124. # define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON
  125. # define ENABLE_RGB_MATRIX_CYCLE_OUT_IN
  126. # define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL
  127. # define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL
  128. # define ENABLE_RGB_MATRIX_CYCLE_SPIRAL
  129. # define ENABLE_RGB_MATRIX_DUAL_BEACON
  130. # define ENABLE_RGB_MATRIX_RAINBOW_BEACON
  131. # define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS
  132. # define ENABLE_RGB_MATRIX_RAINDROPS
  133. # define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS
  134. # define ENABLE_RGB_MATRIX_HUE_BREATHING
  135. # define ENABLE_RGB_MATRIX_HUE_PENDULUM
  136. # define ENABLE_RGB_MATRIX_HUE_WAVE
  137. # define ENABLE_RGB_MATRIX_PIXEL_RAIN
  138. # define ENABLE_RGB_MATRIX_PIXEL_FLOW
  139. # define ENABLE_RGB_MATRIX_PIXEL_FRACTAL
  140. // enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined
  141. # define ENABLE_RGB_MATRIX_TYPING_HEATMAP
  142. # define ENABLE_RGB_MATRIX_DIGITAL_RAIN
  143. // enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined
  144. # define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE
  145. # define ENABLE_RGB_MATRIX_SOLID_REACTIVE
  146. # define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE
  147. # define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE
  148. # define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS
  149. # define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS
  150. # define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS
  151. # define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
  152. # define ENABLE_RGB_MATRIX_SPLASH
  153. # define ENABLE_RGB_MATRIX_MULTISPLASH
  154. # define ENABLE_RGB_MATRIX_SOLID_SPLASH
  155. # define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH
  156. #include "config_led.h"