config.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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. /* MCU Port name definitions */
  34. #define PA 0
  35. #define PB 1
  36. /* This Shift Register expands available hardware output lines to control additional peripherals */
  37. /* It uses four lines from the MCU to provide 16 output lines */
  38. /* Shift Register Clock configuration (MCU to ShiftRegister.RCLK) */
  39. #define SR_EXP_RCLK_PIN B14
  40. /* Shift Register Output Enable configuration (MCU to ShiftRegister.OE_N) */
  41. #define SR_EXP_OE_PIN B15
  42. /* SERCOM port to use for Shift Register SPI */
  43. /* DATAOUT and SCLK must be configured to use hardware pins of this port */
  44. #define SPI_SERCOM SERCOM2
  45. /* Shift Register SPI Data Out configuration (MCU.SERCOMx.PAD[0] to ShiftRegister.SER) */
  46. #define SPI_DATAOUT_PIN A12
  47. #define SPI_DATAOUT_MUX 2
  48. /* Shift Register SPI Serial Clock configuration (MCU.SERCOMx.PAD[1] to ShiftRegister.SRCLK) */
  49. #define SPI_SCLK_PIN A13
  50. #define SPI_SCLK_MUX 2
  51. /* Debug LED (Small LED Located near MCU) */
  52. #define DEBUG_LED_ENABLE 1
  53. #define DEBUG_LED_PORT PA
  54. #define DEBUG_LED_PIN 27
  55. /* Additional debugging ports */
  56. /* PCB M21 */
  57. #define DEBUG_PORT1_ENABLE 1
  58. #define DEBUG_PORT1_PORT PB
  59. #define DEBUG_PORT1_PIN 3
  60. /* PCB M23 */
  61. #define DEBUG_PORT2_ENABLE 1
  62. #define DEBUG_PORT2_PORT PB
  63. #define DEBUG_PORT2_PIN 17
  64. /* PCB M25 */
  65. #define DEBUG_PORT3_ENABLE 1
  66. #define DEBUG_PORT3_PORT PA
  67. #define DEBUG_PORT3_PIN 20
  68. /* Debug Boot Tracing - During boot sequence, ground this pin to halt and display debug code using Debug LED */
  69. /* This is useful in determining which hardware device may have malfunctioned or is improperly configured */
  70. /* Feature is automatically disabled after successful boot */
  71. /* PCB M27 */
  72. #define DEBUG_BOOT_TRACING_ENABLE 1
  73. #define DEBUG_BOOT_TRACING_PORT PB
  74. #define DEBUG_BOOT_TRACING_PIN 23
  75. /* USB2422 config */
  76. #define USB2422_ADDRESS 0x58
  77. #define USB2422_VENDOR_ID 0x04D8
  78. #define USB2422_PRODUCT_ID 0xEEC5
  79. #define USB2422_DEVICE_VER 0x0101
  80. #define USB2422_MANUFACTURER "Massdrop Inc."
  81. #define USB2422_PRODUCT "Massdrop Hub"
  82. #define USB2422_ACTIVE_PIN A18
  83. /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
  84. #define DEBOUNCE 5
  85. /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
  86. //#define LOCKING_SUPPORT_ENABLE
  87. /* Locking resynchronize hack */
  88. //#define LOCKING_RESYNC_ENABLE
  89. /* Force boot in NKRO mode */
  90. //#define FORCE_NKRO
  91. /*
  92. * Feature disable options
  93. * These options are also useful to firmware size reduction.
  94. */
  95. /* disable debug print */
  96. //#define NO_DEBUG
  97. /* disable print */
  98. //#define NO_PRINT
  99. /* disable action features */
  100. //#define NO_ACTION_LAYER
  101. //#define NO_ACTION_TAPPING
  102. //#define NO_ACTION_ONESHOT
  103. //#define NO_ACTION_MACRO
  104. //#define NO_ACTION_FUNCTION
  105. #define RGB_MATRIX_KEYPRESSES
  106. #define RGB_MATRIX_LED_PROCESS_LIMIT 15
  107. #define RGB_MATRIX_LED_FLUSH_LIMIT 10
  108. #include "config_led.h"