2
0

config.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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. /* MCU Port name definitions */
  27. #define PA 0
  28. #define PB 1
  29. /* Port and Pin definition of key row hardware configuration */
  30. #define MATRIX_ROW_PORTS PB, PB, PB, PB, PB, PB, PA, PA, PB, PB, PB
  31. #define MATRIX_ROW_PINS 4, 5, 6, 7, 8, 9, 10, 11, 10, 11, 12
  32. /* Port and Pin definition of key column hardware configuration */
  33. #define MATRIX_COL_PORTS PA, PA, PA, PA, PA, PA, PA, PA
  34. #define MATRIX_COL_PINS 0, 1, 2, 3, 4, 5, 6, 7
  35. /* This Shift Register expands available hardware output lines to control additional peripherals */
  36. /* It uses four lines from the MCU to provide 16 output lines */
  37. /* Shift Register Clock configuration (MCU to ShiftRegister.RCLK) */
  38. #define SR_EXP_RCLK_PORT PB
  39. #define SR_EXP_RCLK_PIN 14
  40. /* Shift Register Output Enable configuration (MCU to ShiftRegister.OE_N) */
  41. #define SR_EXP_OE_N_PORT PB
  42. #define SR_EXP_OE_N_PIN 15
  43. /* SERCOM port to use for Shift Register SPI */
  44. /* DATAOUT and SCLK must be configured to use hardware pins of this port */
  45. #define SR_EXP_SERCOM SERCOM2
  46. /* Shift Register SPI Data Out configuration (MCU.SERCOMx.PAD[0] to ShiftRegister.SER) */
  47. #define SR_EXP_DATAOUT_PORT PA
  48. #define SR_EXP_DATAOUT_PIN 12
  49. #define SR_EXP_DATAOUT_MUX 2
  50. /* Shift Register SPI Serial Clock configuration (MCU.SERCOMx.PAD[1] to ShiftRegister.SRCLK) */
  51. #define SR_EXP_SCLK_PORT PA
  52. #define SR_EXP_SCLK_PIN 13
  53. #define SR_EXP_SCLK_MUX 2
  54. /* Debug LED (Small LED Located near MCU) */
  55. #define DEBUG_LED_ENABLE 1
  56. #define DEBUG_LED_PORT PA
  57. #define DEBUG_LED_PIN 27
  58. /* Additional debugging ports */
  59. /* PCB M21 */
  60. #define DEBUG_PORT1_ENABLE 1
  61. #define DEBUG_PORT1_PORT PB
  62. #define DEBUG_PORT1_PIN 3
  63. /* PCB M23 */
  64. #define DEBUG_PORT2_ENABLE 1
  65. #define DEBUG_PORT2_PORT PB
  66. #define DEBUG_PORT2_PIN 17
  67. /* PCB M25 */
  68. #define DEBUG_PORT3_ENABLE 1
  69. #define DEBUG_PORT3_PORT PA
  70. #define DEBUG_PORT3_PIN 20
  71. /* Debug Boot Tracing - During boot sequence, ground this pin to halt and display debug code using Debug LED */
  72. /* This is useful in determining which hardware device may have malfunctioned or is improperly configured */
  73. /* Feature is automatically disabled after successful boot */
  74. /* PCB M27 */
  75. #define DEBUG_BOOT_TRACING_ENABLE 1
  76. #define DEBUG_BOOT_TRACING_PORT PB
  77. #define DEBUG_BOOT_TRACING_PIN 23
  78. /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
  79. #define DEBOUNCING_DELAY 5
  80. /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
  81. //#define LOCKING_SUPPORT_ENABLE
  82. /* Locking resynchronize hack */
  83. //#define LOCKING_RESYNC_ENABLE
  84. /* key combination for command */
  85. #define IS_COMMAND() ( \
  86. keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
  87. )
  88. /* Force boot in NKRO mode */
  89. //#define FORCE_NKRO
  90. /*
  91. * Feature disable options
  92. * These options are also useful to firmware size reduction.
  93. */
  94. /* disable debug print */
  95. //#define NO_DEBUG
  96. /* disable print */
  97. //#define NO_PRINT
  98. /* disable action features */
  99. //#define NO_ACTION_LAYER
  100. //#define NO_ACTION_TAPPING
  101. //#define NO_ACTION_ONESHOT
  102. //#define NO_ACTION_MACRO
  103. //#define NO_ACTION_FUNCTION